// JavaScript Document

function gmobj(o){
	if(document.getElementById){ m=document.getElementById(o); }
	else if(document.all){ m=document.all[o]; }
	else if(document.layers){ m=document[o]; }
	return m;
}

function ShowWeatherBox(vId) {
	var xmlHttp = null;

	try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) {	try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");	} catch (E) { xmlHttp = null; } }

	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {	xmlHttp = new XMLHttpRequest();	}

	if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; }

	var url='modules/mod_weather/source/weather.php?q='+vId;
	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState==4) {
			var vAdImg, vAdImg1, vAdImg2, vAdImg3, vAdImg4, vAdImg5, vWeather;
			vAdImg = xmlHttp.responseXML.getElementsByTagName('AdImg').item(0).firstChild.nodeValue;
			vAdImg1 = xmlHttp.responseXML.getElementsByTagName('AdImg1').item(0).firstChild.nodeValue;
			if(xmlHttp.responseXML.getElementsByTagName('AdImg2').item(0).firstChild != null)
				vAdImg2 = xmlHttp.responseXML.getElementsByTagName('AdImg2').item(0).firstChild.nodeValue;
			if(xmlHttp.responseXML.getElementsByTagName('AdImg3').item(0).firstChild != null)
				vAdImg3 = xmlHttp.responseXML.getElementsByTagName('AdImg3').item(0).firstChild.nodeValue;
			if(xmlHttp.responseXML.getElementsByTagName('AdImg4').item(0).firstChild != null)
				vAdImg4 = xmlHttp.responseXML.getElementsByTagName('AdImg4').item(0).firstChild.nodeValue;
			if(xmlHttp.responseXML.getElementsByTagName('AdImg5').item(0).firstChild != null)
				vAdImg5 = xmlHttp.responseXML.getElementsByTagName('AdImg5').item(0).firstChild.nodeValue;
			vWeather = xmlHttp.responseXML.getElementsByTagName('Weather').item(0).firstChild.nodeValue;
			var sHTML = '';
			sHTML = sHTML.concat('<img src="modules/mod_weather/images/').concat(vAdImg).concat('" class="weather" alt="" />&nbsp;');
			sHTML = sHTML.concat('<img src="modules/mod_weather/images/').concat(vAdImg1).concat('" class="weather" alt="" />');
			if(vAdImg2!=null) sHTML = sHTML.concat('<img src="modules/mod_weather/images/').concat(vAdImg2).concat('" class="weather" alt="" />');
			if(vAdImg3!=null) sHTML = sHTML.concat('<img src="modules/mod_weather/images/').concat(vAdImg3).concat('" class="weather" alt="" />');
			if(vAdImg4!=null) sHTML = sHTML.concat('<img src="modules/mod_weather/images/').concat(vAdImg4).concat('" class="weather" alt="" />');
			if(vAdImg5!=null) sHTML = sHTML.concat('<img src="modules/mod_weather/images/').concat(vImg5).concat('" class="weather" alt="" />');
			sHTML = sHTML.concat('<img src="modules/mod_weather/images/c.gif" class="weather" alt="" />');

			gmobj('img-Do').innerHTML = sHTML;
			gmobj('txt-Weather').innerHTML = vWeather;
		}
	}
	xmlHttp.open("GET",url);
	xmlHttp.send(null);
}
