﻿//站内搜索
function procheck(){
	if(document.formSear.keys.value==""){
		alert("输入产品名称！");
		document.formSear.keys.focus();
		return false
	}
}

//留言F
 function Fcheck(){
	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;
	  }
}

//判断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 eWin(file,w,h){
   window.open(file,'','resizable=yes,width='+w+",height="+h+',scrollbars=yes,left='+(screen.availWidth-w)/2+',top='+(screen.availHeight-h)/2);
}

//判断是否为空
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}


//列表
var prevList;
function listCon(obj){
	//隐藏前一个
	if(prevList!=null){
		document.getElementById("con"+prevList).style.display="none";
		document.getElementById("m"+prevList).className="pro_nav";
	}
	
	//显示这一个
	document.getElementById("con"+obj).style.display="block";
	document.getElementById("m"+obj).className="pro_navA";
	
	prevList=obj;
}

//产品
var prev;
function proCon(obj){
	//隐藏前一个
	if(prev!=null){
		document.getElementById("pon"+prev).style.display="none";
		document.getElementById("x"+prev).className="pa";
	}
	
	//显示这一个
	document.getElementById("pon"+obj).style.display="block";
	document.getElementById("x"+obj).className="paA";
	
	prev=obj;
}

//产品多图展示
function showimage(u,nameText){
document.images.tus.src=u;
document.getElementById("text").innerHTML=nameText;
}