diff -Nur ProWeather/en-US/js/weather_fly.js ProWeatherByTommy/en-US/js/weather_fly.js
--- ProWeather/en-US/js/weather_fly.js	Sun Mar  2 04:06:04 2008
+++ ProWeatherByTommy/en-US/js/weather_fly.js	Tue Feb 10 07:49:42 2009
@@ -10,7 +10,7 @@
     trimText(text)			                       			**Trim text to not exceed 16
     timePerInterval()	                         			**Load clocks for both locations
     padNumber(num)                            				**Add a 0 to any time that is 1 digit, if 12 hour mode is selected
-    setAm(isAm)												**Called from timePerInterval to set time to AM or PM 
+    setAm(isAm)												**Called from timePerInterval to set time to AM or PM
     Date.prototype.add                          			**Extension to the Date object
     setImages(clicked)	                          			**Load initial images and text
     setFontColor(obj)										**Set font color
@@ -32,11 +32,11 @@
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 
-window.onload = function(){    
-    SettingsManager.loadFile();    
+window.onload = function(){
+    SettingsManager.loadFile();
     loadFly();
 }
- 
+
  	//INITIAL VARIABLE SETUP
     try
     {
@@ -67,23 +67,23 @@
         var hbhfData = new ActiveXObject("Scripting.Dictionary");
     }
     catch(e)
-    {   
+    {
         produceError("Initialization Error! - " + e.description);
     }
 
 function loadFly()
-{   
+{
     background.removeObjects();
     background.addImageObject(FLYOUT_SCREEN_BG, 0, 0);
-    
+
     //loop through twice to get both locations XML data, but only if location 1 does not equal location 2
     for (var loc_ID = 1; loc_ID <= 2; loc_ID++)
-    {   
+    {
         tryXML(loc_ID);
         if (SettingsManager.getValue("location", "locIDH") == SettingsManager.getValue("location", "locIDS"))
-            break;        
+            break;
     }
-    
+
     timePerInterval();
     setImages(false);
 }
@@ -91,7 +91,21 @@
 function swapLocations()
 {
 	//switch to location 2 and reload
-    swapLoc == "unswitched"? swapLoc = "switched":swapLoc = "unswitched";
+    /* add by tommy, 20090210 begin */
+    /* swapLoc == "unswitched"? swapLoc = "switched":swapLoc = "unswitched"; */
+    if (SettingsManager.getValue("location", "locIDS") != "")
+    {
+        var tempID, tempName;
+
+        tempID = SettingsManager.getValue("location", "locIDH");
+        tempName = SettingsManager.getValue("location", "locNameH");
+        SettingsManager.setValue("location", "locIDH", SettingsManager.getValue("location", "locIDS"));
+        SettingsManager.setValue("location", "locNameH", SettingsManager.getValue("location", "locNameS"));
+        SettingsManager.setValue("location", "locIDS", tempID);
+        SettingsManager.setValue("location", "locNameS", tempName);
+        SettingsManager.saveFile();
+    }
+    /* add by tommy, 20090210 end */
     clearTimeout(time_out);
     loadFly();
 }
@@ -101,15 +115,15 @@
 	//open settings page
     if (SettingsManager.getValue("preferences", "sound") == "On")
 	    System.Sound.playSound("media/mode_1.wav");
-	    
-    System.Gadget.Settings.write("flySettings",true);    
+
+    System.Gadget.Settings.write("flySettings",true);
     System.Gadget.Flyout.show = false;
 }
 
 function getInteractiveMap(lat,lon,wd,ht,zoom,tile,over,trans)
 {
     //latitude, longitude, width, height, level, tileSet, overlay, transparency
-	return MapPane.create(lat, lon, wd, ht, zoom, tile, over, trans);	
+	return MapPane.create(lat, lon, wd, ht, zoom, tile, over, trans);
 }
 
 function GetDistance(lat1, lon1, lat2, lon2, unit)
@@ -127,7 +141,7 @@
 	dist = Math.round(dist);
 	if (unit=="k/mh")
 	{
-	    dist = dist * 1.609344;	    
+	    dist = dist * 1.609344;
 	    dist = Math.round(dist);
 	    return dist + " km";
 	}
@@ -139,7 +153,7 @@
 {
     if (document.getElementById("map_pane").hasChildNodes())
         document.getElementById("map_pane").removeChild(document.getElementById("map_pane").firstChild);
-    
+
     //radar,sat,satrad,none
     document.getElementById("map_pane").appendChild(getInteractiveMap(lat, lon, wd, ht, zoom, tile, over, trans));
 }
@@ -154,19 +168,19 @@
 }
 
 function timePerInterval()
-{	
+{
 	//set time for both clocks
     var hours, hours2, minutes, seconds, isAm, calczone, plusmin;
-    
+
     dateT = new Date(System.Time.getLocalTime(System.Time.currentTimeZone));
-        
+
     with (dateT)
     {
         hours = getHours();
         minutes = getMinutes();
         seconds = getSeconds();
     }
-    
+
     if (SettingsManager.getValue("preferences", "time") == "24")
     {
         location1_ampm.style.visibility = "hidden";
@@ -177,17 +191,17 @@
         location1_ampm.style.visibility = "visible";
         location2_ampm.style.visibility = "visible";
     }
-    
+
     calczone = parseInt(locData.Item("zone2")) - parseInt(secZone);
-    
+
     if (calczone >= 0)
         plusmin = "Time Difference: + ";
     else
         plusmin = "Time Difference:  ";
-        
+
     map_info.innerText = plusmin + calczone + " hours | Distance: ~ " + GetDistance(locData.Item("latitude2"),locData.Item("longitude2"),secLati,secLong,SettingsManager.getValue("preferences", "wind"));
     setFontColor(map_info.id);
-    
+
     if (swapLoc == "unswitched")
         calczone = calczone * -1;
     else
@@ -196,22 +210,22 @@
         hours = hours.getHours();
         calczone = calczone * -1;
     }
-    
+
     hours2 = dateT.add("h", calczone);
     hours2 = hours2.getHours();
-        
+
     if ((hours >= 12) && (SettingsManager.getValue("preferences", "time") == "12"))
     {
         hours = hours - 12;
 	    isAm = false;
-	    location1_ampm.innerText = setAm(isAm);	    
-	}    
+	    location1_ampm.innerText = setAm(isAm);
+	}
     else
     {
 		isAm = true;
 		location1_ampm.innerText = setAm(isAm);
 	}
-	
+
     if ((hours2 >= 12) && (SettingsManager.getValue("preferences", "time") == "12"))
     {
         hours2 = hours2 - 12;
@@ -223,18 +237,18 @@
 		isAm = true;
 		location2_ampm.innerText = setAm(isAm);
 	}
-    	
+
 	if (hours2 == 0)
 	    hours2 = 12;
-	    
+
     if (hours == 0)
 	    hours = 12;
-	
+
 	if (colon == ":")
         colon = " ";
     else
         colon = ":";
-	
+
 	location1_time.innerText = padNumber(hours) + " " + padNumber(minutes);
     location1_sec.innerText =  location2_sec.innerText = padNumber(seconds);
     location1_colon.innerText = location2_colon.innerText = colon;
@@ -247,7 +261,7 @@
     setFontColor(location2_colon.id);
     setFontColor(location1_ampm.id);
     setFontColor(location2_ampm.id);
-    
+
     //loop every 1 second
     time_out = setTimeout("timePerInterval()", 1000);
 }
@@ -265,7 +279,7 @@
     if (isAm)
         return "AM";
 	else
-	    return "PM";	
+	    return "PM";
 }
 
 Date.prototype.add = function (sInterval, iNum){
@@ -338,7 +352,7 @@
 	    document.getElementById("fly_alert").setAttribute("src",OTHER_IMAGES_PATH + "alert.gif");
 
         var ndate = new Date(System.Time.getLocalTime(System.Time.currentTimeZone));
-            
+
         with (ndate)
         {
 	        year = getYear();
@@ -346,7 +360,7 @@
 	        dweek = getDay();
 	        month = getMonth();
         }
-        
+
 		//set default weather information that is not click or mouse over specific
 	    cond.innerText = "Today: " + d_names[dweek] + ", " + m_names[month] + " " + dday + " " + year;
 	    main_data.innerText = "Weather Forecast For " + locData.Item("name2");
@@ -358,7 +372,7 @@
 	    setFontColor(location1.id);
 	    setFontColor(work_on_off.id);
 	    setFontColor(status_line.id);
-    	
+
         if (ccData.Item("windDirectionText") == "VAR")
             document.getElementById("fly_wind").setAttribute("src","images/" + SettingsManager.getValue("preferences", "color") + "_col/wind_var.png");
         else if (ccData.Item("windDirectionText") == "CALM")
@@ -371,9 +385,9 @@
 	        wDir = ccData.Item("windDirectionDeg");
             if (wDir > 180)
                 wDir = wDir - 360;
-            
+
             document.getElementById("fly_wind_dial").setAttribute("rotation",wDir);
-        	
+
 	    if (ccData.Item("icon") == "-")
             icon = "NA";
         else
@@ -382,9 +396,9 @@
                 icon = "0" + ccData.Item("icon");
             else
                 icon = ccData.Item("icon");
-        }    
+        }
 	    document.getElementById("fly_icon_curr").setAttribute("src",WEATHER_IMAGES_PATH + icon + ".png");
-    		
+
 	    switch (ccData.Item("barDirection"))
 	    {
 	        case "rising":
@@ -406,13 +420,13 @@
 	    document.getElementById("fly_bar_in").setAttribute("src","images/" + SettingsManager.getValue("preferences", "color") + "_col/" + bDir + ".png");
 	    document.getElementById("fly_bar_status").setAttribute("src","images/" + SettingsManager.getValue("preferences", "color") + "_col/" + bStat + ".png");
 	    var bRead = ccData.Item("barReading").substr(ccData.Item("barReading").length -2,2);
-	    
+
 	    switch (ccData.Item("barReading").substr(0,2))
 	    {
 	        case "28":
-	            bDial = -135 + Math.round((bRead * .90));	            
+	            bDial = -135 + Math.round((bRead * .90));
 	            break;
-	        case "29":	        
+	        case "29":
 	            bDial = -45 + Math.round((bRead * .90));
 	            break;
 	        case "30":
@@ -428,7 +442,7 @@
 	    beginDate = fData.Item("ddate0");
 	    getWeatherIcons(-2,"");
 	    getWeatherInfo(-1);
-	    
+
 	    //triggered if a weather alert exists on the XML feed <swa>
 	    //if (System.Gadget.Settings.readString("swaAlert"))
 	    if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("swa").length)
@@ -437,7 +451,7 @@
             turnOnAlert(false);
 	}
     catch(e)
-    {   
+    {
         produceError("Setting Images Error! - " + e.description);
     }
 }
@@ -448,16 +462,16 @@
 }
 
 function turnOnAlert(which)
-{   
+{
     if (which)
     {
         var linkText;
-        
+
         fly_alert.style.visibility = "visible";
         linkText = swData.Item("alert");
         if (linkText.length > 55)
             linkText = linkText.substr(0,52) + "...";
-            
+
         main_data.style.color = "red";
         main_data.innerHTML = "<A style='color:red; text-decoration: none' href='" + swData.Item("link") + "'>" + linkText + "</A>";
         status_line.innerText = "alert";
@@ -479,13 +493,13 @@
     {
         if (SettingsManager.getValue("preferences", "temp") == "C")
             temp = Math.round((parseInt(temp) - 32) / 1.8);
-            
+
         return temp + DEGREE_SYMBOL + SettingsManager.getValue("preferences", "temp");
     }
 }
 
 function convertDistance(distance,which)
-{   
+{
     if (distance == "N/A")
         return distance;
     else
@@ -493,7 +507,7 @@
         if (SettingsManager.getValue("preferences", "wind") == "k/mh")
         {
             distance = Math.round(parseInt(distance) * 1.609344);
-            
+
             if (which == 1)
                 return distance + " km";
             else
@@ -509,7 +523,7 @@
     if (SettingsManager.getValue("preferences", "time") == "12")
         return time;
     else
-    {   
+    {
         if (time.substr(time.indexOf(" ") + 1,2) == "AM")
             return time.substr(0,time.indexOf(" "));
         else
@@ -527,10 +541,10 @@
 function getWeatherIcons(inDay,which)
 {
     var dDay, dDate, dHigh, dIcons, wHour, dIcon, fromNum, toNum, minusNum, newDate, dMoonCnt, dPhase, latzero, longzero, w, h, x, y;
-    
+
     if ((SettingsManager.getValue("preferences", "sound") == "On") && (inDay != -2))
 	        System.Sound.playSound("media/service.wav");
-    
+
     switch (inDay)
     {
         case -2: //initial load settings, 10 day forecast images
@@ -571,20 +585,20 @@
             radarmapspan.style.visibility = "hidden";
             thirty = true;
             moonphase = false;
-            
+
             if (fDate == 0)
-            {   
+            {
                 for (j = 0; j < 30; j++)
                 {
                     if (hbhfData.Item("hmili" + [j]) == 0)
                         fDate = fDate + 1;
-                 
+
                     var nfdate = new Date(System.Time.getLocalTime(System.Time.currentTimeZone));
                     var d2 = nfdate.add("d", fDate);
                     nDate[j] = d_names[d2.getDay()] + ", " + m_names[d2.getMonth()] + " " + d2.getDate();
                 }
             }
-                        
+
             switch (which) //set navigation arrows to show or not show depending on what range of hours are being shown
             {
                 case "up":
@@ -626,34 +640,34 @@
                     fly_arrow_l.style.visibility = "hidden";
                     fly_arrow_r.style.visibility = "visible";
             }
-            
+
             //set time for labels
             for (i = fromNum; i <= toNum; i++)
-            {   
+            {
                 wHour = hbhfData.Item("hmili" + [i]);
                 if (wHour.length == 1)
                     wHour = "0" + wHour;
-                 
+
                 if (wHour >= 12)
                     wHour = wHour - 12 + ":00 pm";
                 else
                     wHour = wHour + ":00 am";
-                
+
                 if (wHour.substr(0,1) == "0")
                     wHour = wHour.substr(1);
-                
+
                 if (wHour == "0:00 am")
 	                wHour = "12:00 am";
 	            else if (wHour == ":00 pm")
 	                wHour = "12:00 pm";
-	            
+
 	            if (hbhfData.Item("hicon" + [i]) == "-")
                     dIcon = "NA";
                 else if (hbhfData.Item("hicon" + [i]).length == 1)
                         dIcon = "0" + hbhfData.Item("hicon" + [i]);
                 else
                     dIcon = hbhfData.Item("hicon" + [i]);
-                
+
                 var ii = parseInt(i) - parseInt(minusNum);
                 document.getElementById("fly_for_info_" + ii).innerText = wHour;
                 setFontColor(document.getElementById("fly_for_info_" + ii).id);
@@ -679,15 +693,15 @@
             worldmapspan.style.visibility = "hidden";
             radarmapspan.style.visibility = "hidden";
             moonphase = true;
-            
+
             dMoonCnt = ccData.Item("moon");
-            
+
             for (i = 0; i <= 9; i++)
             {
                 dMoonCnt = parseInt(dMoonCnt) + 1;
                 if (dMoonCnt > 29)
                     dMoonCnt = 0;
-                
+
                 if (dMoonCnt == 0)
                     dPhase = "NM";
                 else if ((dMoonCnt > 0) && (dMoonCnt <= 6))
@@ -702,9 +716,9 @@
                         dPhase = "WanG";
                 else if (dMoonCnt == 22)
                         dPhase = "LQ";
-                else if ((dMoonCnt > 22) && (dMoonCnt <= 29)) 
+                else if ((dMoonCnt > 22) && (dMoonCnt <= 29))
                         dPhase = "WanC";
-                            
+
                 document.getElementById("fly_for_info_" + k).innerText = fData.Item("ddayOfWeek" + [k-1]).substr(0,3) + ", " + fData.Item("ddate" + [k-1]);
                 setFontColor(document.getElementById("fly_for_info_" + k).id);
                 document.getElementById("fly_for_temp_" + k).innerText = dPhase;
@@ -717,10 +731,10 @@
             document.getElementById("fly_click_r").style.visibility = "hidden";
             document.getElementById("fly_click_l").style.left = "234";
             fly_arrow_l.style.visibility = "hidden";
-            fly_arrow_r.style.visibility = "hidden";            
+            fly_arrow_r.style.visibility = "hidden";
             w=256;
             h=156;
-            latzero=h/2;            
+            latzero=h/2;
             longzero=w/2;
             x = (longzero + (locData.Item("longitude2") * w) / 360) + 88;
             y = (latzero - (locData.Item("latitude2") * h) / 180) + 250;
@@ -743,7 +757,7 @@
             setFontColor(map_loc2.id);
             setFontColor(map_loc2_tz.id);
             setFontColor(map_loc2_lon.id);
-            setFontColor(map_loc2_lat.id);            
+            setFontColor(map_loc2_lat.id);
             forspan.style.visibility = "hidden";
             worldmapspan.style.visibility = "visible";
             radarmapspan.style.visibility = "hidden";
@@ -779,7 +793,7 @@
         radarmapspan.style.visibility = "hidden";
         thirty = false;
         moonphase = false;
-        
+
         //loop through all 10 icons and set their src path
         for (i = 0; i < 10; i++)
         {
@@ -789,7 +803,7 @@
                 dIcon = "0" + fData.Item(dIcons + [i]);
             else
                 dIcon = fData.Item(dIcons + [i]);
-            
+
             var ii = i + 1;
             document.getElementById("fly_for_info_" + ii).innerText = fData.Item(dDay + [i]).substr(0,3) + ", " + fData.Item(dDate + [i]);
             setFontColor(document.getElementById("fly_for_info_" + ii).id);
@@ -799,27 +813,27 @@
 }
 
 function getWeatherInfo(wDay)
-{       
-	//determine detailed weather information on all options except radar and world map              
+{
+	//determine detailed weather information on all options except radar and world map
     var bIn, dCon, dHum, dRain, dDir, dSpee, dSunr, dSuns, addNum, newDate, dLow, dTerm;
     if ((worldmapspan.style.visibility == "hidden") && (radarmapspan.style.visibility == "hidden"))
 	{
 		//current weather information
 	    if (wDay < 0)
-	    { 
+	    {
 	        document.body.style.cursor = "default";
 	        info_line1.innerText = "Condition: " + ccData.Item("text") + " | Temperature: " +  convertTemp(ccData.Item("temp"));
 	        info_line2.innerText = "Wind Direction: " + ccData.Item("windDirectionText").toLowerCase() + " | Wind Speed: " +  convertDistance(ccData.Item("windSpeed"),0);
         	if ((ccData.Item("windDirectionText") == "CALM") || (ccData.Item("windDirectionText") == "VAR"))
         	    info_line2.innerText = info_line2.innerText.substr(0,info_line2.innerText.length -3);
-		    
+
 	        switch (SettingsManager.getValue("preferences", "press"))
 	        {
 	            case "Inch":
 	                bIn = ccData.Item("barReading") + " inHg";
 	                break;
 	            case "Mill":
-	                bIn = Math.round((ccData.Item("barReading") * 33.8637526) * 10) / 10 + " hPa";	                
+	                bIn = Math.round((ccData.Item("barReading") * 33.8637526) * 10) / 10 + " hPa";
 	                break;
 	            default:
 	                bIn = "";
@@ -832,8 +846,8 @@
 	        info_line8.innerText = "Sunrise: " + convertTime(fData.Item("dsunrise0")) + " | Sunset: " +  convertTime(fData.Item("dsunset0"));
 	    }
         else
-        {    
-        	//moonphase gets default weather information    	
+        {
+        	//moonphase gets default weather information
             if (!moonphase)
             {
             	//30 hour forecast information
@@ -845,7 +859,7 @@
                         addNum = 10;
                     else if ((fly_arrow_l.style.visibility == "visible") && (fly_arrow_r.style.visibility == "hidden"))
                         addNum = 20;
-                    
+
                     var wtDay = wDay + 1;
                     document.body.style.cursor = "hand";
                     info_line1.innerText = nDate[wDay + addNum];
@@ -855,7 +869,7 @@
 	                info_line5.innerText = "Wind Direction: " + hbhfData.Item("hwinddirectiontext" + [wDay + addNum]) + " | " + "Wind Speed: " +  convertDistance(hbhfData.Item("hwindspeed" + [wDay + 1]),0);
 	                if ((hbhfData.Item("hwinddirectiontext" + [wDay + addNum]) == "CALM") || (hbhfData.Item("hwinddirectiontext" + [wDay + addNum]) == "VAR"))
 		                info_line5.innerText = info_line5.innerText.substr(0,info_line5.innerText.length -3);
-		        
+
 	                info_line6.innerText = "Feels Like: " + convertTemp(hbhfData.Item("hflike" + [wDay + addNum]));
                     info_line7.innerText = "Dew Point: " +  convertTemp(hbhfData.Item("hdew" + [wDay + addNum]));
                     info_line8.innerText = "Chance of Rain: " + hbhfData.Item("hprec" + [wDay + addNum]);
@@ -864,10 +878,10 @@
                 {
                 	//10 day/night forecast information
                     var yrdate = new Date(System.Time.getLocalTime(System.Time.currentTimeZone));
-                    var nsdate = new Date(beginDate + ", " + yrdate.getFullYear());                    
-                    var d2 = nsdate.add("d", wDay);                    
+                    var nsdate = new Date(beginDate + ", " + yrdate.getFullYear());
+                    var d2 = nsdate.add("d", wDay);
                     document.body.style.cursor = "hand";
-                    
+
                     switch (dayOnight)
                     {
                         case -2:
@@ -894,7 +908,7 @@
                             dTerm = "High";
                             break;
                     }
-                                        
+
                     info_line1.innerText = d_names[d2.getDay()] + ", " + m_names[d2.getMonth()] + " " + d2.getDate();
                     info_line2.innerText = "Condition: " + fData.Item(dCon + [wDay]);
                     info_line3.innerText = "Today's " + dTerm + ": " +  convertTemp(fData.Item(dLow + [wDay]));
@@ -904,7 +918,7 @@
                     info_line7.innerText = "Wind Speed: " +  convertDistance(fData.Item(dSpee + [wDay]),0);
                     if ((fData.Item(dDir + [wDay]) == "CALM") || (fData.Item(dDir + [wDay]) == "VAR"))
 		                info_line7.innerText = info_line7.innerText.substr(0,info_line7.innerText.length -3);
-		                
+
                     info_line8.innerText = "Sunrise: " + convertTime(fData.Item(dSunr + [wDay])) + " | Sunset: " +  convertTime(fData.Item(dSuns + [wDay]));
                 }
             }
@@ -918,10 +932,10 @@
         document.body.style.cursor = "pointer";
     else
         document.body.style.cursor = "default";
-    
+
     document.getElementById("fly_mouse_over_" + which).style.visibility = show;
     document.getElementById("fly_mouse_over_" + which).style.left = num;
-    
+
     if ((xmlDOM.selectSingleNode("/weather").getElementsByTagName("swa").length) && (txt == "0"))
         turnOnAlert(true);
     else
@@ -929,11 +943,11 @@
 }
 
 function butSwap(imgID,nm,ud)
-{  
+{
     rad_path = document.getElementById(imgID).src;
     rad_path = rad_path.substr(rad_path.length -4,1);
     rad_which = imgID.substr(imgID.length -1,1);
-    
+
     if (ud != "")
         document.getElementById(imgID).src = "images/" + SettingsManager.getValue("preferences", "color") + "_col/" + nm + "_" + ud + ".png";
     else
@@ -944,7 +958,7 @@
 		    if (u != parseInt(rad_which))
 		        document.getElementById("radar_opt_" + u).src = "images/" + SettingsManager.getValue("preferences", "color") + "_col/" + nm + "_u.png";
 		}
-		
+
 		//which radio button is selected
 		switch (parseInt(rad_which))
 		{
@@ -960,8 +974,8 @@
 		    case 4:
 		        rad_rad = "";
 		        break;
-		}	
-	    
+		}
+
 	    //go after radar information
 	    getRadar(locData.Item("latitude2"), locData.Item("longitude2"), 318, 157, rad_zoom, "h", rad_rad, 60);
     }
@@ -971,15 +985,15 @@
 {
     if (SettingsManager.getValue("preferences", "sound") == "On")
 	    System.Sound.playSound("media/tone.wav");
-	
-	//zoom in and out on predetermined levels    
+
+	//zoom in and out on predetermined levels
     if ((zw == "zi") && (rad_zoom < 18))
         rad_zoom = rad_zoom + 2;
     else if ((zw = "zo") && (rad_zoom > 2))
         rad_zoom = rad_zoom - 2;
     else
         rad_zoom = zl;
-    
+
     //go after radar information
     getRadar(locData.Item("latitude2"), locData.Item("longitude2"), 318, 157, rad_zoom, "h", rad_rad, 60);
 }
@@ -989,16 +1003,16 @@
 	getXML(loc_ID);
 	if (timeoutDetected == 1)		// first timeout, wait 30 seconds
 		setTimeout("getXML("+ loc_ID + ")",30000);
-	
+
 	if (timeoutDetected == 1)		// second timeout, wait 1 minute
 		setTimeout("getXML("+ loc_ID + ")",60000);
-	
+
 	if (timeoutDetected == 1)		// third timeout, wait 5 minutes
 		setTimeout("getXML("+ loc_ID + ")",300000);
-	
+
 	if (timeoutDetected == 1)		// fourth timeout, wait 10 minutes
 		setTimeout("getXML("+ loc_ID + ")",600000);
-	
+
 	if (timeoutDetected == 0)		// if successful parse, else give up
 		parseXML(loc_ID);
 }
@@ -1010,7 +1024,7 @@
     //else
     //{
         var getInfoText = new Array("Weather Forecast For " + locData.Item("name2"),"Weather Forecast For 10 Days","Weather Forecast For 10 Nights","Weather Forecast For 30 Hours","Changing of Moon Phases","Navigational Display","Local Radar","Settings Menu","Switch Locations","Show Next 10 Hours","Show Previous 10 Hours");
-        
+
         setFontColor(main_data.id);
         setFontColor(status_line.id);
         return getInfoText[txt];
@@ -1037,14 +1051,14 @@
 	        else
 	            newLoc = SettingsManager.getValue("location", "locIDH");
 	    }
-    	
+
 	    xmlURL = WEATHER_DATA + "weather/local/" + newLoc + "?cc=*&dayf=" + NUM_FORCAST_DAYS + "&unit=s&hbhf=" + NUM_FORCAST_HOURS;
-    	
+
 	    timeoutDetected = 1;		// set default after checking for correct updateType
-    	
-	    // SET UP XML OBJECT, GET XML	
-        xmlDOM.setProperty("SelectionLanguage", "XPath");    
-        xmlDOM.async = false;    
+
+	    // SET UP XML OBJECT, GET XML
+        xmlDOM.setProperty("SelectionLanguage", "XPath");
+        xmlDOM.async = false;
         xmlDOM.load(xmlURL);
 
         if (xmlDOM.xml == "")		//nothing was loaded. same as timeout
@@ -1070,14 +1084,14 @@
 		    produceError("parseXML() Error: XML Error code " + xmlDOM.selectSingleNode("/error/err").getAttribute("type") + ": " + xmlDOM.selectSingleNode("/error/err").text);
 		    return;
 	    }
-    	
+
 	    //****  EXTRACT VALUES FROM XML ****
 	    // <loc> section
 	    if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("loc").length)
 	    {
 		    // delete old data
 		    locData.RemoveAll();
-		    // get new data		
+		    // get new data
 		    if (SettingsManager.getValue("location", "locIDH") != SettingsManager.getValue("location", "locIDS"))
 		    {
 		        if (loc_ID == 1)
@@ -1110,7 +1124,7 @@
 	                locData.add("latitude2", xmlDOM.selectSingleNode("/weather/loc/lat").text);
 	                locData.add("longitude2", xmlDOM.selectSingleNode("/weather/loc/lon").text);
 	                locData.add("zone2", xmlDOM.selectSingleNode("/weather/loc/zone").text);
-	                secName = locData.Item("name").substr(0,locData.Item("name").indexOf(","));	            
+	                secName = locData.Item("name").substr(0,locData.Item("name").indexOf(","));
                     secLati = locData.Item("latitude");
                     secLong = locData.Item("longitude");
                     secZone = locData.Item("zone");
@@ -1139,7 +1153,7 @@
 		    ccData.add("windDirectionText", xmlDOM.selectSingleNode("/weather/cc/wind/t").text);
 		    ccData.add("windSpeed", xmlDOM.selectSingleNode("/weather/cc/wind/s").text);
 		    ccData.add("windGust", xmlDOM.selectSingleNode("/weather/cc/wind/gust").text);
-		    ccData.add("windDirectionDeg", xmlDOM.selectSingleNode("/weather/cc/wind/d").text);		    
+		    ccData.add("windDirectionDeg", xmlDOM.selectSingleNode("/weather/cc/wind/d").text);
 		    ccData.add("humidity", xmlDOM.selectSingleNode("/weather/cc/hmid").text + PERCENT_SYMBOL);
 		    ccData.add("visibility", xmlDOM.selectSingleNode("/weather/cc/vis").text);
 		    ccData.add("uvIndex", xmlDOM.selectSingleNode("/weather/cc/uv/i").text);
@@ -1147,16 +1161,16 @@
 		    ccData.add("dewPoint", xmlDOM.selectSingleNode("/weather/cc/dewp").text);
 		    ccData.add("moon", xmlDOM.selectSingleNode("/weather/cc/moon/icon").text);
 	    }
-    	
+
 	    // <hbhf> section
 	    if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("hbhf").length)
 	    {
             // delete old data
             hbhfData.RemoveAll();
-	            
+
 		    var hourlist = xmlDOM.selectNodes("/weather/hbhf/hour");
 		    for (var i = 0; i < hourlist.length; i++)
-		    {	
+		    {
 			    // PARSE EACH HOUR
 			    hbhfData.add("hhour" + i, hourlist[i].getAttribute("h"));
 			    hbhfData.add("hmili" + i, hourlist[i].getAttribute("c"));
@@ -1168,30 +1182,30 @@
 			    hbhfData.add("hwinddirectiontext" + i, hourlist[i].getElementsByTagName("wind/t").item(0).text);
 			    hbhfData.add("hwindspeed" + i, hourlist[i].getElementsByTagName("wind/s").item(0).text);
 			    hbhfData.add("hdew" + i, hourlist[i].getElementsByTagName("dewp").item(0).text);
-			    hbhfData.add("hhumidity" + i, hourlist[i].getElementsByTagName("hmid").item(0).text + PERCENT_SYMBOL);		
+			    hbhfData.add("hhumidity" + i, hourlist[i].getElementsByTagName("hmid").item(0).text + PERCENT_SYMBOL);
 		    }
 	    }
-	    
+
 	    // <swa> section Severe Weather Alert
         if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("swa").length)
         {
 	        // delete old data
 	        swData.RemoveAll();
-	        // get new data		    
+	        // get new data
 	        swData.add("alert", xmlDOM.selectSingleNode("/weather/swa/a/t").text);
 	        swData.add("link", xmlDOM.selectSingleNode("/weather/swa/a/l").text);
         }
-    	
+
 	    // <dayf> section
 	    if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("dayf").length)
 	    {
 	        // delete old data
 	        fData.RemoveAll();
-	            
-		    var fLastUpdate = xmlDOM.selectSingleNode("/weather/dayf/lsup").text;				
+
+		    var fLastUpdate = xmlDOM.selectSingleNode("/weather/dayf/lsup").text;
 		    var daylist = xmlDOM.selectNodes("/weather/dayf/day");
 		    for (var i = 0; i < daylist.length; ++i)
-		    {	
+		    {
 			    // get new data
 			    var partlist = daylist[i].getElementsByTagName("part");
 			    // PARSE EACH PART OF THE DAY
@@ -1208,7 +1222,7 @@
 					    produceError("ParseXML() Error: one <part> section for " + fData.date + ", but it is not for night!");
 					    return;
 				    }
-    				
+
 				    fData.add("dnum" + i, daylist[i].getAttribute("d"));
 				    fData.add("ddate" + i, daylist[i].getAttribute("dt"));
 				    fData.add("ddayOfWeek" + i, daylist[i].getAttribute("t"));
@@ -1305,10 +1319,10 @@
 				    return;
 			    }
 		    }
-	    } 		
+	    }
 	}
     catch(e)
-    {   
+    {
         produceError("parseXML() Error: Error occured during XML element extraction! - " + e.description);
     }
 }
@@ -1327,7 +1341,7 @@
 
     if (!fso.FolderExists(GADGET_PATH + ERR_PATH + user.UserName))
         fso.CreateFolder(GADGET_PATH + ERR_PATH + user.UserName);
- 
+
     var myFile = fso.OpenTextFile(GADGET_PATH + ERR_PATH + user.UserName + ERR_FILE, 8, true);
     myFile.WriteLine("Fly_Out - " + t_hour + ":" + t_min + ":" + t_sec + " - " + t_date + "/" + t_mon + "/" + t_year + " " + msg);
     myFile.Close();
diff -Nur ProWeather/en-US/js/weather_main.js ProWeatherByTommy/en-US/js/weather_main.js
--- ProWeather/en-US/js/weather_main.js	Sat Mar 15 12:01:14 2008
+++ ProWeatherByTommy/en-US/js/weather_main.js	Tue Feb 10 13:54:54 2009
@@ -3,7 +3,7 @@
 /*
     Vad_M for the permission in using his images in the making of this gadget
     Weather.com for their radar API
-    Todd Northrop for his SettingsManager script    
+    Todd Northrop for his SettingsManager script
 */
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -12,6 +12,9 @@
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /*
     loadMain()			                           			**Initial load
+    // add by tommy, 20090210 begin
+    gadgetClickSwitch()	                         			**Switch location
+    // add by tommy, 20090210 end
     gadgetClickClose()	                         			**Close flyout gadget
     gadgetClickOpen()                              			**Open flyout gadget
     setImages()		                             			**Load initial images and text
@@ -31,16 +34,16 @@
 
 window.onload = function(){
     SettingsManager.loadFile();
-    loadMain();    
+    loadMain();
 }
 
     // INITIAL VARIABLE SETUP
     try
     {
         var timeoutDetected;   //0=no timeout, 1=timeout
-        
+
         var locName, timeInt, xmlURL, icon, sleepVal, alertTime;
-        
+
         var xmlDOM = new ActiveXObject("Microsoft.XMLDOM");
         var headData = new ActiveXObject("Scripting.Dictionary");
         var locData = new ActiveXObject("Scripting.Dictionary");
@@ -48,16 +51,16 @@
         var swData = new ActiveXObject("Scripting.Dictionary");
         var fso = new ActiveXObject("Scripting.FileSystemObject");
         var user = new ActiveXObject("Wscript.Network");
-      
+
         System.Gadget.Flyout.onHide = settingsClosed;
     }
     catch(e)
-    {   
+    {
         produceError("Initialization Error! - " + e.description);
     }
-    
+
 function loadMain()
- {  
+ {
     if (!SettingsManager.getValue("location", "locIDH"))
     {
         activationScreen.style.display = "block";
@@ -74,28 +77,47 @@
         tryXML();
 }
 
+// add by tommy, 20090210 begin
+function gadgetClickSwitch()
+{
+    if (SettingsManager.getValue("location", "locIDS") != "")
+    {
+        var tempID, tempName;
+
+        tempID = SettingsManager.getValue("location", "locIDH");
+        tempName = SettingsManager.getValue("location", "locNameH");
+        SettingsManager.setValue("location", "locIDH", SettingsManager.getValue("location", "locIDS"));
+        SettingsManager.setValue("location", "locNameH", SettingsManager.getValue("location", "locNameS"));
+        SettingsManager.setValue("location", "locIDS", tempID);
+        SettingsManager.setValue("location", "locNameS", tempName);
+        SettingsManager.saveFile();
+        tryXML();
+    }
+}
+// add by tommy, 20090210 end
+
 function gadgetClickClose()
-{ 
+{
 	if (System.Gadget.Flyout.show)
 	{
 	    if (SettingsManager.getValue("preferences", "sound") == "On")
 	        System.Sound.playSound("media/mode_1.wav");
-	        
+
 	    System.Gadget.Flyout.show = false;
 	    main_arrow_l.style.visibility = "visible";
-	    main_arrow_r.style.visibility = "hidden";        
+	    main_arrow_r.style.visibility = "hidden";
 	}
 }
 
 function gadgetClickOpen()
 {
     if (!System.Gadget.Flyout.show)
-    {       
+    {
         System.Gadget.Flyout.show = true;
         main_arrow_l.style.visibility = "hidden";
         if (SettingsManager.getValue("location", "locIDH"))
             main_arrow_r.style.visibility = "visible";
-    }    
+    }
 }
 
 function setImages()
@@ -110,23 +132,23 @@
             if (ccData.Item("icon").length == 1)
                 icon = "0" + ccData.Item("icon");
             else
-                icon = ccData.Item("icon");        
+                icon = ccData.Item("icon");
         }
-        
+
         document.getElementById("background").setAttribute("src","images/" + SettingsManager.getValue("preferences", "color") + "_col/" + MAIN_SCREEN_BG);
         document.getElementById("main_shine").setAttribute("src",MAIN_SCREEN_SH);
         document.getElementById("main_icon").setAttribute("src",WEATHER_IMAGES_PATH + icon + ".png");
         document.getElementById("main_arrow_l").setAttribute("src","images/" + SettingsManager.getValue("preferences", "color") + "_col/arrow_l_up.png");
-        document.getElementById("main_arrow_r").setAttribute("src","images/" + SettingsManager.getValue("preferences", "color") + "_col/arrow_r_up.png");        
+        document.getElementById("main_arrow_r").setAttribute("src","images/" + SettingsManager.getValue("preferences", "color") + "_col/arrow_r_up.png");
         main_temp.innerText = convertTemp(ccData.Item("temp"));
         locName = locData.Item("name");
-        
+
         main_location.innerText = locName;
         main_shine.alt = convertTemp(ccData.Item("temp")) + " in " + locName;
         main_temp.style.color = SettingsManager.getValue("preferences", "fontcolor");
     }
     catch(e)
-    {   
+    {
         produceError("Setting Images Error! - " + e.description);
     }
 }
@@ -135,7 +157,7 @@
 {
     SettingsManager.loadFile();
     if (SettingsManager.getValue("location", "locIDH"))
-    {   
+    {
         main_arrow_r.style.visibility = "hidden";
         main_shine.onclick = null;
         setTimeout("tryXML()",500);
@@ -147,18 +169,18 @@
 
 function settingsChanged()
 {
-    // do a current conditions update every time   
+    // do a current conditions update every time
     if (!System.Gadget.Flyout.show)
-    {   
+    {
         setImages();
-        
+
         activationScreen.style.display = "none";
         main_icon.style.visibility = "visible";
-        main_arrow_l.style.visibility = "visible";        
+        main_arrow_l.style.visibility = "visible";
         System.Gadget.Flyout.file = FLYOUT_FILE;
-        
+
         if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("swa").length)
-        {   
+        {
             document.getElementById("main_alert").setAttribute("src",OTHER_IMAGES_PATH + "alert_still.png");
             main_alert.style.visibility = "visible";
             main_location.style.visibility = "hidden";
@@ -181,7 +203,7 @@
     {
         if (SettingsManager.getValue("preferences", "temp") == "C")
             temp = Math.round((parseInt(temp) - 32) / 1.8);
-            
+
         return temp + DEGREE_SYMBOL + SettingsManager.getValue("preferences", "temp");
     }
 }
@@ -217,15 +239,15 @@
     main_arrow_l.style.visibility = "hidden";
     main_alert.style.visibility = "hidden";
     clearTimeout(alertTime);
-    main_temp.innerText = "";    
+    main_temp.innerText = "";
     main_location.innerText = "";
     main_shine.alt = "";
     activationScreen.innerHTML = ['<div id="noinet">No Internet or Weather Service Available at this time...</div>'].join('');
 }
 
-function tryXML()		// tries to getXML and if/when successful, parseXML       
+function tryXML()		// tries to getXML and if/when successful, parseXML
 {
-	getXML();	
+	getXML();
 	if (timeoutDetected == 1)		// timeout
 		setTimeout("tryXML()",5000);
     else
@@ -237,15 +259,15 @@
 
 function getXML()		// gets the XML page from the server
 {
-    // GET THE URL    
+    // GET THE URL
     xmlURL = WEATHER_DATA + "weather/local/" + SettingsManager.getValue("location", "locIDH") + "?cc=*&unit=s";
     timeoutDetected = 1;		// set default after checking for correct updateType
-	
-    // SET UP XML OBJECT, GET XML	
+
+    // SET UP XML OBJECT, GET XML
     xmlDOM.setProperty("SelectionLanguage", "XPath");
     xmlDOM.async = false;
     xmlDOM.load(xmlURL);
-    
+
     //nothing was loaded. same as timeout
     if (xmlDOM.xml == "")
         noInternetFound(e);
@@ -256,15 +278,15 @@
 function parseXML()
 {
 	try
-	{		
+	{
 	    // CHECK FOR OFFICIAL WEATHER.COM XML ERRORS
 	    if (xmlDOM.getElementsByTagName("error").length > 0)
 	    {
 		    produceError("parseXML() Error: XML Error code " + xmlDOM.selectSingleNode("/error/err").getAttribute("type") + ": " + xmlDOM.selectSingleNode("/error/err").text);
 		    return;
 	    }
-    	
-	    //****  EXTRACT VALUES FROM XML ****	
+
+	    //****  EXTRACT VALUES FROM XML ****
 	    var objNode = xmlDOM.selectSingleNode("/weather")
         if (objNode != null)
         {
@@ -280,7 +302,7 @@
 		        if (SHOW_UNITS_FOR_TEMP == "y")
 			        tempExtra = DEGREE_SYMBOL + headData.item("tempUnit");
             }
-    		
+
 	        // <loc> section
 	        if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("loc").length)
 	        {
@@ -290,29 +312,29 @@
 		        locData.add("id", xmlDOM.selectSingleNode("/weather/loc").getAttribute("id"));
 		        locData.add("name", xmlDOM.selectSingleNode("/weather/loc/dnam").text);
 	        }
-    	
+
 	        // <cc> section
 	        if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("cc").length)
 	        {
 		        // delete old data
 		        ccData.RemoveAll();
-		        // get new data		    
+		        // get new data
 		        ccData.add("temp", xmlDOM.selectSingleNode("/weather/cc/tmp").text);
 		        ccData.add("icon", xmlDOM.selectSingleNode("/weather/cc/icon").text);
 	        }
-	        
+
 	        // <swa> section Severe Weather Alert
 	        if (xmlDOM.selectSingleNode("/weather").getElementsByTagName("swa").length)
 	        {
 		        // delete old data
 		        swData.RemoveAll();
-		        // get new data		    
-		        swData.add("alert", xmlDOM.selectSingleNode("/weather/swa/a/t").text);		        
+		        // get new data
+		        swData.add("alert", xmlDOM.selectSingleNode("/weather/swa/a/t").text);
 	        }
-	    }    			
+	    }
 	}
     catch(e)
-    {   
+    {
         produceError("parseXML() Error: Error occured during XML element extraction! - " + e.description);
     }
 }
@@ -331,7 +353,7 @@
 
     if (!fso.FolderExists(GADGET_PATH + ERR_PATH + user.UserName))
         fso.CreateFolder(GADGET_PATH + ERR_PATH + user.UserName);
- 
+
     var myFile = fso.OpenTextFile(GADGET_PATH + ERR_PATH + user.UserName + ERR_FILE, 8, true);
     myFile.WriteLine("Main - " + t_hour + ":" + t_min + ":" + t_sec + " - " + t_date + "/" + t_mon + "/" + t_year + " " + msg);
     myFile.Close();
Binary files ProWeather/en-US/weather_main.html and ProWeatherByTommy/en-US/weather_main.html differ
