function help(stato){
	if(stato=="open"){
		div_help_open.style.display='block';
		div_help_closed.style.display='none';
		div_help_details.style.display='block';
	}else{
		div_help_open.style.display='none';
		div_help_closed.style.display='block';
		div_help_details.style.display='none';
	}
}

function controlla_data(nome,dt,k){
	var mil='19';
	if(k==2){
		mil='20';
	}
	var rit=false;
	if(dt.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/) && dt.length==10){ // gg/mm/aaaa
		rit=true;
	}else
	if(dt.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{2}$/) && dt.length==8){ // gg/mm/aa in +
		document.form[nome].value=dt.substr(0,6)+mil+dt.substr(6,2);
		rit=true;
	}else
	if(dt.match(/^[0-9]{8}$/) && dt.length==8){						 //	ggmmaaaa
		document.form[nome].value=dt.substr(0,2)+"/"+dt.substr(2,2)+"/"+dt.substr(4,4);
		rit=true;
	}else
	if(dt.match(/^[0-9]{6}$/) && dt.length==6){						 //	ggmmaa in +
		document.form[nome].value=dt.substr(0,2)+"/"+dt.substr(2,2)+"/"+mil+dt.substr(4,2);
		rit=true;
	}else
	if(dt.match(/^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$/) && dt.length==10){ // gg.mm.aaaa
		dt=dt.replace('.','/');
		dt=dt.replace('.','/');
		document.form[nome].value=dt;
		rit=true;
	}else
	if(dt.match(/^[0-9]{2}\.[0-9]{2}\.[0-9]{2}$/) && dt.length==8){ // gg.mm.aa
		dt=dt.replace('.','/');
		dt=dt.replace('.','/');
		document.form[nome].value=dt.substr(0,6)+mil+dt.substr(6,2);
		rit=true;
	}else
	if(dt.match(/^[0-9]{2}\-[0-9]{2}\-[0-9]{2}$/) && dt.length==8){ // gg-mm-aa
		dt=dt.replace('-','/');
		dt=dt.replace('-','/');
		document.form[nome].value=dt.substr(0,6)+mil+dt.substr(6,2);
		rit=true;
	}else
	if(dt.match(/^[0-9]{2}\-[0-9]{2}\-[0-9]{4}$/) && dt.length==10){ // gg-mm-aaaa in +
		dt=dt.replace('-','/');
		dt=dt.replace('-','/');
		document.form[nome].value=dt;
		rit=true;
	}	
	return rit;
}

function centerPopUp(url, nome,larghezza,altezza) {
	posA = (screen.height - altezza)/2;
	posL = (screen.width - larghezza)/2;
	window.open(url, nome, "width=" + larghezza + ",height=" + altezza + ",top =" + posA + ",left=" + posL);
}

