﻿//站内搜索
function searcheck(){
	if(document.formSear.keys.value=="" || document.formSear.keys.value=="输入产品名称或型号"){
		alert("请输入产品名称或型号！");
		document.formSear.keys.focus();
		return false
	}
}

//产品分类搜索
function proTypecheck(){
	if(document.formPro.titlepath.value==""){
		alert("请选择产品分类！");
		document.formPro.titlepath.focus();
		return false
	}
	if(document.formPro.keys.value=="" || document.formPro.keys.value=="输入名称或型号"){
		alert("请输入产品名称或型号！");
		document.formPro.keys.focus();
		return false
	}
}

//价格查询
function pricecheck(){
	if(document.formprice.keys.value==""){
		alert("输入产品关键词！");
		document.formprice.keys.focus();
		return false
	}
}

//会员登录
function usercheck(){
	if(document.formuser.uname.value==""){
		alert("请输入您的登录账号！");
		document.formuser.uname.focus();
		return false
	}	
	if(document.formuser.upass.value==""){
		alert("密码不能为空！");
		document.formuser.upass.focus();
		return false
	}
}

//会员注册
function regcheck(){
   if(document.register.uname.value==""){
      alert("请先输入您的用户名！");
	  document.register.uname.focus();
	  return false;
   }
   if(document.register.upass.value==""){
      alert("请先输入您的密码！");
	  document.register.upass.focus();
	  return false;
   }
   if(document.register.upass2.value==""){
      alert("请重复输入您的密码！");
	 document.register.upass2.focus();
	  return false;
   }
   if(document.register.man.value==""){
      alert("请输入真实姓名");
	  document.register.man.focus();
	  return false;
   }
   if(document.register.email.value==""){
      alert("请输入E-Mail");
	  document.register.email.focus();
	  return false;
   }
   if(emailcheck(document.register.email.value)){
		alert("请输入正确的E-mail！");
		document.register.email.focus();
		return false;
   }
   if(document.register.tel.value==""){
      alert("请输入您的联系方式");
	  document.register.tel.focus();
	  return false;
   }
   if(document.register.add.value==""){
      alert("请输入您的通信地址");
	  document.register.add.focus();
	  return false;
   }
   if(document.register.upass.value!=document.register.upass2.value){
      alert("两次输入的密码不一致！");
	  document.register.upass.focus();
	  return false;
   }
}

//找回密码
function passcheck(){
	if(document.pass.uname.value==""){
		alert("请输入您的会员账号！");
		document.pass.uname.focus();
		return false
	}
}

//会员资料修改
function infocheck(){
   if(document.info.email.value==""){
      alert("请输入E-Mail");
	  document.info.email.focus();
	  return false;
   }
   if(emailcheck(document.info.email.value)){
		alert("请输入正确的E-mail！");
		document.info.email.focus();
		return false;
	}
   if(document.info.tel.value==""){
      alert("请输入联系电话");
	  document.info.tel.focus();
	  return false;
   }
   if(document.info.upass.value!=document.info.upass2.value){
      alert("两次输入的密码不一致！");
	  document.info.upass.focus();
	  return false;
   }
}


//留言F
 function Fcheck(){
	if(document.formF.types.value==""){
      alert("选择类型进行留言！");
	  document.formF.types.focus();
	  return false;
	  }
	if(document.formF.title.value==""){
      alert("主题不能为空！");
	  document.formF.title.focus();
	  return false;
	  }
   if(document.formF.man.value==""){
      alert("请正确填写您的姓名！");
	  document.formF.man.focus();
	  return false;
	  }
	if(document.formF.tel.value==""){
      alert("请填写您的联系电话！");
	  document.formF.tel.focus();
	  return false;
	  }
    if(document.formF.email.value==""){
      alert("请填写您的E-mail！");
	  document.formF.email.focus();
	  return false;
	  }
    if(emailcheck(document.formF.email.value)){
		alert("请输入正确的E-mail！");
		document.formF.email.focus();
		return false;
   }
	if(document.formF.content.value==""){
      alert("您的留言内容不能为容！");
	  document.formF.content.focus();
	  return false;
	  }
	if(document.formF.validatecode.value==""){
      alert("验证码不能为空！");
	  document.formF.validatecode.focus();
	  return false;
	  }
}

//自荐S
 function Scheck(){
	if(document.formSelf.E_1.value==""){
      alert("请输入您的姓名！");
	  document.formSelf.E_1.focus();
	  return false;
	  }
	if(document.formSelf.E_3.value==""){
      alert("年龄不能为空！");
	  document.formSelf.E_3.focus();
	  return false;
	  }
   if(document.formSelf.E_4.value==""){
      alert("请输入您的出生年月！");
	  document.formSelf.E_4.focus();
	  return false;
	  }
	if(document.formSelf.E_7.value==""){
      alert("请填写您的身份证号！");
	  document.formSelf.E_7.focus();
	  return false;
	  }
	if(document.formSelf.E_8.value==""){
      alert("您的籍贯所在地！");
	  document.formSelf.E_8.focus();
	  return false;
	  }
	if(document.formSelf.E_9.value==""){
      alert("输入您的学历！");
	  document.formSelf.E_9.focus();
	  return false;
	  }
	if(document.formSelf.E_11.value==""){
      alert("您所学的专业！");
	  document.formSelf.E_11.focus();
	  return false;
	  }
	if(document.formSelf.E_12.value==""){
      alert("你的毕业时间！");
	  document.formSelf.E_12.focus();
	  return false;
	  }
	 if(document.formSelf.E_18.value==""){
      alert("您的工龄有多久！");
	  document.formSelf.E_18.focus();
	  return false;
	  } 
	 if(document.formSelf.E_19.value==""){
      alert("您现在要应聘岗位是什么！");
	  document.formSelf.E_19.focus();
	  return false;
	  } 
	if(document.formSelf.E_21.value==""){
      alert("请留下您的联系电话！");
	  document.formSelf.E_21.focus();
	  return false;
	  } 
    if(document.formSelf.E_23.value==""){
      alert("请填写您的E-mail！");
	  document.formSelf.E_23.focus();
	  return false;
	  }
    if(emailcheck(document.formSelf.E_23.value)){
		alert("请输入正确的E-mail！");
		document.formSelf.E_23.focus();
		return false;
   }
	if(document.formSelf.validatecode.value==""){
      alert("验证码不能为空！");
	  document.formSelf.validatecode.focus();
	  return false;
	  }
}

//判断Email的正确性
function   emailcheck(string){     
  var   str_len   =   string.length;   
  if   (str_len<=5){   
        return   true   
          }       
  for(i=0;i<str_len;i++){   
          if   (string.charCodeAt(i)>127){   
  return   true     
  }   
  }   
  if   (string.indexOf("@")<2){   
          return   true   
          }       
    if   (string.indexOf(".")==1){   
          return   true   
          }       
  if   (string.indexOf(":")!=-1){   
          return   true   
  }   
 }


//弹出窗口
function Win(file,w,h,r,s){
    window.open(file,'','resizable='+r+',width='+w+",height="+h+',scrollbars='+s+',left='+(screen.availWidth-w)/2+',top='+(screen.availHeight-h)/2);
}

//判断空值
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

//价格标签
var prev;
function showCon(obj){
	//隐藏前一个
	if(prev!=null){
		document.getElementById("con"+prev).style.display="none";
		document.getElementById("m"+prev).className="";
		document.getElementById("c"+prev).className="";
	}
	
	//显示这一个
	document.getElementById("con"+obj).style.display="block";
	document.getElementById("m"+obj).className="trtext";
	document.getElementById("c"+obj).className="trcon";
	
	prev=obj;
}

//公司简介
var prev;
function aboutCon(obj){
	//隐藏前一个
	if(prev!=null){
		document.getElementById("con"+prev).style.display="none";
		document.getElementById("a"+prev).className="";
		document.getElementById("t"+prev).className="";
	}
	
	//显示这一个
	document.getElementById("con"+obj).style.display="block";
	document.getElementById("a"+obj).className="now";
	document.getElementById("t"+obj).className="";
	
	prev=obj;
}


//产品列表
var prev;
function prolistCon(obj){
	//隐藏前一个
	if(prev!=null){
		document.getElementById("pon"+prev).style.display="none";
		document.getElementById("p"+prev).className="";
	}
	
	//显示这一个
	document.getElementById("pon"+obj).style.display="block";
	document.getElementById("p"+obj).className="now";
	
	prev=obj;
}
