<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs directory_title="Doppler Radar and Severe Weather Alerts" title="__UP_namea__" title_url="http://www.floen.com/ATOM/weather/" author="Terence Floen" author_email="googlexml@floen.com" author_location="New York" screenshot="http://www.floen.com/ATOM/weather/screenshot.jpg" thumbnail="http://www.floen.com/ATOM/weather/dopplerradar.png" description="Doppler radar of your surrounding area, severe weather alerts in your county, and local weather information." author_photo="http://www.floen.com/ATOM/weather/terence.PNG" author_aboutme="Started coding back in the days of Basic!  Ohh I miss that little program `snake`!" author_link="http://www.floen.com/" author_quote="If Not IsRich(IsNice(IsSmart(User.ToSring))) Then Return" >
  <Require feature="analytics" />
  <Require feature="setprefs" />
  <Require feature="dynamic-height" />
  </ModulePrefs>
  <UserPref name="namea" display_name="Module title" datatype="hidden" default_value="Doppler Radar with Alerts" required="true"/>
  <UserPref name="doplarani" display_name="Zip Code" default_value="*" required="true"/>
  <UserPref name="wwars" display_name="County Code"/>
  <UserPref name="mytempchoice" display_name="Show Temps" datatype="bool" default_value="true"/>
  <UserPref name="mygrowchoice" display_name="Radar zoom (100-300)" default_value="150"/>
  <UserPref name="stasize" datatype="enum" display_name="Picture size" default_value="closest">
    <EnumValue value="closest" display_value="Closest possible" />
    <EnumValue value="closeradar" display_value="600 mile (always available)"/>
    <EnumValue value="ultraradar" display_value="300 mile (not all areas)"/>
    <EnumValue value="metroradar" display_value="100 mile (major cities only)"/>
  </UserPref>
  <UserPref name="anisize" datatype="enum" display_name="Animation size" default_value="closeradar">
    <EnumValue value="closeradar" display_value="600 mile (always available)" />
    <EnumValue value="ultraradar" display_value="300 mile (not all areas)" />
    <EnumValue value="metroradar" display_value="100 mile (major cities only)" />
  </UserPref>
  <UserPref name="mycustomjpg" display_name="Custom radar image URL" default_value=""/>
  <UserPref name="modversion" datatype="enum" display_name="Current Version" default_value="v32">
    <EnumValue value="v322" display_value="3.22" />
    <EnumValue value="v" display_value=" " />
  </UserPref>
  <Content type="html">
    <![CDATA[ 
       <!-- load the NXSL library --> 
       <script src="http://www.google.com/js/nxsl.1.js" type="text/javascript"></script>
       <div style="display:none;" id=hidden__MODULE_ID__></div>
       <div style="display:none;" id=hiddenp__MODULE_ID__></div>
       <span style="font-weight: bolder; font-size: 10pt; color: red" id="content___MODULE_ID__"></span>
       <span id="consetmodup___MODULE_ID__"></span>
 <table id="table1" border="0" align="center" cellspacing="0" cellpadding="0" width="280">
		<tr>
			<td width="8" height="1"></td>
			<td height="1" width="100%"></td>
			<td height="1" nowrap></td>
		</tr>
		<tr>
			<td width="6"></td>
			<td width="100%" height="145">
				<span align="center" id="contentDYN___MODULE_ID__"><p align="center">
        <img border="0" src="http://www.floen.com/ATOM/weather/loading.gif" width="49" height="50"></p>
				</span>
			</td>
			<td style="padding-left: 3px" nowrap>
				<span id="conwetmodup___MODULE_ID__" style="letter-spacing: -1pt"></span>
			</td>
		</tr>
		<tr>
			<td width="8" height="1"></td>
			<td height="1" width="100%"><img src="http://c14.statcounter.com/counter.php?sc_project=1807962&amp;java=0&amp;security=9544ac8a&amp;invisible=1" border="0"><img src="http://c.statcounter.com/3944932/0/70f6368d/1/" alt="" border="0"></td>
			<td height="1" nowrap></td> 
		</tr>
	</table><span id="conmsgmodup___MODULE_ID__"></span>
<script>

// how many milliseconds we should wait between resizing events
var resizeDelay = 5;
// how many pixels we should grow or shrink by each time we resize
var resizeIncrement = 10;

// this will hold information about the images we're dealing with
var imgCache = new Object();


function getCacheTag (imgElement) {
	return imgElement.src + "~" + imgElement.offsetLeft + "~" + imgElement.offsetTop;
}



function cachedImg (imgElement, increment) {
	this.img = imgElement;
	this.cacheTag = getCacheTag(imgElement);
	this.originalSrc = imgElement.src;
	
	var h = imgElement.height;
	var w = imgElement.width;
	this.originalHeight = h;
	this.originalWidth = w;
	
	increment = (!increment) ? resizeIncrement : increment;
	this.heightIncrement = Math.ceil(Math.min(1, (h / w)) * increment);
	this.widthIncrement = Math.ceil(Math.min(1, (w / h)) * increment);
}


function resizeImg (imgElement, percentChange, newImageURL) {
	// convert the percentage (like 150) to an percentage value we can use
	// for calculations (like 1.5)
	var pct = (percentChange) ? percentChange / 100 : 1;
	
	// if we've already resized this image, it will have a "cacheTag" attribute
	// that should uniquely identify it. If the attribute is missing, create a
	// cacheTag and add the attribute
	var cacheTag = imgElement.getAttribute("cacheTag");
	if (!cacheTag) {
		cacheTag = getCacheTag(imgElement);
		imgElement.setAttribute("cacheTag", cacheTag);
	}
	
	// look for this image in our image cache. If it's not there, create it.
	// If it is there, update the percentage value.
	var cacheVal = imgCache[cacheTag];
	if (!cacheVal) {
		imgCache[cacheTag] = new Array(new cachedImg(imgElement), pct);
	} else {
		cacheVal[1] = pct;
	}
	
	// if we're supposed to be using a rollover image, use it
	if (newImageURL)
		imgElement.src = newImageURL;
	
	// start the resizing loop. It will continue to call itself over and over
	// until the image has been resized to the proper value.
	resizeImgLoop(cacheTag);
	return true;
}


function resizeImgLoop (cacheTag) {
	// get information about the image element from the image cache
	var cacheVal = imgCache[cacheTag];
	if (!cacheVal)
		return false;
	
	var cachedImageObj = cacheVal[0];
	var imgElement = cachedImageObj.img;
	var pct = cacheVal[1];
	var plusMinus = (pct > 1) ? 1 : -1;
	var hinc = plusMinus * cachedImageObj.heightIncrement;
	var vinc = plusMinus * cachedImageObj.widthIncrement;
	var startHeight = cachedImageObj.originalHeight;
	var startWidth = cachedImageObj.originalWidth;
	
	var currentHeight = imgElement.height;
	var currentWidth = imgElement.width;
	var endHeight = Math.round(startHeight * pct);
	var endWidth = Math.round(startWidth * pct);
	
	// if the image is already the right size, we can exit
	if ( (currentHeight == endHeight) || (currentWidth == endWidth) ) {
		_IG_AdjustIFrameHeight();
		return true;
		}
	
	// increase or decrease the height and width, making sure we don't get
	// larger or smaller than the final size we're supposed to be
	var newHeight = currentHeight + hinc;
	var newWidth = currentWidth + vinc;
	if (pct > 1) {
		if ((newHeight >= endHeight) || (newWidth >= endWidth)) {
			newHeight = endHeight;
			newWidth = endWidth;
		}
	} else {
		if ((newHeight <= endHeight) || (newWidth <= endWidth)) {
			newHeight = endHeight;
			newWidth = endWidth;
		}
	}
	
	// set the image element to the new height and width
	imgElement.height = newHeight;
	imgElement.width = newWidth;
	
	// if we've returned to the original image size, we can restore the
	// original image as well (because we may have been using a rollover
	// image in the original call to resizeImg)
	if ((newHeight == cachedImageObj.originalHeight) || (newWidth == cachedImageObj.originalwidth)) {
		imgElement.src = cachedImageObj.originalSrc;
	}
	
	// shrink or grow again in a few milliseconds
	setTimeout("resizeImgLoop('" + cacheTag + "')", resizeDelay);
}

    	function dothexmlget() {
		_IG_FetchXmlContent("http://www.floen.com/ATOM/weather/messages.xml", function (response) {
               		if (response == null || typeof(response) != "object" || response.firstChild == null) {
                  		return;
               		}
               		var title = response.getElementsByTagName("messages").item(0).getAttribute("title1");
       	       		var data = "";
	
        		if (title == "none") {
               			return;
                       	} else if (title == "vote") {
				if (WXreadCookieWork("WxVoted") == null) {
					var itemList = response.getElementsByTagName("messages");
					var nodeList = itemList.item(0).childNodes;
					var node = nodeList.item(0);
					data = node.firstChild.nodeValue;
				    	_gel("conmsgmodup___MODULE_ID__").innerHTML = data;
				} 
			} else if (title == "ad") {
				if (WXreadCookieWork("WxHideAd") == null) {
					var itemList = response.getElementsByTagName("messages");
					var nodeList = itemList.item(0).childNodes;
					var node = nodeList.item(0);
					data = node.firstChild.nodeValue;
				    	_gel("conmsgmodup___MODULE_ID__").innerHTML = data ;
				}
			} else {
				var itemList = response.getElementsByTagName("messages");
				var nodeList = itemList.item(0).childNodes;
				var node = nodeList.item(0);
				data = node.firstChild.nodeValue;
				_gel("conmsgmodup___MODULE_ID__").innerHTML = data ;
			}
	    	}, { refreshInterval: 30 });
	}


	function WXeraseCookie(name) {
		WXcreateCookie(name,"",-1);
	}


	
        function popUper() {
		theone =5
		for (i=0;i<document.testerdo.letter.length;i++){
			if (document.testerdo.letter[i].checked==true)
			theone=document.testerdo.letter[i].value
		}
		if (theone!=5) {
			_gel("conmsgmodup___MODULE_ID__").innerHTML="";
			WXcreateCookie("WxVoted","True",720)
			window.location = theone
		}
	}

        function ClearUserMsg() {
		_gel("conmsgmodup___MODULE_ID__").innerHTML="";
		_IG_AdjustIFrameHeight();
	}


        function HideUserMsgVote() {
		_gel("conmsgmodup___MODULE_ID__").innerHTML="";
		WXcreateCookie("WxVoted","True",2)
		_IG_AdjustIFrameHeight();
	}
        function HideUserMsgAd() {
		_gel("conmsgmodup___MODULE_ID__").innerHTML="";
		WXcreateCookie("WxHideAd","True",1)
		_IG_AdjustIFrameHeight();
	}


	function WXcreateCookie(name,value,hours) {
		if (hours) {
			var date = new Date();
			date.setTime(date.getTime()+(2*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else {
			var date = new Date();
			date.setTime(date.getTime()+(2*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		document.cookie = name+"="+value+expires+"; path=/";
	}

	function WXreadCookie(name) {
		_gel('conwetmodup___MODULE_ID__').innerHTML = WXreadCookieWork(name);
	}

	function WXreadCookieWork(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		var WXinfo = "nottt";
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}


       var prefs = new _IG_Prefs(__MODULE_ID__);
       var zipPref = prefs.getString("doplarani");
       var tempPref = prefs.getString("mytempchoice");
       var anisizePref = prefs.getString("anisize");
       var growchoicePref = prefs.getString("mygrowchoice");

       if (prefs.getString("mycustomjpg")) {
          var customjpgPref = prefs.getString("mycustomjpg");
       } else {
          var customjpgPref = "";
       }
       
       if (prefs.getString("wwars")) {
          var wwarsPref = prefs.getString("wwars");
          wwarsPref = wwarsPref.toUpperCase(); 
          wwarsPref = wwarsPref.replace(' ', '')
       } else {
          var wwarsPref = "";
       }

       if (growchoicePref < 100) {
          growchoicePref = 100
       } else {
         if (growchoicePref > 300) {
            growchoicePref = 300
         }
       }

       if (tempPref == true) {
          _gel('conwetmodup___MODULE_ID__').innerHTML = '<img border="0" src="http://image.weather.com/web/common/wxicons/31/666.gif" width="45" height="34">';
       }
       
       zipPref = zipPref.replace('*', '')
       zipPref = zipPref.replace(' ', '')
       var url = 'http://www.weather.gov/alerts/wwarssget.php?zone=' + wwarsPref; 

       function wxiconlookup(txt)
       {
       var endinghtm = 'width="18" height="18" />'

       if (txt.indexOf('Heavy Rain Icy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/10.gif" alt="Heavy Rain Icy" ' + endinghtm
       } 
       if (txt.indexOf('Heavy Rain') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/12.gif" alt="Heavy Rain" ' + endinghtm
       }
       if (txt.indexOf('Showers / Wind') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/12.gif" alt="Showers / Wind" ' + endinghtm
       }
       if (txt.indexOf('Showers') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/12.gif" alt="Showers" ' + endinghtm
       }
       if (txt.indexOf('Light Rain Icy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/8.gif" alt="Light Rain Icy" ' + endinghtm
       } 
       if (txt.indexOf('Light Rain') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/9.gif" alt="Light Rain" ' + endinghtm
       } 
       if (txt.indexOf('Windy Rain') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/2.gif" alt="Windy Rain" ' + endinghtm
       } 
       if (txt.indexOf('Rain Icy Mix') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/7.gif" alt="Rain Icy Mix" ' + endinghtm
       } 
       if (txt.indexOf('Rain') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/11.gif" alt="Rain" ' + endinghtm
       } 
       if (txt.indexOf('Windy/Snowy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/43.gif" alt="Windy/Snowy" ' + endinghtm
       } 
       if (txt.indexOf('Light Snow') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/13.gif" alt="Light Snow" ' + endinghtm
       } 
       if (txt.indexOf('Sunny/Heavy Snow') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/41.gif" alt="Sunny w/ Heavy Snow" ' + endinghtm
       } 
       if (txt.indexOf('Sunny/Snow') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/41.gif" alt="Sunny w/ chance of Snow" ' + endinghtm
       } 
       if (txt.indexOf('Heavy Snow') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/16.gif" alt="Heavy Snow" ' + endinghtm
       } 
       if (txt.indexOf('Snowflakes') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/15.gif" alt="Snowflakes" ' + endinghtm
       } 
       if (txt.indexOf('Snow') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/14.gif" alt="Snow" ' + endinghtm
       } 
       if (txt.indexOf('Hail') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/6.gif" alt="Hail" ' + endinghtm
       } 
       if (txt.indexOf('Light Partly Cloudy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/34.gif" alt="Light Partly Cloudy" ' + endinghtm
       } 
       if (txt.indexOf('Mostly Cloudy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/28.gif" alt="Mostly Cloudy" ' + endinghtm
       } 
       if (txt.indexOf('Partly Cloudy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/30.gif" alt="Partly Cloudy" ' + endinghtm
       } 
       if (txt.indexOf('Hot Sunny') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/36.gif" alt="Hot Sunny" ' + endinghtm
       } 
       if (txt.indexOf('Mostly Sunny') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/34.gif" alt="Mostly Sunny" ' + endinghtm
       } 
       if (txt.indexOf('Cloudy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/26.gif" alt="Cloudy" ' + endinghtm
       } 
       if (txt.indexOf('Mostly Clear') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/34.gif" alt="Mostly Clear" ' + endinghtm
       } 
       if (txt.indexOf('Partly Sunny') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/34.gif" alt="Partly Sunny" ' + endinghtm
       } 
       if (txt.indexOf('Sunny') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/32.gif" alt="Sunny" ' + endinghtm
       } 
       if (txt.indexOf('Lightening') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/37.gif" alt=Lightening"" ' + endinghtm
       } 
       if (txt.indexOf('Frigid') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/25.gif" alt="Frigid" ' + endinghtm
       } 
       if (txt.indexOf('Windy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/23.gif" alt="Windy" ' + endinghtm
       } 
       if (txt.indexOf('Smoke') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/22.gif" alt="Smoke" ' + endinghtm
       } 
       if (txt.indexOf('Haze') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/21.gif" alt="Haze" ' + endinghtm
       } 
       if (txt.indexOf('Hazy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/21.gif" alt="Hazy" ' + endinghtm
       } 
       if (txt.indexOf('Fog') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/20.gif" alt="Fog" ' + endinghtm
       } 
       if (txt.indexOf('Dust') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/19.gif" alt="Dust" ' + endinghtm
       } 
       if (txt.indexOf('Isolated T-') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/37.gif" alt="Isolated Thunderstorms" ' + endinghtm
       } 
       if (txt.indexOf('Isolated') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/39.gif" alt="Isolated" ' + endinghtm
       } 
       if (txt.indexOf('Scattered T-Storms') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/38.gif" alt="Scattered T-Storms" ' + endinghtm
       } 
       if (txt.indexOf('Thunderstorm') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/3.gif" alt="Thunderstorms" ' + endinghtm
       } 
       if (txt.indexOf('Scattered') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/3.gif" alt="Scattered" ' + endinghtm
       } 
       if (txt.indexOf('T-Storms') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/3.gif" alt="Thunderstorm" ' + endinghtm
       } 
       if (txt.indexOf('Storm') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/2.gif" alt="Stormy" ' + endinghtm
       } 
       if (txt.indexOf('Lightning') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/4.gif" alt="Lightning" ' + endinghtm
       } 
       if (txt.indexOf('Fair') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/34.gif" alt="Fair" ' + endinghtm
       } 
       if (txt.indexOf('Severe') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/1.gif" alt="Severe weather" ' + endinghtm
       } 
        if (txt.indexOf('Clear') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/34.gif" alt="Clear" ' + endinghtm
       } 
       if (txt.indexOf('Icy') > 0) 
       {
       return '<img src="http://image.weather.com/web/common/wxicons/25/8.gif" alt="Icy" ' + endinghtm
       } else {
       return '<img src="http://image.weather.com/web/common/wxicons/25/na.gif" alt="" ' + endinghtm
       } 
       return '<img src="http://image.weather.com/web/common/wxicons/25/na.gif" alt="" ' + endinghtm
       
       // exit funct:wxiconlookup
       }
            

      function DoGetJpgA(urljpga) {
      // urljpga = 'http://www.weather.com/maps/local/local/us_close_nyc_ultra_nyc/1b/dopplerradar300mile_large.html';
           _IG_FetchContent(urljpga, function (response) {
              var rtexta = response.toString()
              var jpgaimageStart
              var jpgaimageSStart
              var jpgaimageEnd
              var JpgaImage
              jpgaimageStart = 1

              jpgaimageStart = rtexta.indexOf('NAME="mapImg"');
              jpgaimageSStart = (rtexta.indexOf('SRC=', jpgaimageStart) + 5);
              jpgaimageEnd = rtexta.indexOf('" ', jpgaimageSStart + 9);
              JpgaImage = rtexta.substring(jpgaimageSStart, jpgaimageEnd);
              
              

		// Split imagePath down to image filename and parse out for animation
		var imageAnimPath
		try {
			//var tempdot = "/web/radar/us_nyc_ultraradar_plus_usen.jpg";
			var tempdot = JpgaImage.substring(JpgaImage.indexOf('.com/') + 4);
			tempdot = tempdot.split('/');
			var whichCount = 0;
			for(i=0; i<tempdot.length; i++) {
				if(tempdot[i].indexOf(".") != -1) {
					whichCount = i;
				}
			}
			if(whichCount != 0) {
				tempdot = tempdot[whichCount].split('.')[0];
				imageAnimPath = tempdot;
			}
		}catch(Exception){}
            var stasizePref = prefs.getString("stasize");
            if (stasizePref == 'closest') {
                // leave alone, let weather.com do it
            } else {
                JpgaImage = JpgaImage.replace('closeradar', stasizePref);
                JpgaImage = JpgaImage.replace('ultraradar', stasizePref);
                JpgaImage = JpgaImage.replace('metroradar', stasizePref);
            }
            var anisizePref = prefs.getString("anisize");
            if (anisizePref == 'closest') {
                // leave alone, let weather.com do it
            } else {
                imageAnimPath = imageAnimPath.replace('closeradar', anisizePref);
                imageAnimPath = imageAnimPath.replace('ultraradar', anisizePref);
                imageAnimPath = imageAnimPath.replace('metroradar', anisizePref);
            } 
            _gel('contentDYN___MODULE_ID__').innerHTML = '<p align="center"><a href="http://www.weather.com/weather/map/' + zipPref + '?showanimation=yes&mapregion=' + imageAnimPath + '" target="_parent"><img src="' + JpgaImage + '" onMouseOver="resizeImg(this, ' + growchoicePref + ')" onMouseOut="resizeImg(this)" width=216 height=145 border="0" align="middle"></a></p>';
           }, { refreshInterval: 30 });
       }


       function doSomethingXsl() {
          var nameheadr = '<div />'
          var content = _gel("hidden__MODULE_ID__");
          var contentp = _gel("hiddenp__MODULE_ID__");
          var setmodup = '<table border="0" width="100%" id="table2"><tr><td width="6" height="25" align="center"></td><td height="25" align="center"></td><td width="6" height="25" align="center"></td></tr><tr><td width="6" align="center"></td><td align="center"><a target="_blank" href="http://www.floen.com/ATOM/weather/countycode/countycodesetup.htm" >Click here to setup module</a></td><td width="6" align="center"></td></tr><tr><td width="6" height="50" align="center"></td><td height="50" align="center"></td><td width="6" height="50" align="center"></td></tr></table>';
          var aurl = 'http://rss.weather.com/weather/rss/local/' + zipPref; 
          
          if (wwarsPref == '')
           {
              _gel('consetmodup___MODULE_ID__').innerHTML = setmodup;
              _gel('conwetmodup___MODULE_ID__').innerHTML = ''
              _gel('contentDYN___MODULE_ID__').innerHTML = ''
              return;
           }
          if (wwarsPref == ' ')
           {
              _gel('consetmodup___MODULE_ID__').innerHTML = setmodup;
              _gel('conwetmodup___MODULE_ID__').innerHTML = ''
              _gel('contentDYN___MODULE_ID__').innerHTML = ''
              return;
           }
          if (wwarsPref == '*')
           {
              _gel('consetmodup___MODULE_ID__').innerHTML = setmodup;
              _gel('conwetmodup___MODULE_ID__').innerHTML = ''
              _gel('contentDYN___MODULE_ID__').innerHTML = ''
              return;
           }
          if (wwarsPref == 'default')
           {
              _gel('consetmodup___MODULE_ID__').innerHTML = setmodup;
              _gel('conwetmodup___MODULE_ID__').innerHTML = ''
              _gel('contentDYN___MODULE_ID__').innerHTML = ''
              return;
           }
           if (wwarsPref == 'Not_Yet_Set')
           {
              _gel('consetmodup___MODULE_ID__').innerHTML = setmodup;
              _gel('conwetmodup___MODULE_ID__').innerHTML = ''
              _gel('contentDYN___MODULE_ID__').innerHTML = ''
              return;
           }
          if (wwarsPref.indexOf('Z') > 0) {
           
           } else {
              _gel('consetmodup___MODULE_ID__').innerHTML = 'County Code not formatted correctly!<br />' + setmodup;
              _gel('conwetmodup___MODULE_ID__').innerHTML = ''
              _gel('contentDYN___MODULE_ID__').innerHTML = ''
              return;
           }           
           
// Get Weather Temps
  _IG_FetchXmlContent(aurl, function (response) {
           if (response == null || typeof(response) != "object" || 
                      response.firstChild == null) {
              _gel("contentp__MODULE_ID__").innerHTML = "<i>Invalid data.</i>" + response;
              return;
           } else {
		   var html = "<div style='padding: 5px;background-color: #ccf;font-family:Arial, Helvetica;" +                   
		              "text-align:left;font-size:90%'>";   
					    
		   html +="<div style='text-align:center; font-size: 120%; color: yellow; " +
		          "font-weight: 700;'>"; 
        html += "</div><br>"; 

           var itemList = response.getElementsByTagName("item");
          for (var i = 0; i < itemList.length ; i++) { 
             var nodeList = itemList.item(i).childNodes;

            for (var j = 0; j < nodeList.length ; j++) {
                var node = nodeList.item(j);
                if (node.nodeName == "title")
                {
                   var name = node.firstChild.nodeValue;
                    
                    if (name.indexOf('Weather Conditions In ') > 0) {
                    var mynamender = name.indexOf(',')
                    var myname = name.substring(29, mynamender) + ' Doppler Radar';
                    prefs.set("namea", myname);
                    }
                }
                if (node.nodeName == "link") {
                   var price = node.firstChild.nodeValue; 
                }
                if (node.nodeName == "description")
                {
                   if (node.firstChild.nodeName == "#cdata-section") 
                      var data = node.firstChild.nodeValue;
                }
             } 
             
             if (customjpgPref) {
                  _gel('contentDYN___MODULE_ID__').innerHTML = '<p align="center"><a href="http://www.weather.com/weather/map/' + zipPref + '?' + anisizePref + '&day=1" target="_parent"><img src="' + customjpgPref + '" onMouseOver="resizeImg(this, ' + growchoicePref + ')" onMouseOut="resizeImg(this)" width=216 height=145 border="0" align="middle"></a></p>';
                } else {
                  if (name.indexOf('ur Local Doppler Radar') > 0) {
                    var dopplerfetch = price;
                    DoGetJpgA(dopplerfetch);
                  }
             }
             
             if (name.indexOf('10-Day Forecast') > 0) {
                var words = data.split("---- ");
                var dayone = (words[0]);
                var daytwo = (words[1]);
                var daytre = (words[2]);
                
                if (dayone.indexOf('/') > 0) { 
                  if (dayone.indexOf('&deg') > 0) {
                    dayone = dayone.substring(0, dayone.indexOf(':')) + ':<br />' + dayone.substring((dayone.indexOf('High ') + 5), dayone.indexOf('F / ')) + '<font color="#CCCCCC"> | </font>' + dayone.substring((dayone.indexOf('/ Low ') + 6), dayone.indexOf('F.'));
                  }
                } else {
                  dayone = 'E blank.';
                  // if (dayone.indexOf('&deg') > 0) {
                  // dayone = dayone.substring(0, dayone.indexOf(':')) + ':<br />' + dayone.substring((dayone.indexOf('&deg') - 2), dayone.indexOf('&deg'));
                  // }
                }
                
                  daytwo = daytwo.substring(0, daytwo.indexOf(':')) + ':<br />' + daytwo.substring((daytwo.indexOf('High ') + 5), daytwo.indexOf('F / ')) + '<font color="#CCCCCC"> | </font>' + daytwo.substring((daytwo.indexOf('/ Low ') + 6), daytwo.indexOf('F.'));
                  daytre = daytre.substring(0, daytre.indexOf(':')) + ':<br />' + daytre.substring((daytre.indexOf('High ') + 5), daytre.indexOf('F / ')) + '<font color="#CCCCCC"> | </font>' + daytre.substring((daytre.indexOf('/ Low ') + 6), daytre.indexOf('F.'));
             }        
             if (name.indexOf('urrent Weather Conditions') > 0) {
                var nowfull = data
                data = data.replace(' For more details?', '<br>');
                var nowpic = '<' + data.substring(1, data.indexOf(' alt=')) + ' alt="' + data.substring(data.indexOf(' />') + 3, data.indexOf(',')) + '" />';
                var nowtemp = nowpic + 'Now: ' + data.substring((data.indexOf('&deg') - 3), (data.indexOf('&deg') - 1)) + '<br><br>';
                var nowtemp2 = nowpic + ' ' + data.substring((data.indexOf('&deg') - 3), (data.indexOf('&deg') - 1));
             }
             // Append extracted data to the HTML string.
             html += "<i><b>";
             html += name;
             html += "</b></i><br>";
             html += "&emsp;"; 
             html += price;
             html += "<i>" + data + "</i><br>";
         } 
         // Close up div
         html += "</div>";

        // Display HTML string in hidden <div>
        contentp.innerHTML = html;
        
        // Check if user wants temps!
        if (tempPref == true) {
            // put it all together
            var inping = '<td width="58" style="padding-bottom: 3px"><tr>'
            var inpong = '</td></tr>'
            var alltoget = ''; 
            
            if (dayone.indexOf('blank') >0) {
              dayone = '';
              alltoget += inping + nowtemp2 + '<br />' + inpong;
            } else { 
               if (wxiconlookup(words[0]) == 'http://image.weather.com/web/common/wxicons/25/na.gif') {
                 //picture is NA
                 alltoget += inping + dayone + inpong;
               } else {
                 //good picture
                 alltoget += inping + wxiconlookup(words[0]) + dayone + '<br />' + inpong;
              }
            }
            alltoget += inping + wxiconlookup(words[1]) + ' ' + daytwo + '<br />' + inpong;
            alltoget += inping + wxiconlookup(words[2]) + ' ' + daytre + '<br />' + inpong;
            
            _gel('conwetmodup___MODULE_ID__').innerHTML = alltoget;
        } else {
            _gel('conwetmodup___MODULE_ID__').innerHTML = '<div />';
        }
     }
  }, { refreshInterval: 55 }); 


  // check for severe weather
          _IG_FetchContent(url, function (response) { 
          
          if (response.indexOf('nvalid zone') > 0) {
          } else {
             var nxsl = xmlParse('' 
               + '<div select="/rss/channel/item">' 
               + ' <h2 select="title" content="."></h2>' 
               + ' <h4 select="link" content="."></h4>' 
               + ' <h3 select="description" content="."></h3>' 
               + '</div>'); 
             nxslProcess(xmlParse(response), nxsl); 
             content.innerHTML = xmlText(nxsl); 
             // var currentoklink = content.getElementsByTagName("H4")[0].innerHTML;
             var currentok = content.getElementsByTagName("H3")[0].innerHTML;
             
             var warningcontent = ''; 

             if (currentok == 'There are no active watches, warnings or advisories') {
                  //no active warnings - do nothing
  //                _gel('content___MODULE_ID__').innerHTML = '';
             } else {
                  //active warnings! show warnings.
                  
                  for (var i = 0; i < content.getElementsByTagName("H2").length; i++) {
                      warningcontent += '<div><a style="color: #FF0000" target=_parent href="' + content.getElementsByTagName("H4")[i].innerHTML + '"><img src="http://www.floen.com/ATOM/weather/images/alert.png" height="9" width="9" border="0"></a> ';
                      warningcontent += '<a style="color: #FF0000" target=_parent href="' + content.getElementsByTagName("H4")[i].innerHTML + '">' + content.getElementsByTagName("H2")[i].innerHTML + '</a>';
                      warningcontent += '</div>';
                  _gel('content___MODULE_ID__').innerHTML = warningcontent;
                  }
             }
	   _IG_AdjustIFrameHeight();
           }
        }, { refreshInterval: 55 });
     }

   _IG_RegisterOnloadHandler(function () {
          doSomethingXsl();
          dothexmlget();
          _IG_Analytics("UA-1490859-1", "/weatherXML");
	  _IG_AdjustIFrameHeight();
       }); 

</script>
      
      ]]>
  </Content>

</Module>