<!--  
var  flag=false;  
var  w_num=97,h_num=111;

function  DrawImage(ImgD,ww,hh){  
var  image=new  Image();  
image.src=ImgD.src;  

if(image.width>0  &&  image.height>0)
{ 
  if (image.width>ww && image.height<=hh){
     ImgD.width=ww; 	 	 
    }
  if (image.height>hh && image.width<=ww){
     ImgD.height=hh;
    }
  if (image.height>hh && image.width>ww){
     num=ww/image.width;
	
	 height_num=image.height*num;
	 
	 if (height_num>hh){
	     num=hh/image.height;
		 ImgD.width=image.width*num;
		 ImgD.height=hh;
		 
		 w_num=image.width*num;
		 h_num=hh;
	 }
	 else{
	     ImgD.width=ww;
		 ImgD.height=image.height*num;
		 
		 w_num=ww;
		 h_num=image.height*num;
	 }
	 
    }	
	//ImgD.alt=image.width+"×"+image.height;
	}
}
//--> 

function click() {
if (event.button==2) {
alert('禁止点击右键')
}
}

function h(obj,url){obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);}

function sub1(e)
{
  if (e.s_name.value.length==0)
  {
	alert("姓名必须填写！");
	e.s_name.focus();
	return false;
  }
  if (e.lxdz.value.length==0)
  {
	alert("联系地址必须填写！");
	e.lxdz.focus();
	return false;
  }
 if (e.lxdh.value.length==0)
 {
	alert("联系电话必须填写！");
	e.lxdh.focus();
	return false;
  }
  
 if (e.zxdg_yzm.value.length==0)
 {
	alert("验证码必须填写！");
	e.zxdg_yzm.focus();
	return false;
  }

 if (e.dgly.value.length==0)
 {
	alert("加盟留言必须填写！");
	e.dgly.focus();
	return false;
 }
		   
	var n=0;
	var i;
    for (i=0;i<e.dgly.value.length;i++)
    {
      if (e.dgly.value.charCodeAt(i)>255)
		{
         //s.charCodeAt(i)为非ascii字符
          n=n+2;
        }
		else{
          //s.charCodeAt(i)为ascii字符
          n=n+1;
        }
       }
		//alert(n);
      if(n>450){
        alert("您填写的加盟留言的字数太多 请酌情处理 ");
		e.dgly.focus();
		return false;
    }
}


function sub2(e)
 {
   if (e.txt_user.value.length==0)
    {
		   alert("请填写姓名!");
		   e.txt_user.focus();
		   return false;
	}
  if (e.txt_mail.value.length==0)
   {
		  alert("请填写信箱!");
		  e.txt_mail.focus();
		  return false;
   }
  var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/; 
  if(pattern.test(e.txt_mail.value)==false){
	alert("Email格式不正确!");
	e.txt_mail.focus();
    return false;
  } 
   
   if (e.txt_jy.value.length==0)
   {
		  alert("请填写留言内容!");
		  e.txt_jy.focus();
		  return false;
   }
   
   var n=0;
   var i;
   for (i=0;i<e.txt_jy.value.length;i++)
   {
      if (e.txt_jy.value.charCodeAt(i)>255)
      {
         //s.charCodeAt(i)为非ascii字符
          n=n+2;
      }
	  else{
             //s.charCodeAt(i)为ascii字符
             n=n+1;
           }
   }
			//alert(n);
   if(n>400){
               alert("留言内容的字数太多 请酌情处理 ");
			   e.txt_jy.focus();
			   return false;
             }
   
 if (e.lyb_yzm.value.length==0)
  {
	alert("验证码必须填写!");
    e.lyb_yzm.focus();
	return false;
  }

}

//document.onmousedown=click

