function displayMETAR(URI){var xmlhttp=false;/*@cc_on @*/if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){xmlhttp=new XMLHttpRequest();}
xmlhttp.open("GET",URI,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==2){}
if(xmlhttp.readyState==4){if(xmlhttp.status==200){var xmlDoc=xmlhttp.responseXML;formatMETAR(xmlDoc);}}}
xmlhttp.send(null);}
function formatMETAR(xmlDoc){if(xmlDoc.getElementsByTagName('visibility')[0].firstChild){var visibility=xmlDoc.getElementsByTagName('visibility')[0].firstChild.nodeValue;visibility=visibility.replace(/BBRR/g,"<br>");$('visibility').innerHTML=visibility;}else{$('visibility').innerHTML="n/a";}
if(xmlDoc.getElementsByTagName('clouds')[0].firstChild){var clouds=xmlDoc.getElementsByTagName('clouds')[0].firstChild.nodeValue;clouds=clouds.replace(/BBRR/g,"<br>");$('clouds').innerHTML=clouds;}else{$('clouds').innerHTML="n/a";}
if(xmlDoc.getElementsByTagName('special')[0].firstChild){var special=xmlDoc.getElementsByTagName('special')[0].firstChild.nodeValue;special=special.replace(/BBRR/g,"<br>");$('special').innerHTML=special;}else{$('special').innerHTML="n/a";special="";}
if(special==""){wxTable.rows[13].style.visibility="collapse";}else{wxTable.rows[13].style.visibility="visible";}}
function getMETAR(){displayMETAR("ajax.back.php?url=http://www.kishk.org/weather/metar.php%3Ficao=KGTU%26xml=1");setTimeout("getMETAR()",900000);}
