
//判断是否正确EMAIL
	function IsValidEmail(val)
	{
	  var mail=/^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.){1,4}[a-z]{2,3}$/i; 
	  if(!mail.test(val))
		{
		  return (false);
		}
	  else
		{
		  return (true);
		}
	}

function SubmitPage(CurrPage){
	document.Pages.Page.value=CurrPage;
	document.Pages.submit();
}
	
	function AddFavorite()
	{
		window.external.AddFavorite('http://www.jmtx.cn/','广州市金梅通讯电子有限公司')
	}
	function AddProd(ProdID)
	{
		window.external.AddFavorite("http://www.jmtx.cn/Products/Product_Details.asp?ID="+ProdID,"广州市金梅通讯电子有限公司")
	}
	
//去掉空格
	function TrimSpace(str)
	{
		var StrLen=str.length;
		if(str.charAt(0) == " ")
		{
			str = str.slice(1);
			str = TrimSpace(str); 
		}
		if(str.charAt(StrLen) == " ")
		{
			str = str.slice(0,StrLen-1);
			str = TrimSpace(str); 
		}
		return str;
	}
	
	function OpenPicWin(ID)
	{
		var theURL = "Product_ShowPic.asp?ID="+ ID
		var xposition=0; yposition=0;
		var theWidth = 500;theHeight=350;
		if ((parseInt(navigator.appVersion) >= 4 ))
		{
			xposition = (screen.width - theWidth) / 2;
			yposition = (screen.height - theHeight) / 2 -100;
		}		
		var NewW=window.open(theURL,"winName",'width='+theWidth+',height='+theHeight+',left='+xposition+',top='+yposition +',scrollbars=1,resizable=1');
		NewW.focus();
	}