var genreCache=new Array();var titleIdCache=new Array();var fullTitleCache=new Array();var assetNameCache=new Array();var actorCache=new Array();var mediumSummaryCache=new Array();var yearCache=new Array();var vodUseGraphicCache=new Array();var genrePatternCache=new Array();var ratingPatternCache=new Array();var subtitlePatternCache=new Array();var audioTypePatternCache=new Array();var curVodPosition=0;var curColPosition=0;var vodServer="";var currentClick=0;var vodVisible=false;var vodGenreCursor=0;var vodTitleCursor=0;var vodGenreCurrent=0;var vodTitleCurrent=0;var vodGenreSelected=0;var vodTitleSelected=0;var curAssetIndex=0;var vodCurCursor=0;var startIndex=0;var vodGenreMax=9;var vodTitleMax=2;var vodGenreTotal=0;var vodTitleTotal=0;var titleIndex=0;var selectedTitleCache=new Array();var selFullTitleCache=new Array();var selAssetNameCache=new Array();var selTitleIdCache=new Array();var curVodIndex=new Array();var selVodUseGraphic=new Array();var selYearCache=new Array();var vodClickCounts=0;var vodPage=0;var trickPlay=false;var trickPlayHandle=null;var trickPlayFrameHandle=null;var vodScreenStatus=false;function launchVodPanel(){vodPage=0;updateGenrePanel();if(document.getElementById("vodTag")!=null){document.getElementById("vodTag").innerHTML=records.key443}if(document.getElementById("startHeader")!=null){document.getElementById("startHeader").innerHTML=records.key445+":";document.getElementById("dirrectorHeader").innerHTML=records.key446+":"}}function updateGenrePanel(){resetGenrePanel();var A="";var B;for(B=0;(genreCache.length>10&&B<10)||(genreCache.length<=10&&B<genreCache.length);++B){A+="<tr><td "+(statusInfo==1?'style="cursor:pointer;" id="genreId'+B+'" onmouseover="selGenre('+B+');" onmouseout="unSelGenre('+B+');" onclick="openGenreAsset('+B+');"':" ")+' width="155px" height="30px" valign=center nowrap>&nbsp;&nbsp;&nbsp;'+genreCache[B]+"</td></tr>"}document.getElementById("vodGenrePanel").innerHTML="<table width="+(A?"165px":"190px")+' align="left" border="0px" style="margin-top:10px;margin-left:5px;" cellspacing="0" cellpadding="0">'+(A?A:"<tr><td width="+(A?"155px":"190px")+' height="30px" valign="middle" align="center" nowrap>'+records.key372+"</td></tr>")+"</table>";if(document.getElementsByTagName){var C=document.getElementById("vodGenrePanel");var D=C.getElementsByTagName("tr");D[0].style.backgroundImage=(A?'url("/view/tv/images/rowGenre.png")':'url("/view/tv/images/rowGenreBig.png")');D[0].style.backgroundRepeat="no-repeat"}buildTitleCache();feedType="igmp"}function buildTitleCache(){selAssetNameCache=new Array();selFullTitleCache=new Array();selectedTitleCache=new Array();selTitleIdCache=new Array();curVodIndex=new Array();selVodUseGraphic=new Array();selYearCache=new Array();resetTitlePanel();var B;var A=0;for(B=0;B<genrePatternCache.length;++B){if(genrePatternCache[B]!=null&&genrePatternCache[B].match("#"+genreCache[vodGenreSelected]+"#")){selectedTitleCache[B]=true;selAssetNameCache[A]=assetNameCache[B];selFullTitleCache[A]=fullTitleCache[B];selTitleIdCache[A]=titleIdCache[B];selVodUseGraphic[A]=vodUseGraphicCache[B];selYearCache[A]=yearCache[B];curVodIndex[A]=B;A++}else{selectedTitleCache[B]=false}}vodTitleTotal=(A==0?0:A-1);updateTitlePanel()}function updateTitlePanel(){var F;var B=0;var E='<tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>';var D=curVodIndex[curAssetIndex];if(document.getElementById("vodTitlePanel")!=null){for(F=0;(selFullTitleCache.length>=9&&F<9)||(selFullTitleCache.length<9&&F<selFullTitleCache.length);++F){B++;if(F%3==0&&F!=0){E+='</tr><tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}E+='<td align="center" valign="middle" nowrap style="width:100px;height:75px;'+(statusInfo==1?"cursor:pointer;":"")+'" '+(statusInfo==1?'onmouseover="selVodAsset('+F+');" onmouseout="unSelVodAsset('+F+');" onclick="openVodAsset('+F+');"':"")+' ><img id="titleId'+F+'" style="width:75px;height:75px;" alt="'+selFullTitleCache[F]+'" src='+(selVodUseGraphic[F]==1?'"/ImageHandler?value='+selTitleIdCache[F]+'&icon=-1&imageType=3"':'"./view/tv/images/vod/logo_none.png"')+'/></td><td width="15px" height="80px" >&nbsp;</td>'}if(B>0){for(var C=0;C<(9-B);++C){if((B+C)%3==0){E+='</tr><tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}E+='<td align="center" valign="middle" nowrap style="width:100px;height:80px;">&nbsp;</td><td width="15px" height="80px" >&nbsp;</td>'}}E+='</tr><tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr>';document.getElementById("vodTitlePanel").innerHTML='<table width="425px"  height="300px" border=0 align="center" valign="middle" cellspacing="0" cellpadding="0" class="item">'+(selTitleIdCache.length>0?E:'<tr><td width="425px" height="30" valign="middle" align="center" nowrap>'+records.key373+" </td></tr>")+"</table>";var A=(selTitleIdCache[0]?updateTitleNYear(0):hideVodDetails())}}function hideVodDetails(){document.getElementById("titleContent").style.visibility="hidden";document.getElementById("ratingPanel").style.visibility="hidden";document.getElementById("ratingTagPanel").style.visibility="hidden";document.getElementById("yearTagPanel").style.visibility="hidden"}function updateTitleNYear(A){var B=curVodIndex[A];var C=selFullTitleCache[A];if(C.indexOf(".")>=0){C=C.substring(0,C.indexOf("."))}document.getElementById("titleContent").innerHTML=(selFullTitleCache[A]?C:" ");document.getElementById("ratingPanel").innerHTML=(ratingPatternCache[B]?" "+ratingPatternCache[B].replace(/#/,"")+"":"&nbsp;");document.getElementById("ratingTagPanel").innerHTML=(ratingPatternCache[B]?records.key454+": ":"");document.getElementById("yearTagPanel").innerHTML=(selYearCache[A]&&selYearCache[A]!=0?records.key455+": "+selYearCache[A]:"")}function emptyAssetContent(){document.getElementById("yearTagPanel").innerHTML="";document.getElementById("ratingTagPanel").innerHTML="";document.getElementById("ratingPanel").innerHTML="";document.getElementById("titleContent").innerHTML=""}function updateVodGuide(){return ;var A=curVodIndex[curAssetIndex];if(document.getElementById("vodTitleGuide")!=null){document.getElementById("vodTitleGuide").innerHTML='<table align="left" cellspacing="0" cellpadding="4" style="width:415px;text-align: justify;"><tr><td style="font-weight:bold;font-size:13px;vertical-align:top;text-align: justify;">'+(mediumSummaryCache[A]?(mediumSummaryCache[A].length>210?mediumSummaryCache[A].substring(0,210)+"...":mediumSummaryCache[A]):"")+"</td></tr></table>"}}function scrollGenrePage(D,A){var B="";var C;for(C=D;C<=A;++C){B+='<tr><td style="cursor:pointer;" id="genreId'+C+'" onmouseover="selGenre('+C+');" onmouseout="unSelGenre('+C+');" onclick="openGenreAsset('+C+');" width="155px" height="30px" valign="middle" nowrap>&nbsp;&nbsp;&nbsp;'+genreCache[C]+"</td></tr>"}document.getElementById("vodGenrePanel").innerHTML="<table width="+(B?"165px":"190px")+' align="left" border="0px" style="margin-top:10px;margin-left:5px;" cellspacing="0" cellpadding="0">'+(B?B:"<tr><td width="+(B?"155px":"190px")+' height="28px" valign="middle" align="center" nowrap>'+records.key372+"</td></tr>")+"</table>";highlightGenre()}function scrollTitlePage(F,B){vodPage=1;document.getElementById("vodTitlePanel").innerHTML="";var D='<tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>';var E=0;if(document.getElementById("vodTitlePanel")!=null){for(i=F;i<=B;++i){if(i%3==0&&i!=0&&E!=0){D+='</tr><tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}E++;D+='<td align="center" valign="middle" nowrap style="width:100px;height:75px;'+(statusInfo==1?"cursor:pointer;":"")+'" '+(statusInfo==1?' onmouseover="selVodAsset('+i+');" onmouseout="unSelVodAsset('+i+');" onclick="openVodAsset('+i+');" ':"")+'  ><img id="titleId'+i+'" style="width:75px;height:75px;" alt="'+selFullTitleCache[i]+'" src='+(selVodUseGraphic[i]==1?'"/ImageHandler?value='+selTitleIdCache[i]+'&icon=-1&imageType=3"':'"./view/tv/images/vod/logo_none.png"')+'/></td><td width="15px" height="80px" >&nbsp;</td>'}if(E>0){for(var C=0;C<(9-E);++C){if((E+C)%3==0){D+='</tr><tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}D+='<td align="center" valign="middle" nowrap style="width:100px;height:80px;">&nbsp;</td><td width="15px" height="80px" >&nbsp;</td>'}}D+='</tr><tr><td colspan="7" width="425px" height="10px">&nbsp;</td></tr>';document.getElementById("vodTitlePanel").innerHTML='<table width="425px"  height="310px" border=0 align="center" valign="middle" cellspacing="0" cellpadding="0" class="item">'+(selTitleIdCache.length>0?D:'<tr><td width="425px" height="30" valign="middle" align="center" nowrap>'+records.key373+" </td></tr>")+"</table>";var A=(selTitleIdCache[curVodPosition-1]?updateTitleNYear(curVodPosition-1):hideVodDetails());if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid paleGoldenRod"}}}function resetGenrePanel(){vodGenreTotal=(genreCache.length==0?0:genreCache.length-1);vodGenreCursor=0;vodGenreCurrent=0;vodGenreSelected=0;vodGenreClicks=0}function resetTitlePanel(){var A;for(A=0;A<assetNameCache.length;++A){selectedTitleCache[A]=true}vodTitleTotal=assetNameCache.length-1;vodPage=0;curVodPosition=0;vodCurCursor=0;vodTitleCursor=0;vodTitleCurrent=0;vodTitleSelected=0;curColPosition=0;startIndex=0}function changeGenreCursor(){if(document.getElementsByTagName){var B=document.getElementById("vodGenrePanel");var C=B.getElementsByTagName("tr");var A;for(A=0;A<C.length;A++){if(A==vodGenreCursor){C[A].style.backgroundImage='url("/view/tv/images/rowGenre.png")';C[A].style.backgroundRepeat="no-repeat"}else{C[A].style.backgroundImage="none"}}}}function changeTitleCursor(){return ;if(document.getElementsByTagName){var B=document.getElementById("vodTitlePanel");var C=B.getElementsByTagName("tr");var A;for(A=0;A<C.length;A++){if(A==vodTitleCursor){C[A].style.backgroundImage='url("/view/tv/images/rowTitle.png")'}else{C[A].style.backgroundImage="none"}}}}function highlightGenre(){if(document.getElementsByTagName){var B=document.getElementById("vodGenrePanel");var C=B.getElementsByTagName("tr");C[vodGenreCursor].style.backgroundImage='url("/view/tv/images/rowGenre.png")';C[vodGenreCursor].style.backgroundRepeat="no-repeat";if(document.getElementById("vodTitlePanel")!=null){var A=document.getElementById("vodTitlePanel");var D=A.getElementsByTagName("tr");D[vodTitleCursor].style.backgroundImage="none"}}}function highlightTitle(){}function startVodStream(){feedType="rtsp";vodActive=true;if(!selAssetNameCache[vodTitleSelected]){return }var A="src=rtsp://"+vodServer+"/"+selAssetNameCache[vodTitleSelected]+";servertype=ncube";if(stbTypeId==7){var B=DetectFlashVer(10,0,0);if(!B){showStatusPanel();document.getElementById("statusMessagePanel").innerHTML="get the flash player now on http://www.adobe.com/go/getflashplayer/";return }var F=selAssetNameCache[vodTitleSelected];var C=F.substring(0,F.indexOf("."));var D=F.substring(F.indexOf(".")+1,F.length).toUpperCase();if(D=="JPEG"||D=="JPG"||D=="GIF"||D=="PNG"||D=="BMP"||D=="EXE"||D=="TIF"||D=="ICO"||D=="ZIP"||D=="TXT"||D=="DOC"||D=="DOCX"){showStatusPanel();document.getElementById("statusMessagePanel").innerHTML=records.key1623;return }else{if(D=="MP4"||D=="MOV"||D=="F4V"){F="mp4:"+F}else{F=C+".flv"}F=C;var E=fmsServerIp+":"+fmsServerPort;document.getElementById("epgPlayer").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="624" height="422" id="mediacasterstreammanagerLive" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /><param name="movie" value="/view/tv/flash/vodTvPlayer.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="opaque"><param name="FlashVars" value="streamName='+F+"&ip="+E+'" /><embed src="/view/tv/flash/vodTvPlayer.swf" FlashVars="streamName='+F+"&ip="+E+'" wmode="opaque" quality="high" bgcolor="#000000" width="624" height="422" name="mediacasterstreammanagerLive" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';if(document.getElementById("epgPlayer")!=null){document.getElementById("epgPlayer").className="epgPlayer"}if(stbTypeId==7){document.getElementById("homePanelImage").style.visibility="visible"}document.getElementById("waitPanel").style.backgroundImage="none"}}else{document.getElementById("waitPanel").style.backgroundImage="none";playStream(A)}}function fastForward(){setSpeedStream(6);trickPlayHandle=window.setInterval("getFwdVideoFrames()",4000)}function getFwdVideoFrames(){continueStream();trickPlayFrameHandle=window.setTimeout("setSpeedStream(6)",500)}function getRwrVideoFrames(){continueStream();trickPlayFrameHandle=window.setTimeout("setSpeedStream(-6)",500)}function rewind(){setSpeedStream(-6);trickPlayHandle=window.setInterval("getRwrVideoFrames()",4000)}function loadVodCache(){var B="method=getvodcachemenu&serial="+serial;var A={success:loadVodCachesSuccessHandler,failure:loadVodCacheFailureHandler,argument:{}};request=YAHOO.util.Connect.asyncRequest("POST",serverUrl,A,B);return false}var loadVodCachesSuccessHandler=function(C){var A=C.responseText;if(A.length>0){var B=A.split("-$#-");genreCache=B[0].split("-@#-");titleIdCache=B[1].split("-@#-");fullTitleCache=B[2].split("-@#-");assetNameCache=B[3].split("-@#-");actorCache=B[4].split("-@#-");mediumSummaryCache=B[5].split("-@#-");yearCache=B[6].split("-@#-");vodUseGraphicCache=B[7].split("-@#-");genrePatternCache=B[8].split("-@#-");ratingPatternCache=B[9].split("-@#-");subtitlePatternCache=B[10].split("-@#-");audioTypePatternCache=B[11].split("-@#-");genreCache[0]==""?genreCache.shift():"";titleIdCache[0]==""?titleIdCache.shift():"";fullTitleCache[0]==""?fullTitleCache.shift():"";assetNameCache[0]==""?assetNameCache.shift():"";actorCache[0]==""?actorCache.shift():"";mediumSummaryCache[0]==""?mediumSummaryCache.shift():"";yearCache[0]==""?yearCache.shift():"";vodUseGraphicCache[0]==""?vodUseGraphicCache.shift():"";genrePatternCache[0]==""?genrePatternCache.shift():"";ratingPatternCache[0]==""?ratingPatternCache.shift():"";subtitlePatternCache[0]==""?subtitlePatternCache.shift():"";audioTypePatternCache[0]==""?audioTypePatternCache.shift():""}updateGenrePanel()};var loadVodCacheFailureHandler=function(A){showStatusPanel();document.getElementById("statusMessagePanel").innerHTML="";document.getElementById("statusMessagePanel").innerHTML=records.key270+". <br>"+((companyName!=null&&companyPhoneNum!=null)?""+records.key271+" "+companyName+" "+records.key272+" "+companyPhoneNum+".":"");window.setTimeout("hideStatusPanel();",20000)};function vodKeyNvg(B){if(selFullTitleCache.length==0){return }if(vodPage==0){return }switch(B){case rcRIGHT:if(curVodPosition==selFullTitleCache.length){vodPage=0;if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid transparent"}curVodPosition=curVodPosition-vodCurCursor;vodCurCursor=0;updateTitleNYear(0);return }vodCurCursor++;if(vodCurCursor>3&&curVodPosition!=0){if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid transparent"}emptyAssetContent();updateTitleNYear(0);vodPage=0;curVodPosition=curVodPosition-3;vodCurCursor=0;return }if(curVodPosition>=0){if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid transparent"}if(document.getElementById("titleId"+curVodPosition)!=null){document.getElementById("titleId"+curVodPosition).style.border="2px solid paleGoldenRod"}updateTitleNYear(curVodPosition);curVodPosition++;return }break;case rcLEFT:vodCurCursor--;curVodPosition--;if(vodCurCursor==0){if(document.getElementById("titleId"+curVodPosition)!=null){document.getElementById("titleId"+curVodPosition).style.border="2px solid transparent"}emptyAssetContent();updateTitleNYear(0);vodPage=0;vodCurCursor=0;return }if(curVodPosition>=0){if(document.getElementById("titleId"+curVodPosition)!=null){document.getElementById("titleId"+curVodPosition).style.border="2px solid transparent"}if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid paleGoldenRod"}updateTitleNYear(curVodPosition-1);return }break;case rcUP:if(vodPage==1){vodTitleCurrent--;vodTitleCurrent=(vodTitleCurrent<0?++vodTitleCurrent:vodTitleCurrent);if((curVodPosition>=1&&curVodPosition<=3)){vodTitleCurrent=0;vodTitleCursor=0;return }if(vodTitleCursor!=0){vodTitleCursor--;if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid transparent"}curVodPosition-=3;if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid paleGoldenRod"}updateTitleNYear(curVodPosition-1)}else{--curColPosition;vodTitleCursor=0;var D=0;D=(startIndex<3?0:startIndex-3);startIndex=D;var A=((vodTitleTotal-D)>8?(D+8):vodTitleTotal);curVodPosition-=3;--vodClickCounts;scrollTitlePage(D,A)}}break;case rcDOWN:if(vodPage==1){var C=(vodTitleTotal/3)+1;if((vodTitleCurrent==parseInt(C))){--vodTitleCurrent;return }++vodTitleCurrent;if(vodTitleCursor<vodTitleMax){if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid transparent"}curVodPosition+=3;if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid paleGoldenRod";updateTitleNYear(curVodPosition-1);vodTitleCursor++}else{curVodPosition-=3;if(document.getElementById("titleId"+(curVodPosition-1))!=null){document.getElementById("titleId"+(curVodPosition-1)).style.border="2px solid paleGoldenRod"}updateTitleNYear(curVodPosition-1);vodTitleCurrent--}}else{if((parseInt(C)-3)==curColPosition){return }curVodPosition+=3;var D=0;if(vodTitleCurrent<3){D=vodTitleCurrent;startIndex=D}else{D=startIndex+3;startIndex=D}vodTitleCursor=2;var A=((vodTitleTotal-D)>8?(D+8):vodTitleTotal);if(curVodPosition>selTitleIdCache.length){curVodPosition-=3;vodTitleCursor-=1}++curColPosition;++vodClickCounts;scrollTitlePage(D,A)}}break;case rcOK:if(curVodPosition>=0){vodTitleSelected=curVodPosition-1;curAssetIndex=vodTitleSelected}break}}function resetVod(){if(vodActive){vodPage=0;curVodPosition=0;launchVodPanel();hideStatusPanel();document.getElementById("statusMessagePanel").innerHTML="";fadeAll();document.getElementById("layer8").style.visibility="visible"}}function selVodAsset(A){vodPage=1;vodTitleCurrent=parseInt(A/3);vodTitleCursor=vodTitleCurrent-vodClickCounts;vodCurCursor=parseInt(A%3)+1;if(document.getElementById("titleId"+curVodPosition)!=null){document.getElementById("titleId"+curVodPosition).style.border="2px solid transparent"}if(document.getElementById("titleId"+A)!=null){document.getElementById("titleId"+A).style.border="2px solid paleGoldenRod"}curVodPosition=A;updateTitleNYear(curVodPosition)}function unSelVodAsset(A){vodPage=1;return ;if(document.getElementById("titleId"+A)!=null){document.getElementById("titleId"+A).style.border="2px solid transparent"}}function openVodAsset(A){curVodPosition=A+1;vodPage=1;keyActionHandler(rcOK)}function escapeVodPanel(){vodActive=true;menuActive=true;keyActionHandler(rcMENU)}var vodGenreClicks=0;function moveVodPageUp(){if(vodPage==0){keyActionHandler(rcUP);return }vodPage=1;keyActionHandler(rcUP);return }function moveVodPageDown(){if(vodPage==0){keyActionHandler(rcDOWN);return }vodPage=1;keyActionHandler(rcDOWN);return }function showVod(A){document.getElementById("vodMove"+A).style.background="#fcf3b8"}function hideVod(A){document.getElementById("vodMove"+A).style.background="none"}function selGenre(A){vodPage=0;vodGenreCursor=A-vodGenreClicks;vodGenreSelected=vodGenreCurrent=A;changeGenreCursor();buildTitleCache()}function unSelGenre(A){return ;document.getElementById("genreId"+A).style.background="none"}function openGenreAsset(A){keyActionHandler(rcOK)}function callFullGuide(){if(stbTypeId==7){document.getElementById("homePanelImage").style.visibility="visible"}keyActionHandler(rcMENU)}function gotoVodPanel(){if(stbTypeId==7){document.getElementById("homePanelImage").style.visibility="hidden"}keyActionHandler(rcMENU)}function showHomeImage(A){document.getElementById("homeImage").style.background=(A==1?"#fcf3b8":"none")}