var urlhref = window.location.href;
showNav(1);
if(urlhref.indexOf('news') > -1){
	showNav(8);
}
if(urlhref.indexOf('talent') > -1){
	showNav(7);
}
if(urlhref.indexOf('training') > -1){
	showNav(6);
}
if(urlhref.indexOf('company') > -1){
	showNav(5);
}
if(urlhref.indexOf('shipprice') > -1 || urlhref.indexOf('shipPrice') > -1){
	showNav(4);
}
if(urlhref.indexOf('supply_list') > -1 || urlhref.indexOf('normalbiz') > -1){
	showNav(3);
}
if(urlhref.indexOf('srcgoods') > -1 || urlhref.indexOf('srccar') > -1 || urlhref.indexOf('bidding') > -1 || urlhref.indexOf('warehouse') > -1){
	showNav(2);
}
function showNav(val){
	$(".nav li a").removeClass('hover');
	$("#navsel_"+val+" a").addClass('hover');
}



	function changeSearcher(val){
		$(".srh_menu li a").removeClass('hover');
		$("#channel_"+val+" a").addClass('hover');
		
		if(val == 'trade'){
			document.topSearcherForm.action="/srcgoods.html";
		} else 	if(val == 'bizinfo'){
			document.topSearcherForm.action="/supply_list.html";
		} else 	if(val == 'news'){
			document.topSearcherForm.action="/news_list.html";
		} else 	if(val == 'com'){
			document.topSearcherForm.action="/company_list.html";
		} else 	if(val == 'price'){
			document.topSearcherForm.action="/shipprice.html";
		}

		$(".srh_more").hide();
		$("#keyword_"+val+" ").show();
	}
	
	function topAllSearcher() {
		document.topSearcherForm.submit();
	}
	
	//添加到收藏夹
		function AddToFavorite()
		{
		    if (document.all){
           window.external.addFavorite(document.URL,document.title);
        }else if (window.sidebar){
		       window.sidebar.addPanel(document.title, document.URL, "");
		    }
		}

		//设为首页
	function setHomepage(){
	if (document.all){
        document.body.style.behavior="url(#default#homepage)";
        document.body.setHomePage(document.URL);
      }else if (window.sidebar){
    		if(window.netscape){
	         try{ 
	            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
	         }catch (e){ 
	   					alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" ); 
	         }
    		} 
		    var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components. interfaces.nsIPrefBranch);
		    prefs.setCharPref("browser.startup.homepage",document.URL);
			}
		}
