// JavaScript Document
var xmlhttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

	xmlhttp = new XMLHttpRequest();
}

function getCurrency(currency) { 

	var url = "http://www.urbanlowdown.com/func/remoteCurrency.php?id=";
	var theCurrency = currency;

	xmlhttp.open("GET", url + escape(theCurrency), true);
	
	xmlhttp.onreadystatechange = function() {

		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		
			results = xmlhttp.responseText;
						
			document.getElementById('currency').innerHTML = results;
			
			if (currency == 'usa') { 
				
				document.getElementById('theMoney').innerHTML = '<a href="#" onclick="getMyHTML(\'usa\')"><img src="<? echo $baseUrl; ?>/img/currency/dollar.gif" height="34px" width="34px" style="vertical-align:middle;" title="Convert this country\'s currency to Dollars" /></a>';
			}
			
			if (currency == 'uk') { 
				
				document.getElementById('theMoney').innerHTML = '<a href="#" onclick="getMyHTML(\'uk\')"><img src="<? echo $baseUrl; ?>/img/currency/pound.gif" height="34px" width="34px" style="vertical-align:middle;" title="Convert this country\'s currency to Pounds" /></a>';
			}
			
			if (currency == 'euro') { 
				
				document.getElementById('theMoney').innerHTML = '<a href="#" onclick="getMyHTML(\'euro\')"><img src="<? echo $baseUrl; ?>/img/currency/euro.gif" height="34px" width="34px" style="vertical-align:middle;" title="Convert this country\'s currency to Euros" /></a>';
			}
			
			if (currency == 'japan') { 
				
				document.getElementById('theMoney').innerHTML = '<a href="#" onclick="getMyHTML(\'japan\')"><img src="<? echo $baseUrl; ?>/img/currency/yen.gif" height="34px" width="34px" style="vertical-align:middle;" title="Convert this country\'s currency to Yen" /></a>';
			}
		}
	}
	
	xmlhttp.send(null);
}


function getTemp(type, temp) { 
	
	var url = "http://www.urbanlowdown.com/func/remoteWeather.php?id=";
	var url2 = "&temp=";
	
	xmlhttp.open("GET", url + escape(type) + url2 + escape(temp), true);
		
	xmlhttp.onreadystatechange = function() {
	
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			
			results = xmlhttp.responseText;
							
			document.getElementById('newWeather').innerHTML = results;
		}
	
	}
	
	xmlhttp.send(null);
}