function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function imgchange(s_img,s_scr){
    s_img.src=s_scr;
}
function tbimchge(d_d){
    rttbimg.style.background="no-repeat url("+d_d+")";
}
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 showtd(tdd){
 document.getElementById(tdd).style.display="";	
}
function hidetd(tdf){
 document.getElementById(tdf).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 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;  
  }
}

