﻿// 加入收藏夹  
function addCookie(){
    if (document.all){   
        window.external.addFavorite(window.location.href, '鲁中物流行业资讯网');   
    }else if (window.sidebar){   
        window.sidebar.addPanel('鲁中物流行业资讯网', window.location.href, "");   
    }   
}
   
// 设为首页  
function setHomepage(){
    var url = location.href;
    if (document.all){   
        document.body.style.behavior = 'url(#default#homepage)';   
        document.body.setHomePage(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', url);   
    }   
}

//-----------------------转页面---------------------------------------------------
//设置session
function setCategory(page,category)
{
    if(page == "index")
	    index.setCategory(category,callBack);
	else
	    detail.setCategory(category,callBack);
}

//设置session
function setCategoryAndId(category,id)
{
	index.setCategoryAndId(category,id,callBack);
}

//转页面
function callBack(result)
{
	if(result.value == "1")
	    location='detail.aspx';
}
//-----------------------转页面-----------------------------------------------

