//javascript here
function load_thoitiet(vId)
{
		
	var thamso,linktp;
	thamso = document.getElementById("selectthanhpho").value;
		
	if (thamso == 1)
	{
		linktp = "http://vnexpress.net/ListFile/Weather/Danang.xml"
	}
	else if (thamso == 2)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/Haiphong.xml" 
	}
	else if (thamso == 3)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/Nhatrang.xml" 
	}
	else if (thamso == 4)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/Pleicu.xml" 
	}
	else if (thamso == 5)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/Sonla.xml" 
	}
	else if (thamso == 6)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/Hanoi.xml" 
	}
	else if (thamso == 7)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/HCM.xml" 
	}
	else if (thamso == 8)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/Vinh.xml" 
	}
	else if (thamso == 9)
	{ 
		linktp = "http://vnexpress.net/ListFile/Weather/Viettri.xml" 
	}
	 jQuery('#thongtintt').html('<img src="images/spinner.gif">');
	 jQuery('#thongtintt').load('ajax/thoitiet.php?randval='+ Math.random() + '&link=' + linktp);
	 
}	
function SwitchMenu(obj, t)
{
	var td_m;
	if(document.getElementById)
	{
		
		var el = document.getElementById(obj);
		var ar = document.getElementById("detail_pro").getElementsByTagName("span");
			
		if(el.style.display != "block")
		{
			
			for (var i=0; i<ar.length; i++)
			{				
				//alert(ar[i].id)	
				td_m=document.getElementById("title_"+i);
				if(td_m!=null) td_m.className='detail_pro_title';	
				
				ar[i].style.display = "none";
				
			}
			el.style.display = "block";
			t.className='detail_pro_title_select';
		}
	}
}
function reload_hinhanhsanpham(thumuc, sanpham_id)
{
	
		jQuery("#hinhanh").html('<img src="images/spinner.gif" align="absmiddle" />');
		
		jQuery.manageAjax.create('clearQueue', {queue: 'clear', maxRequests: 30});
				
		jQuery.manageAjax.add('clearQueue', {   success: function(html) {
		jQuery("#hinhanh").html(html);
		},   url: 'ajax/gethinhanhsanpham.php?id=' + sanpham_id + '&dir='+thumuc});
	
}
function urlencode( str ) 
{
                                     
    var ret = str;
    
    ret = ret.toString();
    ret = encodeURIComponent(ret);
    ret = ret.replace(/%20/g, '+');
 
    return ret;
}