function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
var flag=false;
function suotu(ImgD,wid,hgt){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= wid/hgt){
if(image.width>wid){
ImgD.width=wid;
ImgD.height=(image.height*wid)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt=image.width+"x"+image.height;
}
else{
if(image.height>hgt){
ImgD.height=hgt;
ImgD.width=(image.width*hgt)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt=image.width+"x"+image.height;
}
}
}

function showhide(sid){
 whichEl = eval(sid);
 if (whichEl.style.display == "none"){
 eval(sid + ".style.display=\"\";");
 }else{
 eval(sid + ".style.display=\"none\";");
 }
}

function chksend() {
  var t=document.myform;
 	  re1 = new RegExp(/^[a-zA-Z.0-9-_]*@[a-zA-Z0-9][a-zA-Z0-9-_]*(\.[a-zA-Z0-9][a-zA-Z0-9-_]*)*\.[a-zA-Z]+$/); //正则表达式，用来检测E-mail是否是正确格式
   if (t.zhanghao.value=="" || t.zhanghao.value.length<2) {
    alert("请输入您的帐号");
	t.zhanghao.focus();
    return false;
  } else
   if (t.mima1.value=="" || t.mima1.value.length<2) {
    alert("请输入您的密码");
	t.mima1.focus();
    return false;
  } else
   if (t.mima2.value=="" || t.mima2.value.length<2) {
    alert("请输入您的确认密码");
	t.mima2.focus();
    return false;
  } else
   if (t.mima1.value != t.mima2.value) {
    alert("两次输入的密码不一致");
	t.mima2.focus();
    return false;
  } else
   if (t.xingming.value=="" || t.xingming.value.length<2) {
    alert("请输入您的姓名");
	t.xingming.focus();
    return false;
  }else 
   if (t.dianhua.value=="" || t.dianhua.value.length<2) {
    alert("请输入您的电话");
	t.dianhua.focus();
    return false;
  } else
   if (t.email.value.match(re1)==null) {
    alert("请输入您的EMAIL");
	t.email.focus();
    return false;
  }else{
  return true;
  }
 }

function chksends() {
  var t=document.regForm;
 	  re1 = new RegExp(/^[a-zA-Z.0-9-_]*@[a-zA-Z0-9][a-zA-Z0-9-_]*(\.[a-zA-Z0-9][a-zA-Z0-9-_]*)*\.[a-zA-Z]+$/); //正则表达式，用来检测E-mail是否是正确格式
   if (t.biaoti.value=="") {
    alert("请填写您要申请的型号！！");
	t.biaoti.focus();
    return false;
  } else
   if (t.neirong.value=="" ) {
    alert("请填写您要申请样品的详细内容！！");
	t.neirong.focus();
    return false;
  } else
     if (t.xingming.value=="" || t.xingming.value.length<2) {
    alert("请输入您的姓名");
	t.xingming.focus();
    return false;
  }else 
   if (t.dianhua.value=="" || t.dianhua.value.length<2) {
    alert("请输入您的手机号码！！");
	t.dianhua.focus();
    return false;
  } else
   if (t.email.value.match(re1)==null) {
    alert("请输入您的EMAIL");
	t.email.focus();
    return false;
  }else
  if (t.checkcode.value=="" || t.checkcode.value.length<2) {
    alert("请输入验证码");
	t.checkcode.focus();
    return false;
  } else
  {
  return true;
  }
 }
function chksendsm() {
  var t=document.regForm;
 	  re1 = new RegExp(/^[a-zA-Z.0-9-_]*@[a-zA-Z0-9][a-zA-Z0-9-_]*(\.[a-zA-Z0-9][a-zA-Z0-9-_]*)*\.[a-zA-Z]+$/); //正则表达式，用来检测E-mail是否是正确格式
   if (t.biaoti.value=="") {
    alert("请填写您要订购的型号！！");
	t.biaoti.focus();
    return false;
  } else
   if (t.neirong.value=="" ) {
    alert("请填写您要订购产品的详细内容！！");
	t.neirong.focus();
    return false;
  } else
     if (t.xingming.value=="" || t.xingming.value.length<2) {
    alert("请输入您的姓名");
	t.xingming.focus();
    return false;
  }else 
   if (t.dianhua.value=="" || t.dianhua.value.length<11) {
    alert("请输入您的手机号码！！");
	t.dianhua.focus();
    return false;
  } else
   if (t.email.value.match(re1)==null) {
    alert("请输入您的EMAIL");
	t.email.focus();
    return false;
  }else
  if (t.checkcode.value=="" || t.checkcode.value.length<2) {
    alert("请输入验证码");
	t.checkcode.focus();
    return false;
  } else
  {
  return true;
  }
 }
function chklogin(){
 var t=document.loginform;
   if (t.zhanghao.value=="" || t.zhanghao.value.length<2) {
    alert("请输入您的帐号");
	t.zhanghao.focus();
    return false;
  } else
   if (t.mima.value=="" || t.mima.value.length<2) {
    alert("请输入您的密码");
	t.mima1.focus();
    return false;
  } else
   if (t.yzma.value=="" || t.yzma.value.length<2) {
    alert("请输入验证码");
	t.yzma.focus();
    return false;
  } else{
	return true;  
  }
}


function sAlert(str){
var msgw,msgh,bordercolor;
msgw=500;//提示窗口的宽度
msgh=500;//提示窗口的高度
titleheight=16 //提示窗口标题高度
bordercolor="#888888";//提示窗口的边框颜色
titlecolor="#FFFFFF";//提示窗口的标题颜色
 
var sWidth,sHeight;
sWidth=document.body.scrollWidth;
sHeight= document.body.scrollHeight; 

 
var bgObj=document.createElement("div");
bgObj.setAttribute('id','bgDiv');
bgObj.style.position="absolute";
bgObj.style.top="0";
bgObj.style.background="#BBBBBB";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
bgObj.style.opacity="0.6";
bgObj.style.left="0";
bgObj.style.width=sWidth + "px";
bgObj.style.height=sHeight + "px";
bgObj.style.zIndex = "10000";
document.body.appendChild(bgObj);
 
var msgObj=document.createElement("div")
msgObj.setAttribute("id","msgDiv");
msgObj.setAttribute("align","center");
msgObj.style.background="white";
msgObj.style.border="1px solid " + bordercolor;
msgObj.style.position = "absolute";
msgObj.style.left = "50%";
msgObj.style.top = "20%";
msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
msgObj.style.marginLeft = "-225px" ;
msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
msgObj.style.width = msgw + "px";
msgObj.style.height =msgh + "px";
msgObj.style.textAlign = "center";
msgObj.style.lineHeight ="25px";
msgObj.style.zIndex = "10001";
 
var title=document.createElement("h4");
title.setAttribute("id","msgTitle");
title.setAttribute("align","right");
title.style.margin="0";
title.style.padding="0px";
title.style.background=titlecolor;
title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
title.style.opacity="0.75";
//title.style.border="1px solid " + bordercolor;
title.style.height="16px";
title.style.font="16px Verdana, Geneva, Arial, Helvetica, sans-serif";
title.style.color="black";
title.style.cursor="pointer";
title.innerHTML="×&nbsp;";
title.onclick=function(){
document.body.removeChild(bgObj);
document.getElementById("msgDiv").removeChild(title);
document.body.removeChild(msgObj);
}
document.body.appendChild(msgObj);
document.getElementById("msgDiv").appendChild(title);
var txt=document.createElement("p");
txt.style.margin="1em 0"
txt.setAttribute("id","msgTxt");
txt.innerHTML=str;
document.getElementById("msgDiv").appendChild(txt);
}

