(function($){

	$.fn.weatherCurrentConditionTop = function(zip, options){

		var defaults = {
			imageurl: "",
			locationDisp: ""
		};

		var options = $.extend(defaults, options);

		return this.each(function(i, e){
			var $e = $(this);
			
			// Validate
			if (zip == null) 
				return false;
			$.get('/weather/feeds/'+zip.substring(0,1)+'/currents/' + zip.substring(0,5) + '_full.xml', function(xml){
				var json = $.xml2json(xml);
				$e.find(".weather-city").html(options.locationDisp);
				$e.find(".temp").html(json.data.currents.temp + '&deg;');
				$e.find(".high-low").html('High: ' + json.data.currents.high + '&deg; / Low: ' + json.data.currents.low + '&deg;');
				$e.find(".condition").html(json.data.currents.sky);
				$e.find("#currentConditionsImg").attr("src",''+options.imageurl+'/weather/sm/'+json.data.currents.icon+'.png')
					.attr("alt",''+json.data.currents.sky);
				$e.removeClass("hidden");
				/*
				 <div class="current-conditions mostly-cloudy full-wrap">
				 <div class="inner">
				 <div class="weather-city">Mclean, VA</div>
				 <div class="temp">80&deg;</div>
				 <div class="high-low">High 82&deg;/ Low 49&deg;</div>
				 <div class="condition">Mostly cloudy and warm</div>
				 <a href="#" title="Get full weather report" class="visual"><img src="#request.imageurl#/x.gif" alt="Mostly cloudy" /></a>
				 </div><!--/.inner-->
				 </div><!--/.current-conditions-->
				 */
			});
		});
	};
		
})(jQuery);
