// JavaScript Document
function Favorite(){
	var url=window.location.href;
	var title=document.title;
	try{
		window.external.addFavorite(url, title);
	}
	catch(e){
		try{
			window.sidebar.addPanel(title,url,"");
		}
		catch(e){
			alert("您的浏览器拒绝了此操作,请手动操作加入收藏");
		}
	}
}

function HomePage(obj){
	var vrl=window.location;
	try{
		obj.style.behavior='url(#default#homepage)';
		obj.setHomePage(vrl);
	}
	catch(e){
		if(window.netscape){
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
			}  
			catch (e){ 
				alert("抱歉！您的浏览器不支持直接设为首页。\n\n请在浏览器地址栏输入“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',vrl);
		}
	}
}
