/********************************************************************************************************************
*          函数库
*********************************************************************************************************************/
//缩放图片
var flag=false; 
function imageReSize(Img, width,height ){
	 var image=new Image();  
	 image.src=Img.src;   
	 if(image.width>width||image.height>height){
	  		w=image.width/width; 
	   		h=image.height/height; 
	   	if(w>h){
	    	Img.width=width; 
	    	Img.height=image.height/w; 
	   	}else{
	    	Img.height=height; 
	    	Img.width=image.width/h; 
	   	} 
	 } 
}
/**** 对话框 ****/
function showDialog(  url )
{
        $("body").append( "<a href=\"javascript:void(0);\" id=\"ajaxLink\"></a>" );
		$.fn.createDialog.defaults = {
			progress: false,
			center: true,
			opacity: 0.9,
			bg: '#000'
		}
		$( "#ajaxLink" ).createDialog({
			 addr:  url
		});
		$( "#ajaxLink" ).click(  );
		$( "#ajaxLink" ).remove();
}
function closeDialog()
{
	   $("#jDialogOverlay").remove();
	   $("#jDialogContainer").remove();
}

function openWindow( url , width , height )
{
	
	var setting = "height=" + height +
						", width=" + width + 
						", toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no";
	var winId = window.open( url , null , setting  );
	return winId;
}
/********************************************************************************************************************
*          应用
*********************************************************************************************************************/
