home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 February / Gamestar_81_2006-02_dvd.iso / Programy / mcombo152.exe / Plugin / Weather / script / writeData.js < prev   
Text File  |  2005-10-31  |  20KB  |  428 lines

  1. /*************************************************************************************
  2.  
  3. === Weather 4.41 ===
  4.  
  5. By Neo101
  6. Previous versions by crino, Arkim, mdlist, seidenj and Tara
  7. Created for Maxthon Tabbed Browser (www.maxthon.com)
  8.  
  9. === License ===
  10.  
  11. Please contact Neo10 on forum.maxthon.com or www.neo101.nl if you would like to make any changes!
  12. This plugin is for Maxthon only. You are not allowed to use it for any other program without permission.
  13. Do not remove these comments/credits.
  14. You are allowed to use/copy the icons. I did not create them.
  15.  
  16. Copyright 2005
  17.  
  18. Last modified 09-10-2005
  19.  
  20. === Description of writeData.js ===
  21.  
  22. Here are the functions that write the weather data to the HTML page.
  23.  
  24.  
  25. ***************************************************************************************/
  26.  
  27. function SummaryWeatherHTML(weatherData){
  28.     var text=
  29.         '<table cellpadding="0" cellspacing="0">'+
  30.         '<tr><td class="content">'+
  31.         //Now
  32.         '<table cellpadding="0" cellspacing="0"> '+
  33.             '<tr class="title"><td class="titleleft" title="'+dateToday+'">'+trans(sNow)+
  34.             ((showTodayDate==1)?' '+dateToday:'')+'</td> '+
  35.             '<td class="titleright"> '+
  36.             '<img src="images/plus.gif" class="expclpimg" id="titlenow" onClick="switchstate(\'titlenow\')"></td></tr> '+
  37.             '<tr id="contentnow"> '+
  38.             '<td colspan=2> '+
  39.             '<table cellpadding="0" cellspacing="0"> '+
  40.                 '<tr><td> '+
  41.                 '<table class="obsInfo"> '+
  42.                     '<tr><td>'+
  43.                     ((weatherData.swCIcon!='')?'<img src="images/'+imageLocation+weatherData.swCIcon+iconExtension+'">':'')+
  44.                     '</td></tr> '+
  45.                     '<tr><td> '+
  46.                     '<B> '+transW(weatherData.swConText)+'<br>'+transUnit(weatherData.swTemp,"temp")+
  47.                     '</B></td></tr> '+
  48.                     '<tr><td><B> '+
  49.                     ((details==1)?trans("WT_Feellkie")+"<br>"+transUnit(weatherData.swReal,"temp"):'')+'</B> '+
  50.                 '</table> '+
  51.                 '</td>'+((design==1)?'</tr><tr>':'')+' '+
  52.                 '<td class="obsInfo"> '+
  53.                 ((details==1)?t=trans("WT_UV",1)+((weatherData.swUV&&weatherData.swUV!='')?weatherData.swUV:'0')+"<br>":'')+
  54.                 trans("WT_Humd",1)+weatherData.swHumid+"%<br>"+
  55.                 trans("WT_Visb",1)+transUnit(weatherData.swVis,"visb")+unitsSym[2]+"<br>"+
  56.                 ((details==1)?trans("WT_Pres",1)+transUnit(weatherData.swBaro,"pres")+unitsSym[3]+"<br>":'')+
  57.                 trans("WT_Wind",1)+transUnit(weatherData.swWindS,"wind")+unitsSym[1]+
  58.                 ' <span title="'+transWind3(weatherData.swWindD)+
  59.                 '">'+transWind(weatherData.swWindD)+'</span>'+
  60.                 '</td></tr> '+
  61.             '</table></td></tr> '+
  62.         '</table></td></tr> <tr><td height="3"></td></tr> <tr><td class="content"> '+
  63.         //Today
  64.         '<table cellpadding="0" cellspacing="0"> '+
  65.             '<tr class="title"><td class="titleleft" width="50%">'+trans(sDay)+'</td> '+
  66.             '<td class="titleright"> '+
  67.             '    <img src="images/plus.gif" class="expclpimg" id="titletoday" onClick="switchstate(\'titletoday\')">'+
  68.             '</td></tr> '+
  69.             '<tr id="contenttoday"><td colspan=2>'+
  70.             '<table class="obsInfo"><tr><td '+((design==1)?'colspan=2':'')+' width="50%"> '+
  71.                 "<b>"+trans("WT_Wday")+"</b><br>"+
  72.                 "<img src='images/"+imageLocation+forecastArray[10]+iconExtension+"'><br>"+
  73.                 trans("WT_Hight",1)+" "+transUnit(forecastArray[20],"temp")+"<br>"+
  74.                 ((design==0)?'</td><td valign="top" width="50%">':trans("WT_Precip",1)+
  75.                 " "+forecastArray[25]+"%<br>")+
  76.                 "<b>"+trans("WT_Wnight")+"</b><br><img src='images/"+imageLocation+forecastArray[30]+iconExtension+"'><br>"+
  77.                 trans("WT_Lowt",1)+" "+transUnit(forecastArray[40],"temp")+
  78.                 ((design==0)?'</tr><tr><td colSpan=2>'+
  79.                     trans("WT_Precip",1)+" "+forecastArray[25]+"%":'')+
  80.                 '</td><tr>'+
  81.             '</table>'+
  82.             '</td></tr> '+
  83.         '</table></td></tr> <tr><td height="3"></td></tr> '+
  84.         '<tr><td class="content"> '+
  85.         //Future
  86.         '<table cellpadding="0" cellspacing="0"> '+
  87.             '<tr class="title"><td class="titleleft" width="50%">'+trans("WT_Future")+'</td> '+
  88.             '<td class="titleright"> '+
  89.             '<img src="images/plus.gif" class="expclpimg" id="titlefuture" onClick="switchstate(\'titlefuture\')">'+
  90.             '</td></tr>'+
  91.             '<tr id="contentfuture"> '+
  92.             '<td colspan="2">'+
  93.             '<table cellspacing="0" cellpadding="0" class="obsInfo"> '
  94.     return text
  95. }
  96.  
  97. function FutureWeatherHTML(){
  98.     var text = 
  99.         '<table cellpadding="0" cellspacing="0" id="main">'+
  100.         '<tr><td class="content">'+
  101.         //Today /Tonight
  102.         '<table cellpadding="0" cellspacing="0"> '+
  103.             '<tr class="title"><td class="titleleft" title="'+dateToday+'">'+trans(sNow)+
  104.             ((showTodayDate==1)?' '+dateToday:'')+'</td> '+
  105.             '<td class="titleright"> '+
  106.             '<img src="images/plus.gif" class="expclpimg" id="titlenow" onClick="switchstate(\'titlenow\')"></td></tr> '+
  107.             '<tr id="contentnow"> '+
  108.             '<td colspan=2><table class="obsInfo"> '+
  109.             '<tr><td>'+
  110.             '<table class="obsInfo"><tr><td> '+
  111.                 "<img src='images/"+imageLocation+data[0][5]+iconExtension+"'><br>"
  112.                 +'</td></tr><tr><td><b>'+
  113.                 transW(data[0][6])+'<br>'+
  114.                 ((data[0][2]!='N/A')?transUnit(data[0][2],'temp'):trans("WT_Lowt",1)+transUnit(data[0][3],'temp'))+
  115.                 '</b></td></tr></table> '+
  116.                 '</td>'+((design==1)?'</tr><tr>':'')+'<td>'+
  117.                 ((data[0][2]!='N/A')?trans("WT_Lowt",1)+" "+transUnit(data[0][3],'temp')+"<br>":'')+
  118.                 ((details==1&&data[0][2]!='N/A')?trans("WT_UV",1)+data[0][4]+"<br>":'')+
  119.                 trans("WT_Humd",1)+data[0][11]+"%<br>"+
  120.                 trans("WT_Precip",1)+data[0][10]+"%<br>"+
  121.                 trans("WT_Wind",1)+transUnit(data[0][7],'wind')+
  122.                 unitsSym[1]+" <span title='"+transWind2(data[0][8])+"'>"+transWind(data[0][9])+'</span>'
  123.                 +'</td></tr> '+
  124.             '</table></td></tr> '+
  125.         '</table>'+
  126.         '</td></tr> <tr><td height="3"></td></tr> <tr><td class="content"> '+
  127.         //Future
  128.         '<table cellpadding="0" cellspacing="0"> '+
  129.             '<tr class="title"><td class="titleleft">'+trans("WT_Future")+'</td> '+
  130.             '<td class="titleright"> '+
  131.             '<img src="images/plus.gif" class="expclpimg" id="titlefuture" onClick="switchstate(\'titlefuture\')"></td></tr> '+
  132.             '<tr id="contentfuture"><td class="obsInfo" colspan="2"> '+
  133.             '<table cellspacing="0" cellpadding="0"><tr><td> '+
  134.             '<table '+((design==1)?'style="width:50%"':'')+
  135.                     '><tr><td class="futureD" width=50%><span title="'+data[1][12]+'">'+getWeekday(data[1][0])
  136.             +"</span></td>"+
  137.             "<td><img alt='"+transW(data[1][6])+"' src='images/"+imageLocation+data[1][5]+iconExtension+
  138.             "' align=absmiddle></table>"+((design==1)?'<tr>':'')
  139.             +'</td><td class="futureTDBody" > '+
  140.             '<span class="highT"> '
  141.             if(compactDisplay!=1){
  142.                 text+=trans("WT_Hight",1)+
  143.                 transUnit(data[1][2],'temp')+"</span><br><span class=lowT>"+
  144.                     trans("WT_Lowt",1)+transUnit(data[1][3],'temp')+"<br>"+
  145.                 trans("WT_Precip",1)+data[1][10]+"%<br>"
  146.                 if(type=='Future'&&details==1) text+=trans("WT_Wind",1)+transUnit(data[1][7],'wind')+
  147.                         unitsSym[1]+" <span title='"+transWind2(data[1][8])+"'>"+transWind(data[1][9],1)+'</span>'
  148.                 +'</span></td></tr> '
  149.             }
  150.             else{
  151.                 text+='<table class=lowT style="width:'+((design==1)?'80':'100')+
  152.                     '%"><tr><td class="highT" width="40%" title="'+trans("WT_Hight")+'"><b>'+
  153.                     transUnit(data[1][2],'temp')+
  154.                     '</b></td><td width="30%" title="'+trans("WT_Lowt")+'">'+transUnit(data[1][3],'temp')+
  155.                     '</td><td width="30%" title="'+trans("WT_Precip")+'">'+data[1][10]+'%</td></tr>'
  156.                     +((type=='Future'&&details==1)?'<tr><td colspan=3 title="'+trans("WT_Wind")+'">'+transUnit(data[1][7],'wind')+
  157.                     unitsSym[1]+" <span title='"+transWind2(data[1][8])+"'>"+transWind(data[1][9]):'')+'</td></tr></table>'
  158.             }
  159.  
  160.     return text
  161. }
  162.  
  163. function TodayWeatherHTML(){
  164.     var text='<table cellpadding="0" cellspacing="0" id="main">'
  165.     if(top.todayData==null) return
  166.     if(todayData[0]!='N/A') //After 2pm the "today" weather isn't available anymore. It will be hidden then.
  167.     text+='<tr><td class="content">'+
  168.         //Today
  169.         '<table cellspacing="0"> '+
  170.             '<tr class="title"><td class="titleleft" title="'+dateToday+'">'+trans(sNow)+
  171.             ((showTodayDate==1)?' '+dateToday:'')+'</td> '+
  172.             '<td class="titleright"> '+
  173.             '<img src="images/plus.gif" class="expclpimg" id="titlenow" onClick="switchstate(\'titlenow\')"></td></tr> '+
  174.             '<tr id="contentnow"> '+
  175.             '<td colspan=2> '+
  176.             '<table class="obsInfo"><tr><td><table class="obsInfo">  '+
  177.             '<tr><td><img src="images/'+imageLocation+todayData[2]+iconExtension+'"><br></td></tr>'+
  178.             '<tr><td><B>'+
  179.             transW(todayData[3])+'<br>'+
  180.             transUnit(todayData[0],'temp')+
  181.             '</B></td></tr></table> '+
  182.             '</td>'+((design==1)?'</tr><tr>':'')+' '+
  183.             '<td class="obsInfo"> '+
  184.             ((details==1)?trans("WT_UV",1)+todayData[1]+"<br>":'')+
  185.             trans("WT_Humd",1)+todayData[8]+"%<br>"+
  186.             trans("WT_Precip",1)+todayData[7]+"%<br>"+
  187.             trans("WT_Wind",1)+transUnit(todayData[4],'wind')+
  188.             unitsSym[1]+" <span title='"+transWind2(todayData[5])+"'>"+transWind(todayData[6])+'</span><br>'
  189.             +trans("WT_SunUp",1)+sunUp
  190.             +'</td></tr> '+
  191.         '</table></td></tr> '+
  192.         '</table></td></tr> <tr><td height="3"></td></tr>'
  193.         //Tonight
  194.         text+='<tr><td class="content"> '+
  195.         '<table cellpadding="0" cellspacing="0"> '+
  196.             '<tr class="title"><td class="titleleft" title="'+dateToday+'">'+trans("WT_Tonight")+
  197.             ((showTodayDate==1&&todayData[0]=='N/A')?' '+dateToday:'')+'</td> '+
  198.             '<td class="titleright"> '+
  199.             '<img src="images/plus.gif" class="expclpimg" id="titletoday" onClick="switchstate(\'titletoday\')"></td></tr> '+
  200.             '<tr id="contenttoday"><td colspan=2> '+
  201.             '<table cellpadding="0" cellspacing="0"> '+
  202.             '<tr><td>'+
  203.             '<table class="obsInfo"><tr><td> '+
  204.                 "<img src='images/"+imageLocation+tonightData[1]+iconExtension+"'><br>"
  205.                 +'</td></tr><tr><td> '+
  206.                 '<B class="obsTextA"> '+        
  207.                 transW(tonightData[2])+'<br>'+
  208.                 transUnit(tonightData[0],'temp')+
  209.                 '</B></td></tr></table> '+
  210.                 '</td>'+((design==1)?'</tr><tr>':'')+' '+
  211.                 '<td class="obsInfo" width="70%" '+((design==1)?'colspan=2':'')+'> '+
  212.                 trans("WT_Humd",1)+tonightData[7]+"%<br>"+
  213.                 trans("WT_Precip",1)+tonightData[6]+"%<br>"+
  214.                 trans("WT_Wind",1)+transUnit(tonightData[3],'wind')+
  215.                 unitsSym[1]+" <span title='"+transWind2(tonightData[4])+"'>"+transWind(tonightData[5])+'</span><br>'
  216.                 +trans("WT_SunDown",1)+sunDown
  217.                 +'</td></tr> '+
  218.             '</table></td></tr> '+
  219.         '</table></td></tr> <tr><td height="3"></td></tr> <tr><td class="content"> '+
  220.         //Future
  221.         '<table cellpadding="0" cellspacing="0"> '+
  222.             '<tr class="title"><td class="titleleft" width="50%">'+trans("WT_Details2")+'</td> '+
  223.             '<td class="titleright"> '+
  224.             '<img src="images/plus.gif" class="expclpimg" id="titlefuture" onClick="switchstate(\'titlefuture\')"></td></tr>'+
  225.             '<tr id="contentfuture"> '+
  226.             '<td colspan="2"><table cellspacing="0" cellpadding="0" class="obsInfo"> '
  227.     
  228.  
  229.     return text
  230. }
  231.  
  232. function ModalDialogHTML(weatherData){
  233.     var text,textBody;
  234.     text='<html>'+
  235.         '<head><title>Weather      </title>'+
  236.             '<base href="'+pluginfolder+'">'+
  237.             '<link href="style/common.css" rel="stylesheet" type="text/css">'+
  238.             '<link href="style/'+FONT_SIZE_MODDIALOG+'" rel="stylesheet" type="text/css">'+
  239.             '<link href="style/'+style+'" rel="stylesheet" type="text/css">'+
  240.         '</head>'+
  241.         '<body onunload="dialogArguments.saveCurrentPosition(window.screenLeft,window.screenTop,window.dialogHeight,window.dialogWidth)">'
  242.     if(type=='Summary')
  243.         var textBody="<table class='obsInfo'><tr><td>"+trans(sNow+'_short')+"</td><td colspan=2>"+trans(sDay+'_short')+
  244.         "</td></tr>"+
  245.         "<tr><td>"+
  246.         "<img alt='"+transW(weatherData.swConText)+"' src='images/"+IMG_LOCATION_MODDIALOG+weatherData.swCIcon+iconExtension+"'></td>"+
  247.         "<td><img src='images/"+IMG_LOCATION_MODDIALOG+forecastArray[10]+iconExtension+"'></td>"+
  248.         "<td><img src='images/"+IMG_LOCATION_MODDIALOG+forecastArray[30]+iconExtension+"'></td>"+
  249.         "</tr>"+
  250.         "<tr><td>"+transUnit(weatherData.swTemp,"temp")+"</td>"+
  251.         "<td>"+transUnit(forecastArray[20],"temp")+"</td><td>"+
  252.         transUnit(forecastArray[40],"temp")+"</td></tr></table>"
  253.     else if(type=='Future') 
  254.         textBody="<table class='obsInfo'>"+
  255.         "<tr><td>"+trans(sNow+'_short')+"</td><td>"+trans(sDay+'_short')+
  256.         "</td><td>"+trans("WT_Future_short")+"</td></tr><tr>"+
  257.         "<td><img alt='"+transW(data[0][6])+"' src='images/"+IMG_LOCATION_MODDIALOG+data[0][5]+iconExtension+"'></td><td>"+
  258.         "<img alt='"+transW(data[1][6])+"' src='images/"+IMG_LOCATION_MODDIALOG+data[1][5]+iconExtension+"'></td><td>"+
  259.         "<img alt='"+transW(data[2][6])+"' src='images/"+IMG_LOCATION_MODDIALOG+data[2][5]+iconExtension+"'></td></tr>"+
  260.         "<tr><td>"+((data[0][2]!='N/A')?transUnit(data[0][2],'temp'):transUnit(data[0][3],'temp'))+
  261.         "</td><td>"+transUnit(data[1][2],'temp')+"</td><td>"+
  262.         transUnit(data[2][2],'temp')+"</td></tr>"+
  263.         "</table>"
  264.     else if(type=='Today'&&todayData[0]!='N/A')
  265.         textBody="<table class='obsInfo'>"+
  266.         "<tr><td>"+trans('WT_Today_short')+"</td><td>"+
  267.         trans('WT_Tonight_short')+'</td><td>'+data[0][0]+".00</td></tr><tr>"+
  268.         "<td><img alt='"+transW(todayData[3])+"' src='images/"+IMG_LOCATION_MODDIALOG+todayData[2]+iconExtension+"'></td><td>"+
  269.         "<img alt='"+transW(tonightData[2])+"' src='images/"+IMG_LOCATION_MODDIALOG+tonightData[1]+iconExtension+"'></td><td>"+
  270.         "<img alt='"+transW(data[0][2])+"' src='images/"+IMG_LOCATION_MODDIALOG+data[0][1]+iconExtension+"'></td></tr>"+
  271.         "<tr><td>"+transUnit(todayData[0],'temp')+
  272.         "</td><td>"+transUnit(tonightData[0],'temp')+"</td><td>"+
  273.         transUnit(data[0][3],'temp')+"</td></tr>"+
  274.         "</table>"
  275.     else if(type=='Today') 
  276.         textBody="<table class='obsInfo'>"+
  277.         "<tr><td>"+trans('WT_Tonight_short')+
  278.         '</td><td>'+data[0][0]+'.00</td><td>'+data[1][0]+".00</td></tr><tr>"+
  279.         "<td><img alt='"+transW(tonightData[2])+"' src='images/"+IMG_LOCATION_MODDIALOG+tonightData[1]+iconExtension+"'></td><td>"+
  280.         "<img alt='"+transW(data[0][2])+"' src='images/"+IMG_LOCATION_MODDIALOG+data[0][1]+iconExtension+"'></td><td>"+
  281.         "<img alt='"+transW(data[1][2])+"' src='images/"+IMG_LOCATION_MODDIALOG+data[1][1]+iconExtension+"'></td></tr>"+
  282.         "<tr><td>"+transUnit(tonightData[0],'temp')+
  283.         "</td><td>"+transUnit(data[0][3],'temp')+"</td><td>"+
  284.         transUnit(data[1][3],'temp')+"</td></tr>"+
  285.         "</table>"
  286.     return text+textBody
  287. }
  288.  
  289. /* This will load the weather info into the webpage. */
  290.  
  291. function loadPage(){
  292.     t=''
  293.     var weatherData
  294.     if(type=='Summary'){ //summary
  295.         futdays = eval(readIni("FutureDays"));
  296.         if(futdays>3) futdays = 3
  297.         sDay     = "WT_Tomorrow";
  298.         try{ 
  299.             weatherData = new makeWeatherObj() 
  300.         }
  301.         catch(err) {
  302.             showErrorMessage(errorMsg1)
  303.         }
  304.         if(weatherData.swFore&&weatherData.swFore!=''){
  305.             forecastArray = weatherData.swFore.split('|')
  306.             for(i=1; i<6; i++){
  307.                 data[i]=[forecastArray[(i-1)],'',forecastArray[(19+i)],forecastArray[(39+i)],
  308.                     '',forecastArray[(9+i)],'','','','',forecastArray[(24+i)],'','']
  309.             }
  310.             curDate = new Date();
  311.             if((forecastArray[0] - 1)==curDate.getDay()) sDay = "WT_Today"
  312.             showDate(weatherData.swLastUp.split(' ')[0].replace(/\//g,','))
  313.             setClock(weatherData.swLastUp.split(' ')[1])
  314.         }
  315.         else {
  316.             document.all['mainBody'].innerHTML=''
  317.             showErrorMessage(errorMsg2)
  318.             window.onerror=nothing
  319.             document.all['lastUpdate'].innerHTML=''
  320.         }
  321.         if(activeCityName=='unknown') {
  322.                 activeCityName=weatherData.swCity+', '+weatherData.swCountry
  323.                 writeIni("LocationTxt"+activeLocation,activeCityName)
  324.                 document.all['cityNameDisp'].innerHTML=activeCityName
  325.         }
  326.         
  327.         var mainText = SummaryWeatherHTML(weatherData)
  328.     }
  329.     else if(type=='Future'){ //future forecast
  330.         sDay = "WT_Tomorrow"
  331.         sNow = (data[0][2]!='N/A')?"WT_Today":"WT_Tonight";
  332.         futdays = eval(readIni("FutureDays"))-1;
  333.         if(a==0) showErrorMessage(errorMsg1)
  334.         
  335.         var mainText = FutureWeatherHTML()
  336.     }
  337.     else if(type=='Today'){ //today's weather
  338.         futdays = readIni("FutureDays");
  339.         if(futdays>6) futdays=6
  340.         sDay = "WT_Tomorrow";
  341.         if(a==0) showErrorMessage(errorMsg1)
  342.         
  343.         var mainText = TodayWeatherHTML()
  344.     }
  345.     
  346.     /* Create the Future / Details part */
  347.     
  348.     if(type=='Summary'||type=='Future') {
  349.         for(i=2;i<(futdays+2);i++){
  350.             if(data[i]==null||data[i][6]=='N/A') continue
  351.                 mainText+='<tr><td > '+
  352.                     '<table '+((design==1)?'style="width:50%"':'')+'>'+
  353.                         '<tr><td class="futureD" width=50%><span title="'+data[i][12]+'">'+getWeekday(data[i][0])
  354.                         +"</span></td>"+
  355.                         "<td><img alt='"+transW(data[i][6])+"' src='images/"+imageLocation+data[i][5]+iconExtension+
  356.                         "' align=absmiddle>"+
  357.                     "</table>"+((design==1)?'<tr>':'')
  358.                     +'</td> '+
  359.                     '<td class="futureTDBody" > '+
  360.                     '<span class="highT">'
  361.                     if(compactDisplay!=1){
  362.                         mainText+=trans("WT_Hight",1)+
  363.                         transUnit(data[i][2],'temp')+"</span><br><span class=lowT>"+
  364.                             trans("WT_Lowt",1)+transUnit(data[i][3],'temp')+"<br>"+
  365.                         trans("WT_Precip",1)+data[i][10]+"%<br>"
  366.                         if(type=='Future'&&details==1) mainText+=trans("WT_Wind",1)+transUnit(data[i][7],'wind')+
  367.                         unitsSym[1]+" <span title='"+transWind2(data[i][8])+"'>"+transWind(data[i][9])+'</span>'
  368.                     } else{
  369.                         mainText+='<table class=lowT style="width:'+((design==1)?'80':'100')+'%"><tr>'+
  370.                         '<td class="highT" width="40%" title="'+trans("WT_Hight")+'"><b>'+transUnit(data[i][2],'temp')+
  371.                         '</b></td>'+
  372.                         '<td width="30%" title="'+trans("WT_Lowt")+'">'+transUnit(data[i][3],'temp')+
  373.                         '</td><td width="30%" title="'+trans("WT_Precip")+'">'+data[i][10]+'%</td></tr>'
  374.                         +((type=='Future'&&details==1)?'<tr><td colspan=3 title="'+trans("WT_Wind")+'">'+
  375.                         transUnit(data[i][7],'wind')+unitsSym[1]+" <span title='"+transWind2(data[i][8])+
  376.                         "'>"+transWind(data[i][9],1):'')+'</td></tr>'+
  377.                         '</table>'
  378.                     }
  379.                     mainText+='</span></td></tr> '
  380.         }
  381.     }
  382.     else{//data0, icon1 ,weather type2, temp3, feel like temp4, percip5  , dew point (whatever that is...)6,  humid7, wind direction8  speed9
  383.         for(var i=0;i<futdays;i++){
  384.             if(data[i]==null||data[i][6]=='N/A') continue
  385.                 mainText+='<tr><td > '+
  386.                     '<table '+((design==1)?'style="width:50%"':'')+'>'+
  387.                         '<tr><td class="futureD" width=50%><span>'+data[i][0]
  388.                         +data[i][10]+"</span></td>"+
  389.                         "<td><img alt='"+transW(data[i][2])+"' src='images/"+imageLocation+data[i][1]+iconExtension+
  390.                         "' align=absmiddle>"+
  391.                     "</table>"+((design==1)?'</td></tr><tr>':'</td>')+
  392.                     '<td class="futureTDBody" > '+
  393.                     '<span class="highT"> '
  394.                     if(compactDisplay!=1){
  395.                         mainText+=trans("WT_Temperature",1)+
  396.                         transUnit(data[i][3],'temp')+"</span><br><span class=lowT>"+
  397.                         trans("WT_Precip",1)+data[i][5]+"%"+
  398.                         ((details==1)?'<br>'+trans("WT_Wind",1)+
  399.                         transUnit(data[i][9],'wind')+unitsSym[1]+' <span title="'+
  400.                             transWind3(data[i][8])+'">'+transWind(data[i][8])+'</span>':'')
  401.                         +'</span></td></tr> '
  402.                     }
  403.                     else {
  404.                         mainText+='<table style="width:'+((design==1)?'50':'100')+'%" class=lowT>'+
  405.                         '<tr><td class="highT" width="50%" title="'+trans("WT_Temperature")+'"><b>'+
  406.                         transUnit(data[i][3],'temp')+
  407.                         '</b></td><td width="50%"  title="'+trans("WT_Precip")+'">'+
  408.                         data[i][5]+'%</td></tr><tr><td colspan=2 title="'+trans("WT_Wind")+'" >'+
  409.                         ((details==1)?transUnit(data[i][9],'wind')+unitsSym[1]+' <span title="'+
  410.                             transWind3(data[i][8])+'">'+transWind(data[i][8],1)+'</span>':'')
  411.                         +'</td></tr></table></td></tr> '
  412.                     }
  413.                     
  414.         }
  415.     
  416.     }
  417.     
  418.     mainText+='</table>'
  419.     document.all['mainBody'].innerHTML=mainText  //print the data
  420.     
  421.     /* The Small Window code*/
  422.     modalDialogText = ModalDialogHTML(weatherData)
  423.     
  424.     writeFile("script/Dialog.htm",modalDialogText)
  425.     
  426.     if(smallWindow && smallWindow!='') smallWindow.document.body.innerHTML=modalDialogText
  427.     if(showWinAlways==1 && smallWindow=='') window.setTimeout('showFloatingWindow()',200)
  428. }