var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);
function transPNGPic(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
    var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
    var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
    var imgTitle = (myImage.title) ? 
               "title='" + myImage.title   + "' " : "title='" + myImage.alt + "' "
    var imgStyle = "display:inline-block;" + myImage.style.cssText
    var strNewHTML = "<span " + imgID + imgClass + imgTitle
                   + " style=\"" + "cursor:hand;width:" + myImage.width 
                   + "px; height:" + myImage.height 
                   + "px;" + imgStyle + ";"
                   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                   + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
     myImage.outerHTML = strNewHTML;
    }
}


//site list
var site = {
	us:0,
	co:1,
	eo:2,
	ct:3,
	zo:4,
	wotf:5,
	tw:6
}

//btm
function publicBottom(siteType,tbWidth,target){
	var bmContext = null;
	target = (target == "_blank" || target == "_self" || target == "_top" || target == "_parent") ? target : "_blank";
	//global value
	var about91 = "<a target=\"" + target + "\" href=\"http://us.91.com/tq/about.shtml\">About 91.com</a>";
	var eu91 = "<a target=\"" + target + "\" href=\"http://eu.91.com/\">91 EU</a>";
	var useragreement="<a target=\"" + target + "\" href=\"https://account.91.com/common/read.htm\">User Agreement</a>";
	var copyright = "Copyright &copy; 2003-2008 <A href=\"http://www.netdragon.us/\">NetDragon Websoft Inc.</A> All Rights Reserved.";

    //child site value*/
    var top = "<a href=\"" + window.location.href + "#Top\" target=\"_self\">Top</a>";
	
	var uscontactus = "<a target=\"" + target + "\" href=\"http://us.91.com/about/contact.shtml\">Contact Us</a>";
	var ussignup = "<a target=\"" + target + "\" href=\"https://account.91.com/\">Sign Up</a>";
	var usproductfaq = "<a target=\"" + target + "\" href=\"http://us.91.com/tq/faq_games.shtml\">Product FAQ</a>";
	var ussitemap = "<a target=\"" + target + "\" href=\"http://us.91.com/tq/sitemap.shtml\">Site Map</a>";
		
	var cocontactus = "<a target=\"" + target + "\" href=\"http://co.91.com/systempage/contact.shtml\">Contact Us</a>";
	var cosignup = "<a target=\"" + target + "\" href=\"https://account.91.com/common/signup.aspx?flag=co&url=http://co.91.com\">Sign Up</a>";
	var coproductfaq = "<a target=\"" + target + "\" href=\"http://co.91.com/guide/faqs.shtml\">Product FAQ</a>";
	var cositemap = "<a target=\"" + target + "\" href=\"http://co.91.com/guide/sitemap.shtml\">Site Map</a>";
	
	var eocontactus = "<a target=\"" + target + "\" href=\"http://eo.91.com/contact/contact.shtml\">Contact Us</a>";
	var eosignup = "<a target=\"" + target + "\" href=\"https://account.91.com/common/signup.aspx?flag=eo&url=http://eo.91.com\">Sign Up</a>";
	var eoproductfaq = "<a target=\"" + target + "\" href=\"http://eo.91.com/guide/proficient/faq/faq.shtml\">Product FAQ</a>";
	var eositemap = "<a target=\"" + target + "\" href=\"http://eo.91.com/guide/sitemap.shtml\">Site Map</a>";
	
	var ctcontactus = "<a target=\"" + target + "\" href=\"http://ct.91.com/systempage/contact.shtml\">Contact Us</a>";
	var ctsignup = "<a target=\"" + target + "\" href=\"https://account.91.com/common/signup.aspx?flag=ct&url=http://ct.91.com\">Sign Up</a>";
	var ctproductfaq = "<a target=\"" + target + "\" href=\"http://ct.91.com/guide/faq.shtml\">Product FAQ</a>";
	var ctsitemap = "<a target=\"" + target + "\" href=\"http://ct.91.com/guide/sitemap.shtml\">Site Map</a>";

	var zocontactus = "<a target=\"" + target + "\" href=\"http://zo.91.com/info/contact.shtml\">Contact Us</a>";
	var zosignup = "<a target=\"" + target + "\" href=\"https://account.91.com/common/signup.aspx?flag=zo&url=http://zo.91.com\">Sign Up</a>";
	var zoproductfaq = "<a target=\"" + target + "\" href=\"http://zo.91.com/info/intro.shtml\">Product FAQ</a>";
	var zositemap = "<a target=\"" + target + "\" href=\"http://zo.91.com/guide/sitemap.shtml\">Site Map</a>";
	
	function getValue(txt){
		var value = "";
		var items = txt.split("<br>");
		var sitem = null;
		var part = null;
		var parttxt = null;
		for(var i = 0; i < items.length; i++){
			sitem = items[i].split(',');
			part = (i == 1) ? "|" : " ";
			parttxt = "";
			for(var k = 0; k < sitem.length; k++)
				parttxt += eval(sitem[k].valueOf()) + part;
			value += parttxt.substring(0,parttxt.length - 1) + "<br />";
		}
		return value;
	}

	document.writeln("<table cellSpacing=\"5\" cellPadding=\"0\" width=\"" + tbWidth + "\" height=\"50\" border=\"0\" class=\"public_bm_table\"><tbody><tr>");
	document.writeln("<td align=\"right\" width=\"250\" class=\"public_bm_td1\"><img src=\"https://hsimages.91.com/logo.png\" width=\"155\" height=\"33\" onload=\"transPNGPic(this);\"/><\/td>");
	document.writeln("<td align=\"center\" class=\"public_bm_td2\" id=\"public_bottom_context\"> <\/td><\/tr><\/tbody><\/table>");
	document.getElementById("public_bottom_context").innerHTML = " ";

//value combination
	bmContext = document.getElementById("public_bottom_context");
	switch(siteType){
		case site.us: bmContext = getValue("copyright<br>about91,eu91,uscontactus,ussignup,usproductfaq,useragreement,ussitemap"); break;
		case site.co: bmContext = getValue("copyright<br>about91,eu91,cocontactus,cosignup,coproductfaq,useragreement,cositemap"); break;
		case site.eo: bmContext = getValue("copyright<br>about91,eu91,eocontactus,eosignup,eoproductfaq,useragreement,eositemap"); break;
		case site.ct: bmContext = getValue("copyright<br>about91,eu91,ctcontactus,ctsignup,ctproductfaq,useragreement,ctsitemap"); break;
		default:bmContext = getValue("copyright<br>about91,eu91,zocontactus,zosignup,zoproductfaq,useragreement,zositemap"); break;
	}
	document.getElementById("public_bottom_context").innerHTML = bmContext;
           try{setPageLinksToReg();}catch(err){}
}

//Register Return
	function setPageLinksToReg(){
		var temp = window.location.search.substr(1).match(new RegExp("(^|&)campaignid=([^&]*)(&|$)"));
		var urlPara = null;
		if(temp != null){ urlPara = unescape(temp[2]); }
		if(urlPara != null && urlPara != ""){
			var links = document.getElementsByTagName("a");
			for(var i = 0; i < links.length; i++){
				temp = links[i].href;
				links[i].href = (temp.indexOf("?") > -1) ? temp + "&campaignid=" + urlPara : temp + "?campaignid=" + urlPara;
			}
		}
	}














