﻿document.writeln("<link href=\"http://www.joy.cn/css/joytop.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
document.writeln("<link href=\"http://www.joy.cn/css/joyfont.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
var DomainUrl="";var OnclikUrl="";var kan8kan="0";var kanba="";var kanba_color="red12";var XMLHttpReq;
var Stat_address="http://58.211.1.39/Report.ashx?ADName=%e4%b8%bb%e7%ab%99%e5%a4%b4%e9%83%a8%e6%94%b6%e8%97%8f&Domain=www.joy.cn&ReturnURL=http%3a%2f%2f58.211.1.39%2fspace.htm";
var url = document.location.href;
if(url.indexOf("joy.kan8kan.com")>0)
{
		url="http://sports.joy.cn";kan8kan="1";
}
else if(url.indexOf("kanba.joy.cn")>0)
{
		kan8kan="0";kanba="kb_";kanba_color="kb_white";
}
else
{
		kan8kan="0";kanba="";
}
function Add()
{       
    var stathtml="";var V_URL=window.location.hostname;var Z_URL="http://"+V_URL;window.external.AddFavorite(Z_URL,"激动网");Stathtml();
}
function Stathtml()
{
   if(kan8kan="0")
   {
       stathtml="<iframe id='Stat' src='http://58.211.1.39/Report.ashx?ADName=%e4%b8%bb%e7%ab%99%e5%a4%b4%e9%83%a8%e6%94%b6%e8%97%8f&Domain=www.joy.cn&ReturnURL=http%3a%2f%2f58.211.1.39%2fspace.htm?"+Math.random() +"' width='0' height='0' ></iframe>";
       document.getElementById("logo_r").innerHTML=stathtml;
   }
}
function head()
{
	  var flashurl = document.location.href;
    var html1="<iframe id='iframeProxy'  src='http://usercenter.joy.cn/SubDomainProxy2.html' border='0' width='0' height='0'></iframe><div id="+kanba+"joybgcolor><div id='"+kanba+"topmain'><div id='"+kanba+"top'><div id='"+kanba+"logo'><a href='http://www.joy.cn'><img src='http://www.joy.cn/images/"+kanba+"logo.jpg' width='148' height='61' alt='joy.cn' /></a></div><div id='"+kanba+"logo_r'><dl><dt><font class='gray16b' id='currentChannel'></font></dt>";
    var html2="<dd id=LoginHeadUrl>[<a href='http://usercenter.joy.cn/userInfo.do?m=UserCenter&type=login'  target='_parent' class='"+kanba+"blue12'>登录</a>][<a href='http://usercenter.joy.cn/userInfo.do?m=UserCenter&type=register' class='"+kanba+"blue12'>注册</a>] | <a href='http://space.you.joy.cn' class='"+kanba+"blue12'>我的空间</a></dd></dl></div>";
		var htmlhot="<div id='"+kanba+"top_r'><dl class='gray12'><iframe allowTransparency='true'  frameborder='0' width='460' height='40' scrolling='no' marginWidth=0 marginHeight=0 src='http://www.joy.cn/www200810/zxzr/index.shtml'> </iframe><dd><strong><a href='#'  class='"+kanba+"bt_sc "+kanba_color+"' onclick='Add()'>收藏本站</a></strong><strong><a id='Subscribe' href='#' class='"+kanba+"bt_dy "+kanba_color+"' onclick=\"window.open(OnclikUrl, '', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400px,height=260px,top=10px,left=10px')\" style=\"cursor:pointer\">订阅</a></strong><span><input type='text'  class='formgray' size='40' id='_lxkw' name='T1' /><input name='' type='button'  class='"+kanba+"searchbt' onclick='settop()' style='margin-left:5px'/></span></dd></dl></div></div></div>";
    var html3="<div class='nav' id='navcontainer'><ul class='white14b' id='navlist'><li id='newLi-0' class='black14b nav_bg_home'><a href='http://www.joy.cn' target='_parent'>首页</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-1' ><a href='http://news.joy.cn' target='_parent'>资讯</a></li><li class='top_span'>|</li>"
    +"<li id='newLi-2' ><a href='http://ent.joy.cn' target='_parent'>娱乐</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-3' ><a href='http://sports.joy.cn' target='_parent'>体育</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-4' ><a href='http://finance.joy.cn' target='_parent'>财经</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-5' ><a href='http://movie.joy.cn' target='_parent'>电影</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-6' ><a href='http://tvplay.joy.cn' target='_parent'>电视剧</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-9' ><a href='http://you.joy.cn' target='_parent'>播客</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-10' ><a href='http://joke.joy.cn' target='_parent'>赳客</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-12'><a href='http://auto.joy.cn' target='_parent'>汽车</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-11' ><a href='http://games.joy.cn' target='_parent'>游戏</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-8' ><a href='http://real.joy.cn' target='_parent'>纪实</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-7' ><a href='http://live.joy.cn' target='_parent'>直播</a></li>"
		+"<li class='top_span'>|</li><li id='newLi-13'><a href='http://shop.joy.cn' target='_parent'><img src='http://www.joy.cn/images/ico_new0907.gif' class='joy_iconew' />购物</a></li>"
		+"<li class='top_span'>|</li>"
    //+"<li id='newLi-14'><a href='http://kanba.joy.cn' target='_parent'><img src='http://www.joy.cn/images/ico_new0907.gif' class='joy_iconew' />看吧</a></li>"
  	//+"<li class='top_span'>|</li>"
    +"<li id='newLi-14'><a href='http://pay.joy.cn' target='_parent'>激动派</a></li></ul></div></div>";
		var html4="<!--Live提示--><DIV id=_lxlivelist style=\"BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; DISPLAY: none; Z-INDEX: 100; BORDER-LEFT: black 1px solid; WIDTH: 360px; BORDER-BOTTOM: black 1px solid; POSITION: absolute; BACKGROUND-COLOR: white\" onfocusout=\"this.style.display='none';\"><DIV id=_lxliveitem style=\"DISPLAY: none\"><DIV onmousedown=_LxLiveQuery(this); id=_lxliveitem[$rank$] onmouseover=_LxHighLightResult(this); style=\"WIDTH: 100%; PADDING-TOP: 3px; HEIGHT: 20px\" onmouseout=_LxunHighLightResult(this);><DIV id=_lxliveitem[$rank$]_kw style=\"PADDING-LEFT: 5px; FONT-SIZE: 14px; FLOAT: left; OVERFLOW: hidden; WIDTH: 230px; COLOR: black; WHITE-SPACE: nowrap; TEXT-ALIGN: left\">[$livekw$]</DIV><DIV id=_lxliveitem[$rank$]_count style=\"PADDING-RIGHT: 3px; FONT-SIZE: 12px; OVERFLOW: hidden; WIDTH: 110px; COLOR: green; WHITE-SPACE: nowrap; TEXT-ALIGN: right\">约[$livecount$]项结果</DIV></DIV></DIV></DIV><!--live结束-->";
		document.write(html1+ html2+htmlhot + html3+html4);
		var divStyleArray = new Array("nav","navnews","navent","navsports","navfina","navmov","navtv","navlive","navreal","navyou","navjoke","navgame","navauto","navshop","navkanba","navbbs");
		var liStyleArray = new Array("black14b nav_bg_home","black14b nav_bg_news","black14b nav_bg_ent","black14b nav_bg_sports","black14b nav_bg_fina","black14b nav_bg_mov","black14b nav_bg_tv","black14b nav_bg_live","black14b nav_bg_real","black14b nav_bg_you","black14b nav_bg_joke","black14b nav_bg_game","black14b nav_bg_auto","black14b nav_bg_shop","black14b nav_bg_kanba","black14b nav_bg_bbs");
		var domainArray = new Array("www.joy.cn","news.joy.cn","ent.joy.cn","sports.joy.cn","finance.joy.cn","movie.joy.cn","tvplay.joy.cn","live.joy.cn","real.joy.cn","you.joy.cn","joke.joy.cn","games.joy.cn","auto.joy.cn","shop.joy.cn","kanba.joy.cn","bbs.joy.cn");
		var channelArray = new Array("首页","资讯","娱乐","体育","财经","电影","电视剧","直播","纪实","播客","赳客","游戏","汽车","购物","看吧","社区");
		var ISInArray = false;
		for (var i=0; i<15; i++)
		{
			var objs = document.getElementById("newLi-"+i);
			if (url.indexOf(domainArray[i])>0)
			{
				DomainUrl=domainArray[i];
				if(domainArray[i]!="www.joy.cn")
				{
					document.getElementById("currentChannel").innerText = "-" + channelArray[i];
				}
				else
				{
					document.getElementById("currentChannel").innerText = " ";
				}
				document.getElementById("navcontainer").className = divStyleArray[i];objs.className = liStyleArray[i];ISInArray = true;
			}
			else
			{
				if(objs)
				{
				  objs.className = "";
			  }
			}
		}
    if (ISInArray == false)
		{
			var objs = document.getElementById("newLi-0");
			if(url.indexOf("mm.joy.cn")>0)
			{
					objs = document.getElementById("newLi-9");
					document.getElementById("currentChannel").innerText = "-播客";
					document.getElementById("navcontainer").className = "navmm";
				  objs.className ="black14b nav_bg_mm" ;
			}
			else
			{
			    objs.className = liStyleArray[0];
		  }
		}
		if(DomainUrl=="www.joy.cn"||DomainUrl=="live.joy.cn"||DomainUrl=="client.joy.cn"||DomainUrl=="city.joy.cn"||DomainUrl=="search.joy.cn"||DomainUrl=="kanba.joy.cn"||DomainUrl=="shop.joy.cn")
		{
				document.getElementById("Subscribe").style.display="none";
		}
		OnclikUrl="http://space.you.joy.cn/SubscribeClient.aspx?Domain="+DomainUrl;
		if(kan8kan=="0")
		{
				setTimeout('load_Login()',100);
		}
}	
try
{
	document.domain = "joy.cn"; 
}
catch (e)
{}
var time = 60;var count = 0;
function load_Login()
{
		
		var xmlUrl="http://usercenter.joy.cn/userInfo.do?m=CheckUserLoginInfo&r="+Math.random();
		try{
			var proxy = document.getElementById("iframeProxy").contentWindow;
			proxy.sendRequest2(xmlUrl);
		}
		catch(e)
		{}
		
		
}
function ResponseReturn(ResponseText)
{
	try
	{
		var LoginInfo=ResponseText;
		var LoginArray;
		var LoginHeadUrlText="";
		var SubscribeUrl="";
		if(LoginInfo.substring(0,4)=="0001")
		{
			//未登录状态
			LoginHeadUrlText="[<a href='http://usercenter.joy.cn/userInfo.do?m=UserCenter&type=login' class='"+kanba+"blue12' target='_parent'>登录</a>][<a href='http://usercenter.joy.cn/userInfo.do?m=UserCenter&type=register' class='"+kanba+"blue12' target='_parent'>注册</a>] | <a href='http://space.you.joy.cn' class='"+kanba+"blue12' target='_parent'>我的空间</a>";
			SubscribeUrl="window.open('http://space.you.joy.cn/SubscribeClient.aspx?Domain=you.joy.cn', '', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400px,height=260px,top=10px,left=10px')";
			OnclikUrl="http://space.you.joy.cn/SubscribeClient.aspx?Domain="+DomainUrl;
		}
		else
		{
			//登录状态
			LoginArray=LoginInfo.split("|");
			LoginHeadUrlText="您好<strong>&nbsp;"+LoginArray[1]+"</strong> [<a href='http://usercenter.joy.cn/userInfo.do?m=UserLogout&Returnurl="+url+"' class='"+kanba+"blue12' target='_parent'>登出</a>] | <a href='"+LoginArray[3]+"' class='"+kanba+"blue12' target='_parent'>我的空间</a>";
			SubscribeUrl="window.open('http://space.you.joy.cn/"+LoginArray[1]+"/SubscribeClient.aspx?Domain="+DomainUrl+"', '', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400px,height=260px,top=10px,left=10px')";
			OnclikUrl="http://space.you.joy.cn/SubscribeClient.aspx?Domain="+DomainUrl;
		}
		document.getElementById("LoginHeadUrl").innerHTML=LoginHeadUrlText;
	}
	catch (e){}
}
function settop()
{
	try
	{
		     var ele = '1,3,4,6,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,25,27';
         lexosearch.Criteria.Topics='1,3,4,6,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,25,27'; 
         lexosearch.Criteria.QueryString=document.getElementById('_lxkw').value; 
         if(ele.value=='0') 
         { 
             lexosearch.Criteria.Topics='1,3,4,6,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,25,27'; 
         } 
         else 
         { 
             lexosearch.Criteria.Topics='1,3,4,6,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,25,27'; 
         }
         return lexosearch.Search(true); 
	}
	catch(e){}
} 
head();
function _LxFocusIn() 
{ 
    var e = document.getElementById("_lxkw"); 
    if (e.value=='请选择你所要选择的范围并输入你所要查询内容') 
    { 
        e.value=''; 
        e.style.color='black'; 
    }  
    _LxLoadLiveTips('_lxkw'); 
} 
function _LxFocusOut() 
{ 
    _LxStopLiveTips(); 
    document.getElementById("_lxlivelist").style.display='none'; 
} 
function _LxKeyDown(evt) 
{ 
    var e = evt || window.event; 
    var c = e.charCode || e.keyCode; 
    if (c == 13) 
    {                                    
        document.getElementById("_lxkw").value = this.value; 
        joySearch(); 
         
    }  
    _LxTxtKwClick('_lxkw',c); 
} 
try
{
  if (lexosearch.Criteria.QueryString != "") 
  { 
      document.getElementById("_lxkw").value = lexosearch.Criteria.QueryString; 
      document.getElementById("_lxkw").style.color = "black"; 
  } 
  if (lexosearch.Browse != "IE") 
  {                                 
      document.getElementById("_lxkw").addEventListener("focus",_LxFocusIn,false);                                 
      document.getElementById("_lxkw").addEventListener("blur",_LxFocusOut,false); 
      document.getElementById("_lxkw").addEventListener("keydown",_LxKeyDown,false); 
  } 
  else 
  { 
      document.getElementById("_lxkw").onfocusin = _LxFocusIn; 
      document.getElementById("_lxkw").onfocusout = _LxFocusOut; 
      document.getElementById("_lxkw").onkeydown = _LxKeyDown; 
  } 
  lexosearch.Server = "search.joy.cn";
  lexosearch.Options.SubmitTo= "http://search.joy.cn/index.html";
}
catch(e){}
function joySearch()
{
    lexosearch.Criteria.QueryString = document.getElementById("_lxkw").value;
    return lexosearch.Search();
}
function NavigateToUrl(str)
{
  window.open(str);
}
