

UBMain = 

{
	
	init:function()
	{
		
		//UBMain.getWeather();
	}
	, 
	getWeather:function()
	{
		
		
		
		$.get("weather.php", function(data){
  			
  			
  			
  			var t = $(data).find("*[temp]");	
  			
  			//if($(t).length < 1){ return; });
			
			var current_temp =  $(t).attr("temp");
			var current_img =  "<img src=\"http://l.yimg.com/us.yimg.com/i/us/we/52/" + $(t).attr("code") + ".gif\"/>";
			
			var d = $(data).find("*[day]");	
			
			var fc_1_day = $(d[0]).attr("day");
			var fc_1_low = $(d[0]).attr("low");
			var fc_1_high = $(d[0]).attr("high");
			var fc_1_desc = $(d[0]).attr("text");
			
			var fc_2_day = $(d[1]).attr("day");
			var fc_2_low = $(d[1]).attr("low");
			var fc_2_high = $(d[1]).attr("high");
			var fc_2_desc = $(d[1]).attr("text");
			
			var html = '<div class="theweather">';
				html +=	'<div class="wimg">' + current_img + '</div>';
				html +=	'<div class="current_temp">' + current_temp + '°F</div>';
				html += '<h4>' + fc_1_day  + '</h4>';
				html += '<p>high: ' + fc_1_high + '°F / low: ' + fc_1_low + '°F - ' + fc_1_desc + '</p>';
				html += '<h4>' + fc_2_day  + '</h4>';
				html += '<p>high: ' + fc_2_high + '°F / low: ' + fc_2_low + '°F - ' + fc_2_desc + '</p>';
				html += '</div>';
				
   		
			$("#moab-weather").html(html);
			
		
		
			
			
			
		});

		
		//$.get("");
		
		
		
	}
	
	
}

$(document).ready(function () {
    UBMain.init();
});


/* 

<pubDate>Sat, 23 Aug 2008 12:53 pm MDT</pubDate>
<yweather:condition  text="Fair"  code="34"  temp="92"  date="Sat, 23 Aug 2008 12:53 pm MDT" />
<description><![CDATA[
<img src="http://l.yimg.com/us.yimg.com/i/us/we/52/34.gif"/><br />
<b>Current Conditions:</b><br />
Fair, 92 F<BR />
<BR /><b>Forecast:</b><BR />
Sat - Mostly Sunny. High: 101 Low: 68<br />
Sun - Mostly Sunny. High: 101 Low: 68<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Moab__UT/*http://weather.yahoo.com/forecast/USUT0165_f.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>
]]></description>


*/
