var IsLight=false;function ChangeColor(j,k,i){var g=document.getElementById(j).getElementsByTagName(k);function l(){for(h=1;h<g.length+1;h++){g[h-1].className=""}}for(var h=0;h<g.length;h++){g[h].onmouseover=function(){l();this.className=i};g[h].onmouseout=function(){this.className=""}}}function Change_Color(i,h){var f=document.getElementsByTagName(i);function j(){for(g=1;g<f.length+1;g++){f[g-1].className=""}}for(var g=0;g<f.length;g++){f[g].onmouseover=function(){this.tmpClass=this.className;this.className=h};f[g].onmouseout=function(){this.className=this.tmpClass}}}function NavigateToUrl(b){window.open(b)}function spread(){if(document.getElementById("PartBrief").style.display=="block"){document.getElementById("PartBrief").style.display="none";document.getElementById("FullBrief").style.display="block"}else{document.getElementById("PartBrief").style.display="block";document.getElementById("FullBrief").style.display="none"}}var xpos,ypos,locationobj;function showBtn(g,f){var h=document.documentElement.scrollLeft;var e=document.documentElement.scrollTop;getAbsPoint(g);locationobj=f;document.getElementById("btn").style.display="block";document.getElementById("btn").style.left=xpos+h+50+"px";document.getElementById("btn").style.top=ypos+e+30+"px"}function showBtn1(g,f){var h=document.documentElement.scrollLeft;var e=document.documentElement.scrollTop;getAbsPoint(g);locationobj=f;document.getElementById("btn").style.display="block";document.getElementById("btn").style.left=xpos+h+25+"px";document.getElementById("btn").style.top=ypos+e+15+"px"}function hiddnBtn(){document.getElementById("btn").style.display="none"}function openPage(){window.open(locationobj)}function showContinue(b){b.style.display="block"}function getAbsPoint(d){var c=d.getBoundingClientRect();xpos=c.left;ypos=c.top}function AddFavoriteNew(d,e){try{window.external.addFavorite(d,e)}catch(f){try{window.sidebar.addPanel(e,d,"")}catch(f){alert("\u52a0\u5165\u6536\u85cf\u5931\u8d25\uff0c\u6709\u52b3\u60a8\u901a\u8fc7\u6d4f\u89c8\u5668\u201c\u6536\u85cf\u5939\u201d\u624b\u52a8\u6dfb\u52a0\u6216\u4f7f\u7528Ctrl+D\u8fdb\u884c\u6dfb\u52a0\u3002")}}}function ShowLetterClass(d){var f=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");for(var e=0;e<f.length;e++){if(f[e]==d){$("#letter"+f[e]).addClass("cur")}else{$("#letter"+f[e]).removeClass("cur")}}}function JumpPayVideo(){if(Now_Pay!=""){if(Now_Pay.toString().indexOf("|")!=-1){var f=Now_Pay.toString().split("|");var d=f[0];var e=f[1];if(e==51){window.location.href="http://pay.joy.cn/hdfilm/video/"+d+"_"+Now_Vid+".htm"}else{window.location.href="http://pay.joy.cn/hdtv/video/"+d+"_"+Now_Vid+".htm"}}}}function UpdateCookieTime(B){var C=$.cookie("Joy_Cur_Played");var s=new Date().getTime();if(C==null){var y=Now_Pid+","+Now_Vid+","+B+","+Now_PName+","+s+","+isH+"|";$.cookie("Joy_Cur_Played",y,{expires:30,path:"/"})}else{var i=C;i=i.substring(0,i.length-1);var z=i.split("|");var x="";if(z.length==6){var t=new Array(6);for(var v=0;v<6;v++){var A=z[v].split(",");if(A[0]==Now_Pid){t[0]=Now_Pid+","+Now_Vid+","+B+","+Now_PName+","+s+","+isH;for(var w=1;w<=v;w++){t[w]=z[w-1]}if(v!=6){for(var a=w;a<6;a++){t[a]=z[a]}}for(var k=0;k<t.length;k++){x=x+t[k]+"|"}$.cookie("Joy_Cur_Played",x,{expires:30,path:"/"});SetHtmlByCookie();return}}t[0]=Now_Pid+","+Now_Vid+","+B+","+Now_PName+","+s+","+isH;for(var D=1;D<6;D++){t[D]=z[D-1]}for(var b=0;b<t.length;b++){x+=t[b]+"|"}$.cookie("Joy_Cur_Played",x,{expires:30,path:"/"})}else{var t=new Array();for(var v=0;v<z.length;v++){var A=z[v].split(",");if(A[0]==Now_Pid){t[0]=Now_Pid+","+Now_Vid+","+B+","+Now_PName+","+s+","+isH;if(z.length>1){for(var w=1;w<=v;w++){t[w]=z[w-1]}if(w!=z.length){for(var a=w;a<z.length;a++){t[a]=z[a]}}}for(var k=0;k<t.length;k++){x+=t[k]+"|"}$.cookie("Joy_Cur_Played",x,{expires:30,path:"/"});SetHtmlByCookie();return}}t[0]=Now_Pid+","+Now_Vid+","+B+","+Now_PName+","+s+","+isH;if(z.length>1){for(var D=1;D<=z.length;D++){t[D]=z[D-1]}}else{t[1]=z[0]}for(var b=0;b<t.length;b++){x+=t[b]+"|"}$.cookie("Joy_Cur_Played",x,{expires:30,path:"/"})}}SetHtmlByCookie()}function SetHtmlByCookie(){var B=$.cookie("Joy_Cur_Played");var i="";var s="";var x="";var t=new Date().getTime();var u;var w;if(B==null){$("#cookieHi").html("")}else{var r=B;r=r.substring(0,r.length-1);var z=r.split("|");if(z.length>4){for(var v=0;v<4;v++){var A=z[v].split(",");u=t-A[4];w=u/1000;w=GetTime(w);if(v==0){i+="<p>"+w+"\u524d\u770b\u5230&nbsp;&nbsp;<strong>"+unescape(A[3])+"-"+unescape("%u7B2C")+""+A[1]+""+unescape("%u96C6")+"</strong><span>"+formatplaylength(A[2])+'</span><a href="'+BuildHref(A[0],A[1],A[2],A[5])+'"><img src="http://css.megajoy.com/vod/db/images/btn091126.jpg" alt="" /></a></p>'}else{s+="<li><span>"+w+'\u524d\u770b\u8fc7</span><a href="'+BuildHref(A[0],A[1],A[2],A[5])+'" title="\u70b9\u51fb\u7ee7\u7eed\u89c2\u770b">'+unescape(A[3])+"</a></li>"}}x=i+"<ul>"+s+'</ul><strong class="go"><a href="javascript:RemoveCookie();">\u6e05\u7a7a\u89c2\u770b\u5386\u53f2>></a></strong>'}else{for(var v=0;v<z.length;v++){var A=z[v].split(",");u=t-A[4];w=u/1000;w=GetTime(w);if(v==0){i+="<p>"+w+"\u524d\u770b\u5230&nbsp;&nbsp;<strong>"+unescape(A[3])+"-"+unescape("%u7B2C")+""+A[1]+""+unescape("%u96C6")+"</strong><span>"+formatplaylength(A[2])+'</span><a href="'+BuildHref(A[0],A[1],A[2],A[5])+'"><img src="http://css.megajoy.com/vod/db/images/btn091126.jpg" alt="" /></a></p>'}else{s+="<li><span>"+w+'\u524d\u770b\u8fc7</span><a href="'+BuildHref(A[0],A[1],A[2],A[5])+'" title="\u70b9\u51fb\u7ee7\u7eed\u89c2\u770b">'+unescape(A[3])+"</a></li>"}}x=i+"<ul>"+s+'</ul><strong class="go"><a href="javascript:RemoveCookie();">\u6e05\u7a7a\u89c2\u770b\u5386\u53f2>></a></strong>'}$("#cookieHi").html(x);for(var y=0;y<z.length;y++){var A=z[y].split(",");if(A[0]==Now_Pid){for(var k=1;k<=A[1];k++){if(k!=Now_Vid){var q='<span><a href="javascript:viewNewsVideo('+k+');">\u7b2c'+k+"\u96c6</a></span>";$("#"+k).html(q)}}return}}}}function SetDefaultHtml(){var v=$.cookie("Joy_Cur_Played");var k="";var n="";var r="";var o=new Date().getTime();var p;var q;if(v==null){$("#cookieHi").html("")}else{var m=v;m=m.substring(0,m.length-1);var t=m.split("|");for(var s=0;s<t.length;s++){var u=t[s].split(",");if(u[0]==Now_Pid){UpdateCookieTime(u[2]);return}}}}function RemoveCookieTime(){}function BuildHref(i,f,h,j){if(h.toString().indexOf(".")!=-1){var g=h.toString().split(".");h=g[0]}return"http://db.joy.cn/tvplay/"+i+"/"+f+"_"+h+"/"+j+".htm"}function RemoveCookie(){$.cookie("Joy_Cur_Played","",{expires:-1,path:"/"});SetHtmlByCookie()}function formatplaylength(h){if(h.toString().indexOf(".")!=-1){var f=h.toString().split(".");h=f[0]}var g=parseInt(h/60);var e=h-g*60;return((g.toString().length<2)?"0"+g:g)+":"+((e.toString().length<2)?"0"+e:e)}function GetTime(f){var d;if(f>3600){if(f>86400){f=f/86400;d="\u5929"}else{f=f/3600;d="\u5c0f\u65f6"}}else{f=f/60;d="\u5206\u949f"}if(f.toString().indexOf(".")!=-1){var e=f.toString().split(".");f=e[0];if(f==0){f=1}f=f+d;return f}else{if(f==0){f=1}f=f+d;return f}}function settop(){try{window.location="http://search.joy.cn/index.html?_lxkw="+escape(document.getElementById("_lxkw").value)+"&_lxpg=1&_lxps=12&_lxsort=&_lxsa=1&_lxdate1=&_lxdate2=&_lxlayout=disp1&_lxmp=7&_lxtpc=1,3,4,6,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,25,27&_lxkwt=&_lxdup=3&_lxtpcc=1,3,4,6,11,12,14,15,20,21,23,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42"}catch(b){}}jQuery.cookie=function(w,p,i){if(typeof p!="undefined"){i=i||{};if(p===null){p="";i=$.extend({},i);i.expires=-1}var t="";if(i.expires&&(typeof i.expires=="number"||i.expires.toUTCString)){var s;if(typeof i.expires=="number"){s=new Date();s.setTime(s.getTime()+(i.expires*24*60*60*1000))}else{s=i.expires}t="; expires="+s.toUTCString()}var n=i.path?"; path="+(i.path):"";var r=i.domain?"; domain="+(i.domain):"";var x=i.secure?"; secure":"";document.cookie=[w,"=",encodeURIComponent(p),t,n,r,x].join("")}else{var u=null;if(document.cookie&&document.cookie!=""){var o=document.cookie.split(";");for(var q=0;q<o.length;q++){var v=jQuery.trim(o[q]);if(v.substring(0,w.length+1)==(w+"=")){u=decodeURIComponent(v.substring(w.length+1));break}}}return u}};function autoclick(){lnk=document.getElementById("light");lnk.click()}(function(b){b.fn.lightBox=function(l){l=jQuery.extend({overlayBgColor:"#000",overlayOpacity:0.8,fixedNavigation:false,imageBtnClose:"images/lightbox-btn-close.gif",containerBorderSize:10,containerResizeSpeed:400},l);var n=this;function j(){m(this,n);return false}function m(c,d){k()}function k(){if(IsLight==false){b("body").append('<div id="jquery-overlay"></div>');var c=a();b("#jquery-overlay").css({backgroundColor:l.overlayBgColor,opacity:l.overlayOpacity,width:c[0],height:c[1]}).fadeIn();IsLight=true}else{i()}}function i(){IsLight=false;b("#jquery-overlay").fadeOut(function(){b("#jquery-overlay").remove()})}function a(){var d,f;if(window.innerHeight&&window.scrollMaxY){d=window.innerWidth+window.scrollMaxX;f=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){d=document.body.scrollWidth;f=document.body.scrollHeight}else{d=document.body.offsetWidth;f=document.body.offsetHeight}}var e,c;if(self.innerHeight){if(document.documentElement.clientWidth){e=document.documentElement.clientWidth}else{e=self.innerWidth}c=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){e=document.documentElement.clientWidth;c=document.documentElement.clientHeight}else{if(document.body){e=document.body.clientWidth;c=document.body.clientHeight}}}if(f<c){pageHeight=c}else{pageHeight=f}if(d<e){pageWidth=d}else{pageWidth=e}arrayPageSize=new Array(pageWidth,pageHeight,e,c);return arrayPageSize}return this.unbind("click").click(j)}})(jQuery);