﻿function writeWeather()
{
	document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">')
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">')
	document.write('<tr>')
	document.write('<td align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">')
    document.write('<tr>')
	document.write('<td width="7%">&nbsp;</td>')
    document.write('<td width="93%" height="30"><select name="locat" onChange="showwhat(this.value)">')
	document.write('<option value="1">Hà Nội</option>')
	document.write('<option value="3">Huế</option>')
	document.write('<option value="4">Tp.HCM</option>')
	document.write('<option value="2">Đà Nẵng</option>')
    document.write('</select></td>')
    document.write('</tr>')
    document.write('</table></td>')
    document.write('<td width="42%" rowspan="2" valign="top" id="dnotes"></td>')
    document.write('</tr>')
    document.write('<tr>')
    document.write('<td width="58%" valign="top" id="dimg"></td>')
    document.write('</tr>')
    document.write('</table>')
	document.write('<table style="display:none" border="0" width="100%">')
	document.write('<tr>')
	document.write('<td id="himg1"><img border="0" src="images/weather/symbols/26.gif"><img src="images/weather/tempo/2.gif"><img src="images/weather/tempo/7.gif"><img src="images/weather/tempo/-.gif"><img src="images/weather/tempo/3.gif"><img src="images/weather/tempo/3.gif"><img src="images/weather/tempo/c.gif"></td>')
	document.write('<td id="hnotes1"></td>')
	document.write('</tr>')
	document.write('<tr>')
	document.write('<td id="himg3"><img border="0" src="images/weather/symbols/3.gif"><img src="images/weather/tempo/2.gif"><img src="images/weather/tempo/5.gif"><img src="images/weather/tempo/-.gif"><img src="images/weather/tempo/3.gif"><img src="images/weather/tempo/4.gif"><img src="images/weather/tempo/c.gif"></td>')
	document.write('<td id="hnotes3"></td>')
	document.write('</tr>')
	document.write('<tr>')
	document.write('<td id="himg4"><img border="0" src="images/weather/symbols/4.gif"><img src="images/weather/tempo/2.gif"><img src="images/weather/tempo/4.gif"><img src="images/weather/tempo/-.gif"><img src="images/weather/tempo/3.gif"><img src="images/weather/tempo/3.gif"><img src="images/weather/tempo/c.gif"></td>')
	document.write('<td id="hnotes4"></td>')
	document.write('</tr>')
	document.write('<tr>')
	document.write('<td id="himg2"><img border="0" src="images/weather/symbols/we.gif"><img src="images/weather/tempo/2.gif"><img src="images/weather/tempo/5.gif"><img src="images/weather/tempo/-.gif"><img src="images/weather/tempo/3.gif"><img src="images/weather/tempo/4.gif"><img src="images/weather/tempo/c.gif"></td>')
	document.write('<td id="hnotes2"></td>')
	document.write('</tr>')
	document.write('</table>')
}

function getObj(name)
{   if (document.getElementById) { return document.getElementById(name); }
	    else if (document.all)       { return document.all[name]; }
	    else if (document.layers)    { return document.layers[name]; }
}
function showwhat(what)
{
 	getObj("dimg").innerHTML = getObj("himg"+what).innerHTML
 	getObj("dnotes").innerHTML =  getObj("hnotes"+what).innerHTML
	getObj("locat").value = what
 }
