function $(ID){
	return document.getElementById(ID);
}
function loadHtml(url,ID){
	var xmlhttp=null;
	if (window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	}else if(window.ActiveXObject){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	if(xmlhttp != null){
		xmlhttp.onreadystatechange=function(){
				if (xmlhttp.readyState==1)
					$(ID).innerHTML = "Loading...";
				if (xmlhttp.readyState==4){					
					if(xmlhttp.status==200){
						/*var html = "";
						var dom = xmlhttp.responseXML;			
						var root = dom.firstChild;
						if(window.ActiveXObject)
							root = dom.documentElement;
						if(root.nodeName == 'alerts'){
							html = 	parseAlerts(root);
						}else if(root.nodeName == 'notice'){
							html = 	parseNotice(ID, root);
						}else{
							html = 	parseMeters(ID, root);
						}*/
						$(ID).innerHTML = xmlhttp.responseText;		
					}
				}
			};
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
}
function selectGiornata(G){
	for(var i = 1;i<19;i++){
		$('g'+i).style.display = "none";
		$('l'+i).style.backgroundColor = "#C8D9ED";
	}
	$('g'+G).style.display = "block";
	$('l'+G).style.backgroundColor = "#ffffff";
}

function makeGiornate(ID,G){
	var html = "<div class='label'><b>giornate</b></div>";
	for(var i=1;i<19;i++){
		html += '<a href="javascript:selectGiornata('+i+');" id="l'+i+'"';
		if(i == G)
			html += " style='background:#ffffff'";
		html += '>'+i+'</a>';
	}
	$(ID).innerHTML = html;
}
