var cssver='v=20080825';
var topdomain = document.domain.replace("www.","").replace(/test\./,"");
function $(a){return document.getElementById(a)}
var tagreg = new RegExp("</?[^>]+>","ig");

vhref = location.href;
bdtn = "s565";
if(vhref.search(/365j/)>-1)bdtn = "s565_pg";
else if(vhref.search(/go2000.cn/)>-1)bdtn = "s565";
else if(vhref.search(/go2000.com/)>-1)bdtn = "s565_pg";
else if(vhref.search(/qq5/)>-1)bdtn = "s565_pg";
else if(vhref.search(/1188/)>-1)bdtn = "s565_pg";
else if(vhref.search(/yy2000/)>-1)bdtn = "s565_pg";

function fav()
{
	window.external.addFavorite(location.href,document.title);
}


function his(n,l){
ll=sE.href.length;
if( location.href.substr(0,13) == sE.href.substr(0,13) ) return
if(n.substr(0,2)=='¸ü¶à') return
if(l.substr(0,4)!='http' ) return
n = n.replace(tagreg,'');
if(n.length>14)n=n.substr(0,14);
l = (l.replace(/</g,"&lt;")).replace(/>/g,"&gt;")
n = (n.replace(/</g,"&lt;")).replace(/>/g,"&gt;")
var hisstr=GetCookie('ckhis'),hisarr=new Array()
if( hisstr != null ) hisarr=hisstr.split('^^')
if(n=='' || l=='') return
var tmp = new Array(),row
if(typeof(hisarr) == 'object'){
if(hisarr.length > 14) delete(hisarr[0])
for(v in hisarr){row = hisarr[v].split('**');tmp[row[0]] = row[1]}
if( typeof(tmp[n]) != 'undefined' ) delete(tmp[n])
hisarr=new Array()
for(v in tmp)if( tmp[v] != 'undefined') hisarr.push(v+'**'+tmp[v])}
hisarr.push(n+'**'+l)
ck('ckhis',hisarr.join('^^'))
}
function ck(n,v){SetCookie(n,v,94608000,'/',topdomain)}

function clears()
{
SetCookie('ckhis',"",-1,'/',topdomain);
document.location.reload();
}

function showhis()
{
	var hisstr=GetCookie('ckhis'),hisarr=new Array()
	if( hisstr != null ) hisarr=hisstr.split('^^')
	var tmp = new Array(),row
	if(typeof(hisarr) == 'object')
	{
		s='<ul>'
		var len=hisarr.length;
		var j=len-1;
		var i=0;
		for(i=0;i<len;i++)
		{
			r = hisarr[j--].split('**')
			if(r[0] != 'undefined' && r[1].substr(0,4)=='http')
			s+='<li><a href='+r[1]+' target=_blank>'+r[0]+'</a></li>'
		}
		s+="</ul>";
	}
	//alert(hisstr);
	if(s.length<20)$('hisline').style.display="none";
	else
	{
	$('hisline').style.display="";
	$('hisdiv').innerHTML = s;
	}

}

document.onclick = function(e){
e = window.event || e
sE = e.srcElement || e.target
if( sE.tagName == "A" && sE.className!='ssbutton' ){
	l=sE.href.length
	if( location.href.substr(0,l-10) == sE.href.substr(0,l-3) ) return
	his(sE.innerHTML,sE.href);showhis();
}
}

/*user set*/
function set_user_skin(bgcolor,skinc,skinp,layer)
{
var qz='';
if(skinp==2)qz='big_';
if( skinc!='2' &&skinc!='1' &&skinc!='3' )skinc=1
var css = '/css/'+qz+'inside'+skinc+'.css?'+cssver;
document.write('<link href="'+css+'" type="text/css" rel="stylesheet" id="skin" />');
skincss_written = true;
}

var sk_bgcolor = GetCookie('pagebgcook');
var sk_skinc = GetCookie('skinc'),sk_skinp = GetCookie('skinp')
var sk_layer = GetCookie('layer');
set_user_skin(sk_bgcolor,sk_skinc,sk_skinp,sk_layer);

window.onload=function(){
if(sk_bgcolor && sk_bgcolor.substr(0,4)!="nobg")document.body.style.backgroundImage= "url('/img/"+sk_bgcolor+"')";
}