<!--  
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 reg(e)
 {
   if (e.user_name.value.length==0)
    {
		   alert("用户名必须填写！");
		   e.user_name.focus()
		   return false;
	}
  if (e.user_password.value.length==0)
   {
		  alert("密码必须填写！");
		  e.user_password.focus()
		  return false;
   }
 if (e.pwds.value.length==0)
  {
	alert("验证码必须填写！");
    e.pwds.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;
  }

}

function h(obj,url){obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);}
