if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(f,d,m,g,j,l,n,i,a,e){if(!document.getElementById){return}this.DETECT_KEY=e?e:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(f){this.setAttribute("swf",f)}if(d){this.setAttribute("id",d)}if(m){this.setAttribute("width",m)}if(g){this.setAttribute("height",g)}if(j){this.setAttribute("version",new deconcept.PlayerVersion(j.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(l){this.addParam("bgcolor",l)}var b=n?n:"high";this.addParam("quality",b);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var k=(i)?i:window.location;this.setAttribute("xiRedirectUrl",k);this.setAttribute("redirectUrl","");if(a){this.setAttribute("redirectUrl",a)}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(a,b){this.params[a]=b},getParams:function(){return this.params},addVariable:function(a,b){this.variables[a]=b},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var a=new Array();var b;var c=this.getVariables();for(b in c){a[a.length]=b+"="+c[b]}return a},getSWFHTML:function(){var d="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}d='<embed pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';d+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var c=this.getParams();for(var a in c){d+=[a]+'="'+c[a]+'" '}var b=this.getVariablePairs().join("&");if(b.length>0){d+="flashvars="+b+'&realfull=1&moz=1"'}d+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}d='<object id="'+this.getAttribute("id")+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';d+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var a in c){d+='<param name="'+a+'" value="'+c[a]+'" />'}var b=this.getVariablePairs().join("&");if(b.length>0){d+='<param name="flashvars" value="'+b+'" />'}d+="</object>"}return d},write:function(a){if(this.getAttribute("useExpressInstall")){var b=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(b)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}var c=(typeof a=="string")?document.getElementById(a):a;c.innerHTML=this.getSWFHTML();return true}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var c=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){c=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var d=1;var b=3;while(d){try{b++;d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b);c=new deconcept.PlayerVersion([b,0,0])}catch(f){d=null}}}else{try{var d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(f){try{var d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");c=new deconcept.PlayerVersion([6,0,21]);d.AllowScriptAccess="always"}catch(f){if(c.major==6){return c}}try{d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(f){}}if(d!=null){c=new deconcept.PlayerVersion(d.GetVariable("$version").split(" ")[1].split(","))}}}return c};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};deconcept.util={getRequestParameter:function(d){var c=document.location.search||document.location.hash;if(d==null){return c}if(c){var b=c.substring(1).split("&");for(var a=0;a<b.length;a++){if(b[a].substring(0,b[a].indexOf("="))==d){return b[a].substring((b[a].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var c=document.getElementsByTagName("OBJECT");for(var b=c.length-1;b>=0;b--){c[b].style.display="none";for(var a in c[b]){if(typeof c[b][a]=="function"){c[b][a]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var theTimer;var m_NowVideoID=0;var m_AlbumTitle="";var m_pageindexplay=1;var m_pageindex=1;var m_rslength=0;var m_rslengthplay=0;var m_pagecount;var m_pagesize=8;var m_pagenumber=5;var video_count=0;var m_vid;var m_aid;var m_cid=51;var m_rscount=0;var rs;var m_showid=-1;var m_extid=0;var imglist;function functiongetParms(c,a,b){m_aid=c;m_pageindex=a;m_pageindexplay=a;m_showid=b}function showPlayer(g,c,b,j,i,f,d,a,h){m_aid=g;m_showid=c;m_vid=b;m_pageindex=j;m_pageindexplay=j;video_count=i;var e=new SWFObject("http://client.joy.cn/flvplayer/BagPlayer_V3.swf","myplayer","965","460","9","#000000");e.addParam("allowFullScreen","true");e.addParam("allowScriptAccess","always");e.addParam("quality","high");if(i>1){e.addVariable("playermode","2")}else{e.addVariable("playermode","1")}if(f!=""){e.addVariable("pid",f)}if(d!=""){e.addVariable("tid",d)}if(h!=""){e.addVariable("starttime",h)}if(a!=""){e.addVariable("action",a)}e.addVariable("programid",m_aid);e.addVariable("type","vod");e.addVariable("jname","setPlayerFront");e.addVariable("listmode","0");e.addVariable("channelid",m_cid);e.addParam("wmode","Transparent");e.addVariable("iswide",1);e.write("dplayer")}var __sto=setTimeout;setTimeout2=function(e,c,d){var a=Array.prototype.slice.call(arguments,2);var b=function(){e.apply(null,a)};__sto(b,c)};function showTitle(){if(m_showid>0){$("#video_t").html("正在播放："+rs[m_showid].title)}}function holdPlayer(){$("#dplayer").css({top:$(".flash").offset().top-35,left:$(".flash").offset().left,display:""})}function GetVideoIdToJs(c,b){if(m_showid<0){if(typeof(iVideoID)=="undefined"||iVideoID==0){if(m_rslength>1){m_showid=1}}else{for(var a=1;a<m_rslength;a++){if(rs[a].id==iVideoID){m_showid=a;break}}}}else{if(c=="next"){if(m_pageindexplay==m_pageindex){setPlayStyle(m_showid,0);m_showid++}else{m_pageindex=m_pageindexplay;var d=m_showid;if(m_showid>=m_rslengthplay-1){m_pageindex++;if(m_pageindex>m_pagecount){m_pageindex=1}m_pageindexplay=m_pageindex;d=0}m_showid=0;ajaxLoadNextVideo(3,d)}if(m_showid>=m_rslength){m_pageindex++;if(m_pageindex>m_pagecount){m_pageindex=1}m_showid=0;ajaxLoadNextVideo(2)}}else{if(c=="now"){}else{if(m_pageindexplay==m_pageindex){if(m_pageindexplay==1){if(m_showid==1){m_showid==1;setPlayStyle(m_showid,0)}else{setPlayStyle(m_showid,0);m_showid--}}else{if(m_showid==1){m_pageindex--;if(m_pageindex<1){m_pageindex=1}m_showid=8;ajaxLoadNextVideo(5)}else{setPlayStyle(m_showid,0);m_showid--}}}else{m_pageindex=m_pageindexplay;var d=m_showid;if(m_pageindex==1){if(m_showid==1){m_showid=1;m_pageindex=1;ajaxLoadNextVideo(2)}else{m_showid--;ajaxLoadNextVideo(6)}}else{if(m_showid==1){m_pageindex--;ajaxLoadNextVideo(5)}else{m_showid--;ajaxLoadNextVideo(6)}}}}}}if(m_showid>0&&typeof(b)=="undefined"){setPlayStyle(m_showid,1);expandvideo(m_showid,1);showTitle();m_NowVideoID=rs[m_showid].id;m_pageindexplay=m_pageindex;m_rslengthplay=m_rslength}else{if(m_showid>0&&b==1){m_NowVideoID=m_vid}else{m_NowVideoID=0}}return m_NowVideoID}function setPlayStyle(c,a){if(c>0){var b=$("#newsVideo-"+c)[0];if(typeof(b)!="undefined"){if(a==1){b.className="cur"}else{b.className="cur_none"}}}}function viewNewVideo(b){var a;a=(m_pageindex-1)*8+b;location="/movie/detail/"+m_aid+"/"+a+".htm"}function viewNextVideo(a){if(a>0){setPlayStyle(m_showid,0);m_showid=a;setPlayStyle(m_showid,1);expandvideo(m_showid,1);showTitle();m_NowVideoID=rs[m_showid].id;m_pageindexplay=m_pageindex;m_rslengthplay=m_rslength;$("#myplayer")[0].GetVideoIdFromJs(m_NowVideoID)}}function viewProVideo(){setPlayStyle(8,0);m_showid=8;setPlayStyle(8,1);expandvideo(8,1);showTitle();m_NowVideoID=rs[m_showid].id;m_pageindexplay=m_pageindex;m_rslengthplay=m_rslength;$("#myplayer")[0].GetVideoIdFromJs(m_NowVideoID)}function videohtml(e){var a;a=(m_pageindex-1)*8+e;var c="'/movie/detail/"+m_aid+"/"+a+".htm'";$("#s_pvamount").html(rs[e].pt);var b=rs[e].brief;if(b.length>64){b=b.substring(0,64)+"..."}document.getElementById("Support").innerHTML=rs[e].suport;var d='<dl id="newsVideo-'+e+'" onmouseover="expandvideo('+e+')"><dt style="width:170px;"><a href="javascript:viewNewVideo('+e+')">'+rs[e].title+'</dt><dd style="width:100px;"><i style="width:60px;">'+formatplaylength(rs[e].timer)+'</i><img style="cursor:hand;margin:8px;" id="ext-'+e+'" src="http://css.megajoy.com/vod/movie/images/img09090302.gif" width="8" height="8" alt="展开"/></dd></dl><dl class="dl04_01" id="det-'+e+'"><dt style="width:290px;line-height:16px;border:0;"><a href="javascript:viewNewVideo('+e+')" title="'+rs[e].title+'"><img class="img" style="float:left;padding-right:2px;" width="84" height="64" src="'+rs[e].img_url+'" alt="'+rs[e].title+'" /></a><span style="cursor:pointer;" title="'+rs[e].brief+'">'+b+"</span></dt></dl>";return d}document.getElementsById=function(b){if(b=="CommentCountnum"){var a=[];$("*").each(function(){if(this.id==b){a.push(this)}});return a.length==0?null:a.length==1?a[0]:a}return null};function getCommentCount(){var c=$("#CommentCount");if(c.html()=="0&nbsp;"){}else{try{if(video_count==1){$("#CommentCountnum").html("评论:"+c.html())}else{var d=document.getElementsById("CommentCountnum");for(var a=0;a<d.length;a++){d[a].innerHTML="评论:"+c.html()}}clearInterval(startgetComment)}catch(b){clearInterval(startgetComment)}}}var startgetComment=window.setInterval(getCommentCount,3000);function expandvideo(b,a){if(b<=0||b>=m_rslength){return}if(b==m_extid&&(typeof(a)=="undefined"||a==0)){}else{if(m_extid>0&&m_extid<m_rslength){$("#ext-"+m_extid)[0].src="http://css.megajoy.com/vod/movie/images/img09090302.gif";$("#ext-"+m_extid)[0].alt="展开";$("#ext-"+m_extid)[0].height=8;$("#det-"+m_extid)[0].style.display=""}$("#ext-"+b)[0].src="http://css.megajoy.com/vod/movie/images/img09090301.gif";$("#ext-"+b)[0].alt="闭合";$("#ext-"+b)[0].height=2;$("#det-"+b)[0].style.display="block";m_extid=b}}function SecondLoadexpandvideo(){expandvideo(m_showid,1)}function buildtitle(b){var a=b.replace(/\s+/g,"").replace(RegExp("^"+m_AlbumTitle,"i"),"");return(a!="")?CutString(a,44):m_AlbumTitle}function buildvideo(result){var timeout;clearTimeout(timeout);eval("rs="+result);var i=0;m_rscount=rs[i].total;m_rslength=rs.length;m_rslengthplay=m_rslength;$(".dlbox04").empty();if(m_rslength<=0){$(".dlbox04").html('<img src="http://css.megajoy.com/vod/movie/images/NoVideo.jpg" width="84" height="64" alt="暂无视频" title="暂无视频" />')}else{for(i=1;i<m_rslength;i++){if(typeof(rs[i])!="undefined"){$(".dlbox04").append(videohtml(i))}}}if($(".dlbox04").html()==null||$(".dlbox04").html()==""){timeout=setTimeout2(buildvideo,1000,result);return}if(m_pageindexplay==m_pageindex){setPlayStyle(m_showid,1);expandvideo(m_showid,1)}m_pagecount=parseInt((m_rscount-1)/m_pagesize)+1;showpagepanel()}function stopTimer(){window.clearTimeout(theTimer)}function StartTimer(){setPlayStyle(m_showid,1);expandvideo(m_showid,1);stopTimer()}function ajaxLoadNextVideo(a,b){$.ajax({type:"GET",url:"/vod.do?method=vodPlayList",data:"videoId="+encodeURIComponent(m_aid)+"&p="+encodeURIComponent(m_pageindex)+"&cid="+encodeURIComponent(m_cid)+"&r="+Math.random(),success:function(c){buildvideo(c);if(m_rslength>1){if(a==3){m_showid=b;if(m_pageindex==m_pageindexplay){setPlayStyle(m_showid,1);expandvideo(m_showid,1)}GetVideoIdToJs("next");viewNextVideo(m_showid)}else{if(a==4){m_showid=b;GetVideoIdToJs("peo");viewNextVideo(m_showid)}else{if(a==5){viewProVideo()}else{if(a==2){viewNextVideo(1)}else{if(a==6){viewNextVideo(m_showid)}}}}}}},error:function(c){}})}function firstflashvidoe(){var a=$("#myplayer")[0];if(a.GetVideoIdFromJs){a.GetVideoIdFromJs(GetVideoIdToJs("now",1));ajaxLoadNextVideo(1)}else{setTimeout(firstflashvidoe,100)}}function getdata(a){if(m_pageindex!=a){m_pageindex=a;m_extid=0;ajaxLoadNextVideo(0)}}function BulidAmount(result){eval("var rs="+result);var i=0;$("#Support").append(rs[i].SupportAmount)}function GetProgramAmount(){$.ajax({type:"GET",url:"/movieapp/Service/GetContentStatByChannelIdAndProgramId.ashx",data:"cid=51&pid="+encodeURIComponent(m_aid),success:function(a){BulidAmount(a)},error:function(a){}})}function GetRedirect(b,a){$.ajax({type:"GET",url:"/movieapp/movie/checkh264.aspx",data:"pid="+b+"&vid="+encodeURIComponent(a),success:function(c){if(c!=""){window.location.href=c}},error:function(c){}})}function showpagepanel(){var a=parseInt((m_pageindex-1)/m_pagenumber)*m_pagenumber+1;var e=(m_pageindex-1)*m_pagesize+1;var d=m_pageindex*m_pagesize;if(d>m_rscount){d=m_rscount}var f="<dt>共"+m_rscount+"个&nbsp;第"+e+"-"+d+"个</dt> "+((m_pageindex>1)?'<dd><a title="上页" href="javascript:getdata('+(m_pageindex-1)+')">上一页</a>':"上一页");for(var c=0;c<m_pagenumber;c++){var b=a+c;if(b<=m_pagecount){f+=" "+((b!=m_pageindex)?'<a title="第'+b+'页" href="javascript:getdata('+b+')">'+b+"</a>":'<font title="当前页" color=red>'+b+"</font>")}}f+=((m_pageindex<m_pagecount)?'&nbsp;<a title="下页" href="javascript:getdata('+(m_pageindex+1)+')">下一页</a> </dd>':"&nbsp;下一页</dd>");$(".dl01").html(f)}function formatplaylength(b){var c=parseInt(b/60);var a=b-c*60;return((c.length<2)?"0"+c:c)+":"+((a.length<2)?"0"+a:a)}function isIE(){if(window.navigator.userAgent.toLowerCase().indexOf("msie")>=1){return true}else{return false}}if(!isIE()){HTMLElement.prototype.__defineGetter__("innerText",function(){return this.textContent.replace(/(^\s*)|(\s*$)/g,"")});HTMLElement.prototype.__defineSetter__("innerText",function(a){this.textContent=a})};