var bookmarkname=document.title;
var dynamichost=document.location.host;
var countimg=document.createElement('img');
var sPop = null;
var postSubmited = false;
var smdiv = new Array();
var domain="http://"+location.host;
var thisurl=window.location.href;
var userAgent = navigator.userAgent.toLowerCase();
var is_webtv = userAgent.indexOf('webtv') != -1;
var is_kon = userAgent.indexOf('konqueror') != -1;
var is_mac = userAgent.indexOf('mac') != -1;
var is_saf = userAgent.indexOf('applewebkit') != -1 || navigator.vendor == 'Apple Computer, Inc.';
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko' && !is_saf) && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ns = userAgent.indexOf('compatible') == -1 && userAgent.indexOf('mozilla') != -1 && !is_opera && !is_webtv && !is_saf;
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera && !is_saf && !is_webtv) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
var ua = navigator.userAgent.toLowerCase()
var isFF=ua.indexOf('firefox') > -1
function top_domain(){
	var domain,tmp=location.host.split('.'),i = tmp.length
	var hz = tmp[(i-1)]
	var hz2 = tmp[(i-2)]
	if( hz2=='net' || hz2=='com' || hz2=='org'  ){return tmp[(i-3)]+"."+hz2+"."+hz}
	return tmp[(i-2)]+"."+tmp[(i-1)]
}
function setHome(){
	if (document.all){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(domain);
	}
	else if (window.sidebar){
		if(window.netscape){
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}
			catch (e){
				alert( "该操作被浏览器拒绝，你可以手动修改默认首页地址");
			}
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);	
		prefs.setCharPref('browser.startup.homepage',domain);
	}
}
function setFav(uname,t){
	
	if(document.all){
		if(t=="index"){
			window.external.AddFavorite(domain,(uname?uname:document.title));
		}
		else{
			window.external.AddFavorite(thisurl,(uname?uname:document.title));
		}
	}
	else if (window.sidebar){
		if(t=="index"){
			window.sidebar.addPanel((uname?uname:document.title),domain,"");
		}
		else{
			window.sidebar.addPanel((uname?uname:document.title),thisurl,"");
		}
	}
}
function checkhomepage(){
   if (document.getElementById('logo').isHomePage('http://' + document.location.host + '/'))
   {
     return true;
   }else{
     return false;
   }
}
function lSx(src,charset){
	var script = document.createElement('script'); 
	script.setAttribute('language', 'javascript'); 
	script.setAttribute('type', 'text/javascript'); 
	if(charset){
		script.setAttribute('charset', charset); 
	}
	script.setAttribute('src', src); 
   document.getElementsByTagName("head")[0].appendChild(script);
}
function clicklogo(){
    if(checkhomepage()){
	    window.location=('http://' + document.location.host + '/');
	}else{ 
		document.getElementById('logourl').style.behavior='url(#default#homepage)';
		document.getElementById('logourl').setHomePage('http://' + document.location.host + '/'); 
	}
}
function selectTag(showContent,selfObj){
	var tag = document.getElementById("tags").getElementsByTagName("a");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.className = "focu";
	for(i=0; j=document.getElementById("baidu"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";
}

function selectTagyihe(showContent,selfObj,tabs){
	var tag = document.getElementById("tags").getElementsByTagName("a");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.className = "focu";
	var tabscut = tabs.split(',');
	for(i=0; i<tabscut.length; i++){
		document.getElementById(tabscut[i]).style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";
}

function addBookmark(title,url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
}

function SetCookie(name, value) { 
       var exp = new Date(); 
       exp.setTime (exp.getTime()+86400*365); 
       document.cookie = name + "=" + value + "; expires=" + exp.toGMTString()+"; path=/;"; 
}

function getCookieVal (offset) { 
	var endstr = document.cookie.indexOf ("; ", offset); 
	if (endstr == -1) endstr = document.cookie.length; 
    return unescape(document.cookie.substring(offset, endstr)); 
 } 
function DelCookie(name)
{
    SetCookie(name, '');
    return;
}

function GetCookie(name) {

         var arg = name + "="; 
         var alen = arg.length; 
         var clen = document.cookie.length; 
         var i = 0; 
         while (i < clen) { 
             var j = i + alen; 
             if (document.cookie.substring(i, j) == arg) return getCookieVal (j); 
             i = document.cookie.indexOf(" ", i) + 1; 
             if (i == 0) break; 
         } 
	     return null; 
 } 
function $(o){
 var o=document.getElementById(o)?document.getElementById(o):'';
 return o;
}
function history_show() {   
	try{
		var history=GetCookie("history");
		history=unescape(history);
		var content='';
		if(history!="null"&&history!="undefined"&&history!=null) {
			history_arg=history.split("$rayyu$");
			i=0;
			linknum=0;
			len= history_arg.length;
			for(i=0;i<len;i++) { 
				var wlink=history_arg[i].split("$");
				if(history_arg[i]!="null" && content.indexOf(wlink[0])==-1 && linknum<44){
					content+="<li><a href=\""+wlink[1]+"\" onclick=\"clickOut(this,"+wlink[2]+")\" target=\"_blank\">"+wlink[0]+"</a></li>";
					linknum+=1;
				}    
			}    
			document.getElementById("history").innerHTML=content; 
	
		} else {
			document.getElementById("history").innerHTML="</ul><div style='margin-top:35px;text-align=center'>您目前还没有浏览记录。</div><ul>";
		
		}
	} catch(e){}
}

function ClearHistory()
{
  if(confirm("您要清除所有的浏览记录，是否确定？")	)
  {
	DelCookie("history");
	document.getElementById("history").innerHTML="<center>目前还没有浏览记录。</center>";
  }
}

function clickOut(srcElem,uid){
    if (('A' == srcElem.tagName.toUpperCase()) && ('' != uid) && (!isNaN(uid))){
         var  wlink=srcElem.innerHTML+"$"+srcElem.href+"$"+ uid +"$rayyu$";
		 var wcookie=GetCookie("history");
		 if(wcookie!="undefined"&wcookie!=null){
			 if(wcookie.indexOf(wlink)>=0){
				 wcookie=wcookie.replace(wlink,"")
			 }
         	wlink=wlink+wcookie;
		 }
         SetCookie("history",escape(wlink)); 
         history_show();
    
        var url = "apps/clickout.asp?sid=" + uid + "&t=" + (new Date()).getTime();
        
        try 
        {
            if (!isIndex)
            {
                url = '../' + url;
            }
        }
        catch (e)
        {
            url = '../' + url;
        }
        
        lSx(url,"gb2312");
    }
}

function handleStateChange(){
  if(xmlHttp.readyState == 4){
	  //alert(xmlHttp.responseText);
  }	  
}
var showsoft=false;
function showStm(n){
	if(n==2&&$("stm"+n).getElementsByTagName("iframe")[0].src=="about:blank"){
		try{$("stm"+n).getElementsByTagName("iframe")[0].src=("apps/mysite/stock.html");}catch(e){}
	}
	else if(n==5&&$("stm"+n).getElementsByTagName("iframe")[0].src=="about:blank"){
		try{$("stm"+n).getElementsByTagName("iframe")[0].src=("apps/mysite/m3.html");}catch(e){}
	}
	else if(n==4&&$("stm"+n).getElementsByTagName("iframe")[0].src=="about:blank"){
		try{$("stm"+n).getElementsByTagName("iframe")[0].src=("apps/mysite/m4.html");}catch(e){}
	}
	else if(showsoft==false && n==1){
		$("indexsoft").innerHTML='<iframe frameborder="0" src="apps/mysite/soft.html" scrolling="no" style="height: 100%; visibility: inherit; width: 100%; z-index: 1;overflow: hidden;"></iframe>';
		showsoft=true;
	}
	for (i=0;i<6;i++){
		try{
		 document.getElementById("stgm" + i).className = "blur";
		 document.getElementById("stm" + i).style.display = "none";
		}catch(e){}
    }
	document.getElementById("stgm" + n).className = "bluron";
	document.getElementById("stm" + n).style.display = "block";
}
try{
    if (isIndex && ('' != document.referrer) && !isSameSite(document.referrer)){
        lSx("apps/clickin.asp?url=" + document.referrer,"gb2312");
    }
}
catch(e){}
function isSameSite(str){
    return (new RegExp("http://" + document.location.host)).test(str);
}
var ise_first={};
ise_first.a=0;
ise_first.b=[
	0,0,0,0,0,0,0
];
var ise_word=[
	[
		
		[
			"淘宝",
			"http://www.taobao.com/",
			"http://search8.taobao.com/browse/search_auction.htm?q={TestWord}&pid=mm_14370857_0_0&commend=all&search_type=auction&user_action=initiative&f=D9_5_1&at_topsearch=1&sort=&spercent=0",
			"/file/buy.gif"
		]
		,
		[
			"Google",
			"http://www.google.cn",
			"http://www.google.cn/search?hl=zh-CN&client=pub-1542616452329331&channel=2776933345&source=hp&q={TestWord}&aq=f&oq=",
			"/file/sp1.gif"
		],
		[
			"搜狗",
			"http://www.sogou.com/",
			"http://www.sogou.com/sogou?query={TestWord}&pid=sogou-site-f4d73ecc86598305",
			"/file/sp3.gif"
		],
		[
			"百度",
			"http://www.baidu.com/index.php?tn=uuseetvbar_pg",
			"http://www.baidu.com/s?ie=gb2312&tn=uuseetvbar_pg&wd={TestWord}&o=",
			"/file/sp0.gif"
		]
	],
	[
		[
			"百度",
			"http://mp3.baidu.com",
			"http://mp3.baidu.com/m?f=nidx&tn=baidump3&ct=134217728&lf=&rn=&word={TestWord}&tn=uuseetvbar_pg",
			"/file/sp7.gif"
		],
		[
			"迅雷",
			"http://mp3.gougou.com/",
			"http://mp3.gougou.com/search?search={TestWord}&id=50984",
			"/file/sp2.gif"
		],
		[
			"Google",
			"http://www.google.cn/music/homepage",
			"http://www.google.cn/music/search?q={TestWord}&client=pub-1542616452329331&channel=2776933345&&aq=f",
			"/file/sp1.gif"
		],
		[
			"搜狗",
			"http://mp3.sogou.com/index.shtml",
			"http://mp3.sogou.com/music.so?pf=&as=&st=&ac=1&w=02009900&query={TestWord}&class=1&%2Fmusic.so=null",
			"/file/sp3.gif"
		]
	],
	[
		[
			"迅雷",
			"http://movie.gougou.com/",
			"http://movie.gougou.com/search?search={TestWord}&id=50984",
			"/file/sp2.gif"
		]
	],
	[
		[
			"百度",
			"http://video.baidu.com/",
			"http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=0&fbl=1024&word={TestWord}&tn=uuseetvbar_pg",
			"/file/sp0.gif"
		],
		[
			"Google",
			"http://video.google.cn/",
			"http://video.google.cn/videosearch?q={TestWord}&client=pub-1542616452329331&channel=2776933345&emb=0&aq=f",
			"/file/sp1.gif"
		],
		[
			"迅雷",
			"http://www.sogou.com/",
			"http://video.gougou.com/search?s={TestWord}&id=50984",
			"/file/sp2.gif"
		]
	],
	[
		[
			"百度",
			"http://image.baidu.com/",
			"http://image.baidu.com/i?ct=201326592&cl=2&lm=-1&tn=baiduimage&pv=&word={TestWord}&tn=uuseetvbar_pg",
			"/file/sp9.gif"
		],
		[
			"Google",
			"http://images.google.cn/",
"http://images.google.cn/images?hl=zh-CN&source=hp&q={TestWord}&client=pub-1542616452329331&channel=2776933345&gbv=2&aq=f&oq=",
			"/file/sp1.gif"
		]
	],
	[
		[
			"贴吧",
			"http://tieba.baidu.com/",
			"http://tieba.baidu.com/f?ct=&tn=&rn=&pn=&lm=&cm=0&kw={TestWord}&rs2=0&sc=&un=&rs1=&rs5=&sn=&rs6=&myselectvalue=0&word={TestWord}&tn=uuseetvbar_pg",
			"/file/sp10.gif"
		]
	],
	[
		[
			"知道",
			"http://zhidao.baidu.com/",
			"http://zhidao.baidu.com/q?word={TestWord}&ct=17&pn=0&tn=ikaslist&rn=10&lm=0&fr=search&tn=uuseetvbar_pg",
			"/file/sp8.gif"
		],
		[
			"地图",
			"http://ditu.google.cn/",
			"http://ditu.google.cn/?q={TestWord}&client=pub-1542616452329331&channel=2776933345&",
			"/file/sp1.gif"
		],
		[
			"购物",
			"http://gouwu.google.cn/",
			"http://www.google.cn/products?q={TestWord}&client=pub-1542616452329331&channel=2776933345&&ie=gb2312&oe=gb2312",
			"/file/sp1.gif"
		]
	]
];
var set_so=function(v){
	if(ise_word.length<v||ise_first.a==v){
		return;
	}
	var u=ise_word[v];
	$("ise_sps").innerHTML="";
	for(var a=0;a<u.length;a++){
		$("ise_sps").innerHTML+="<li><input type=\"radio\" onclick=\"set_so2("+a+")\" "+((ise_first.b[v]==a)?"checked=\"checked\"":"")+" name=\"sp\" id=\"ise_sp"+a+"\"><label for=\"sp"+a+"\">"+u[a][0]+"<\/label></li>";
	}	
	$("ise_so"+ise_first.a).className="t-l-tab";
	$("ise_so"+v).className="t-l-tab_cur";
	ise_first.a=v;
	try{
		var index=isIndex;
	}catch(e){var index=false}
	$("ise_sp-img").getElementsByTagName("img")[0].src=(index==true)?(u[(ise_first.b[v])][3]):("../"+(u[(ise_first.b[v])][3]));
	$("ise_sp-img").href=(u[(ise_first.b[v])][1]);
}
var set_so2=function(v){
	var u=ise_word[ise_first.a];
	if(ise_first.b[ise_first.a]==v){
		return;
	}
	try{
		var index=isIndex;
	}catch(e){var index=false}
	$("ise_sp-img").getElementsByTagName("img")[0].src=(index==true)?(u[v][3]):("../"+(u[v][3]));
	$("ise_sp-img").href=(u[v][1]);
	ise_first.b[ise_first.a]=v;
}
var searchx=function(){
	var u=ise_word[ise_first.a];
	var x=(u[ise_first.b[ise_first.a]][2].replace("{TestWord}",$("ise_keyword").value));
	var y=x.split("?");
	$("sform").action=y[0];
	var z=y[1].split("&");
	$("pform").innerHTML="";
	for(var w in z){
		var v=z[w].split("=");
		$("pform").innerHTML+='<input type="hidden" value="'+v[1]+'" name="'+v[0]+'" />';
	}
	clearData();
	return;
}
/*=======*/
function findtags(parentobj, tag){
	if(!isUndefined(parentobj.getElementsByTagName)){
		return parentobj.getElementsByTagName(tag);
	}
	else if(parentobj.all && parentobj.all.tags){
		return parentobj.all.tags(tag);
	}
	else{
		return null;
	}
}
function gb2utf(gbStr){
    var codeStr = getCodeStr();
    var codeRE = new RegExp("(%..%..)","gi");
    var replaceRE = new RegExp("(%..%..)","i");
    var gbCode;
    var utfCode;
    var gbStart;
    while((codeRE.lastIndex < gbStr.length) && replaceRE.test(gbStr)){
        codeRE.exec(gbStr);
        gbCode = new String(RegExp.$1);
        gbStart = new Number(codeStr.indexOf(gbCode.toLowerCase()));
        var utfStart = 0;
        if(gbStart != -1){
            utfStart= gbStart + 7;
            utfCode = codeStr.substring(utfStart,utfStart + 6);
        }else{
            utfCode = "%u3000";
        }
        gbStr = gbStr.replace(replaceRE,utfCode);
    }
    return gbStr;
}
function isUndefined(variable) {
	return typeof variable == 'undefined' ? true : false;
}
function in_array(needle, haystack){
	if(typeof needle == 'string') {
		for(var i in haystack) {
			if(haystack[i] == needle) {
				return true;
			}
		}
	}
	return false;
}
function getPos(el){
	var r = {'x':el.offsetLeft,'y':el.offsetTop};
	if(el.offsetParent){
		var tmp = getPos(el.offsetParent);
		r.x += tmp.x;r.y += tmp.y;
	}
	return r
}
function regE(n,e,f){if(window.attachEvent)	n.attachEvent(e,f);	else n.addEventListener(e.replace(/^on/,''),f,false)}
function os(obj){
	return $(obj).style
}
/*关闭按钮*/
function getClose(){var p=getPos($('setimg'));$("closetop").style.top=(p.y-37)+"px";$("closetop").style.left=(p.x+47)+"px";}
function topClose(){
	SetCookie('bgpic','k');
	skinF.get();
	document.body.style.backgroundImage= "none";
	document.body.style.backgroundRepeat="no-repeat";
	pagepos();
}
function showAd(V){
	var pid="mm_14370857_0_0";
	for(var i=0;i<3;i++){
		if(V!=("leftAd_"+i)){
			document.getElementById("leftAd_"+i).className="";
			document.getElementById("leftAd_"+i+"n").className="leftAd dpn";
		}
		else{
			document.getElementById(V).className="this";
			document.getElementById(V+"n").className="leftAd";
		}
		var X=document.getElementById("leftAd_"+i+"n").getElementsByTagName("iframe")[0];
		if(i==1&&X.src=="about:blank"){
			X.src='http://chongzhi.huoban.taobao.com/game_card.php?css=&pid='+pid;
		}
		else if(i==2&&X.src=="about:blank"){
			X.src='http://chongzhi.huoban.taobao.com/mobile_card.php?css=&pid='+pid;
		}
	}
}
var noSuggest=false;
function myhint(event,obj){
	var keyword=obj;
	var h=document.getElementById("ise_kwh");
	if(!keyword.value||!keyword.value.length||event.keyCode==27||event.keyCode==13){
		h.style.display="none";
		if(event.keyCode==13&&keyword.value!=""){
			searchx();
		}
		return;
	}
	if(event.keyCode==38||event.keyCode==40){
		if(h.style.display=="none"){
			return
		}
		if(event.keyCode==38){
			if(search_i==-1){
				search_i=h.firstChild.rows.length-1
			}
			else{
				search_i--
			}
		}
		else{
			search_i++
		}
		for(var i=0;i<h.firstChild.rows.length;i++){
			h.firstChild.rows[i].className="";
		}
		if(search_i>=0&&search_i<h.firstChild.rows.length){
			with(h.firstChild.rows[search_i]){
				className="on";
				keyword.value=cells[0].attributes._h.value;
			}
		}
		else{
			keyword.value=h._kw;
			search_i=-1
		}
	}
	else{
		search_i=-1;
		h._kw=keyword.value;
		lSx("http://www.google.cn/complete/search?hl=zh-CN&client=suggest&js=true&q="+encodeURIComponent(keyword.value),"utf-8");
	}
}


var search_i=-1;
window.google={};
window.google.ac={};
var suggest=document.getElementById("ise_kwh");
window.google.ac.h=function(a){
	var e=a[1];
	if(!e||e.length<3){
		return
	}
	if(noSuggest==true){
		return
	}
	var d="";
	for(var b=0;b<e.length;b++){
		d+='<tr style="cursor:hand"><td onmouseover="javascript:this.className=\'on\';try{$(\'ise_kwh\').firstChild.rows[search_i].className=\'\';}catch(e){}search_i='+b+';" onmouseout="javascript:this.className=\'\';" _h="'+e[b][0]+'"><em  style="color:#090" align="right" style="font-size:11.5px;">\u7ea6 '+e[b][1]+"</em>";d+='<a href="javascript:void(0);" target="_self" onclick="$(\'ise_keyword\').value=this.innerHTML;searchx();clearData()" rel = "sugitem">'+e[b][0]+"</a></td></tr>"
	}
	document.getElementById("ise_kwh").innerHTML='<table width="100%" border="0" cellpadding="0" cellspacing="0">'+d+'</table><div class="close"><a href="javascript:void(0);" target="_self" onclick="document.getElementById(\'ise_kwh\').style.display=\'none\';noSuggest=true;">\u5173\u95ed</a></div>';
	document.getElementById("ise_kwh").style.display="block";
};
function clearData(){
	document.getElementById("ise_kwh").style.display="none";
}
function __firefox()
{ 
HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style); 
window.constructor.prototype.__defineGetter__("event", __window_event); 
Event.prototype.__defineGetter__("srcElement", __event_srcElement); 
} 
function __element_style(){return this.style;} 
function __window_event(){return __window_event_constructor();} 
function __event_srcElement(){return this.target;} 
function __window_event_constructor(){if(document.all){return window.event;} 
var _caller = __window_event_constructor.caller; 
while(_caller!=null)
{
var _argument = _caller.arguments[0]; 
if(_argument)
{ 
var _temp = _argument.constructor; 
if(_temp.toString().indexOf("Event")!=-1){return _argument;} 
} 
_caller = _caller.caller; 
} 
return null; 
} 
if(window.addEventListener){__firefox();}