// JavaScript Document
function aprifinestra(pagina,altezza,larghezza) {
	window.open(pagina,null,'height='+altezza+',width='+larghezza);	
}
function divshow(div){
	if( document.getElementById(div).style.display == 'none'){
		document.getElementById(div).style.display = 'block';
	} else {
		document.getElementById(div).style.display = 'none';	
	}
	return;
}
function showdiv(div){
	return divshow(div);	
}


function showslides(div){
	if( document.getElementById(div).style.display == 'none'){
		new Effect.SlideDown(div,{ duration: 0.5 } );	
	} else {
		new Effect.SlideUp(div,{ duration: 0.5 } );		
	}
	return;
}

function showfade(div){
	if( document.getElementById(div).style.display == 'none'){
		new Effect.Appear(div,{ duration: 0.2 } );	
	} else {
		new Effect.Fade(div,{ duration: 0.2 } );		
	}
	return;
}

function showblinds(div,durata){
	if( document.getElementById(div).style.display == 'none'){
		new Effect.BlindDown(div,{ duration: durata } );	
	} else {
		new Effect.BlindUp(div,{ duration: durata } );		
	}
	return;
}
function msgandgo(msg,goto){
	//window.open("_conferme.php?msg="+msg+"&goto="+goto,"conferma","width=400,height=150,scrollbars=0");	
	if(confirm(msg)) { window.location=goto; }
	//window.location=goto;
}

var myRequest = null;
var scrivineldiv = null;


function CreateXmlHttpReq(handler) {
	  var xmlhttp = null;
	  try {
		xmlhttp = new XMLHttpRequest();
	  } catch(e) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	  }
	  xmlhttp.onreadystatechange = handler;
	  return xmlhttp;
}

function h_resp_noloader() {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = eval("document.getElementById('"+scrivineldiv+"');");
        e.innerHTML = myRequest.responseText;
    }
	scirvineldiv = null;
}

function ajaxgo(div_response,action){
	scrivineldiv = div_response;
	myRequest = CreateXmlHttpReq(h_resp_noloader);
	myRequest.open("GET",action);
    myRequest.send(null);	
}