(function($) {

var is={
        Null:function(a){
                return a===null;
        },
        Undefined:function(a){
                return a===undefined;
        },
        nt:function(a){
                return(a===null||a===undefined);
        },
        Function:function(a){
                return(typeof(a)==='function')?a.constructor.toString().match(/Function/)!==null:false;
        },
        String:function(a){
                return(typeof(a)==='string')?true:(typeof(a)==='object')?a.constructor.toString().match(/string/i)!==null:false;
        },
        Array:function(a){
                return(typeof(a)==='object')?a.constructor.toString().match(/array/i)!==null||a.length!==undefined:false;
        },
        Boolean:function(a){
                return(typeof(a)==='boolean')?true:(typeof(a)==='object')?a.constructor.toString().match(/boolean/i)!==null:false;
        },
        Date:function(a){
                return(typeof(a)==='date')?true:(typeof(a)==='object')?a.constructor.toString().match(/date/i)!==null:false;
        },
        HTML:function(a){
                return(typeof(a)==='object')?a.constructor.toString().match(/html/i)!==null:false;
        },
        Number:function(a){
                return(typeof(a)==='number')?true:(typeof(a)==='object')?a.constructor.toString().match(/Number/)!==null:false;
        },
        Object:function(a){
                return(typeof(a)==='object')?a.constructor.toString().match(/object/i)!==null:false;
        },
        RegExp:function(a){
                return(typeof(a)==='function')?a.constructor.toString().match(/regexp/i)!==null:false;
        }
};

var type={
        of:function(a){
                for(var i in is){
                        if(is[i](a)){
                                return i.toLowerCase();
                        }
                }
        }
};


	$.fn.reorder = function(sortby, order) {
		
		var objArray = new Array()
		
		$(this).each(
			function(){
				objArray.push(this)
			}
		);
		
		var d = 1
		if (order=="desc"){
			var d = -1
		}
		
		function formatobj(obj){
			if (type.of(obj)=="date"){
				return obj.getTime()
			}
			
			return obj
		}
		
		function sorttest(a,b){
			a = a[sortby]
			b = b[sortby]
			if (isNaN(formatobj(a)-formatobj(b)))
				return (isNaN(formatobj(a))?1:-1)*d;
			
			return (formatobj(a)-formatobj(b))*d;
		}
		
		return objArray.sort(function(a,b){
					return sorttest(a,b)
		});
		
	}
	


	$.fn.displayWeather = function(options) {
		

		var defaults = {
			data:"",
			weatherLocations: {},
			defaultLoc: "",
			forcastdays:0,
			tempunits:"c",
			imagepath:""
		};
		
		// Extend our default options with those provided.
		var opts = $.extend(defaults, options);
		
		$.browser.msie6 = $.browser.msie && /MSIE 6\.0/i.test(window.navigator.userAgent) && !/MSIE 7\.0/i.test(window.navigator.userAgent);
		
		
		
		 
		function itemHoverOver(obj,employerId) {
			if(moreinfocontainer){
				if(moreinfocontainer.children()){
					moreinfocontainer.children().remove()
				}
				var elementLinkText = 'View '+ employers[employerId].companyname + ' profile'+((employers[employerId].jobs.length > 0)? '  ***** <blink>now recruiting</blink> ****':'')
				var elementLink = $('<a href="' + employers[employerId].companylink+ '">' + elementLinkText + '</a>').appendTo(moreinfocontainer);
			}
		}
		
		function itemHoverOut($obj) {
		}
		
		// Our plugin implementation code goes here.
		var data = opts.data
		
		var weatherDisplay = this;
		
		var locations = new Object()
		
		var dayList = new Object()
		
		var conditionList = new Array()
		
		var days = new Array()
		
		var moreinfochildren = $(opts.moreinfo_id).children()
		
		var moreinfocontainer = $(opts.moreinfo_id)
		
		var weatherDisplayPanel
		
		var weatherDisplayInfo
		
		var weatherDisplayForm
		
		var weatherDisplayFormContainer
		
		var lastWeatherQuery
		
		var gIsNightTime
		
		var weatherQueries = new Object()
		
		var weatherSheet
		
		var tt
		
		
		
		function toDate(dStr) {
			var dStr_ampm = dStr.substr(dStr.indexOf(" ")+1)
			var dStr_time = dStr.substr(0,dStr.indexOf(" "))
			
			var now = new Date();
			now.setHours((dStr_ampm=="AM")?dStr_time.substr(0,dStr_time.indexOf(":")):12+parseInt(dStr_time.substr(0,dStr_time.indexOf(":"))));
 			now.setMinutes(dStr_time.substr(dStr_time.indexOf(":")+1));
 			now.setSeconds(0);
 			return now;
		}
		
		function toTime(tmStr){
			var tmData  = convertTime(tmStr);
			var tm = new Date( );
			tm.setHours( tmData.split( ":" )[0] );
			tm.setMinutes( tmData.split( ":" )[1] );
			tm.setSeconds(0);
			tm.setMilliseconds(0);
			
			var theTm = tm.getTime( );
			return theTm
		}
		
		function convertTime( timeIn ){
			
			timeIs = timeIn.split( " " )[0];
			amPmIs = timeIn.split( " " )[1].toUpperCase();

			timeHour = timeIs.split( ":" )[0];
			timeMinute = timeIs.split( ":" )[1];

			if( amPmIs == "AM" && timeHour == "12" ){
				return "00:" + timeMinute;
			}
			else if( amPmIs == "PM" && timeHour == "12" )
			{
				return "12:" + timeMinute;
			}
			else if( amPmIs == "PM" )
			{
				return ( 12 + Number( timeHour ) ) + ":" + timeMinute;
			}
			else
			{
				return timeIs;	
			}
		}

		
		
		
		function isNightTime(Timerise,Timeset,Timecur){
			try{
				var theSet = toTime(Timeset);
				var theRise = toTime(Timerise);
				var theCur = toTime(Timecur);
				
				if(theSet < theRise){
					if(theCur < theSet){
						theRise -= ( 1000 * 60 * 60 * 24 )
					}else{
						theSet += ( 1000 * 60 * 60 * 24 )
					}
				}

				if( theCur > theRise && theCur < theSet ){
					return false;
				}else{
					return true;
				}
			} catch( e ){
				var dateNow = new Date( );
				var hourStamp = dateNow.getHours( );
				if( hourStamp > 6 && hourStamp < 20 ){
					return false;
				}else{
					return true;
				}
			}
		}
		
		
		function getIcons( code, size, moonphase, gIsNightTime)
{
	
	
	
	var sun = new Object( );
	var cloud = new Object( );

	var baseColor, textColor, textHighlightColor, cloudVoffsetLarge, cloudVoffsetMedium;
	var sunSource = null;

	if( size == "small" )
	{
		var prefix = opts.imagepath+"Small/";
		var sunOffsetH = 0;
		sun.hOffset = cloud.hOffset = 0;
		sun.vOffset = cloud.vOffset = 41;
		sun.hAlign = cloud.hAlign = "center";
		cloudVoffsetLarge = cloudVoffsetMedium = 41;
	}
	else
	{
		var prefix = opts.imagepath+"Big/";
		var sunOffsetH = 0;
		cloudVoffsetLarge = -26;
		cloudVoffsetMedium = -16;
	}

	if(gIsNightTime)
	{
		var moonIconCode = moonphase;
		if( !isNaN( moonIconCode ) )
		{
			sunSource = prefix + "Moons/" + moonIconCode + ".png";
		}
	}
	else
	{
		sunSource = prefix + "Sun.png";
	}

	switch( code )
	{
		case "-": // Unknown Weather
			sun.src				= prefix + "Unknown.png";
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "0": // Tornado
		case "1": // Tropical Storm
		case "2": // Hurricane
		case "3": // Strong Thunderstorms
		case "4": // Thunderstorms
			cloud.src			= prefix + "Thunderstorms.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#63758b";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "5": // Rain and Snow
		case "6": // Rain and Sleet
		case "7": // Freezing Rain
			cloud.src			= prefix + "Wintry_Mix.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#96a6b3";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
  			break

		case "8": // Freezing Drizzle
			cloud.src			= prefix + "Freezing_Drizzle.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#96a6b3";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "9": // Drizzle
			cloud.src			= prefix + "Drizzle.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#5c7287";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "10": // Freezing Rain
			cloud.src			= prefix + "Freezing_Rain.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#96a6b3";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "11": // Showers
			cloud.src			= prefix + "Showers.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#6e8aa2";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "12": // Rain
		case "40": // Heavy Rain
			cloud.src			= prefix + "Rain.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#5a7085";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "13": // Flurries
			cloud.src			= prefix + "Flurries.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#bccde1";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "14": // Snow Showers
			cloud.src			= prefix + "Snow_Showers.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#bccde1";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "15": // Blowing Snow
			cloud.src			= prefix + "Blowing_Snow.png";
			baseColor			= "#bccde1";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "16": // Snow
			cloud.src			= prefix + "Snow.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#bccde1";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "17": // Hail
			cloud.src			= prefix + "Hail.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#9aa8b5";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "18": // Sleet
			cloud.src			= prefix + "Sleet.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#9aa8b5";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "19": // Dust
			cloud.src			= prefix + "Dust.png";
			baseColor			= "#898077";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "20": // Fog
			cloud.src			= prefix + "Fog.png";
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "21": // Haze
			cloud.src			= prefix + "Haze.png";
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "22": // Smoke
			cloud.src			= prefix + "Smoke.png";
			baseColor			= "#7c7d7f";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "23": // Breezy
			cloud.src			= prefix + "Breezy.png";
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "24": // Windy
			cloud.src			= prefix + "Windy.png";
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "25": // Frigid
			cloud.src			= prefix + "Frigid.png";
			baseColor			= "#cfdcef";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "26": // Cloudy (no sun/moon)
			cloud.src			= prefix + "Cloudy.png";
			baseColor			= "#8698ae";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "27": // Mostly Cloudy - night
			sun.src				= sunSource;
			cloud.src			= prefix + "Mostly_Cloudy.png";
			baseColor			= "#738fa7";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "28": // Mostly Cloudy - day
			sun.src				= sunSource;
			cloud.src			= prefix + "Mostly_Cloudy.png";
			baseColor			= "#738fa7";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "29": // Partly Cloudy - night
			sun.src				= sunSource;
			cloud.src			= prefix + "Partly_Cloudy.png";
			baseColor			= "#88aac6";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break
			
		case "30": // Partly Cloudy - day
			sun.src				= sunSource;
			cloud.src			= prefix + "Partly_Cloudy.png";
			baseColor			= "#88aac6";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break
			
		case "31": // Clear - night
			sun.src				= sunSource;
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "32": // Sunny - day
			sun.src				= sunSource;
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "33": // Mostly Clear - night
			sun.src				= sunSource;
			cloud.src			= prefix + "Mostly_Clear.png";
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "34": // Mostly Sunny - day
			sun.src				= sunSource;
			cloud.src			= prefix + "Mostly_Clear.png";
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "35": // Mixed Rain and Hail
			cloud.src			= prefix + "Rain_and_Hail.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#7a8b9d";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break
			
		case "36": // Hot
			sun.src				= sunSource;
			baseColor			= "#c08951";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "37": // Isolated Thunderstorms
			sun.src				= sunSource;
			cloud.src			= prefix + "Isolated_Thunderstorms.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#748194";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break

		case "38": // Scattered Thunderstorms - day
			sun.src				= sunSource;
			cloud.src			= prefix + "Scattered_Thunderstorms.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#727f92";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break

		case "47": // Scattered Thunderstorms - night
			sun.src				= sunSource;
			cloud.src			= prefix + "Scattered_Thunderstorms.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#727f92";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break
			
		case "39": // Scattered Showers - day
			sun.src				= sunSource;
			cloud.src			= prefix + "Scattered_Showers.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#66849e";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break
			
		case "41": // Scattered Snow Showers - day
			sun.src				= sunSource;
			cloud.src			= prefix + "Scattered_Snow_Showers.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#b2c4dc";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break
			
		case "42": // Heavy Snow
		case "43": // Blizzard
			cloud.src			= prefix + "Heavy_Snow.png";
			cloud.vOffset		= cloudVoffsetLarge;
			baseColor			= "#bccae4";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "44": // No Feed
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			break

		case "45": // Scattered Showers - night
			sun.src				= sunSource;
			cloud.src			= prefix + "Scattered_Showers.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#66819e";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break

		case "46": // Scattered Snow Showers - night
			sun.src				= sunSource;
			cloud.src			= prefix + "Scattered_Snow_Showers.png";
			cloud.vOffset		= cloudVoffsetMedium;
			baseColor			= "#bbcadf";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
			sun.hOffset += sunOffsetH;
			break
			
		default:
			baseColor			= "#5883c8";
			textColor			= "#ffffff";
			textHighlightColor	= "#265080";
 			break
	}
	
	if( size == "small" )
	{
		var images = {};
		images.sun = sun;
		images.cloud = cloud;
	
		return images;
	}
	else if( size == "big" )
	{

		sun.hOffset = 0;

		var images = {};
		images.sun = sun;
		images.cloud = cloud;
		
		return images;
		
		
	}
}

		
		
		function loadweather(id){
			if(id != ""){
				
				var forecaststring=(opts.forcastdays>0)?"&dayf="+opts.forcastdays:""
				var tempstring=(opts.tempunits=="c")?"&ut=c&ud=k&us=k&up=m&ur=m":"&ut=f&ud=mi&us=mph&up=in&ur=in"
			
				weatherQueries.lastWeatherQuery = {
		   						type: 'POST',
		   						url: "/yahoo_weather.asp",
		  						data: "url=http://yahoowidget.weather.com/weather/local/"+id+"&cc=*"+forecaststring+tempstring+"&prod=bd_select&par=yahoowidgetxml",
		  						dataType: 'xml',
		   						success: function(xml) {}
							   }
			
			
				$.loadAjaxWeatherQuery("lastWeatherQuery")
			}
		}
		
		$.loadAjaxWeatherQuery = function(id){
			$.ajax(weatherQueries[id]);
		}
		
		function loadlocs(locVal){
			weatherQueries.lastLocQuery = {
		   		type: 'GET',
		   		url: "/yahoo_weather.asp",
		  		data: "url=http://yahoowidget.weather.com/weather/search/search&where="+locVal,
		  		dataType: 'xml',
		   		success: function(xml) {}
				}
			
			$.loadAjaxWeatherQuery("lastLocQuery")
		}
		
		function init() {
			
			
			
			if(!opts.data){
				$(this).ajaxSuccess(
					function(evt, request, settings){
						data = request.responseXML
						update(weatherDisplay)
					}
				);
			}
			
			dayList = { Sunday:"Sun", Monday:"Mon", Tuesday:"Tue", Wednesday:"Wed", Thursday:"Thu", Friday:"Fri", Saturday:"Sat"};
			
			monthList = { Jan:0, Feb:1, Mar:2, Apr:3, May:4, Jun:5, Jul:6, Aug:7, Sep:8, Oct:9, Nov:10, Dec:11};
			
			 
			
			conditionList = [ "Tornado", "Tropical Storm", "Hurricane", "Strong Thunderstorms", "Thunderstorms", "Rain and Snow", "Rain and Sleet", "Freezing Rain", "Freezing Drizzle", "Drizzle", "Freezing Rain", "Showers", "Rain", "Flurries", "Snow Showers", "Blowing Snow", "Snow", "Hail", "Sleet", "Dust", "Fog", "Haze", "Smoke", "Breezy", "Windy", "Frigid", "Cloudy", "Mostly Cloudy", "Mostly Cloudy", "Partly Cloudy", "Partly Cloudy", "Clear", "Sunny", "Mostly Clear", "Mostly Sunny", "Mixed Rain and Hail", "Hot", "Isolated Thunderstorms", "Scattered Thunderstorms", "Scattered Showers", "Heavy Rain", "Scattered Snow Showers", "Heavy Snow", "Blizzard", "No Feed", "Scattered Showers", "Scattered Snow Showers", "Scattered Thunderstorms" ];
			
			weatherInputHTML='<input name="weatherloc" id="weatherloc" type="text" value="Type City">'
			var weatherInput = $(weatherInputHTML)
			
			weatherInput.change(
				function () {
					
					loadlocs($(this).val())
        		}
			);
			
			
			
			
			
					

																																																							   
			weatherDisplayWrapper = $('<div id="weatherDisplayWrapper"></div>').appendTo(weatherDisplay)
			
			weatherDisplayTop  = $('<div id="weatherDisplayTop"></div>').appendTo(weatherDisplayWrapper)
			weatherDisplayTop.css({ height:'20px'})
			weatherDisplayPanel = $('<div id="weatherDisplayPanel"></div>').insertAfter(weatherDisplayTop)
			weatherDisplayPanel.css({ 'min-height':'161px', 'padding-left':'5px', 'padding-right':'5px'})
			
			
			
			
			
			//weatherDisplayPanel  = $('<div id="weatherDisplayPanel"></div>').appendTo(weatherDisplayWrapper)
			weatherDisplayFormContainer = $('<div id="weatherDisplayFormContainer"></div>').appendTo(weatherDisplayPanel)
			
			
			weatherDisplayFormContainer.css({overflow:'hidden'})
			
			weatherDisplayForm = $('<form id="weatherDisplayForm"></form>').appendTo(weatherDisplayFormContainer)
			
			weatherDisplayForm.css({padding:'10px', 'text-align':'center'})
					
			
			weatherInput = weatherInput.appendTo(weatherDisplayForm)
			
			weatherInput.css({'font-size':'11px', color:'#333333', width:'150px'})
					
			
			
			var weatherSelectHTML = ""
			
			//var selectedHTML  = ' selected="selected"'
			var selectCount = 0
			var selectedIndex = null
			var selectedHTML
			for (var i in opts.weatherLocations){
				
				if (i == opts.defaultLoc){
					selectedIndex = i
					selectedHTML = ' selected="selected"'
				}else{
					selectedHTML = ''
				}
				weatherSelectHTML+='<option value="'+opts.weatherLocations[i]+'"'+selectedHTML+'>'+i+'</option>'
				selectCount++
			}
			
			if(selectCount>0){
				if (selectedIndex){
					weatherSelectHTML = '<option value="">'+selectCount+' Location'+((selectCount>1)?'s':'')+' Found</option>'+weatherSelectHTML
				}else{
					weatherSelectHTML = '<option value="" selected="selected">'+selectCount+' Location'+((selectCount>1)?'s':'')+' Found</option>'+weatherSelectHTML
				}
			}else{
				weatherSelectHTML = '<option value="" selected="selected">0 Locations Found</option>'
			}
			
			
			weatherSelectHTML='<select name="weatherselect" size="1" id="weatherselect"'+((selectCount==0)?'disabled':'')+'>'+weatherSelectHTML+'</select>'
			
			var weatherSelect = $(weatherSelectHTML)
			
			
			
			
			
			
			
			weatherSelect.change(
							function () {
								var str = "";
								$("select option:selected").each(
									function () {
										loadweather($(this).val())
              						}
								);
          					
        				})
        				.change();
				
						
			if(weatherDisplayForm){
				weatherSelect = weatherSelect.appendTo(weatherDisplayForm)
			}
			
			weatherSelect.css({'font-size':'11px', color:'#333333', width:'150px'})
			
			
			var splitBorderTop    = RUZEE.ShadedBorder.create({ corner:8, edges:"tlr", shadow:16, border:2, borderOpacity:0.1  });
  			var splitBorderBottom = RUZEE.ShadedBorder.create({ corner:8, edges:"blr", shadow:16, border:2, borderOpacity:0.1  });
  			splitBorderBottom.render('weatherDisplayPanel');
			splitBorderTop.render('weatherDisplayTop');
			$('.sb-border', weatherDisplayWrapper).css({'background-color':'#000000'})
			
			
			if($.browser.msie6){
			
				$('.sb-inner', weatherDisplayTop).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad2.png')"})
					
						
				$('.blank', weatherDisplayTop).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+opts.imagepath+"blank.png')"})
				
				$('.sb-inner', weatherDisplayPanel).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad3.png')"})
				
				$('.blank', weatherDisplayPanel).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+opts.imagepath+"blank.png')"})
				
			}else{
				$('.sb-inner', weatherDisplayTop).css({'background-color':'#5c93c8', 'background-image':'url('+opts.imagepath+'grad2.png)', 'background-repeat':'repeat-x'})
						
				$('.blank', weatherDisplayTop).css({'background-color':'#5c93c8', 'background-image':'none'})
				
				$('.sb-inner', weatherDisplayPanel).css({'background-color':'#5c93c8', 'background-image':'url('+opts.imagepath+'grad3.png)', 'background-repeat':'repeat-x'})
						
				$('.blank', weatherDisplayPanel).css({'background-color':'#5c93c8', 'background-image':'none'})
				
			}
			
			weatherDisplayForm.bind("submit", function() { return false; })
			
			
			if (selectedIndex){
				loadweather(opts.weatherLocations[selectedIndex])
			}		


			
			
		}
		
		init()
		
		
		function update(obj){
			
			if (data){
				
				if($(data).find("search").length > 0){
					
					var weatherSelectHTML = ""
					var selectCount = 0
					
					
					$(data).find("loc").each(
						function (){
							weatherSelectHTML+='<option value="'+$(this).attr("id")+'">'+$(this).text()+'</option>'
							
							selectCount++
						}
					);
			
			
					/*if (weatherSelectHTML!=""){*/
						if(selectCount>0){
							weatherSelectHTML = '<option value="" selected="selected">'+selectCount+' Location'+((selectCount>1)?'s':'')+' Found</option>'+weatherSelectHTML
						}else{
							weatherSelectHTML = '<option value="" selected="selected">0 Locations Found</option>'
						}
			
						$("#weatherselect",weatherDisplayForm).remove()
						
						weatherSelectHTML='<select name="weatherselect" size="1" id="weatherselect"'+((selectCount==0)?'disabled':'')+'>'+weatherSelectHTML+'</select>'
			
			
						var weatherSelect = $(weatherSelectHTML)
						
				
						weatherSelect.change(
							function () {
								var str = "";
								$("select option:selected").each(
									function () {
										loadweather($(this).val())
              						}
								);
          					
        				})
        				.change();
				
						
						if(weatherDisplayForm){
						weatherSelect = weatherSelect.appendTo(weatherDisplayForm)
						
						}
						
						weatherSelect.css({'font-size':'11px', color:'#333333', width:'150px'})
			
						//var weatherDisplayForm = (weatherSelect.wrap('<form></form>')).parent()
				
						/*$("option:selected",weatherSelect).each(
							function(){
								loaddata($(this).val())
							}
						);*/
			
				
					/*}*/
				}
				
				
				
				if($(data).find("weather").length > 0){
					
			
					locations = new Object()
						
					$(data).find("loc").each(
												  
						function() {
							if(weatherDisplayPanel){
								
								$("#weatherDisplayInfo", weatherDisplayPanel).remove()
							}
							//locsuns:$("suns", this).text()
							var location = {id:$(this).attr("id"),
											locname:$("dnam", this).text(),
											loctime:$("tm", this).text(),
											locsunr:$("sunr", this).text(),
											locsuns:$("suns", this).text()
											}
							
							
							
							var theSet = toTime(location.locsuns);
							var theRise = toTime(location.locsunr);
							var theCur = toTime(location.loctime);
					
							if(theSet < theRise){
								if(theCur < theSet){
									theRise -= ( 1000 * 60 * 60 * 24 )
								}else{
									theSet += ( 1000 * 60 * 60 * 24 )
								}
							}


							if(theCur >= theSet){
								
								var tempid = setTimeout("$.loadAjaxWeatherQuery('lastWeatherQuery')", Math.max(60*1200,Math.abs(toTime("24:00 AM")-theCur)));
								

							}else if (theCur >= theRise){
								var tempid = setTimeout("$.loadAjaxWeatherQuery('lastWeatherQuery')", Math.max(60*1200,Math.abs(theSet-theCur)));
								
							}else{
								var tempid = setTimeout("$.loadAjaxWeatherQuery('lastWeatherQuery')", Math.max(60*1200,Math.abs(theRise-theCur)));
								
							}
							
							
							gIsNightTime = isNightTime(location.locsunr,location.locsuns,location.loctime)
							
							
							
							
							//weatherDisplayInfo = $('<div id="weatherDisplayInfo"></div>').appendTo(weatherDisplayPanel)
							
							
							
							weatherDisplayInfo = $('<div id="weatherDisplayInfo"></div>').insertBefore(weatherDisplayFormContainer)
							
							
							
							
					
							$(data).find("cc").each(
								function(){
								location.locmoon=$(this).children("moon").children("icon").text()
								location.locicon=$(this).children("icon").text()
								location.loctemp=$(this).children("tmp").text()
								location.locsum=$(this).children("t").text()
								location.lochumid=$(this).children("hmid").text()
								locpressure = $(this).children("bar")
								location.locpressure=locpressure.children("r").text()
								location.locchill=$(this).children("flik").text()
								var locwind = $(this).children("wind")
								location.locwind=locwind.children("t").text()+" "+locwind.children("s").text()
								
								var icons = getIcons(location.locicon, "big", location.locmoon, gIsNightTime)
								
								var weatherDisplayInfo_current = $('<div id="weatherDisplayInfo_current"></div>').appendTo(weatherDisplayInfo)
								var weatherDisplayInfo_currentIcons = $('<div id="weatherDisplayInfo_currentIcons"></div>').appendTo(weatherDisplayInfo_current)
								
								weatherDisplayInfo_current.css({ position:'relative'})
								weatherDisplayInfo_currentIcons.css({ position:'absolute', height:'30px', top:'-50px', left:'-25px'})
								
								/*weatherDisplayInfo_current.css({position:'relative'})
					weatherDisplayInfo_currentIcons.css({position:'absolute', height:'30px', top:'-50px', left:'-25px'})*/
					
					
					
								
								
								if(icons.sun.src){
									var icon = $('<div id="weatherDisplayInfo_currentSun"></div>').appendTo(weatherDisplayInfo_currentIcons)
									
									icon.css({top:((icons.sun.vOffset)?icons.sun.vOffset:0)+'px', left:((icons.sun.hOffset)?icons.sun.hOffset:0)+'px', position:'absolute', width:'107px', height:'99px'})
									if($.browser.msie6){
										icon.css({backgroundImage:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+icons.sun.src+"')"});
									}else{
										//alert('backgroundImage:url (' + icons.sun.src + ')')
										icon.css({backgroundImage:'url(' + icons.sun.src +')'})
									}	
								}
								if(icons.cloud.src){
									var icon = $('<div id="weatherDisplayInfo_currentCloud"></div>').appendTo(weatherDisplayInfo_currentIcons)
									icon.css({top:((icons.cloud.vOffset)?icons.cloud.vOffset:0)+'px', left:((icons.cloud.hOffset)?icons.cloud.hOffset:0)+'px', position:'absolute', width:'169px', height:'114px'})
									if($.browser.msie6){
										icon.css({background:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+icons.cloud.src+"')"});
									}else{
										//alert('background:url (' + icons.sun.src + ')')
										icon.css({backgroundImage:'url(' + icons.cloud.src +')'})
									}	
								}
								
								
								
								
								
								
								
								
								weatherDisplayInfo_currentTemp = $('<div id="weatherDisplayInfo_currentTemp"><div id="weatherDisplayInfo_currentTemp_light_Text"><div id="weatherDisplayInfo_currentTemp_shad_Text">'+location.loctemp+'&#176;<span class="weatherDisplayInfo_currentTemp_units">'+opts.tempunits+'</span></div>'+location.loctemp+'&#176;<span class="weatherDisplayInfo_currentTemp_units">'+opts.tempunits+'</span></div></div>').appendTo(weatherDisplayInfo_current)
								}
							);
							
							weatherDisplayInfo_currentTemp.css({'text-align':'right', position:'relative', top:'-10px', left:'-6px'})
							$('#weatherDisplayInfo_currentTemp_light_Text').css({ color:'#FFFFFF', 'font-size':'24px', display:'inline-block', position:'relative'})
							$('#weatherDisplayInfo_currentTemp_shad_Text').css({ color:'#000000', 'font-size':'24px', position:'absolute', top:'1px', right:'-1px', 'z-index':'-1'})
							
							if($.browser.msie6){
								$('#weatherDisplayInfo_currentTemp_shad_text').css({filter:'alpha(opacity=50)'})
							}else{
								$('#weatherDisplayInfo_currentTemp_shad_text').css({opacity:'0.5'})
							}
							
							$('.weatherDisplayInfo_currentTemp_units', weatherDisplayInfo_currentTemp).css({ 'font-size':'14px'})
							
							
							locations[location.id] = location
							
							days = new Array()
							
							$(data).find("day").each(
								function() {
									var day = {
												locid:location.id,
									  			loctime:location.loctime,
									   			locsunr:location.locsunr,
												locsuns:location.locsuns,
												locmoon:location.locmoon,
												daynum:$(this).attr("d"),
												daytitle:$(this).attr("t"),
												daydate:$(this).attr("dt"),
												hi:$(this).children("hi").text(),
												low:$(this).children("low").text(),
												sunr:$(this).children("sunr").text(),
												suns:$(this).children("suns").text(),
												dayparts:$("part", this)
									}
									days.push(day);
									
									/*day.dayparts.each(
										function(){
										//	alert($(this).children("icon").text())
										}
									)*/
									
									//alert($(this).children("part").attr("p"))
								}
							);
						}
								
					);
					
					
					
					
					if (days.length> 0){
						
						
						
						
						
						var  weatherDisplayTabs = $('<ul id="weatherDisplayTabs"><li id="weatherDisplayInfo_forecastTab"><a href="#weatherDisplayInfo_forecast"><span class="weather_tabtext">Forecast</span></a></li><li id="weatherDisplayInfo_detailTab"><a href="#weatherDisplayInfo_detail"><span class="weather_tabtext">Current Conditions</span></a></li></ul>').appendTo(weatherDisplayInfo)
						
						
						/*$('li',weatherDisplayTabs).each(
							function(){
								$(this).css({float:'left', color:'#000', 'list-style':'none', padding:'0px', margin:'0 0 0 5px'})
								if($.browser.msie){
									weatherDisplayTabs.css({display:'inline-block'})
								}

#tabs li a { display:block; float:left; text-decoration:none; padding:5px; color:#000; }
#tabs li, #tabs li .sb-inner { background:#ccc; }
#tabs li:hover, #tabs li:hover .sb-inner { background:#eee; }
#tabs li.hover, #tabs li.hover .sb-inner { background:#eee; } /* for ie6 */
/*#tabs li .sb-border { background:#fff; }
							}
						);*/
						
						
						
						
						
						
						
						
						

						
						
						
					/*	$('.sb-inner', weatherDisplayTabs).each(
					function(){
						if($.browser.msie6){
							$(this).css({background:'#5c93c8', backgroundImage:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad2.png')"});
						}else{
							$(this).css({background:'#5c93c8 url('+opts.imagepath+'grad2.png) repeat-x'})
						}
					}
			);*/
						
						var weatherDisplayInfo_forecast = $('<div id="weatherDisplayInfo_forecast"></div>').appendTo(weatherDisplayInfo)
						
						
						
						
						
						
						
						
						
						
						var forecastDisplay = $('<table id="forecastDisplay_Table" border="0" cellspacing="0" cellpadding="0"></table>').appendTo(weatherDisplayInfo_forecast)
						
						forecastDisplay.css({width:'100%'})
						
						var forecastDisplayDayRow = $('<tr class="forecastday_title_row"></tr>').appendTo(forecastDisplay)
						//forecastDisplayDayRow.css({background: 'url('+opts.imagepath+'grad5.png) repeat-x;'})
						var forecastDisplayHiRow = $('<tr class="forecasthi_row"></tr>').appendTo(forecastDisplay)
						var forecastDisplayIconRow = $('<tr class="forecasticon_row"></tr>').appendTo(forecastDisplay)
						var forecastDisplayLowRow = $('<tr id="forecastlow_row"></tr>').appendTo(forecastDisplay)
						var d = 1
						
						
						
						$(days).each(
							function(){
								//alert (toDate(this.locdate+" "+this.loctime)>toDate(this.daydate+" "+this.locsuns))
								
								//alert(isNightTime(this.locsunr,this.locsuns,this.loctime))
								/*var dayHTML = '<td class="forecastday" id="forecastday'+this.daynum+'"><span class="forecastday_detail" >'+dayList[this.daytitle]+'</span><span class="forecastday_detail">'+this.hi+'</span><div id="weatherDisplayInfo_currentIcons"></div><span class="forecastday_detail">'+this.low+'</span></td>'*/
								
								if (d==1){
									var selector = " firstforecastday"
									//forecastobj.css({background:'url('+opts.imagepath+'grad5.png) repeat-y'})
								}else{
									var selector = (Math.floor(d*0.5)==Math.round(d*0.5))?" evenforecastday":" oddforecastday";
									//forecastobj.css({background:'url('+opts.imagepath+((Math.floor(d*0.5)==Math.round(d*0.5))?'cell_bg_dark.png':'cell_bg_light.png')+') repeat-y'})
								}
								
								var forecastobj 
								
								forecastobj = $('<td class="forecastday_detail forecastday'+this.daynum+'"><span class="forecastday_title">'+dayList[this.daytitle]+'</span></td>').appendTo(forecastDisplayDayRow)
								
								forecastobj.css({margin:'0px', 'border-top':'0px', 'border-bottom':'1px dotted #888888', 'border-left':'0px', 'border-right':'0px', 'padding-top':'4px','padding-bottom':'4px', 'padding-left':'2px', 'padding-right':'2px', 'text-align':'center', 'font-family': 'Verdana, Arial, Helvetica, sans-serif', 'font-size': '9px', 'font-weight':'bold',' text-align':'center', color:'#FFFFFF'})
								
								if($.browser.msie6){
									forecastobj.css({'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+opts.imagepath+"grad5.png')"})
								}else{
									forecastobj.css({'background-image':'url('+opts.imagepath+'grad5.png)'})
								}
								
								
								forecastobj = $('<td class="forecastday_detail forecastday'+this.daynum+selector+'"><span class="forecastday_hi">'+((this.hi=="N/A")?'--':this.hi+'&#176;')+'</span></td>').appendTo(forecastDisplayHiRow)
								
								forecastobj.css({margin:'0px', border:'0px', padding:'2px', 'text-align':'center', 'font-family': 'Verdana, Arial, Helvetica, sans-serif', 'font-size': '9px', 'font-weight':'bold',' text-align':'center', color:'#FFFFFF'})
								
								forecastobj = $('<td class="forecastday_detail forecastday'+this.daynum+selector+'"></td>').appendTo(forecastDisplayIconRow)
								
								forecastobj.css({margin:'0px', border:'0px', padding:'2px', 'text-align':'center', 'font-family': 'Verdana, Arial, Helvetica, sans-serif', 'font-size': '9px', 'font-weight':'bold', color:'#FFFFFF'})
								
								
								forecastobj = $('<div class="forecastday_icons"></div>').appendTo(forecastobj)
								
								forecastobj.css({'margin-left':'auto', 'margin-right':'auto', position:'relative', width:'33px', height:'23px'})
								
								var suncode = (this.dayparts.eq(0)).children("icon").text()
								
								var mooncode = this.locmoon
								
								
								
								var icons = getIcons(suncode, "small", mooncode, (d==1)?gIsNightTime:false)
								
								if(!icons.sun.src && !icons.cloud.src){
									suncode = (this.dayparts.eq(1)).children("icon").text()
									var icons = getIcons(suncode, "small", mooncode, gIsNightTime)
								}
								
								
								
								if(icons.sun.src){
									var icon = $('<div class="forecastday_iconsun"></div>').appendTo(forecastobj)
									
									icon.css({left:((icons.sun.hOffset)?icons.sun.hOffset:0)+'px', position:'absolute', width:'33px', height:'23px'})
									if($.browser.msie6){
										icon.css({backgroundImage:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+icons.sun.src+"')"});
									}else{
										//alert('backgroundImage:url (' + icons.sun.src + ')')
										icon.css({backgroundImage:'url(' + icons.sun.src +')'})
									}	
								}
								if(icons.cloud.src){
									var icon = $('<div class="forecastday_iconcloud"></div>').appendTo(forecastobj)
									icon.css({left:((icons.cloud.hOffset)?icons.cloud.hOffset:0)+'px', position:'absolute', width:'33px', height:'23px'})
									if($.browser.msie6){
										icon.css({background:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+icons.cloud.src+"')"});
									}else{
										//alert('background:url (' + icons.sun.src + ')')
										icon.css({backgroundImage:'url(' + icons.cloud.src +')'})
									}	
								}
								
								
								forecastobj = $('<td class="forecastday_detail forecastday'+this.daynum+selector+'"><span class="forecastday_low">'+((this.low=="N/A")?'--':this.low+'&#176;')+'</span></td>').appendTo(forecastDisplayLowRow)
								
								
								
								
								forecastobj.css({margin:'0px', border:'0px', padding:'2px', 'text-align':'center', 'font-family': 'Verdana, Arial, Helvetica, sans-serif', 'font-size': '9px', 'font-weight':'bold',color:(gIsNightTime?'#ffffff':'#19467a')})
								
								
					
					
					
					
					
					
					
				
					
								//var day = $(dayHTML).appendTo(forecastDisplay)
								/*$('.forecastday_detail', day).each(
									function(){
										$(this).css({float:'left',clear:'both'})
									}
								);*/
								
								d++;
								
							}
						);
						
						if($.browser.msie6){
							$('.firstforecastday',forecastDisplay).css({'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad5.png')"})
							$('.oddforecastday',forecastDisplay).css({'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"cell_bg_light.png')"})
							$('.evenforecastday',forecastDisplay).css({'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"cell_bg_dark.png')"})
						}else{
							$('.firstforecastday',forecastDisplay).css({'background-image':'url('+opts.imagepath+'grad5.png)'})
							$('.oddforecastday',forecastDisplay).css({'background-image':'url('+opts.imagepath+'cell_bg_light.png)'})
							$('.evenforecastday',forecastDisplay).css({'background-image':'url('+opts.imagepath+'cell_bg_dark.png)'})
						}
						
						
					}
					
					/**/
					
					for (var location in locations){
						
						
						var weatherDisplayInfo_detail = $('<div id="weatherDisplayInfo_detail"></div>').appendTo(weatherDisplayInfo)
						
						weatherDisplayTabs.tabs({show: function(ui) {
											
										if($.browser.msie6){	
											$('.weather_tabtext',$(ui.target)).css({filter:'alpha(opacity=60)'})
											$('.sb-inner',$(ui.target)).css({background:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad7.png')"})
										
											$('.ui-tabs-selected',$(ui.target)).each(
												function(){
													$('.weather_tabtext',this).css({filter:'alpha(opacity=100)'})
													$('.sb-inner',this).css({background:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad4.png')"})
												}
											);
										}else{
											//if(!$.browser.msie){
												$('.weather_tabtext',$(ui.target)).css({opacity:'0.7'})	
												
												$('.sb-inner',$(ui.target)).css({'background-image':'url('+opts.imagepath+'grad7.png)' , 'background-repeat':'repeat-x'})
												
										
												$('.ui-tabs-selected',$(ui.target)).each(
													function(){
														$('.weather_tabtext',this).css({opacity:'1'})
														$('.sb-inner',this).css({'background-image':'url('+opts.imagepath+'grad4.png)' , 'background-repeat':'repeat-x'})
													
													}
												);
											//}
										}
						
        					$('.ui-tabs-hide',weatherDisplayInfo).css({display: 'none'})
   						}});
						
						/*$('.ui-tabs-hide',weatherDisplayInfo).each(
							function(){
								$(this).css({display: 'none'})
							}
						);*/
								
						
						
						
						
						weatherDisplayTabs.css({overflow:'hidden', padding:'0px', margin:'0px', color:'#444'})
						
						if($.browser.msie6){
							weatherDisplayTabs.css({height:'1%'})
						}
					
					
					$('li', weatherDisplayTabs).css({float:'left', 'list-style':'none', padding:'0px', margin:'0px'})
					$('.weather_tabtext',weatherDisplayTabs).css({'font-family': 'Verdana, Arial, Helvetica, sans-serif', 'font-size': '11px', color:'#000000'})
					$('a', weatherDisplayTabs).css({display:'block', float:'left', 'text-decoration':'none', padding:'5px', color:'#000'})
					
					var detailDisplay = $('<table id="weather_detailDisplay_Table" border="0" cellspacing="0" cellpadding="0"></table>').appendTo(weatherDisplayInfo_detail)
						
						detailDisplay.css({width:'100%'})
						
						var detailDisplayRow = $('<tr class="weather_detail_summary_row"><td colspan="2" class="weather_detail">'+locations[location].locsum+'</td></tr>').appendTo(detailDisplay)
						
						$('td', detailDisplayRow).each(
							function(){
								$(this).css({'border-bottom':'1px dotted #888888', color:'#FFFFFF', 'text-align':'center', 'font-family':'Verdana, Arial, Helvetica, sans-serif','font-size':'9px', 'font-weight':'bold', padding:'3px 10px 3px 10px', width:'100%'})
								if($.browser.msie6){
									
									$(this).css({'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad5.png')"})
								}else{
									$(this).css({'background-image':'url('+opts.imagepath+'grad5.png)'})
								}
							}
						);
						
						detailDisplayRow = $('<tr class="weather_detail_row weather_detail_label"><td class="weather_detail weather_detail_label_td first_weather_detail">Humidity</td><td class="weather_detail weather_detail_label_td second_weather_detail">Wind</td></tr>').appendTo(detailDisplay)
						
						
						
						detailDisplayRow = $('<tr class="weather_detail_row weather_detail_text"><td class="weather_detail weather_detail_text_td first_weather_detail">'+locations[location].lochumid+'%</td><td class="weather_detail weather_detail_text_td second_weather_detail">'+locations[location].locwind+((opts.tempunits=="c")?" km/h":" mph")+'</td></tr>').appendTo(detailDisplay)
						
						
						
						detailDisplayRow = $('<tr class="weather_detail_row weather_detail_label"><td class="weather_detail weather_detail_label_td first_weather_detail">Sunset</td><td class="weather_detail weather_detail_label_td second_weather_detail">Sunrise</td></tr>').appendTo(detailDisplay)
						
						detailDisplayRow = $('<tr class="weather_detail_row weather_detail_text"><td class="weather_detail weather_detail_text_td first_weather_detail">'+(locations[location].locsuns).toLowerCase()+'</td><td class="weather_detail weather_detail_text_td second_weather_detail">'+(locations[location].locsunr).toLowerCase()+'</td></tr>').appendTo(detailDisplay)
						
						detailDisplayRow = $('<tr class="weather_detail_row weather_detail_label"><td class="weather_detail weather_detail_label_td first_weather_detail">Wind Chill</td><td class="weather_detail weather_detail_label_td second_weather_detail">Pressure</td></tr>').appendTo(detailDisplay)
						
						detailDisplayRow = $('<tr class="weather_detail_row weather_detail_text"><td class="weather_detail weather_detail_text_td first_weather_detail">'+locations[location].locchill+'&#176;'+opts.tempunits+'</td><td class="weather_detail weather_detail_text_td  second_weather_detail">'+locations[location].locpressure+((opts.tempunits=='c')?' mb':' ""')+'</td></tr>').appendTo(detailDisplay)
						
						/*$('.weather_detail_label', detailDisplay).each(
							function(){
								$(this).css({color:'#FFFFFF', 'font-family':'Verdana, Arial, Helvetica, sans-serif','font-size':'9px', 'font-weight':'bold', padding:'3px 10px 3px 10px', width:'50%'})
							}
						);
						
						$('.weather_detail_text', detailDisplayRow).each(
							function(){
								$(this).css({color:'#19467a', 'font-family':'Verdana, Arial, Helvetica, sans-serif','font-size':'9px', 'font-weight':'bold', padding:'3px 10px 3px 10px', width:'50%'})
							}
						);*/
						
						$('.weather_detail_label_td', detailDisplay).css({color:'#FFFFFF', 'font-family':'Verdana, Arial, Helvetica, sans-serif','font-size':'9px', 'font-weight':'bold', padding:'3px 10px 3px 10px', width:'50%'})
						
						$('.weather_detail_text_td', detailDisplay).css({color:'#19467a', 'font-family':'Verdana, Arial, Helvetica, sans-serif','font-size':'9px', 'font-weight':'bold', padding:'3px 10px 3px 10px', width:'50%'})
						
						if($.browser.msie6){
							$('.first_weather_detail', detailDisplay).css({'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad5.png')"})
							$('.second_weather_detail', detailDisplay).css({'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"cell_bg_light.png')"})
						}else{
							$('.first_weather_detail', detailDisplay).css({'background-image':'url('+opts.imagepath+'grad5.png)'})
							$('.second_weather_detail', detailDisplay).css({'background-image':'url('+opts.imagepath+'cell_bg_light.png)'})
						}
								
						
						
						var weatherDisplayInfo_detailLink = $('<div id="weatherDisplayInfo_detailLink"><a href="http://www.weather.com/outlook/travel/businesstraveler/extended/'+location+'" target="_blank">Extended Forecast weather.com</a></div>').appendTo(weatherDisplayInfo)
						
						
						weatherDisplayInfo_detailLink.css({'border-top':'1px dotted #888888', padding:'3px', 'text-align':'center'})
						
						$('a',weatherDisplayInfo_detailLink).css({'font-family': 'Verdana, Arial, Helvetica, sans-serif', 'font-size': '11px', color:(gIsNightTime?'#ffffff':'#19467a')})
						
						if($.browser.msie6){
							weatherDisplayInfo_detailLink.css({'background-image':'none', width:'100%', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+opts.imagepath+"grad5.png')"})
						}else{
							weatherDisplayInfo_detailLink.css({'background-image':'url('+opts.imagepath+'grad5.png)'})
							
						}
						
						
						var splitBorderTop    = RUZEE.ShadedBorder.create({ corner:8, edges:"tlr", shadow:16, border:2, borderOpacity:0.1  });
  			var splitBorderBottom = RUZEE.ShadedBorder.create({ corner:8, edges:"blr", shadow:16, border:2, borderOpacity:0.1  });
  			splitBorderBottom.render('weatherDisplayPanel');
			splitBorderTop.render('weatherDisplayTop');
			$('.sb-border', weatherDisplayWrapper).css({'background-color':'#000000'})
			
			
			if($.browser.msie6){
			
				$('.sb-inner', weatherDisplayTop).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad2.png')"})
					
						
				$('.blank', weatherDisplayTop).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+opts.imagepath+"blank.png')"})
				
				$('.sb-inner', weatherDisplayPanel).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad3.png')"})
				
				$('.blank', weatherDisplayPanel).css({background:'#5c93c8', 'background-image':'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+opts.imagepath+"blank.png')"})
				
			}else{
				$('.sb-inner', weatherDisplayTop).css({'background-color':'#5c93c8', 'background-image':'url('+opts.imagepath+'grad2.png)', 'background-repeat':'repeat-x'})
						
				$('.blank', weatherDisplayTop).css({'background-color':'#5c93c8', 'background-image':'none'})
				
				$('.sb-inner', weatherDisplayPanel).css({'background-color':'#5c93c8', 'background-image':'url('+opts.imagepath+'grad3.png)', 'background-repeat':'repeat-x'})
						
				$('.blank', weatherDisplayPanel).css({'background-color':'#5c93c8', 'background-image':'none'})
				
			}
			
			
			if (gIsNightTime){
				
								if($.browser.msie6){
									$('.sb-inner', weatherDisplayWrapper).css({background:'#17003a'})
								}else{
									$('.sb-inner', weatherDisplayWrapper).css({'background-color':'#17003a'})
								}
							}else{
								if($.browser.msie6){
									$('.sb-inner', weatherDisplayWrapper).css({background:'#5c93c8'})
								}else{
									$('.sb-inner', weatherDisplayWrapper).css({'background-color':'#5c93c8'})
								}
								
							}
			
					
					if($.browser.msie6){
						
						$('li', weatherDisplayTabs).css({display:'inline-block'})
						$('.weather_tabtext',weatherDisplayTabs).css({filter:'alpha(opacity=60)'})
						var tabBorder = RUZEE.ShadedBorder.create({ corner:5, edges:"tlr", border:1, borderOpacity:0.1 });
						tabBorder.render('weatherDisplayInfo_forecastTab');
						tabBorder.render('weatherDisplayInfo_detailTab');
						$('.sb-inner',weatherDisplayTabs).css({background:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad7.png')"})

						$('.ui-tabs-selected',weatherDisplayTabs).each(
							function(){
								$('.weather_tabtext',weatherDisplayTabs).css({filter:'alpha(opacity=100)'})
								$('.sb-inner',this).css({background:'none', filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+opts.imagepath+"grad4.png')"})
							}
						);
						
																																														
					}else{
						var tabBorder = RUZEE.ShadedBorder.create({ corner:5, edges:"tlr", border:1, borderOpacity:0.1 });
						tabBorder.render('weatherDisplayInfo_forecastTab');
						tabBorder.render('weatherDisplayInfo_detailTab');
						$('.weather_tabtext').css({opacity:'0.7'})
						$('.sb-inner',weatherDisplayTabs).css({'background-image':'url('+opts.imagepath+'grad7.png)' , 'background-repeat':'repeat-x'})

						$('.ui-tabs-selected',weatherDisplayTabs).each(
							function(){
								$('.weather_tabtext',this).css({opacity:'1'})
								$('.sb-inner',this).css({'background-image':'url('+opts.imagepath+'grad4.png)' , 'background-repeat':'repeat-x'})
							}
						);
						
					}
					//$.rule('#weatherDisplayTabs li div.sb-inner { background-color:inherit; background-image:url('+opts.imagepath+'grad4.png) !important; background-repeat:repeat-x;}').appendTo(weatherSheet)
					
					
					
					$('.sb-border', weatherDisplayTabs).css({'background-color':'#000000'})
						

					
						
						
						

					


					
					
						
						
							/*var employerLink = employers[employer].companylink
							
							$("#employer_"+employers[employer].id, obj).each(
								function(){
									var partnersDisplayLink = $(this).wrap('<a href="'+employerLink+'" class="partnersDisplayLink"></a>').parent()
									var employerId = employer
									partnersDisplayLink.hover(
										function (obj) {
											
											
											itemHoverOver($(this),employerId)
										},
										function () {
											itemHoverOut($(this))

										}
									);
								}
							);*/
					
					}
					
					
					
					

					
					
					
					
					
					
					

					/*$('.ui-tabs-hide', '#weatherDisplayPanel').each(
						function(){

							$(this).css({display:'none'})
						}
					);*/

					
					
						
					
					
					
					
					
			
					
					if($.browser.msie6){
						
						
						
						
						
						
					}else{
						//$('#weatherDisplayTop').css({'background-color':'#5c93c8', 'background-image':'url('+opts.imagepath+'grad2.png)', 'background-repeat':'repeat-x'})
						
						

						//$('#weatherDisplayPanel').css({'background-color':'#5c93c8', 'background-image':'url('+opts.imagepath+'grad3.png)', 'background-repeat':'repeat-x'})
						
						
					
						

						

						
						
						/*$('#weatherDisplayTabs').click(
							function () {
								alert("sss")
								$('li', '#weatherDisplayTabs').each(
									function(){
										$(this).css({opacity:'0.7'})
									}
								);
								$(this).css({opacity:'1'})	
							}
						);*/
						
						
    
						//$.rule('#weatherDisplayTabs .sb-inner','style').append('background-image:url('+opts.imagepath+'grad5.png) !important;');
						
						
						
						
					
					}
			
			
				
				
			
					
					
					
					
				}
				
			}
		}
		
		update(weatherDisplay)
	}
	
})(jQuery);