var quizGenreCache=new Array();var quizTitleIdCache=new Array();var quizTitleCache=new Array();var quizTitleDescCache=new Array();var quizTitleUseGraphic=new Array();var quizQuestionCache=new Array();var quizQuestionIdCache=new Array();var quizAnserCache=new Array();var quizAnsIdCache=new Array();var quizCorrAnswerCache=new Array();var quizCorrAnsIdCache=new Array();var quizSelArrIndex=new Array();var curQuizIndex=new Array();var quizGenreTotal=0;var quizTitleTotal=0;var quizGenreIndex=0;var quizGenreCursor=0;var quizTitleIndex=0;var quizTitleCursor=0;var quizRowIndex=0;var quizColumnIndex=0;var quizPanel=0;var quizResponse=false;var startQuizIndex=0;var quizCursorIndex=0;var curQuizQIndex=0;var openQuizPanelStatus=false;var showQuizResult=false;var curQuesOptIndex=0;var quizQuestionMax=0;var quizAvailOption=0;var quizGenreClick=0;var quizTitleClick=0;function launchQuizPanel(A){getQuizInfo(A)}function resetQuizGenre(){quizGenreIndex=0;quizGenreCursor=0;quizPanel=0;quizGenreClick=0}var quizQArr=new Array();var quizAArr=new Array();var correctAnsArr=new Array();var quizStatusArr=new Array();var quizIndexArr=new Array();var ansStatusArr=new Array();var correctQuizSCore=0;var wrngQuizAns=new Array();function getQuizInfo(A){var B="method=getQuizInfo&widgetId="+A+"&serial="+serial;createAjaxRequest();if(ajaxRequest==null){return }ajaxRequest.onreadystatechange=function(){if(ajaxRequest.readyState==4){if(ajaxRequest.status==200){if(ajaxRequest.responseText=="recall"){getQuizInfo(A)}else{var E=ajaxRequest.responseText;if(E.length>0){var I=E.split("-?#-");quizGenreCache=(I[0]).split("-*$-");var H=(I[1]).split("-*$-");quizTitleIdCache=new Array(H.length);for(var G=0;G<H.length;G++){quizTitleIdCache[G]=(H[G]).split("-@#-")}H=(I[2]).split("-*$-");quizTitleCache=new Array(H.length);for(var G=0;G<H.length;G++){quizTitleCache[G]=(H[G]).split("-@#-")}H=(I[3]).split("-*$-");quizTitleDescCache=new Array(H.length);for(var G=0;G<H.length;G++){quizTitleDescCache[G]=(H[G]).split("-@#-")}H=(I[4]).split("-*$-");quizTitleUseGraphic=new Array(H.length);for(var G=0;G<H.length;G++){quizTitleUseGraphic[G]=(H[G]).split("-@#-")}H=(I[5]).split("-*$-");quizQuestionCache=new Array(H.length);for(var G=0;G<H.length;G++){var J=(H[G]).split("-@#-");quizQuestionCache[G]=new Array(J.length);for(var F=0;F<J.length;F++){quizQuestionCache[G][F]=(J[F]).split("-$#-")}}H=(I[6]).split("-*$-");quizQuestionIdCache=new Array(H.length);for(var G=0;G<H.length;G++){var J=(H[G]).split("-@#-");quizQuestionIdCache[G]=new Array(J.length);for(var F=0;F<J.length;F++){quizQuestionIdCache[G][F]=(J[F]).split("-$#-")}}H=(I[7]).split("-*$-");quizAnserCache=new Array(H.length);for(var G=0;G<H.length;G++){var J=(H[G]).split("-@#-");quizAnserCache[G]=new Array(J.length);for(var F=0;F<J.length;F++){var D=(J[F]).split("-$#-");quizAnserCache[G][F]=new Array(D.length);for(var C=0;C<D.length;C++){quizAnserCache[G][F][C]=(D[C]).split("@$@")}}}H=(I[8]).split("-*$-");quizAnsIdCache=new Array(H.length);for(var G=0;G<H.length;G++){var J=(H[G]).split("-@#-");quizAnsIdCache[G]=new Array(J.length);for(var F=0;F<J.length;F++){var D=(J[F]).split("-$#-");quizAnsIdCache[G][F]=new Array(D.length);for(var C=0;C<D.length;C++){quizAnsIdCache[G][F][C]=(D[C]).split("@$@")}}}H=(I[9]).split("-*$-");quizCorrAnswerCache=new Array(H.length);for(var G=0;G<H.length;G++){var J=(H[G]).split("-@#-");quizCorrAnswerCache[G]=new Array(J.length);for(var F=0;F<J.length;F++){quizCorrAnswerCache[G][F]=(J[F]).split("-$#-")}}H=(I[10]).split("-*$-");quizCorrAnsIdCache=new Array(H.length);for(var G=0;G<H.length;G++){var J=(H[G]).split("-@#-");quizCorrAnsIdCache[G]=new Array(J.length);for(var F=0;F<J.length;F++){quizCorrAnsIdCache[G][F]=(J[F]).split("-$#-")}}}createQuizCache();showQuizPanel()}}else{if(ajaxRequest.status==500){failureInfo()}}}};ajaxRequest.open("POST","/TvHandler",true);ajaxRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajaxRequest.send(B);return false}function buildQuizDesign(){}function buildQuizContent(B){var D=3*quizRowIndex+quizColumnIndex;var A=quizIndexArr[curQuizQIndex];quizQArr=quizQuestionCache[quizGenreIndex][D];for(var C=0;C<quizQArr.length;C++){quizAArr[C]=new Array(quizAnserCache[quizGenreIndex][D][C].length);quizAArr[C]=quizAnserCache[quizGenreIndex][D][C]}correctAnsArr=quizCorrAnswerCache[quizGenreIndex][D];for(var C=0;C<quizQArr.length;C++){quizIndexArr[C]=-1;ansStatusArr[C]=new Array([-1,-1,-1,-1])}}function resetQuizPanel(A){quizQArr=new Array();quizAArr=new Array();correctAnsArr=new Array();ansStatusArr=new Array();quizIndexArr=new Array();quizStatusArr=new Array();buildQuizContent(A);quizQuestionMax=ansStatusArr.length-1;quizAvailOption=quizQArr.length-1;for(var B=0;B<=quizAvailOption;B++){quizStatusArr[B]=0}correctQuizSCore=0;wrngQuizAns=new Array();curQuizQIndex=0;openQuizPanelStatus=false;showQuizResult=false;curQuesOptIndex=0;document.getElementById("quizResponseMsg").innerHTML="Choose a suitable answer for the following question.";document.getElementById("quizResultMsg").innerHTML="&nbsp;";document.getElementById("quizCorrectedAns").innerHTML="&nbsp;"}function drawQuizPanel(){index=curQuizQIndex;if(quizStatusArr[index]==0){quizStatusArr[index]=1;quizIndexArr[curQuizQIndex]=index;curQuesOptIndex=0;document.getElementById("quizQuestionPanel").innerHTML=(quizQArr[index]==""?"Not Available!":quizQArr[index]);for(var A=0;A<4;A++){ansStatusArr[curQuizQIndex][A]=-1;if(A<quizAArr[index].length){document.getElementById("quizAnsPanel"+A).innerHTML=(quizAArr[index][A]==""?"Not Available!":quizAArr[index][A])}else{document.getElementById("quizAnsPanel"+A).innerHTML="Not Available!"}}selQuizOption(0);updateQuizStatus()}else{drawQuizPanel()}}function getQuizRandom(){var A=Math.round(Math.random()*quizAvailOption);return A}function selQuizOption(B){try{unSelQuizOption();if(ansStatusArr[curQuizQIndex][B]==-1){document.getElementById("quizAnsOption"+B).style.background='url("/view/tv/images/keyboardSelector.png") no-repeat'}else{document.getElementById("quizAnsOption"+B).style.background='url("/view/tv/images/selectedTick.png") no-repeat'}}catch(A){}}function unSelQuizOption(){try{for(var B=0;B<4;B++){if(ansStatusArr[curQuizQIndex][B]==-1){document.getElementById("quizAnsOption"+B).style.background=""}else{}}}catch(A){}}function createQuizCache(){quizPanel=0;quizSelArrIndex=new Array();for(var B=0;B<quizGenreCache.length;B++){quizSelArrIndex[B]=new Array(quizTitleUseGraphic[B].length);for(var A=0;A<quizTitleUseGraphic[B].length;A++){quizSelArrIndex[B][A]=0}}quizGenreTotal=quizGenreCache.length==0?0:quizGenreCache.length-1;quizTitleTotal=quizTitleCache.length==0?0:quizTitleCache.length-1;document.getElementById("quizContentPanel").style.visibility="visible";createQuizGenrePanel()}function onQuizGenrePanel(B){var A=B+quizGenreClick;if(quizGenreCache.length<=A){return }unSelQuizTitle();quizPanel=0;quizGenreCursor=B;quizGenreIndex=B+quizGenreClick;selQuizGenre(B);createQuizTitlePanel()}function createQuizGenrePanel(){resetQuizGenre();document.getElementById("quizGenrePanel").innerHTML="";var B="";var D=0;var E=quizGenreCache.length;for(var C=0;(E>=10&&C<10)||(E<10&&C<E);++C){var A=updateQuizGenrePanel(quizGenreCache[C]);B+="<tr><td "+(statusInfo==1?' onmouseover="onQuizGenrePanel('+C+');" ':"")+' id="quizGenreId'+C+'" style="height:30px;width:160px;padding-bottom:3px;padding-left:18px;font-family: trebuchet MS;font-size:15px;font-weight:bold;">'+((A).length>28?A:A)+"</td></tr>";D++}for(var C=0;C<(10-D);++C){if(D==0){break}B+="<tr><td "+(statusInfo==1?' onmouseover="onQuizGenrePanel('+(C+D)+');" ':"")+' id="quizGenreId'+(C+D)+'" style="height:30px;width:160px;padding-bottom:3px;padding-left:18px;font-family: trebuchet MS;font-size:15px;font-weight:bold;"></td></tr>'}document.getElementById("quizGenrePanel").innerHTML='<table width="100%" align="left" valign="top" cellspacing="0" cellpadding="0" >'+(B?B:'<tr><td height="28" width="100%" align="center" valign="middle"><span style="width:100%;text-align:center;vertical-align:middle;background-repeat:no-repeat;font-family: trebuchet MS;">No options avaliable</span></td></tr>')+"</table>";selQuizGenre(quizGenreCursor);createQuizTitlePanel()}function updateQuizGenrePanel(B){B=parseInt(B);var A="";switch(B){case 1:A="Latest";break;case 2:A="Most Popular";break;case 3:A="Most Liked";break;case 4:A="Personality Test";break;case 5:A="Science";break;case 6:A="Music";break;case 7:A="Movie";break;case 8:A="Miscellaneous";break;case 9:A="Others";break}return A}function selQuizGenre(B){document.getElementById("quizTitleImg").innerHTML="";try{unSelQuizGenre();document.getElementById("quizGenreId"+B).style.background='url("/view/tv/images/rowGenre.png") no-repeat'}catch(A){}}function unSelQuizGenre(){try{var C=document.getElementById("quizGenrePanel");var D=C.getElementsByTagName("td");for(var B=0;B<D.length;B++){D[B].style.background=""}}catch(A){}}function resetQuizTitle(){quizRowIndex=0;quizColumnIndex=0;quizCursorIndex=0;quizTitleTotal=0;quizTitleClick=0}function onQuizTitlePanel(D,B,C){unSelQuizTitle(quizRowIndex,quizColumnIndex);var A=3*D+B;quizRowIndex=D;quizColumnIndex=B;quizCursorIndex=C;quizPanel=1;selQuizTitle(D,B)}function createQuizTitlePanel(){resetQuizTitle();var J=quizTitleCache[quizGenreIndex];document.getElementById("quizTitlePanel").innerHTML="";var A="";var B=0;var A='<tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>';for(var D=0;D<3;D++){curQuizIndex[D]=new Array(3);for(var C=0;C<3;C++){curQuizIndex[D][C]=0}}for(var F=0;(J.length>=9&&F<9)||(J.length<9&&F<J.length);++F){var I=parseInt(F/3);var H=parseInt(F%3);if(F%3==0&&F!=0){A+='</tr><tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}var G=3*I+H;curQuizIndex[I][H]=1;A+='<td id="quizTitlePanelId'+I+""+H+'" align="center" valign="middle" nowrap style="width:75px;height:75px;'+(statusInfo==1?"cursor:pointer;":"")+'" '+(statusInfo==1?" onmouseover='onQuizTitlePanel("+I+", "+H+", "+B+");' onclick='quizKeyHandler("+rcOK+");' ":"")+' ><img id="quizTitleId'+I+""+H+'" style="width:75px;height:75px;border:2px solid transparent;" src='+(parseInt(quizTitleUseGraphic[quizGenreIndex][G])==1?'"/ImageHandler?value='+quizTitleIdCache[quizGenreIndex][G]+'&icon=-1&imageType=13"':"./view/tv/images/vod/logo_none.png")+' /></td><td width="15px" height="80px" >&nbsp;</td>';B++}if(B>0){for(var E=0;E<(9-B);++E){if((B+E)%3==0){A+='</tr><tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}A+='<td id="quizTitlePanelId'+I+""+H+'" align="center" valign="middle" nowrap style="width:75px;height:80px;">&nbsp;</td><td width="15px" height="80px" >&nbsp;</td>'}}A+='</tr><tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr>';document.getElementById("quizTitlePanel").innerHTML='<table width="100%" align="left" valign="top" cellspacing="0" cellpadding="0" >'+(A?A:'<tr><td height="28" width="100%" align="center" valign="middle"><span style="width:100%;text-align:center;vertical-align:middle;background-repeat:no-repeat;">No options avaliable</span></td></tr>')+"</table>";quizTitleTotal=J.length==0?0:J.length-1}function updateQuizStatus(){var A=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][A];D=D.toString();document.getElementById("quizQuestionStatus").innerHTML=(curQuizQIndex+1)+"/"+(quizQuestionMax+1)+".";var C=0;for(var B=0;B<(ansStatusArr[curQuizQIndex]).length;B++){if(ansStatusArr[curQuizQIndex][B]!=-1){++C;document.getElementById("quizAnsOption"+B).style.background='url("/view/tv/images/selectedTick.png") no-repeat'}else{document.getElementById("quizAnsOption"+B).style.background=""}}if(C==0){document.getElementById("quizAnsOption"+C).style.background='url("/view/tv/images/keyboardSelector.png") no-repeat'}if((trim(D)).length==0){document.getElementById("quizQuestionStatus").innerHTML=(0)+"/"+0+"."}}function quizKeyHandler(J){switch(J){case rcLEFT:if(quizGenreCache.length==0){return }if(openQuizPanelStatus){var G=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][G];D=D.toString();if((trim(D)).length==0){return }--curQuizQIndex;curQuizQIndex=curQuizQIndex<0?quizQuestionMax:curQuizQIndex;if(quizIndexArr[curQuizQIndex]!=-1){var G=quizIndexArr[curQuizQIndex];document.getElementById("quizQuestionPanel").innerHTML=quizQArr[G];for(var E=0;E<4;E++){document.getElementById("quizAnsPanel"+E).innerHTML=quizAArr[G][E]}updateQuizStatus()}else{drawQuizPanel()}if(showQuizResult){showQuizResultRes(curQuizQIndex)}return }if(quizColumnIndex==0){quizPanel=0;unSelQuizTitle(quizRowIndex,quizColumnIndex);return }if(quizPanel==0){return }if(quizColumnIndex>=0){unSelQuizTitle(quizRowIndex,quizColumnIndex);--quizColumnIndex;selQuizTitle(quizRowIndex,quizColumnIndex);return }break;case rcRIGHT:if(openQuizPanelStatus){var G=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][G];D=D.toString();if((trim(D)).length==0){return }++curQuizQIndex;curQuizQIndex=curQuizQIndex>quizQuestionMax?0:curQuizQIndex;if(quizIndexArr[curQuizQIndex]!=-1){var G=quizIndexArr[curQuizQIndex];document.getElementById("quizQuestionPanel").innerHTML=quizQArr[G];for(var E=0;E<4;E++){document.getElementById("quizAnsPanel"+E).innerHTML=quizAArr[G][E]}updateQuizStatus()}else{drawQuizPanel()}if(showQuizResult){showQuizResultRes(curQuizQIndex)}return }if(quizPanel==0){selQuizTitle(quizRowIndex,quizColumnIndex);quizPanel=1;return }var A=quizRowIndex*3+quizColumnIndex;if(A==quizTitleTotal||quizColumnIndex==2){return }if(quizColumnIndex>=0){unSelQuizTitle(quizRowIndex,quizColumnIndex);quizColumnIndex++;selQuizTitle(quizRowIndex,quizColumnIndex);return }break;case rcUP:if(showQuizResult){return }if(openQuizPanelStatus){var G=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][G];D=D.toString();if((trim(D)).length==0){return }--curQuesOptIndex;curQuesOptIndex=curQuesOptIndex<0?3:curQuesOptIndex;selQuizOption(curQuesOptIndex);return }if(quizPanel==0){if(quizGenreIndex==0){return }--quizGenreIndex;if(quizGenreCursor!=0){--quizGenreCursor;selQuizGenre(quizGenreCursor)}else{var B=quizGenreIndex;var C=quizGenreIndex+9;scrollQuizGenre(B,C)}quizGenreClick=quizGenreIndex-quizGenreCursor;createQuizTitlePanel()}else{if(quizRowIndex==0){return }unSelQuizTitle(quizRowIndex,quizColumnIndex);quizRowIndex--;if(quizCursorIndex!=0){quizCursorIndex--;selQuizTitle(quizRowIndex,quizColumnIndex)}else{quizCursorIndex=0;var B=0;B=(startQuizIndex<3?0:startQuizIndex-3);startQuizIndex=B;var C=((quizTitleTotal-B)>8?(B+8):quizTitleTotal);scrollQuizTitle(B,C)}quizTitleClick=quizRowIndex-quizCursorIndex}break;case rcDOWN:if(showQuizResult){return }if(openQuizPanelStatus){var G=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][G];D=D.toString();if((trim(D)).length==0){return }++curQuesOptIndex;curQuesOptIndex=curQuesOptIndex>3?0:curQuesOptIndex;selQuizOption(curQuesOptIndex);return }if(quizPanel==0){if(quizGenreIndex==quizGenreTotal){return }++quizGenreIndex;if(quizGenreCursor<9){++quizGenreCursor;selQuizGenre(quizGenreCursor)}else{var B=quizGenreIndex-9;var C=quizGenreIndex;scrollQuizGenre(B,C)}quizGenreClick=quizGenreIndex-quizGenreCursor;createQuizTitlePanel()}else{var I=quizCursorIndex+1;var H=quizColumnIndex;if(I<3){if(curQuizIndex[I][H]==0){return }}var F=(quizTitleTotal/3);if(quizRowIndex==parseInt(F)){return }unSelQuizTitle(quizRowIndex,quizColumnIndex);quizRowIndex++;if(quizCursorIndex<2){quizCursorIndex++;selQuizTitle(quizRowIndex,quizColumnIndex)}else{var B=0;if(quizRowIndex<3){B=quizRowIndex;startQuizIndex=B}else{B=startQuizIndex+3;startQuizIndex=B}quizCursorIndex=2;var C=((quizTitleTotal-B)>8?(B+8):quizTitleTotal);scrollQuizTitle(B,C)}quizTitleClick=quizRowIndex-quizCursorIndex}break;case rcOK:if(showQuizResult){return }if(openQuizPanelStatus){var G=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][G];D=D.toString();if((trim(D)).length==0){return }if(ansStatusArr[curQuizQIndex][curQuesOptIndex]==-1){for(var E=0;E<(ansStatusArr[curQuizQIndex]).length;E++){ansStatusArr[curQuizQIndex][E]=-1;document.getElementById("quizAnsOption"+E).style.background=""}ansStatusArr[curQuizQIndex][curQuesOptIndex]=curQuesOptIndex;document.getElementById("quizAnsOption"+curQuesOptIndex).style.background='url("/view/tv/images/selectedTick.png") no-repeat'}else{ansStatusArr[curQuizQIndex][curQuesOptIndex]=-1;document.getElementById("quizAnsOption"+curQuesOptIndex).style.background='url("/view/tv/images/keyboardSelector.png") no-repeat'}return }if(quizPanel==1){var G=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][G];D=D.toString();gotoQuizPanel();document.getElementById("quizControlPanel").style.visibility="visible";document.getElementById("quizContentPanel").style.visibility="hidden";quizResponse=true;openQuizPanelStatus=true}break;case rcMENU:if(quizResponse){var G=3*quizRowIndex+quizColumnIndex;var D=quizQuestionCache[quizGenreIndex][G];D=D.toString();if((trim(D)).length==0){showQuizResult=true}if(showQuizResult){showQuizResult=false;quizResponse=false;openQuizPanelStatus=false;document.getElementById("openChartId").innerHTML="";document.getElementById("quizControlPanel").style.visibility="hidden";document.getElementById("quizContentPanel").style.visibility="visible"}else{showQuizResult=true;calculateQuizResult();showQuizResultRes(curQuizQIndex)}}else{document.getElementById("quizContentPanel").style.visibility="hidden";quizActive=false;showGoPanel();showGuidePanel()}break}}function showQuizResultRes(B){var A="";if(wrngQuizAns[B]!=-1){A="Wrong!"}else{A="Correct!"}document.getElementById("quizResultMsg").innerHTML=A;if(quizIndexArr[B]!=-1){B=quizIndexArr[B]}B=correctAnsArr[B];document.getElementById("quizCorrectedAns").innerHTML="Correct answer is <b>"+(B==0?"a":(B==1?"b":(B==2?"c":"d")))+"</b>."}function calculateQuizResult(){for(var C=0;C<ansStatusArr.length;C++){var B=quizIndexArr[C];var D=0;for(var A=0;A<ansStatusArr[C].length;A++){if(correctAnsArr[B]==ansStatusArr[C][A]){++D}}if(D!=0){++correctQuizSCore;wrngQuizAns[C]=-1}else{wrngQuizAns[C]=C}}document.getElementById("quizResponseMsg").innerHTML="Total corrected "+(correctQuizSCore<=1?"question is ":"questions are ")+correctQuizSCore+"."}function gotoQuizPanel(){var A=3*quizRowIndex+quizColumnIndex;resetQuizPanel(A);drawQuizPanel()}function openFlashQuiz(){document.getElementById("openChartId").innerHTML='<object height="422" width="624" id="online-jigsaw-puzzles-big" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="high" name="quality"/><param value="noscale" name="scale"/><param value="#F3F4FFF" name="bgcolor"/><param value="./view/tv/flash/quiz/online-jigsaw-puzzles-big.swf?loadgame=./view/tv/flash/quiz/flash/duckling_s_1.swf&amp;defback=2&amp;quote=" name="movie"/><embed height="422" align="" width="624" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="online-jigsaw-puzzles-big" bgcolor="#FFFFFF" scale="noscale" quality="high" src="./view/tv/flash/quiz/online-jigsaw-puzzles-big.swf?loadgame=./view/tv/flash/quiz/flash/duckling_s_1.swf&amp;defback=2&amp;quote="/></object>'}function saveQuizInfo(){try{quizSelArrIndex[quizGenreIndex][quizTitleIndex]=0;for(var B=0;B<8;B++){hideQuizSelImg(B)}}catch(A){}}function updateQuizDesc(D,B){try{var C=3*D+B;document.getElementById("quizTitleImg").innerHTML=quizTitleDescCache[quizGenreIndex][C]}catch(A){alert(A)}}function selQuizTitle(D,B){updateQuizDesc(D,B);try{document.getElementById("quizTitleId"+D+""+B).style.border="2px solid white"}catch(A){try{--quizRowIndex;--quizCursorIndex;selQuizTitle(quizRowIndex,quizColumnIndex)}catch(C){return }}}function unSelQuizTitle(C,B){try{document.getElementById("quizTitleImg").innerHTML="";document.getElementById("quizTitleId"+C+""+B).style.border="2px solid transparent"}catch(A){}}function scrollQuizGenre(E,A){var B="";var D=0;for(var C=E;C<=A;++C){document.getElementById("quizGenreId"+D).innerHTML=updateQuizGenrePanel(quizGenreCache[C]);++D}}function scrollQuizTitle(A,F){quizPanel=1;var H;var C=0;for(var E=0;E<3;E++){curSpIndexArr[E]=new Array(3);for(var D=0;D<3;D++){curQuizIndex[E][D]=0}}var L=quizTitleCache[quizGenreIndex];document.getElementById("quizTitlePanel").innerHTML="";var B='<tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>';for(H=A;H<=F;++H){var K=parseInt(H/3);var J=parseInt(H%3);if(H%3==0&&H!=0&&C!=0){B+='</tr><tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}curQuizIndex[parseInt(C/3)][parseInt(C%3)]=1;var I=3*K+J;B+='<td align="center" valign="middle" nowrap style="width:75px;height:75px;'+(statusInfo==1?"cursor:pointer;":"")+'" '+(statusInfo==1?" onmouseover='onQuizTitlePanel("+K+", "+J+", "+C+");' onclick='quizKeyHandler("+rcOK+");' ":"")+' ><img id="quizTitleId'+K+""+J+'" style="width:75px;height:75px;border:2px solid transparent;" src='+(parseInt(quizTitleUseGraphic[quizGenreIndex][H])==1?'"/ImageHandler?value='+quizTitleIdCache[quizGenreIndex][H]+'&icon=-1&imageType=13"':"./view/tv/images/vod/logo_none.png")+' /></td><td width="15px" height="80px" >&nbsp;</td>';C++}if(C>0){for(var G=0;G<(9-C);++G){if((C+G)%3==0){B+='</tr><tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr><tr><td width="15px" height="80px">&nbsp;</td>'}B+='<td align="center" valign="middle" nowrap style="width:75px;height:80px;" onclick="quizKeyHandler('+rcOK+');" onmouseover="onQuizualTitle('+H+');">&nbsp;</td><td width="15px" height="80px" >&nbsp;</td>'}}B+='</tr><tr><td colspan="7" width="400px" height="10px">&nbsp;</td></tr>';document.getElementById("quizTitlePanel").innerHTML='<table width="100%" align="left" valign="top" cellspacing="0" cellpadding="0" >'+(B?B:'<tr><td height="28" width="100%" align="center" valign="middle"><span style="width:100%;text-align:center;vertical-align:middle;background-repeat:no-repeat;">No options avaliable</span></td></tr>')+"</table>";selQuizTitle(quizRowIndex,quizColumnIndex)}function showQuizSelImg(B){try{document.getElementById("quizTitleSelId"+B).style.visibility="visible"}catch(A){}}function hideQuizSelImg(B){try{document.getElementById("quizTitleSelId"+B).style.visibility="hidden"}catch(A){}}function showQuizNavPanel(A,C){var B=C==1?"skyBlue":"";document.getElementById("quizPanelMove"+A).style.background=B}function moveQuizPanel(A){var B=A==1?rcUP:rcDOWN;quizKeyHandler(B)}function onQuizHome(B){var A=(B==1?"skyBlue":"");document.getElementById("quizPanelHome").style.background=A}function escapeQuizPanel(){quizKeyHandler(rcMENU)}function onQuizAnsPanel(A){unSelQuizOption();curQuesOptIndex=A;selQuizOption(curQuesOptIndex)}function selQuizSelOption(A){quizKeyHandler(rcOK)}function changeQuizQues(B,A){document.getElementById("quizImg"+B).style.background=(A==1?"skyBlue":"")}