function searchForm()
{
	var url = document.Search.strselect.options[document.Search.strselect.selectedIndex].value;
	var keyword = document.Search.SearchKeyword.value;
	if (keyword =="" )
	{
		alert("* You must enter keyword!");
		document.Search.SearchKeyword.focus();
		return false;
	}
	else
	{
	location.href =url+"?SearchKeyword="+escape(keyword);
	//location.href =url+"?SearchKeyword="+keyword;
	}
}

function CheckFormLogin()
{
	var FormName = document.FormLogin;
	//判断输入的内容
	if ( FormName.UserName.value == "" )
	{
	    alert("* You must enter your user name！");
		FormName.UserName.focus();
		return false;
	}
	if ( FormName.UserPassword.value == "" )
	{
		alert("* You must enter your password");
		FormName.UserPassword.focus();
		return false;
	}
	FormName.submit();	
}

function IsCheck(form1)
{
  var flag;
  flag=false;
  for (var j=0;j<form1.elements.length;j=j+1)
  {
    var e1 = form1.elements[j];
    if (e1.checked && e1.name != 'chkall')
    {     
    			flag=true;
          break;
    }
  }
  if(flag==true)
  {   
      //return true;
      form1.submit();
  }
  else
  {
    alert("Please tick on the supplier you wish to contact.");
    return false;
  }
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i=i+1)
    {
    var e = form.elements[i];
    if (e.name != 'chkall' )
       e.checked = form.chkall.checked;
    }
  }
  
  function winopen(url,width,height)
	{
		var left = (screen.width/2) - width/2;
		var top = (screen.height/2) - height/2;
		var styleStr = 'toolbar=no,location=no,directories=auto,status=no,menubar=no,scrollbars=yes resizable=yes,z-lock=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
		window.open(url,"", styleStr);
	}
	function getOs()
	{
	   if(navigator.userAgent.indexOf("MSIE")>0)return 1;
	   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)return 2;
	   if(isSafari=navigator.userAgent.indexOf("Safari")>0)return 3;   
	   if(isCamino=navigator.userAgent.indexOf("Camino")>0)return 4;
	   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)return 5;
	   return 0;
	}
	function open_win($url)
	{
		var screenW = window.screen.width;
		var screenH = window.screen.height;
		switch(getOs())
		{
			case 1:
				window.open($url,"","fullscreen=1,menubar=no,,scrollbars=yes,resizable=no,status=no,top=0,left=0,width=100%,height=100%");
				break;
			case 2:			
				window.open($url, 'newwindow', 'fullscreen=1, height='+screenH+', width='+screenW+', top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');		
				break;
			default:
				window.open($url, 'newwindow', 'fullscreen=1, height='+screenH+', width='+screenW+', top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
				obj = new ActiveXObject("wscript.shell")
				obj.sendKeys("{F11}")
	
		}
		
	}
