﻿
function zfWeContent(idx)	
{
	var strc='<div align=left><img src="http://www.zing.vn/news/images/weather/'+weather[idx][3]+'" alt=""  align="absmiddle" />';
	strc+='<span class=degree><strong>'+weather[idx][2]+'</strong></span><br /><div class=td-weather-data>'+weather[idx][4]+'<br>';
	
	   strc+='Độ ẩm: <span>'+weather[idx][5]+'</span><br>';
    strc+='<span>'+weather[idx][6]+'</span></DIV>';
	/*strc+='<span><strong>'+weather[idx][2]+'</strong></span></p>';
	strc+=weather[idx][4]+'<p>Độ ẩm:<span>'+weather[idx][5]+'</span></p>';
				strc+=weather[idx][6]+'<p style="clear:both;"></p><br class="clear" />';
 */
	document.getElementById('zfWeContent').innerHTML=strc;
}
function zfChange(this_)
{ 
		zfWeContent(this_.selectedIndex);
};
	
function zfShowWeather()
{ 
		var strcboWeather='<select class="sltbox01" onchange="zfChange(this);">';
		var itemindex=0;
		var initWeatherValue='t-p-ha-noi';
		
		for(var i=0;i<weather.length;i++)
		{ 
			var id=weather[i][0];
			if (initWeatherValue==id)
				itemindex=i;
				strcboWeather+='<option value="'+id+'"'+(initWeatherValue==id?' selected ':'')+'>'+weather[i][1]+'</option>';
		}
	document.getElementById('cboWeather').innerHTML=strcboWeather+'</select>';
	zfWeContent(itemindex);
};

