function ajaxFunction(){						
var xmlHttp; 

try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
	{
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  catch (e)
	{
	try
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e)
	  {
	  alert("Your browser does not support AJAX!");
	  return false;
	  }
	}
  }
			  
  xmlHttp.onreadystatechange=function()
	{
	//alert(newurl)															
	if(xmlHttp.readyState==4)
	  {
		var xmlDoc=xmlHttp.responseXML.documentElement;
		var condition =  xmlDoc.getElementsByTagName("yweather:condition")[0].attributes.getNamedItem("text").value; 
		var temp =  xmlDoc.getElementsByTagName("yweather:condition")[0].attributes.getNamedItem("temp").value; 
		var low =  xmlDoc.getElementsByTagName("yweather:forecast")[0].attributes.getNamedItem("low").value; 
		var high =  xmlDoc.getElementsByTagName("yweather:forecast")[0].attributes.getNamedItem("high").value; 													
		
		alert(condition + temp);
		
		document.getElementById("forecast").innerHTML = "<p><strong>L: "+ low + "&deg;<span class='unit'>F</span></strong></p><p><strong>H: "+ high + "&deg;<span class='unit'>F</span></strong></p><p><a href='http://www.weather.com/weather/local/90089'>Ext. Forecast</a></p>";
																							
	  }
	}
	
	 var newurl = "http://mylaw2.usc.edu/weather.xml";
	 xmlHttp.open("GET",newurl,true);
	 xmlHttp.send(null);
}


function test()	{
				
	var xmlHttp; 
									
	try //Internet Explorer
	  {
	  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  }
	catch(e)
	  {
	  try //Firefox, Mozilla, Opera, etc.
		{
		xmlDoc=document.implementation.createDocument("","",null);
		}
	  catch(e)
		{
		alert(e.message);
		return;
		}
	  }
									
	 xmlDoc.async = false;  
	 xmlDoc.load("http://weather.yahooapis.com/forecastrss?p=90089");
					
	var str = xmlDoc.getElementsByTagName("yweather:condition")[0].attributes.getNamedItem("text").value; 
	
	alert(str);
}
