
function gd(elm){
	return document.getElementById(elm);
}

function chome(){
	gd('div_content').style.display = 'none';
	gd('dots').style.display = 'none';
	gd('div_homepage').style.display = 'block';
}

function cload(cpath,im){
	if (gd('div_homepage').style.display != 'none'){
		gd('div_homepage').style.display = 'none';
		gd('div_content').style.display = 'block';
		gd('dots').style.display = 'block';
	}
	/*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest)
	window.XMLHttpRequest = function() { return new ActiveXObject('Microsoft.XMLHTTP') }
	@end @*/
	this.rq = new XMLHttpRequest();
	rq.open('GET', cpath, true);
	rq.onreadystatechange = function (aEvt) {
		if (rq.readyState == 4) {
			if(rq.status == 200){
				gd('dots').style.marginLeft = (iLeft(gd(im))+15) + 'px';
				gd('div_content').innerHTML = rq.responseText;
			} else {
				alert('Pagina attualmente non disponibile');
			}
		}
	}
	rq.send(null); 
}

function iLeft(obj) {
	if (obj.offsetParent) {
		var curleft = curtop = 0;
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return curleft;
	}
}
