var isWeatherAssigned=false;var minTemp=new Array();var maxTemp=new Array();var weatherStatus=new Array();function launchWeatherPanel(A){getWeatherDetails(A)}function presentDate(C){var D=new Date();D.setTime(D.getTime()+C*24*60*60*1000);var B=D.getMonth();B++;var E=D.getDate();var A=B+"/"+E;return A}function presentDay(){var B=new Date();var A=B.getDay();return A}function currentDay(A){if(A>6){A=A-7}if(A==0){A="Sun"}else{if(A==1){A="Mon"}else{if(A==2){A="Tue"}else{if(A==3){A="Wed"}else{if(A==4){A="Thu"}else{if(A==5){A="Fri"}else{if(A==6){A="Sat"}}}}}}}return A}function currentMonth(A){if(A==0){A="Jan"}else{if(A==1){A="Feb"}else{if(A==2){A="Mar"}else{if(A==3){A="Apr"}else{if(A==4){A="May"}else{if(A==5){A="Jun"}else{if(A==6){A="Jul"}else{if(A==7){A="Aug"}else{if(A==8){A="Sep"}else{if(A==9){A="Oct"}else{if(A==10){A="Nov"}else{if(A==11){A="Dec"}}}}}}}}}}}}return A}function paintWeatherHtml(){document.getElementById("weatherAssigned").innerHTML='<tr><td><table width="580px" height="200px" border="0" cellspacing="0" cellpadding="0"><tr><td width="80px" height="200px" align="center" valign="top" ><table width="80px" height="200px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="left" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"><span id="day1" class="temperature"></span></td></tr></table></td></tr><tr><td align="left" width="80px" height="60px" valign="middle"><table width="80px" height="60px" align="center" valign="top" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" id="weatherImg1" valign="top"></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>H &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="highTemp1" class="temperature" align="left">H 26&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="middle"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>L &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="lowTemp1" class="temperature" align="left">L 20&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="80px" valign="middle"><table width="80px" height="80px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="center" valign="middle" nowrap><span class="temperature">&nbsp;</span></td></tr></table></td></tr></table></td><td width="3px" height="250px" align="left" valign="top" ><table width="3px" height="250px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;border-left:1px solid #59718c;"><tr><td align="left" width="3px" height="250px" valign="top"><table width="3px" height="250px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"></td></tr></table></td></tr></table></td><td width="80px" height="200px" align="center" valign="top" ><table width="80px" height="200px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="left" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"><span id="day2" class="temperature"></span></td></tr></table></td></tr><tr><td align="left" width="80px" height="60px" valign="middle"><table width="80px" height="60px" align="center" valign="top" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" id="weatherImg2" valign="top"></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>H &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="highTemp2" class="temperature" align="left">H 43&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="middle"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>L &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="lowTemp2" class="temperature" align="left">L 35&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="80px" valign="middle"><table width="80px" height="80px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="center" valign="middle" nowrap><span class="temperature">&nbsp;</span></td></tr></table></td></tr></table></td><td width="3px" height="250px" align="left" valign="top" ><table width="3px" height="250px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;border-left:1px solid #59718c;"><tr><td align="left" width="3px" height="250px" valign="top"><table width="3px" height="250px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"></td></tr></table></td></tr></table></td><td width="80px" height="200px" align="center" valign="top" ><table width="80px" height="200px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="left" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"><span id="day3" class="temperature"></span></td></tr></table></td></tr><tr><td align="left" width="80px" height="60px" valign="middle"><table width="80px" height="60px" align="center" valign="top" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" id="weatherImg3" valign="top"></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>H &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="highTemp3" class="temperature" align="left">H 33&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="middle"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>L &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="lowTemp3" class="temperature" align="left">L 24&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="80px" valign="middle"><table width="80px" height="80px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="center" valign="middle" nowrap><span class="temperature">&nbsp;</span></td></tr></table></td></tr></table></td><td width="3px" height="250px" align="left" valign="top" ><table width="3px" height="250px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;border-left:1px solid #59718c;"><tr><td align="left" width="3px" height="250px" valign="top"><table width="3px" height="250px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"></td></tr></table></td></tr></table></td><td width="80px" height="200px" align="center" valign="top" ><table width="80px" height="200px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="left" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"><span id="day4" class="temperature"></span></td></tr></table></td></tr><tr><td align="left" width="80px" height="60px" valign="middle"><table width="80px" height="60px" align="center" valign="top" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" id="weatherImg4" valign="top"></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>H &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="highTemp4" class="temperature" align="left">H 20&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="middle"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>L &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="lowTemp4" class="temperature" align="left">L 15&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="80px" valign="middle"><table width="80px" height="80px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="center" valign="middle" nowrap><span class="temperature">&nbsp;</span></td></tr></table></td></tr></table></td><td width="3px" height="250px" align="left" valign="top" ><table width="3px" height="250px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;border-left:1px solid #59718c;"><tr><td align="left" width="3px" height="250px" valign="top"><table width="3px" height="250px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"></td></tr></table></td></tr></table></td><td width="80px" height="200px" align="center" valign="top" ><table width="80px" height="200px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="left" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"><span id="day5" class="temperature"></span></td></tr></table></td></tr><tr><td align="left" width="80px" height="60px" valign="middle"><table width="80px" height="60px" align="center" valign="top" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" id="weatherImg5" valign="top"></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>H &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="highTemp5" class="temperature" align="left">H 40&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="middle"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>L &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="lowTemp5" class="temperature" align="left">L 29&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="80px" valign="middle"><table width="80px" height="80px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="center" valign="middle" nowrap><span class="temperature">&nbsp;</span></td></tr></table></td></tr></table></td><td width="3px" height="250px" align="left" valign="top" ><table width="3px" height="250px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;border-left:1px solid #59718c;"><tr><td align="left" width="3px" height="250px" valign="top"><table width="3px" height="250px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"></td></tr></table></td></tr></table></td><td width="80px" height="200px" align="center" valign="top" ><table width="80px" height="200px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="left" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"><span id="day6" class="temperature"></span></td></tr></table></td></tr><tr><td align="left" width="80px" height="60px" valign="middle"><table width="80px" height="60px" align="center" valign="top" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" id="weatherImg6" valign="top"></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>H &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="highTemp6" class="temperature" align="left">H 30&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="middle"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>L &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="lowTemp6" class="temperature" align="left">L 22&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="80px" valign="middle"><table width="80px" height="80px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="center" valign="middle" nowrap><span class="temperature">&nbsp;</span></td></tr></table></td></tr></table></td><td width="3px" height="250px" align="left" valign="top" ><table width="3px" height="250px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;border-left:1px solid #59718c;"><tr><td align="left" width="3px" height="250px" valign="top"><table width="3px" height="250px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"></td></tr></table></td></tr></table></td><td width="80px" height="200px" align="center" valign="top" ><table width="80px" height="200px" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="left" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle"><span id="day7" class="temperature"></span></td></tr></table></td></tr><tr><td align="left" width="80px" height="60px" valign="middle"><table width="80px" height="60px" align="center" valign="top" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" id="weatherImg7" valign="top"></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="top"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>H &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="highTemp7" class="temperature" align="left">H 42&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="20px" valign="middle"><table width="80px" height="20px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="right" valign="middle" width="35px" class="temperature" nowrap>L &nbsp;</td><td align="left" valign="middle" width="45px" nowrap><span id="lowTemp7" class="temperature" align="left">L 29&deg;</span></td></tr></table></td></tr><tr><td align="left" width="80px" height="80px" valign="middle"><table width="80px" height="80px" align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;"><tr><td align="center" valign="middle" nowrap><span class="temperature">&nbsp;</span></td></tr></table></td></tr></table></td></tr></table></td></tr><tr><td width="582px" height="2px" align="left" valign="top"><table width="582px" height="2px" border="0" cellspacing="0" cellpadding="0" style="border-top:1px solid #59718c;"><tr><td width="582px" height="2px"></td></tr></table></td></tr><tr><td width="580px" height="10px"  align="center" valign="top"><table width="580px" height="10px" border="0" cellspacing="0" cellpadding="0"><tr><td width="80px" height="10px" align="center" valign="top" ><table width="80px" height="10px" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" width="80px" height="10px" valign="top"><table width="80px" height="10px" align="center" valign="top" border="0" style="padding-top:10px;"cellspacing="0" cellpadding="0" ><tr><td align="center" valign="top" nowrap><span id="date1" class="temperature" >Today</span></td></tr></table></td></tr></table></td><td width="80px" height="10px" align="center" valign="top" ><table width="80px" height="10px" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" width="80px" height="10px" valign="top"><table width="80px" height="10px" align="center" valign="top" border="0" style="padding-top:10px;"cellspacing="0" cellpadding="0" ><tr><td align="center" valign="top" nowrap><span id="date2" class="temperature" ></span></td></tr></table></td></tr></table></td><td width="80px" height="10px" align="center" valign="top" ><table width="80px" height="10px" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" width="80px" height="10px" valign="top"><table width="80px" height="10px" align="center" valign="top" border="0" style="padding-top:10px;"cellspacing="0" cellpadding="0" ><tr><td align="center" valign="top" nowrap><span id="date3" class="temperature" ></span></td></tr></table></td></tr></table></td><td width="80px" height="10px" align="center" valign="top" ><table width="80px" height="10px" border="0" cellspacing="0" cellpadding="0" ><tr>	<td align="center" width="80px" height="10px" valign="top"><table width="80px" height="10px" align="center" valign="top" border="0" style="padding-top:10px;"cellspacing="0" cellpadding="0" ><tr><td align="center" valign="top" nowrap><span id="date4" class="temperature" ></span></td></tr></table></td></tr>	</table></td><td width="80px" height="10px" align="center" valign="top" ><table width="80px" height="10px" border="0" cellspacing="0" cellpadding="0" ><tr>	<td align="center" width="80px" height="10px" valign="top"><table width="80px" height="10px" align="center" valign="top" border="0" style="padding-top:10px;"cellspacing="0" cellpadding="0" ><tr><td align="center" valign="top" nowrap><span id="date5" class="temperature" ></span></td></tr></table></td></tr></table></td><td width="80px" height="10px" align="center" valign="top" ><table width="80px" height="10px" border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" width="80px" height="10px" valign="top"><table width="80px" height="10px" align="center" valign="top" border="0" style="padding-top:10px;"cellspacing="0" cellpadding="0" ><tr><td align="center" valign="top" nowrap><span id="date6" class="temperature" ></span></td></tr></table></td></tr></table></td><td width="80px" height="10px" align="center" valign="top" ><table width="80px" height="10px" border="0" cellspacing="0" cellpadding="0" ><tr>	<td align="center" width="80px" height="10px" valign="top"><table width="80px" height="10px" align="center" valign="top" border="0" style="padding-top:10px;"cellspacing="0" cellpadding="0" ><tr><td align="center" valign="top" nowrap><span id="date7" class="temperature" ></span></td></tr></table></td></tr></table></td></tr></table></td></tr>';var A=presentDay();document.getElementById("day1").innerHTML=currentDay(A);document.getElementById("day2").innerHTML=currentDay(A+1);document.getElementById("day3").innerHTML=currentDay(A+2);document.getElementById("day4").innerHTML=currentDay(A+3);document.getElementById("day5").innerHTML=currentDay(A+4);document.getElementById("day6").innerHTML=currentDay(A+5);document.getElementById("day7").innerHTML=currentDay(A+6);document.getElementById("date2").innerHTML=presentDate(1);document.getElementById("date3").innerHTML=presentDate(2);document.getElementById("date4").innerHTML=presentDate(3);document.getElementById("date5").innerHTML=presentDate(4);document.getElementById("date6").innerHTML=presentDate(5);document.getElementById("date7").innerHTML=presentDate(6);for(i=0;i<7;i++){if(minTemp[i]==-1000){document.getElementById("lowTemp"+(i+1)).innerHTML="-";document.getElementById("highTemp"+(i+1)).innerHTML="-";document.getElementById("weatherImg"+(i+1)).innerHTML=""}else{document.getElementById("weatherImg"+(i+1)).innerHTML=(weatherStatus[i]==0?"&nbsp;":'<img alt="" src="/view/tv/images/weather/'+weatherStatus[i]+'.png" style="padding-top:6px;">');document.getElementById("lowTemp"+(i+1)).innerHTML=minTemp[i]+" &deg";document.getElementById("highTemp"+(i+1)).innerHTML=maxTemp[i]+" &deg"}}}function getWeatherDetails(C){var B="method=getweather&serial="+serial+"&widgetId="+C;createWeatherResponse(B);return ;var A={success:getWeatherDetailsSuccessHandler,failure:getWeatherDetailsFailureHandler,argument:{}};request=YAHOO.util.Connect.asyncRequest("POST",serverUrl,A,B);return false}function getWeatherDetailsInfo(C){saveTimeLineData("Widget","Weather",1);try{if(C.length>0){var A=YAHOO.lang.JSON.parse(C);isWeatherAssigned=true;for(i=0;i<A.length;i++){minTemp[i]=A[i].minTemp;maxTemp[i]=A[i].maxTemp;weatherStatus[i]=A[i].weatherStatus}paintWeatherHtml()}else{isWeatherAssigned=false;document.getElementById("weatherAssigned").innerHTML="&nbsp;&nbsp;&nbsp; "+records.key374}}catch(B){}showWeatherPanel()}function getWeatherDetailsFailureInfo(){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 createWeatherResponse(A){createAjaxRequest();if(ajaxRequest==null){return }ajaxRequest.onreadystatechange=function(){paintWeatherContent()};ajaxRequest.open("POST","/TvHandler",true);ajaxRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajaxRequest.send(A);return false}function paintWeatherContent(){if(ajaxRequest.readyState==4){if(ajaxRequest.status==200){getWeatherDetailsInfo(ajaxRequest.responseText)}if(ajaxRequest.status==500){getWeatherDetailsFailureInfo()}}}function escapeWeatherPanel(){showGoPanel();weatherActive=false;if(isGridViewOpened){gridView=true;showGridFullGuidePanel();return }showGuidePanel()}function gotoHomeWeather(B){var A="";A=(B==1?"#fcf3b8":"none");document.getElementById("weatherHomePanel").style.background=A}