function apri(x,y,z){
	window.open(x,y,z);
}

function fnc1(id){
	document.getElementById(id).style.backgroundColor = '#264B71';
}

function fnc2(id){
	document.getElementById(id).style.backgroundColor = '#0A2642';
}

function fncApriInfo(){
		//if(document.getElementById('hidInfo').value == "1"){
		//	return;
		//}
		document.getElementById('divInfoHome').style.visibility = 'visible';
		document.getElementById('divInfoHome').style.top = "120px";
		document.getElementById('divInfoHome').style.left = ((screen.width / 2) - 300) + "px";
		//document.getElementById('hidInfo').value = "1";
		//document.forms[0].action = "home.asp?divinfo=ok";
		//document.forms[0].submit();
	}
function fncChiudiInfo(){
		document.getElementById('divInfoHome').style.visibility = 'hidden';
		document.getElementById('divInfoHome').style.top = "0px";
		document.getElementById('divInfoHome').style.left = "0px";
	}

function caricPagina(){
	window.status='Colonproctologia a Roma';
	var pagina = document.form1.txtPagina.value;
	if (pagina=='pazienti'){
		document.getElementById('divImg').style.visibility = 'hidden';
		document.getElementById('divImg').style.position = 'absolute';
		document.getElementById("div1p").style.visibility = 'visible';
		document.getElementById("div1p").style.position = 'relative';
		document.getElementById("div2p").style.visibility = 'visible';
		document.getElementById("div2p").style.position = 'relative';
		document.getElementById("div3p").style.visibility = 'visible';
		document.getElementById("div3p").style.position = 'relative';
		document.getElementById("div4p").style.visibility = 'visible';
		document.getElementById("div4p").style.position = 'relative';
	}else{ 
			if (pagina=='medici'){
				document.getElementById('divImg').style.visibility = 'hidden';
				document.getElementById('divImg').style.position = 'absolute';
				document.getElementById("div1m").style.visibility = 'visible';
				document.getElementById("div1m").style.position = 'relative';
				//document.getElementById("div2m").style.visibility = 'visible';
				//document.getElementById("div2m").style.position = 'relative';
				//document.getElementById("div3m").style.visibility = 'visible';
				//document.getElementById("div3m").style.position = 'relative';
				document.getElementById("div4m").style.visibility = 'visible';
				document.getElementById("div4m").style.position = 'relative';
				document.getElementById("div5m").style.visibility = 'visible';
				document.getElementById("div5m").style.position = 'relative';
				document.getElementById("div6m").style.visibility = 'visible';
				document.getElementById("div6m").style.position = 'relative';
				//document.getElementById("div7m").style.visibility = 'visible';
				//document.getElementById("div7m").style.position = 'relative';
				//document.getElementById("div8m").style.visibility = 'visible';
				//document.getElementById("div8m").style.position = 'relative';
			}else{
				document.getElementById('divImg').style.visibility = 'visible';
				document.getElementById('divImg').style.position = 'relative';
				document.getElementById("div1p").style.visibility = 'hidden';
				document.getElementById("div1p").style.position = 'absolute';
				document.getElementById("div2p").style.visibility = 'hidden';
				document.getElementById("div2p").style.position = 'absolute';
				document.getElementById("div3p").style.visibility = 'hidden';
				document.getElementById("div3p").style.position = 'absolute';
				document.getElementById("div4p").style.visibility = 'hidden';
				document.getElementById("div4p").style.position = 'absolute';
				document.getElementById("div1m").style.visibility = 'hidden';
				document.getElementById("div1m").style.position = 'absolute';
				//document.getElementById("div2m").style.visibility = 'hidden';
				//document.getElementById("div2m").style.position = 'absolute';
				//document.getElementById("div3m").style.visibility = 'hidden';
				//document.getElementById("div3m").style.position = 'absolute';
				document.getElementById("div4m").style.visibility = 'hidden';
				document.getElementById("div4m").style.position = 'absolute';
				document.getElementById("div5m").style.visibility = 'hidden';
				document.getElementById("div5m").style.position = 'absolute';
				document.getElementById("div6m").style.visibility = 'hidden';
				document.getElementById("div6m").style.position = 'absolute';
				//document.getElementById("div7m").style.visibility = 'hidden';
				//document.getElementById("div7m").style.position = 'absolute';
				//document.getElementById("div8m").style.visibility = 'hidden';
				//document.getElementById("div8m").style.position = 'absolute';
			}
	}
}

function InviaMail(){
	if (document.getElementById("txtNome").value == "") { alert('Inserire correttamente il proprio nome!'); return; }
	if (document.getElementById("txtTesto").value == "") { alert('Inserire correttamente il testo!'); return; }
	conferma = fncChkEmail("txtMail");
    if (conferma == "no") { alert("Inserire correttamente la propria E-mail!"); return; }	
	document.forms[0].submit();
}
function fncChkEmail(id) {
    var conferma = "si";
    var stringa = document.getElementById(id).value;
    var controllo = stringa.indexOf("@", 0);
    if (controllo == -1) {
        conferma = "no";
    }
    if (conferma == "si") {
        controllo = stringa.indexOf(".", 0);
        if (controllo == -1) {
            conferma = "no";
        }
    }
    return conferma;
}
