function ch(a)
{ var pattern=/@/;
//pattern=/@\w+\.\w{1,3}$/;
  var cnt=0;
  var error="Attention please：\n";
    if(a.name.value=="")
   {cnt=cnt+1;
    error= error+cnt+"."+"Please input your name\n ";
   } 
      if(a.code.value=="")
   {cnt=cnt+1;
    error= error+cnt+"."+"Please input your city,state\n ";
   }
    if(a.email.value=="")
   {cnt=cnt+1;
    error= error+cnt+"."+"Please input your email\n ";
   } 
  if(!a.email.value==""){
  if(!pattern.test(a.email.value))
	{cnt=cnt+1;error=error+cnt+"."+"wrong email address, please double check it,thanks\n";
	}}  
					


   if(a.Content.value==""){cnt=cnt+1;error=error+cnt+"."+"Please input your message";}
   if(cnt==0)return true;
     else 
	 {alert (error);return false;}
	 }

function SetImgAutoSize(img) 
{ 
//var img=document.all.img1;//获取图片 
var MaxWidth=650;//设置图片宽度界限 
var MaxHeight=650;//设置图片高度界限 
var HeightWidth=img.offsetHeight/img.offsetWidth;//设置高宽比 
var WidthHeight=img.offsetWidth/img.offsetHeight;//设置宽高比 
if(img.readyState!="complete"){
 return false;//确保图片完全加载
}

if(img.offsetWidth>MaxWidth){ 
img.width=MaxWidth; 
img.height=MaxWidth*HeightWidth; 
} 
if(img.offsetHeight>MaxHeight){ 
img.height=MaxHeight; 
img.width=MaxHeight*WidthHeight; 
} 
} 

function flash(ur,w,h){
document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+w+'" height="'+h+'">');
document.write('<param name="movie" value="'+ur+'">');
document.write('<param name="quality" value="high"> ');
document.write('<param name="wmode" value="transparent"> ');
document.write('<param name="menu" value="false"> ');
document.write('<embed src="'+ur+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="'+w+'" height="'+h+'" quality="High" wmode="transparent">');
document.write('</embed>');
document.write('</object>');
}

function picflash(imgurl,imglink,imgtext){

 var focus_width=984
 var focus_height=179
 var text_height=0
 var swf_height = focus_height+text_height
 
 var pics=imgurl
 var links=imglink
 var texts=imgtext
 
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/swf/AdvChange.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('<embed src="/swf/AdvChange.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');  document.write('</object>'); 
}
