$_config={favlink:{host:"http://www.myshopex.com",title:"MyShopEx插件站"}};
$ES('.fav').addEvent('click', function(e){
	e.stop();
	if(document.all) window.external.addFavorite($_config['favlink']['host'],$_config['favlink']['title']);
	else if(window.sidebar) window.sidebar.addPanel($_config['favlink']['title'],$_config['favlink']['host'], "");
});
$ES('.home').addEvent('click', function(e){
	e.stop();
	try{
		this.style.behavior='url(#default#homepage)';
		this.setHomePage($_config['favlink']['host']);
	}
    catch(e){
		if(window.netscape) {
		   try {
			   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		    }  
           catch(e){
			   alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入\"about:config\"并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
			}
           var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
           prefs.setCharPref('browser.startup.homepage',$_config['favlink']['host']);
        }
    }
});
