﻿// File JScript

function Vota(cod) { 
    //setCookie('ibl'+cod,cod,100);
	document.form1.txtCod.value=cod;
	document.form1.submit();
}


 
 // imposta il cookie sNome = sValore
// per la durata di iGiorni
function setCookie(sNome, sValore, iGiorni) {
 
  var dtOggi = new Date()
  var dtExpires = new Date()
  dtExpires.setTime
    (dtOggi.getTime() + 24 * iGiorni * 3600000)
  document.cookie = sNome  + "=" + escape(sValore) +
    "; expires=" + dtExpires.toGMTString();
}



 




function resize(frm) {
    //if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
        var wn = window.frames[frm];
        //browserUtente = navigator.userAgent.toUpperCase();

       
//        if (browserUtente.indexOf("CHROME") < 0) {
//            document.getElementById(frm).style.height = wn.document.documentElement.scrollHeight + 'px';
//        }

        //if (browserUtente.indexOf("CHROME") > 0) {           
            document.getElementById(frm).style.height =  wn.document.documentElement.scrollHeight + 'px';
        //}
}




function ShowHideDiv(show, hide) {
    if (document.getElementById('txtNome').value == '') {
        alert('Inserire nome e cognome');
        return
    }


    if (document.getElementById('txtEmail').value == '') {
        alert('Inserire email');
        return
    }




    EmailAddr = document.getElementById('txtEmail').value
    Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
    if (Filtro.test(EmailAddr)) {
        document.getElementById(show).style.display = 'block';
        document.getElementById(hide).style.display = 'none';
    }
    else {
        alert("Controlla l'indirizzo di e-mail inserito");
        return
    }
}




function test_altezza() {
    alert(document.getElementById('divCentrale').height);
    
}
