
function RenderWeather(Weather) 
{
	var sTmp = '';
	
	sTmp = '‹C‰·' + Weather.CurrentTemperature + 'Ž<img src="' + Weather.ImagePath + 'diamond_weather.gif" width="13" height="12"/>' + calcTime('-10');
	
	return sTmp;
}

// function to calculate local time
// in a different city
// given the city's UTC offset
function calcTime(offset) {

    // create Date object for current location
    d = new Date();
	
	var greeting = '';
    
    // convert to msec
    // add local time zone offset 
    // get UTC time in msec
    utc = d.getTime() + (d.getTimezoneOffset() * 60000);
    
    // create new Date object for different city
    // using supplied offset
    nd = new Date(utc + (3600000*offset));
    
	var hours = nd.getHours()
  	var minutes = nd.getMinutes()

  	var suffix = "AM";
  	if (hours >= 12) {
  		suffix = "PM";
  		hours = hours - 12;
  	}
	
  	if (hours == 0) {
  		hours = 12;
  	}

  	if (minutes < 10)
  		minutes = "0" + minutes
		
	if (suffix == "AM") {
		greeting = ""
	} else {
		if ((hours < 6) || (hours == 12)) {
			greeting = ""
		} else {
			greeting = ""
		}
	}
		

  //document.write("<b>" + hours + ":" + minutes + " " + suffix + "</b>");

    // return time as a string
    //return "The local time in " + city + " is " + nd.toLocaleString();
	document.write("<img src='/weather/images/diamond_weather.gif' width='13' height='12'/>" +"<br>" + hours + ":" + minutes + " " + suffix + "<img src='/weather/images/diamond_weather.gif' width='13' height='12'/>" + greeting);
}

