// JavaScript Document
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function closewin() {
if (opener!=null && !opener.closed) {
opener.window.newwin=null;
opener.openbutton.disabled=false;
opener.closebutton.disabled=true;
}
}

var count=0;//做计数器
var limit=new Array();//用于记录当前显示的哪几个菜单
var countlimit=1;//同时打开菜单数目，可自定义
function expandIt(el) {
obj = eval("sub" + el);
 if (obj.style.display == "none") {
  obj.style.display = "block";//显示子菜单
  if (count<countlimit) {//限制2个
  limit[count]=el;//录入数组
  count++;
  }
  else {
  eval("sub" + limit[0]).style.display = "none";
  for (i=0;i<limit.length-1;i++) {limit[i]=limit[i+1];}//数组去掉头一位，后面的往前挪一位
  limit[limit.length-1]=el;
  }
 }
 else {
 obj.style.display = "none";
 var j;
 for (i=0;i<limit.length;i++) {if (limit[i]==el) j=i;}//获取当前点击的菜单在limit数组中的位置
 for (i=j;i<limit.length-1;i++) {limit[i]=limit[i+1];}//j以后的数组全部往前挪一位
 limit[limit.length-1]=null;//删除数组最后一位
 count--;
 }
}
function gosearch()
{
	if (document.form2.keyword.value=="")
   {
     alert("Please input product name!");
	 document.form2.keyword.focus();
	 return false;
   }  
}
function guestceeck()
{
if (document.myform.CompanyName.value==""){
	      alert("Please input company name！")
		  document.myform.CompanyName.focus();
		  return false
		   }
		   
	  if (document.myform.Receiver.value==""){
	      alert("Please input contact name！");
		  document.myform.Receiver.focus();
		  return false
		  } 
		  
		  
      if (document.myform.Phone.value==""){
	      alert("Please input telephone number！");
		  document.myform.Phone.focus();
		  return false
		  } 
		  
		  if (document.myform.email.value==""){
	      alert("Please input your email address！")
		  document.myform.email.focus();
		  return false
		    }
			
       if(isEmail(document.myform.email.value)==false)
		{
			window.alert("Please input your right email address");
			document.myform.email.focus();
			document.myform.email.select();
			return false;		
		}
		
		if (document.myform.Title.value==""){
	      alert("Please input title of the guestbook！");
		  document.myform.Title.focus();
		  return false
		  } 
		  
		if (document.myform.Content.value==""){
	      alert("please input message！");
		  document.myform.Content.focus();
		  return false
		  } 
}
function isEmail(vEMail)
	{
		var regInvalid=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
		var regValid=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
		return (!regInvalid.test(vEMail)&&regValid.test(vEMail));
	}


