var gameMenuGenreCache=new Array();var gameMenuGenreTitle=new Array();var gameMenuTitleDesc=new Array();var gameMenuTitleIdCache=new Array();var swfTitleCache=new Array();var gameMenuActive=false;var gameMenuStatus=false;var exitGameMenu=false;var curGameMenuIndex=new Array();var gameMenuGenreIndex=0;var gameMenuGenreTotal=0;var gameMenuGenreCursor=0;var gameMenuRowIndex=0;var gameMenuColIndex=0;var gameMenuCursorIndex=0;var gameMenuTitleTotal=0;var gameMenuPanel=0;var startGameMenuIndex=0;var gameMenuWidgetId=0;function hideResetImage(){document.getElementById("resetGamePanel").style.visibility="hidden"}function showResetImage(){document.getElementById("resetGamePanel").style.visibility="visible"}function resetGameMenu(){hideResetImage();exitGameMenu=true;gameMenuStatus=false;gameMenuActive=false;gameMenuGenreCursor=0;gameMenuGenreTotal=0;gameMenuGenreIndex=0;curGameMenuIndex=new Array();gameMenuRowIndex=0;gameMenuColIndex=0;gameMenuCursorIndex=0;gameMenuTitleTotal=0;gameMenuPanel=0;gameMenuGenreCache=new Array();gameMenuGenreTitle=new Array();gameMenuTitleDesc=new Array();gameMenuTitleIdCache=new Array();swfTitleCache=new Array()}function getGameMenuInfo(){var A="method=getGameMenuInfo&widgetId="+gameMenuWidgetId+"&serial="+serial;createAjaxRequest();if(ajaxRequest==null){return }ajaxRequest.onreadystatechange=function(){if(ajaxRequest.readyState==4){if(ajaxRequest.status==200){if(ajaxRequest.responseText=="recall"){getGameMenuInfo()}else{var B=ajaxRequest.responseText;if(B.length>0){var E=B.split("-?#-");gameMenuGenreCache=(E[0]).split("-*$-");var D=(E[1]).split("-*$-");gameMenuGenreTitle=new Array(D.length);for(var C=0;C<D.length;C++){gameMenuGenreTitle[C]=(D[C]).split("-@#-")}D=(E[2]).split("-*$-");gameMenuTitleIdCache=new Array(D.length);for(var C=0;C<D.length;C++){gameMenuTitleIdCache[C]=(D[C]).split("-@#-")}D=(E[3]).split("-*$-");gameMenuTitleDesc=new Array(D.length);for(var C=0;C<D.length;C++){gameMenuTitleDesc[C]=(D[C]).split("-@#-")}D=(E[4]).split("-*$-");gameMenuFileNameCache=new Array(D.length);for(var C=0;C<D.length;C++){gameMenuFileNameCache[C]=(D[C]).split("-@#-")}}drawGameMenuGenre();showGamePanel();hideResetImage()}}else{if(ajaxRequest.status==500){failureInfo()}}}};ajaxRequest.open("POST","/TvHandler",true);ajaxRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajaxRequest.send(A);return false}function drawGamePanelMenu(){gameMenuStatus=false;gameMenuActive=true;gameMenuPanel=0;exitGameMenu=true;drawGameMenuGenre();showGamePanel();hideResetImage()}function getGameMenuGenre(B){B=parseInt(B);var A="";switch(B){case -1:A="Latest Games";break;case 1:A="Arcade";break;case 2:A="Adventure Games";break;case 3:A="Fishing Games";break;case 4:A="Multiplayer";break;case 5:A="Puzzle Games";break;case 6:A="Racing Games";break;case 7:A="Shooting";break;case 8:A="Others";break}return A}function initializeGameMenu(){return ;gameMenuGenreCache=new Array("Latest Games","Multiplayer","Arcade","Shooting","Fighing Games","Adventure Games","Racing Games","Puzzle Games");gameMenuGenreTitle=new Array(["Checker","Minesweeper","Tic Tac Toe","Chess"],["Conquer Antarctica Multiplayer","Multiplayer Bunny Wars","Multiplayer Chess","Match 4","Multiplayer Checkers"],["18 Wheeler","Chain Reaction","Crash Down","Fly Plane","Go Green Go","Ice Castle Blaster","Jumping Troll","Little Shepherd"],["A.L.I.A.S","A.L.I.A.S 3","Army of Destruction","Battle Over Berlin"],["Alpha Bravo Charlie","Bully Basher","Fat Ninja","Mobs Down"],["Advanced Ninja","Baby Blimp","Dungeon Hunt","Fat Fred"],["4x4 Rally","Big Truck Adventures 2","Boat Rush","Dune Bashing"],["3D Reversi","Amoebas","Arms Dealer","Block N Roll","Bubble Maker"]);gameMenuTitleDesc=new Array(["Checker","Minesweeper","Tic Tac Toe","Chess"],["The multiplayer version of this Antarctic domination game. Shoot your evil rival penguins to oblivion!","Time for some bunny whacking puzzle game action! Dominate the playing field with your bunnies!","Practice your logic skills on this online game of chess! Revisit the best classic game of all time!","Up for a game of match 4? Test your logic skills by playing against other people in this fun multiplayer game!","Try this classic game with players from around the world!"],["Put your truck driving skills to the test. How quick can you park the 18 wheeler?","An atom bomb is triggered by a chain reaction. Try to ignite a chain reaction here by yourself!","Try to eliminate rows of the same color, but if it builds up too much you will lose the game.","Just try to fly up your plane and collect as many red dots as you possible!","Control your UFO and clear all the levels by landing it accurately on the destination platforms in least possible time.","Demolish the castles in front of you using your catapult. Time to blast some ice castles!","Help the troll to bounce on the mushroom, collect all the fruits and light up the rings while avoiding the baddies","Take part in the sheep herding competition and guide your sheep safely into the fences."],["Fight your way through this side scrolling shooter as A.L.I.A.S (Artificial Lifeform Intended for Assassination and Sabotage).","A.L.I.A.S has finally identified his human nature! He has decided to take revenge against the evil humans who turned him into a war machine!","Defend your city in this futuristic defense-thriller game!","Battle your way in the skies of berlin for aerial supremacy.. How good are you at dogfighting?"],["In this helicopter recon game, your mission is to pick up the stranded and wounded special-op's servicemen returning from missions.","As a gloves-and-glasses-wearing kid, kick some bully ass!","Control the fat ninja and clear various exciting levels by killing all the security agents without getting spotted","Back to basic good old street fighting game."],["You must master the use of the grappling hook to scale walls and do crazy cliffhanger moves to reach your destination. Avoid falling off from a high elevation or you will die.","Babies are delivered by storks! Help them prepare their precious cargo for delivery on the baby production line.","Can you escape the dungeon? Try this great survival horror game!","Help Fat Fred to eat hamburgers, in this nice online game and score maximum points."],["Extreme 4x4 on and off road racing game, Race against 4 other drivers on ice, through cities, swamps, deserts, forest etc... with score board.","Extreme 4x4 on and off road racing game, Race against 4 other drivers on ice, through cities, swamps, deserts, forest etc... with score board.","Your objective is to safely navigate your boat in the river, and do it before its too late!","Take this challenging journey through the massive sand dunes of Dubai riding a quad bike and try to complete all the levels."],["Beat your opponent by converting all the Reversi pieces on the board into yours before the game ends","Become the predatory amoeba in this simple but very addicting game!","Buy passports, fly around and trade weapons!","Roll the block in this interesting 3d puzzle game!","Play this interesting flash game and catch as many cherry flowers as you can before time runs out."])}function launchGameMenu(A){gameMenuWidgetId=A;resetGameMenu();document.getElementById("gameImagePanel").innerHTML='<img  height="36px" width="36px" alt="games" id="widgetIcon1" src="/view/tv/images/widgets/logoPanel27.png"  />';document.getElementById("gameTitlePanel").innerHTML="Games";gameMenuStatus=false;gameMenuActive=true;getGameMenuInfo()}function getGameMenuInfoOther(){initializeGameMenu();drawGameMenuGenre();showGamePanel();hideResetImage()}function drawGameMenuGenre(){document.getElementById("gameId").innerHTML='<table widht="625px" height="100%"><tr><td id="gameMenuGenreId" widht="20%" valign="top" height="100%" style="vertical-align:top;border-right:1px solid LightSlateGray;font-family:trebuchet MS;font-size:15px;"></td><td id="gameMenuTitleId" widht="80%" height="100%"></td></tr></table>';var B="";var A=0;for(A=0;(gameMenuGenreCache.length>10&&A<10)||(gameMenuGenreCache.length<=10&&A<gameMenuGenreCache.length);++A){B+='<tr><td aling="left" id="gameMenuGenreId'+A+'" '+(statusInfo==1?'style="text-align:left;cursor:pointer;font-weight:bolder;" onmouseover="onGameMenuPanel('+A+');"':' style="text-align:left;font-weight:bolder;" ')+' width="155px" height="30px" valign=center nowrap>&nbsp;&nbsp;&nbsp;'+getGameMenuGenre(gameMenuGenreCache[A])+"</td></tr>"}document.getElementById("gameMenuGenreId").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="30px" valign="middle" align="center" nowrap>'+records.key372+"</td></tr>")+"</table>";gameMenuGenreTotal=gameMenuGenreCache.length==0?0:gameMenuGenreCache.length-1;selGameMenuGenre(gameMenuGenreCursor);drawGameMenuTitle()}function onGameMenuPanel(A){unSelGameMenuGenre(gameMenuGenreCursor);gameMenuGenreCursor=A;gameMenuGenreIndex=A;gameMenuPanel=0;selGameMenuGenre(A);drawGameMenuTitle()}function selGameMenuGenre(B){document.getElementById("messagePanel").innerHTML="";try{document.getElementById("gameMenuGenreId"+B).style.backgroundImage='url("/view/tv/images/rowGenre.png")';document.getElementById("gameMenuGenreId"+B).style.backgroundRepeat="no-repeat"}catch(A){}}function unSelGameMenuGenre(B){try{document.getElementById("gameMenuGenreId"+B).style.backgroundImage="none"}catch(A){}}function scrollGameMenu(F,A){var D=0;for(var C=F;C<=A;++C){var E="gameMenuGenreId"+D;var B=getGameMenuGenre(gameMenuGenreCache[C]);document.getElementById(E).innerHTML="&nbsp;&nbsp;&nbsp;"+(B.length>16?B:B);D++}}function returnCurGameMenuIndex(){var A=new Array();if(gameMenuIndex[gameMenuGenreIndex].length>0){A=(gameMenuIndex[gameMenuGenreIndex])}gameMenuTitleTotal=A.length-1;return A}function resetGameMenuTitle(){curGameMenuIndex=new Array();gameMenuRowIndex=0;gameMenuColIndex=0;gameMenuCursorIndex=0;gameMenuTitleTotal=0}function drawGameMenuTitle(){resetGameMenuTitle();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++){curGameMenuIndex[D]=new Array(3);for(var C=0;C<3;C++){curGameMenuIndex[D][C]=0}}titleCache=new Array();titleCache=gameMenuGenreTitle[gameMenuGenreIndex];for(var F=0;(titleCache.length>=9&&F<9)||(titleCache.length<9&&F<titleCache.length);++F){var I=parseInt(F/3);var G=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 H=3*I+G;curGameMenuIndex[I][G]=1;var J=(gameMenuGenreIndex==0?"./view/tv/images/widgets/gameMenu/gameMenu"+(gameMenuGenreIndex+1)+"/gameMenu"+(gameMenuGenreIndex+1)+""+(F+1)+(gameMenuGenreIndex+1==1?".png":".jpg"):"/ImageHandler?value="+gameMenuTitleIdCache[gameMenuGenreIndex][H]+"&icon=-1&imageType=11");A+='<td id="gameMenuTitlePanelId'+I+""+G+'" align="center" valign="middle" nowrap style="width:80px;height:80px;'+(statusInfo==1?"cursor:pointer;":"")+'" '+(statusInfo==1?" onmouseover='selGameMenuTitlePanel("+I+", "+G+", "+F+");' onclick='gameMenuKeyHandler("+rcOK+");' ":"")+' ><img id="gameMenuTitle'+I+""+G+'" style="width:75px;height:75px;background:darkolivegreen;border:2px solid gray;" src="'+J+'" /></td><td width="15px" height="80px" >&nbsp;</td>';B++}if(B>0){for(var E=0;E<(9-B);++E){var I=parseInt((E+B)/3);var G=parseInt((E+B)%3);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="gameMenuTitlePanelId'+I+""+G+'" align="center" valign="middle" nowrap style="width:80px;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("gameMenuTitleId").innerHTML='<table width="100%" align="left" valign="top" cellspacing="0" cellpadding="0" >'+(titleCache.length>0?A:'<tr><td height="28" width="400px" 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>";gameMenuTitleTotal=titleCache.length-1}function selGameMenuTitle(C,B){gameMenuPanel=1;try{gameMenuDesc(C,B)}catch(A){}try{document.getElementById("gameMenuTitle"+C+""+B).style.border="2px solid Cyan"}catch(A){--gameMenuRowIndex;--gameMenuCursorIndex;selGameMenuTitle(gameMenuRowIndex,gameMenuColIndex)}}function unSelGameMenuTitle(C,B){try{document.getElementById("gameMenuTitle"+C+""+B).style.border="2px solid gray"}catch(A){alert(A)}}function selGameMenuTitlePanel(C,B,A){unSelGameMenuTitle(gameMenuCursorIndex,gameMenuColIndex);gameMenuRowIndex=parseInt(A/3);gameMenuColIndex=B;gameMenuCursorIndex=C;selGameMenuTitle(C,B)}function gameMenuDesc(E,B){var A=3*E+B;var D=gameMenuTitleDesc[gameMenuGenreIndex][A];var C=gameMenuGenreTitle[gameMenuGenreIndex][A];document.getElementById("messagePanel").innerHTML='<table width="100%" height="100%"><tr><td align="left" width="40%" nowrap id="messageTitle" style="font-size:16px;"></td><td style="font-size:12px;" width="60%" align="right" nowrap id="messageDesc"></td></tr></table>';document.getElementById("messageTitle").innerHTML=(C.length>20?C.substring(0,20)+"..":C);document.getElementById("messageDesc").innerHTML=(D.length>40?D.substring(0,40)+"..":D)}function openSelectGame(C,B){if(C==0){showResetImage();switch(B){case 0:gameMenuStatus=true;gameMenuActive=false;var A=wrecords.wRecords[currImage].useGraphic;A=A.substring(0,(A.length-1));document.getElementById("gameImagePanel").innerHTML='<img  height="36px" width="36px" alt="'+wrecords.wRecords[currImage].title+'" id="widgetIcon1" src='+(A==1?"/ImageHandler?value="+wrecords.wRecords[currImage].id+"&icon=2&imageType=2":"/view/tv/images/widgets/logoPanel27.png")+"  />";document.getElementById("gameTitlePanel").innerHTML=wrecords.wRecords[currImage].title;hideControlPanelActive();gameActive=true;createCrackerGamePanel();showGamePanel();saveTimeLineData("Widget","Checkers",1);break;case 1:gameMenuStatus=true;gameMenuActive=false;var A=wrecords.wRecords[currImage].useGraphic;A=A.substring(0,(A.length-1));document.getElementById("gameImagePanel").innerHTML='<img  height="36px" width="36px" alt="'+wrecords.wRecords[currImage].title+'" id="widgetIcon1" src='+(A==1?"/ImageHandler?value="+wrecords.wRecords[currImage].id+"&icon=2&imageType=2":"/view/tv/images/widgets/logoPanel27.png")+"  />";document.getElementById("gameTitlePanel").innerHTML=wrecords.wRecords[currImage].title;gameActive=true;hideControlPanelActive();initMineSweeper();saveTimeLineData("Widget","MineSweeper",1);break;case 2:gameMenuStatus=true;gameMenuActive=false;var A=wrecords.wRecords[currImage].useGraphic;A=A.substring(0,(A.length-1));document.getElementById("gameImagePanel").innerHTML='<img  height="36px" width="36px" alt="'+wrecords.wRecords[currImage].title+'" id="widgetIcon1" src='+(A==1?"/ImageHandler?value="+wrecords.wRecords[currImage].id+"&icon=2&imageType=2":"/view/tv/images/widgets/logoPanel27.png")+"  />";document.getElementById("gameTitlePanel").innerHTML=wrecords.wRecords[currImage].title;gameActive=true;hideControlPanelActive();createTicTacToePanel();showGamePanel();saveTimeLineData("Widget","Tic-Tac-Toe",1);break;case 3:gameMenuStatus=true;gameMenuActive=false;var A=wrecords.wRecords[currImage].useGraphic;A=A.substring(0,(A.length-1));document.getElementById("gameImagePanel").innerHTML='<img  height="36px" width="36px" alt="'+wrecords.wRecords[currImage].title+'" id="widgetIcon1" src='+(A==1?"/ImageHandler?value="+wrecords.wRecords[currImage].id+"&icon=2&imageType=2":"/view/tv/images/widgets/logoPanel27.png")+"  />";document.getElementById("gameTitlePanel").innerHTML=wrecords.wRecords[currImage].title;gameActive=true;hideControlPanelActive();loadChessPanel();saveTimeLineData("Widget","Chess",1);break}}else{document.getElementById("openChartId").innerHTML='<object height="422" width="625"><param name="movie" value="./games/'+gameMenuFileNameCache[C][B]+'"/><param value="sameDomain" name="allowScriptAccess"/><param value="true" name="allowFullScreen"/><param value="high" name="quality"/><param value="#000000" name="bgcolor"/><param value="opaque" name="wmode"/><embed height="422" align="middle" width="625" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="sameDomain" bgcolor="#000000" quality="high" src="./games/'+gameMenuFileNameCache[C][B]+'" wmode="transparent"/></object>'}}function gameMenuKeyHandler(F){switch(F){case rcOK:if(gameMenuPanel==0){return }exitGameMenu=false;fadeAll();if(gameMenuGenreIndex!=0){document.getElementById("homePanelImage").style.visibility="visible"}var E=3*gameMenuRowIndex+gameMenuColIndex;openSelectGame(gameMenuGenreIndex,E);break;case rcMENU:document.getElementById("openChartId").innerHTML="";document.getElementById("homePanelImage").style.visibility="hidden";if(gameMenuActive){if(exitGameMenu){hideResetImage();exitGameMenu=false;gameMenuActive=false;gameMenuStatus=false;gameActive=false;resetGameMenu();showGoPanel();showGuidePanel()}else{showGamePanel();hideResetImage();exitGameMenu=true}}else{hideResetImage();gameMenuActive=false;gameMenuStatus=false;gameActive=false;resetGameMenu();showGoPanel();showGuidePanel()}break;case rcLEFT:if(gameMenuColIndex==0){gameMenuPanel=0;unSelGameMenuTitle(gameMenuRowIndex,gameMenuColIndex);return }if(gameMenuPanel==0){return }if(gameMenuColIndex>=0){unSelGameMenuTitle(gameMenuRowIndex,gameMenuColIndex);--gameMenuColIndex;selGameMenuTitle(gameMenuRowIndex,gameMenuColIndex);return }break;break;case rcRIGHT:if(gameMenuPanel==0){selGameMenuTitle(gameMenuRowIndex,gameMenuColIndex);gameMenuPanel=1;return }var B=gameMenuRowIndex*3+gameMenuColIndex;if(B==gameMenuTitleTotal||gameMenuColIndex==2){return }if(gameMenuColIndex>=0){unSelGameMenuTitle(gameMenuRowIndex,gameMenuColIndex);gameMenuColIndex++;selGameMenuTitle(gameMenuRowIndex,gameMenuColIndex);return }break;case rcUP:if(gameMenuPanel==0){if(gameMenuGenreIndex==0){return }gameMenuGenreIndex--;if(gameMenuGenreCursor!=0){unSelGameMenuGenre(gameMenuGenreCursor);gameMenuGenreCursor--;selGameMenuGenre(gameMenuGenreCursor)}else{var H=gameMenuGenreIndex;var A=gameMenuGenreIndex+9;scrollGameMenu(H,A)}drawGameMenuTitle();return }if(gameMenuRowIndex==0){return }unSelGameMenuTitle(gameMenuCursorIndex,gameMenuColIndex);gameMenuRowIndex--;if(gameMenuCursorIndex!=0){gameMenuCursorIndex--;selGameMenuTitle(gameMenuCursorIndex,gameMenuColIndex)}else{var H=0;H=(startGameMenuIndex<3?0:startGameMenuIndex-3);startGameMenuIndex=H;var A=((gameMenuTitleTotal-H)>8?(H+8):gameMenuTitleTotal);scrollGameMenuTitle(H,A)}break;case rcDOWN:if(gameMenuPanel==0){if(gameMenuGenreIndex==gameMenuGenreTotal){return }gameMenuGenreIndex++;if(gameMenuGenreCursor<9){unSelGameMenuGenre(gameMenuGenreCursor);gameMenuGenreCursor++;selGameMenuGenre(gameMenuGenreCursor)}else{var H=gameMenuGenreIndex-9;var A=gameMenuGenreIndex;scrollGameMenu(H,A)}drawGameMenuTitle();return }var G=gameMenuCursorIndex+1;var D=gameMenuColIndex;if(G<3){if(curGameMenuIndex[G][D]==0){return }}var C=(gameMenuTitleTotal/3);if(gameMenuRowIndex==parseInt(C)){return }unSelGameMenuTitle(gameMenuCursorIndex,gameMenuColIndex);gameMenuRowIndex++;if(gameMenuCursorIndex<2){gameMenuCursorIndex++;selGameMenuTitle(gameMenuCursorIndex,gameMenuColIndex)}else{var H=0;if(gameMenuRowIndex<3){H=gameMenuRowIndex;startGameMenuIndex=H}else{H=startGameMenuIndex+3;startGameMenuIndex=H}gameMenuCursorIndex=2;var A=((gameMenuTitleTotal-H)>8?(H+8):gameMenuTitleTotal);scrollGameMenuTitle(H,A)}break}}function scrollGameMenuTitle(B,C){for(var E=0;E<3;E++){for(var D=0;D<3;D++){document.getElementById("gameMenuTitlePanelId"+E+""+D).innerHTML="&nbsp;"}}var F=0;for(var E=B;E<=C;E++){var H=parseInt(F/3);var G=parseInt(F%3);var I=(gameMenuGenreIndex==0?"./view/tv/images/widgets/gameMenu/gameMenu"+(gameMenuGenreIndex+1)+"/gameMenu"+(gameMenuGenreIndex+1)+""+(E+1)+(gameMenuGenreIndex+1==1?".png":".jpg"):"/ImageHandler?value="+gameMenuTitleIdCache[gameMenuGenreIndex][E]+"&icon=-1&imageType=11");var A='<img id="gameMenuTitle'+H+""+G+'" style="width:75px;height:75px;background:darkolivegreen;border:2px solid gray;" src="'+I+'" />';document.getElementById("gameMenuTitlePanelId"+E+""+D).innerHTML=A;++F}}