$(document).ready(function() {

	$('#flight_results').each(function(){
		var query = location.search;
		
		$(this).append(
		'<iframe	width="775px" height="1000" frameborder="0" scrolling="no" style=" margin-left: -8px" src="http://204.124.13.55/new/fltquery-dev.php' + query + '"></iframe>');
		//if query string is empty?
	});

	if($('#weather #temp').length > 0)
	{
		var options =
				{
					type:		'GET',
					url:		'weather.asp',
					dataType: 	'xml',
					success:	processWeatherXml
				};
		var bob = $.ajax(options);
		var tuna = 1;
		/*$.get("weather.asp", function(data){
			alert("Data Loaded: " + data);
		});*/
	}

	function processWeatherXml(responseXML, statusText)
	{
		var temp_f = $(responseXML).find('temp_f')[0].firstChild.data;
		var weather =  $(responseXML).find('weather')[0].firstChild.data;
		var imgsrc = $(responseXML).find('icon_url_base')[0].firstChild.data + $(responseXML).find('icon_url_name')[0].firstChild.data;
		$('#temp')[0].innerHTML = temp_f;
		$('#icon_holder')[0].innerHTML = '<img src="' + imgsrc + '" alt="' +  weather + ' title="' + weather + '" width="36" height="37"/>';
	}

});
