	var curPath=(location.pathname+location.search).toLowerCase();
	var leftmenus=document.getElementById("topmenu").getElementsByTagName("div").item(0).firstChild.childNodes;
	var rightmenus=document.getElementById("topmenu").getElementsByTagName("div").item(1).firstChild.childNodes;
	
	//var searchOption=document.getElementById(
	//首页 供应  求购 企业黄页 服务 工作
	// /     sell  buy   company  service job
	if(curPath=='/' || curPath=='/index.htm')
	{
	    setMenu(0,0);
	}
	else if(curPath.indexOf('sell/')>0)
	{
	    setMenu(1,0);
		SetSearchOption('sell');
	}
	else if(curPath.indexOf('buy/')>0)
	{
	    setMenu(2,0);
		SetSearchOption('buy');
	}
	else if(curPath.indexOf('company/')>0)
	{
	    setMenu(3,0);
		SetSearchOption('company');
	}
	else if(curPath.indexOf('service/')>0)
	{
	    setMenu(4,0);
		SetSearchOption('service');
	}
	else if(curPath.indexOf('job/')>0)
	{
	    setMenu(5,0);
		SetSearchOption('job');
	}
	else if(curPath.indexOf('manage/')>0>0)
	{
	    setMenu(6,0);
		SetSearchOption('manage');
	}
	else if(curPath.indexOf('news/')>0>0)
	{
	    setMenu(0,1);
		SetSearchOption('news');
	}
	else if(curPath.indexOf('member')>0)
	{
	    setMenu(1,1);
		SetSearchOption('sell');
	}
	else
	{
		SetSearchOption('sell');
	}

function setMenu(id,leftorright)
{
			
	for(var i=0;i<leftmenus.length;i++)
	{
	    leftmenus.item(i).className='out';
	}
	for(var i=0;i<rightmenus.length;i++)
	{
		rightmenus.item(i).className='out';
	}
	if(leftorright==0)
		leftmenus.item(id).className='on';
	else if(leftorright==1)
		rightmenus.item(id).className='on';
}
function SearchPost()
{
	var key=document.getElementById('key').value;
	if(key==null || key=="")
	{
		alert('请输入关键字！');
		histroy.back();
	}
	else
	{
		window.location.href="/search.aspx?key="+key+"&channel="+document.getElementById('channel').value;
	}
}
function SetSearchOption(optionvalue)
{
	var obj=document.getElementById('channel');
	obj.value=optionvalue;
	//alert(optionvalue);
	/*for(var i=0;i<obj.options.length;i++)
	{
		alert(obj.options[i].value);
		if(obj.options[i].value==optionvalue)
		{
			obj.selectedIndex=i;	
		}
	}*/
}

