function addCookie(pageURL,pageNAME){
	try{
		window.external.addFavorite(pageURL,pageNAME);
	}catch(e){
		try{
			window.sidebar.addPanel(pageNAME, pageURL, "");
		}catch(e){
			alert('对不起，您使用的浏览器拒绝此操作。请使用Ctrl+D进行添加！');
		}
	}
}
function SetHome(obj,vrl){
	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请在浏览器地址栏输入'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',vrl);
		}
	}
}

jQuery(function($){
	$(".new_game_box ul a.server").mouseover(function(){
		$(this).not($(".new_game_box ul a.over").removeClass("over"));
		$(this).addClass("over");
		
		var popgames = $(".PopGames")[$(this).index(".new_game_box ul a.server")];
		popgames.style.display = "block";
		popgames.style.top = $(this).position().top - 29 + "px";
		popgames.style.left = $(this).position().left + 165 + "px";
	});
	
	$(".new_game_box ul a.server").mouseout(function(){
		$(this).removeClass("over");
		$(".PopGames").each(function(i){$(this).hide();});
	});
	
	$(".PopGames").mouseover(function(){
		$(this).show();
		$(".new_game_box ul a.server")[$(this).index(".PopGames")].className = "server over";
	});
	
	$(".PopGames").mouseout(function(){
		$(this).hide();
		$(".new_game_box ul a.server")[$(this).index(".PopGames")].className = "server";
	});
	
	$(".news_box .menu li a").mouseover(function(i){
		$(this).not($(".news_box .menu li a.over").removeClass("over"));
		$(this).addClass("over");
		
		$(".news_list").hide();
		$(".news_list")[$(this).index(".news_box .menu li a")].style.display = "block";
	});
});
