

function addHome()
{
	if (window.sidebar) 
	{
		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","http://www.phpuu.com/?fav=1");
	}
	else if(document.all)
	{
		document.body.style.behavior="url(#default#homepage)";
		document.body.setHomePage("http://www.phpuu.com/?fav=1");
	}
	else
	{
		;
	}
}

function favSite()
{
	url  ="http://www.phpuu.com/?fav=2";
	title="PHPUU";

	if (window.sidebar) 
	{
		window.sidebar.addPanel(title,url,"");
	}
	else   if(  document.all )
	{  
		window.external.AddFavorite(url,title);
	}
	else
	{
		return   true;
	}

}


function favPage()
{
	var pageName=window.location.href;
	var nameArr =pageName.split("?");
	pageName=nameArr[0] + "?" + nameArr[1] +"&fav=2";
	if (window.sidebar) 
	{
		window.sidebar.addPanel(document.title,pageName,"");
	}
	else   if(  document.all )
	{  
		window.external.AddFavorite(pageName,document.title);
	}
	else
	{
		return   true;
	}

}

function savePage()
{
	var pageName=window.location.href;
	var nameArr =pageName.split("?");
	pageName=nameArr[0];
	var pots=pageName.lastIndexOf("/");
	pageName=pageName.substr(pots+1);

	document.execCommand("saveas",1,pageName);
}


var xmlHttp;

function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}

function startRequest(URL) {
	createXMLHttpRequest();
	xmlHttp.open("GET", URL, true);
	xmlHttp.send(null);
}


//count clicks
function openLinks(id)
{
	startRequest("/_link.php?id="+id);
}

//top left (Default Login box)
function _showLeft()
{
	document.write('快乐名言：你只要生气一分钟，便丧失了60秒钟的快乐');
}

//top right (Default User Tools,fav)
function _showRight()
{
	document.write('&nbsp;<A href="http://www.phpuu.com/about/"><STRONG>关于我们</STRONG></A><STRONG> |&nbsp;</STRONG>&nbsp;<A href="http://www.phpuu.com/webmaster/money/"><STRONG><FONT color=#ee0000>建站赚钱</FONT></STRONG></A><STRONG> | </STRONG><A href="javascript:favSite();"><STRONG>收藏本站</STRONG></A><STRONG> | </STRONG><A href="javascript:favPage();"><STRONG>收藏本页</STRONG></A>');
}


var linkString=Array();

function _showLink(name)
{
	if (linkString[name])
	{
		document.write(linkString[name]);
	}
}


linkString['A1']='<li><A HREF="http://www.phpuu.com" hidefocus=true class="link" onclick="openLinks(12)" TARGET="_blank"><img src="/upload/_link/link20081003114135_dcv.gif" width="468" height="60" border="0" alt="PHP学习乐园"></A></li>';
linkString['C2']='<li><A HREF="http://www.phpuu.com" hidefocus=true class="link" onclick="openLinks(18)" TARGET="_blank"><img src="/upload/_link/link20081003114234_ibe.gif" width="300" height="250" border="0" alt="内容页300*250GG广告"></A></li>';
linkString['T1']='<li><A HREF="http://www.phpuu.com/free/other/view_10928.html" onclick="openLinks(13)" TARGET="_blank" class="link" hidefocus=true>→火山互联免费VPS重新开放申请</A></li>';
linkString['_pic']='<li><A HREF="http://www.joyurl.com" hidefocus=true class="link" onclick="openLinks(8)" TARGET="_blank"><img src="/upload/_link/link20080831213620_uhc.gif" width="88" height="31" border="0" alt="快乐中文网"></A></li>';
linkString['_text']='<li><A HREF="http://www.joyurl.com" onclick="openLinks(7)" TARGET="_blank" class="link" hidefocus=true>快乐中文网</A></li><li><A HREF="http://www.baidu.com" onclick="openLinks(30)" TARGET="_blank" class="link" hidefocus=true>百度</A></li><li><A HREF="http://www.google.cn" onclick="openLinks(31)" TARGET="_blank" class="link" hidefocus=true>Google</A></li><li><A HREF="http://www.yahoo.cn" onclick="openLinks(32)" TARGET="_blank" class="link" hidefocus=true>Yahoo</A></li>';

