function CreateIndex()
{
	var jsHour=new Date().getHours();
	if(jsHour%2==0)
	{
		var xmlHttp;
		if (window.ActiveXObject)   // IE下创建XMLHTTPREQUEST
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			var rndcode = new Date().getTime();
			xmlHttp.open("GET","bhp.asp",true);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ;
			xmlHttp.send(null);
			//xmlHttp.onreadystatechange=callback;

		}
		else if (window.XMLHttpRequest)   // 其他浏览器创建XMLHTTPREQUEST
		{
			xmlHttp = new XMLHttpRequest();
			var rndcode = new Date().getTime();
			xmlHttp.open("GET","bhp.asp",false);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ;
			xmlHttp.send(null);
			//xmlHttp.onreadystatechange=callback();
		}
	}
}

function MoveLeftLayer(layerName)
{
	var x = 5;
	var y = 100;// 左侧广告距离页首高度
	var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
	var y = document.body.scrollTop + y - diff;
	eval("document.all." + layerName + ".style.posTop = parseInt(y)");
	eval("document.all." + layerName + ".style.posLeft = x");
	setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
	
function MoveRightLayer(layerName) 
{
	var x = 5;
	var y = 100;// 右侧广告距离页首高度
	var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
	var y = document.body.scrollTop + y - diff;
	eval("document.all." + layerName + ".style.posTop = y");
	eval("document.all." + layerName + ".style.posRight = x");
	setTimeout("MoveRightLayer('AdLayer2');", 20);
}
function initLEcAd() 
{
	document.all.AdLayer1.style.posTop = -200;
	document.all.AdLayer1.style.visibility = 'visible'	
	MoveLeftLayer('AdLayer1');
}

function initREcAd() 
{
	document.all.AdLayer2.style.posTop = -200;
	document.all.AdLayer2.style.visibility = 'visible'
	MoveRightLayer('AdLayer2');
}

 function search()  
	  {  
	  if(trim(document.searchform.searchkey.value)!='')
	    {
			if(document.searchform.sortname.value=='供应信息')       
			{       
				searchform.action="/websearch/enterinfo_search.asp";       
				searchform.submit();       
			}       
			else if(document.searchform.sortname.value=='求购信息')       
			{       
				searchform.action="/websearch/enterinfo_search.asp";       
				searchform.submit();       
			}       
			else if(document.searchform.sortname.value=='代理信息')       
			{       
				searchform.action="/websearch/enterinfo_search.asp";       
				searchform.submit();       
			}   
			else if(document.searchform.sortname.value=='合作信息')       
			{       
				searchform.action="/websearch/enterinfo_search.asp";       
				searchform.submit();       
			} 
			else if(document.searchform.sortname.value=='生活服务')       
			{       
				searchform.action="/websearch/enterinfo_search.asp";       
				searchform.submit();       
			}    
			else if(document.searchform.sortname.value=='展会信息')       
			{       
				searchform.action="/websearch/enterinfo_search.asp";       
				searchform.submit();       
			}   
			else if(document.searchform.sortname.value=='招聘信息')       
			{       
				searchform.action="/websearch/enterinfo_search.asp";       
				searchform.submit();       
			}  
			else if(document.searchform.sortname.value=='产品信息')       
			{       
				searchform.action="/websearch/product_search.asp";       
				searchform.submit();       
			}   

		}
		else
		{
		 alert("请输入关键字！");
		}
	  }  
	  function trim(str)
	  { 
		return str.replace(/(^\s*)|(\s*$)/g, "");
	  }


	  function checkname()
	{
		if(document.form2.username.value == "")
        {
			alert("帐号不能为空！");
			document.form2.username.focus();
			return (false);
        }
		if(document.form2.password.value =="") 
         {
			alert("密码不能为空！");
			document.form2.password.focus();
			return (false); 
         }
		if(document.form2.code.value =="") 
         {
			alert("验证码不能为空！");
			document.form2.code.focus();
			return (false); 
         }
		
		var filter=/^\s*[.A-Za-z0-9_-]{6,15}\s*$/;
        if (!filter.test(document.form2.username.value)) { 
                alert("登录名填写不正确,请重新填写！"); 
                document.form2.username.focus();
                document.form2.username.select();
                return (false); 
          }
		 if (!filter.test(document.form2.password.value)) { 
                alert("密码填写不正确,请重新填写！"); 
                document.form2.password.focus();
                document.form2.password.select();
                return (false); 
          }
		form2.method="post";
		form2.action="check.asp";
		form2.submit();
	}
	function getcode()
	{
		 document.getElementById("imgcode").src="/getcode.asp?tmp="+Math.random();
	}
	function getpass()
	{
		window.open("getpass.asp","getpass","resizable=yes,width=380,height=200,top=200,left=300,scrollbars=yes");
	}

	
	function S(i)
	{ 
		return document.getElementById(i); 
	}
	function download(evt,fid,sortid,sortname)
	{
		var _event = evt ? evt : event;
		var _target = evt ? evt.target : event.srcElement;
		var _p = S( "downloadPanel" );
		_p.style.top = _event.clientY + document.body.scrollTop ;
		_p.style.left = ( _event.clientX + document.body.scrollLeft < 180 ? _event.clientX + document.body.scrollLeft + 10  : _event.clientX  + document.body.scrollLeft );
		Show("downloadPanel",true,sortid,sortname);	
		_p.focus();
	}
	function Show(obj, bShow,sortid,sortname)
	{
		obj = (typeof(obj) == "string" ? S(obj) : obj);
		if (obj) obj.style.display= (bShow ? "" : "none");
		var tab="<table border=0 width=100% height=100% cellspacing=0 cellpadding=0><tr><td height=15 colspan=2 align=right><img src='images/close.gif' onclick='hideDownloadPanel();' style='cursor:hand'></td></tr><tr height=20><td align=center><a href='enterinfo/supply/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>供应信息</b></font></a></td><td align=center><a href='enterinfo/demand/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>求购信息</b></font></a></td></tr><tr height=20><td align=center><a href='enterinfo/product/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>产品信息</b></font></a></td><td align=center><a href='enterinfo/agent/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>代理信息</b></font></a></td></tr><tr height=20><td align=center><a href='enterinfo/together/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>合作信息</b></font></a></td><td align=center><a href='enterinfo/exhin/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>展会信息</b></font></a></td></tr><tr height=20><td align=center><a href='enterinfo/server/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>生活服务</b></font></a></td><td align=center><a href='enterinfo/invite/list.asp?sort=yes&id="+sortid+"&sortid="+sortid+"&sortname="+sortname+"'><font color='#DA3B3B'><b>招聘信息</b></font></a></td></tr></table>";
		obj.innerHTML = "<table width=100% cellspacing=0 cellpadding=0 height=100% border=0  style='padding-bottom:10px;BACKGROUND-COLOR: #ffffff'><tr><td>"+tab+"</td></tr></table>";

	}
	function hideDownloadPanel(evt)
	{
		Show("downloadPanel" ,false,'','');	
	}
	function checkClick(evt)
	{
		var _target = evt ? evt.target : event.srcElement ;
		var _id = _target.id;
		if( _id == "" )
		{
			_id = _target.parentNode.id;
		}
		if( _id !="downloadDirect" && _id != "downloadAgent" && _id != "downloadPanel" && _id.indexOf( "downloadFile_" ) < 0 && _id.indexOf( "downloadLink_" ) < 0 )
		{
			Show("downloadPanel",false );
		}
	}


	function ShowDialog(url,iWidth,iHeight,title) 
	{ 
		var iTop=(window.screen.height-iHeight)/2; 
		var iLeft=(window.screen.width-iWidth)/2; 
		window.open(url,title,"Scrollbars=yes,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft); 
	} 
function showit()
{
	self.setInterval("changeit()",800);
}

function changeit()
{
  var bg='#';   
  var color=new Array("A","B","C","D","E","F"); 
  var node=document.getElementById("dhText");//#33FF33   
  for (var j=1;j<7;j++)
  {
  var i=Math.round(Math.random()*10);
  if(i>=5)
  {
	bg=bg+color[i-5];
  }
  else
  {
	bg=bg+i;
  }
 }
 node.style.color=bg;
}

function loadpic(pic,picid)
{
	var img = new Image(); 
	img.src = pic; 
	img.onload = function() 
	{ 
	document.getElementById(picid).src = this.src; 
	}
}
function openTool(toolurl)
{
	window.open(toolurl);
}
