<!-- hide from old browsers
  function GetDay(intDay){
    var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
                         "Thursday", "Friday", "Saturday")
    return DayArray[intDay]
    }

  function GetMonth(intMonth){
    var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December") 
    return MonthArray[intMonth] 	  	 
    }
  function getDateStrWithDOW(){
    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetDay(today.getDay()) + ", "
    todayStr += GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    return todayStr
    }
//-->


var xmlhttp

function loadXMLDoc(url)
{
xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null)

  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
  {
 var imageurl;
 var imagename;
 var fileurl;
 var weather;
 weather = xmlhttp.responseXML.getElementsByTagName("weather")[0].childNodes[0].nodeValue;
   imageurl = 'images/'; 

  if ((weather == 'Overcast') || (weather == 'Overcast with Haze') || (weather == 'Overcast and Breezy'))
  {
	imagename = 'weather_overcast.gif';
  }
  else if ((weather == 'Light Rain Showers') || (weather == 'Light Rain and Breezy') || (weather == 'Light Showers Rain'))
  {
	imagename = 'weather_lite_rain.gif';
  }
  else if ((weather == 'A Few Clouds') || (weather == 'A Few Clouds with Haze') || (weather == 'A Few Clouds and Breezy') || (weather == 'Partly Cloudy') || (weather == 'Partly Cloudy with Haze') || (weather == 'Partly Cloudy and Breezy'))
  {
	imagename = 'weather_part_cloud.gif';
  }
  else if ((weather == 'Mostly Cloudy') || (weather == 'Mostly Cloudy with Haze') || (weather == 'Mostly Cloudy and Breezy'))
  {
	imagename = 'weather_part_sun.gif';
  }
  else if ((weather == 'Rain Showers') || (weather == 'Heavy Rain Showers') || (weather == 'Rain Showers in Vicinity') || (weather == 'Heavy Showers Rain') || (weather == 'Showers Rain') || (weather == 'Showers Rain in Vicinity') || (weather == 'Thunderstorm') || (weather == 'Thunderstorm Rain') || (weather == 'Light Thunderstorm Rain') || (weather == 'Heavy Thunderstorm Rain'))
  {
	imagename = 'weather_rain.gif';
  }
  else if ((weather == 'Fair') || (weather == 'Clear') || (weather == 'Fair with Haze') || (weather == 'Clear with Haze') || (weather == 'Fair and Breezy') || (weather == 'Clear and Breezy'))
  {
	imagename = 'weather_sun.gif';
  }
  else
  {
	imagename = 'na.gif';
  }


  fileurl = imageurl + imagename;
  document.getElementById('A2').innerHTML= '&nbsp;/&nbsp;';
  credit=xmlhttp.responseXML.getElementsByTagName("temp_f");
  document.getElementById('A3').innerHTML=credit[0].childNodes[0].nodeValue + '&ordm;F';
  document.getElementById('A4').innerHTML=xmlhttp.responseXML.getElementsByTagName("temp_c")[0].childNodes[0].nodeValue + '&ordm;C';
  document.getElementById('A5').innerHTML= '&nbsp;<img src=' + fileurl + '>';

	
  }
  else
  {
  alert("Problem retrieving XML data:" + xmlhttp.statusText)
  }
  }
}
