/*按比例生成缩略图*/
function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){  
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){  
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;     
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
  }
}


function chkMeaage(form){
/*
	if(form.MesName.value==""){
		alert("主题不能为空");
		form.MesName.focus();
		return false;
	}
*/
	if(form.Linkman.value==""){
		alert("姓名不能为空");
		form.Linkman.focus();
		return false;
	}
/*
	if(form.Telephone.value==""){
		alert("电话不能为空");
		form.Telephone.focus();
		return false;
	}
	if(form.Email.value==""){
		alert("邮箱不能为空");
		form.Email.focus();
		return false;
	}
	if(form.Address.value==""){
		alert("地址不能为空");
		form.Address.focus();
		return false;
	}
*/
	if(form.Content.value==""){
		alert("内容不能为空");
		form.Content.focus();
		return false;
	}
	return true;
}
