

//按比例缩放图片
function DrawImage(ImgD,FitWidth,FitHeight) 
{ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0) 
{ 
if(image.width/image.height>= FitWidth/FitHeight) 
{ 
if(image.width>FitWidth) 
{ 
ImgD.width=FitWidth; 
ImgD.height=(image.height*FitWidth)/image.width; 
} 
else 
{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
} 
else 
{ 
if(image.height>FitHeight) 
{ 
ImgD.height=FitHeight; 
ImgD.width=(image.width*FitHeight)/image.height; 
} 
else 
{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
} 
} 
} 




function Check(){
		if (document.getElementById("MesName").value==""){
			alert("请填写留言标题!");
			document.getElementById("MesName").focus();
			return false;
			}
		if (document.getElementById("Content").value==""){
			alert("请填写留言内容!");
			document.getElementById("Content").focus();
			return false;
			}
		if (document.getElementById("Linkman").value==""){
			alert("请填写称呼!");
			document.getElementById("Linkman").focus();
			return false;
			}
		if (document.getElementById("Telephone").value=="" && document.getElementById("Mobile").value==""){
			alert("联系电话与手机必需填写一个,以便我们与您联系!");
			document.getElementById("Telephone").focus();
			return false;
			}
		if (document.getElementById("CheckCode").value==""){
			alert("请填写验证码!");
			document.getElementById("CheckCode").focus();
			return false;
			}
		return true;
		
	}
	
	
	
	

