var xmlhttp;
var livello;
function frich(p1, p2, p3, p4, p5, p6, p7) {
	xmlhttp = null;
	livello = p3;
	if(window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
	}else if(window.ActiveXObject) {
		try {   
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");   
		} catch (e1) {   
			try {   
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");   
			} catch (e2) {   
				try {   
					xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");   
				} catch (e3) {   
					xmlhttp = null;   
				}   
			}   
		}		
		
	}
	if(!p5) {
		if(!p6) {p6 = 0;}
		if(p6 !== "noscroll") {
			scroll(0, 0);
		}
		if(document.getElementById('animazione')) {
			document.getElementById('animazione').style.display = 'none';
		}
	}	
	if(!p7) {
		document.getElementById(livello).style.display = 'block';
		document.getElementById(livello).innerHTML = '';
	}
	if(xmlhttp !== null) {		
		if(p1 === 'POST') {
			xmlhttp.open(p1, p2, true);
			xmlhttp.onreadystatechange = frisp;	
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
			setQueryString(p4);
			xmlhttp.send(queryString);
		}else {	
			if(p4 !== "null") {
				setQueryString(p4);
				xmlhttp.open(p1, p2+queryString, true);
			}else {
				xmlhttp.open(p1, p2, true);
			}
			xmlhttp.onreadystatechange = frisp;	
			xmlhttp.send(null);			
		}
		return 'ok';
	}else {
		document.getElementById(livello).innerHTML = '<br />Problemi del browser: tecnologia non supportata'; 
	}
}
function frisp() {	
	if(xmlhttp.readyState === 4) {
		if(xmlhttp.status === 200) {	
			var response = xmlhttp.responseText;
			document.getElementById(livello).innerHTML = response;
		}
	}else {
		document.getElementById(livello).innerHTML = 'Loading...';
	}
}

var xmlhttp1;
var livello1;
function frich1(p1, p2, p3, p4, p5, p6) {
	xmlhttp1 = null;
	livello1 = p3;
	if(window.XMLHttpRequest) {
		xmlhttp1 = new XMLHttpRequest();
	}else if(window.ActiveXObject) {
		xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
	}
	document.getElementById(livello1).style.display = 'block';
	document.getElementById(livello1).innerHTML = '';
	if(xmlhttp1 !== null) {		
		if(p1 === 'POST') {
			xmlhttp1.open(p1, p2, true);
			xmlhttp1.onreadystatechange = frisp1;	
			xmlhttp1.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
			setQueryString(p4)
			xmlhttp1.send(queryString);
		}else {	
			if(p4 !== "null") {
				setQueryString(p4)
				xmlhttp1.open(p1, p2+queryString, true);
			}else {
				xmlhttp1.open(p1, p2, true);
			}
			xmlhttp1.onreadystatechange = frisp1;	
			xmlhttp1.send(null);					
		}
	}else {
		document.getElementById(livello1).innerHTML = '<br />Problemi del browser: tecnologia non supportata'; 
	}
	if(p6) {
		if(document.getElementById('animazione')) {
			document.getElementById('animazione').style.display = 'none';
		}
	}	
}
function frisp1() {
	if(xmlhttp1.readyState === 4) {
		if(xmlhttp1.status === 200) {
			var response = xmlhttp1.responseText;
			document.getElementById(livello1).innerHTML = response;
		}
	}else {
		document.getElementById(livello1).innerHTML = 'Loading...';
	}
}




