﻿var intPlWeb;
 


//function ShowHide(ID, IDtesto) {
//    if (document.getElementById(IDtesto).innerText == 'Mostra mappa') {
//        document.getElementById(ID).style.display = 'block';
//        document.getElementById(IDtesto).innerText = 'Nascondi mappa';
//    } else {
//        document.getElementById(ID).style.display = 'none';
//        document.getElementById(IDtesto).innerText = 'Mostra mappa';
//    }
//}



 




//pannello per invio mail


    function chiudi(ID) {
       
        document.getElementById(ID).style.display = "none";
        //clearInterval(intPlWeb)
    }

    function vedi(cod,operazione) {
        document.form1.txtCod.value = cod;
        document.form1.txtOperazione.value = operazione;
        document.getElementById("divInvioMail").style.top = String(parseInt(getScrollXY())) + "px";
        document.getElementById("divInvioMail").style.display = "";
        //intPlWeb = setInterval('Riposiziona()', 100)
        //__doPostBack("divInvioMail", cod)
    }

//    function Riposiziona() {
//        document.getElementById("PLSquadra").style.top = String(parseInt(getScrollXY())) + "px";
//    }


    function getScrollXY() {
        var scrOfX = 0, scrOfY = 0;
        if (typeof (window.pageYOffset) == 'number') {
            //Netscape compliant
            scrOfY = window.pageYOffset;
            scrOfX = window.pageXOffset;
        } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
            //DOM compliant
            scrOfY = document.body.scrollTop;
            scrOfX = document.body.scrollLeft;
        } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
            //IE6 standards compliant mode
            scrOfY = document.documentElement.scrollTop;
            scrOfX = document.documentElement.scrollLeft;
        }
        return [scrOfY];
    }



    function ShowHideInfo(ID) {
        if (document.getElementById(ID).style.display == "none") {
            document.getElementById(ID).style.display = "block";
        } else {
            document.getElementById(ID).style.display = "none";
        }
    }


    function MouseOverImmagini(ID,path) {
        document.getElementById(ID).src = "ImgExp/" + path; 
    }


    function MouseOutImmagini(ID, path) {
      document.getElementById(ID).src = "ImgExp/" + path;
    }


    function ChiudiUpload() {
        document.getElementById("PLUpload").style.display = "none";
    }


    function altezzaFrame(nome) { // v.1.0
        //copyright 2004 Eddie Traversa http://www.dhtmlnirvana.com/
        if (!window.opera && !document.mimeType && document.all && document.getElementById) {
            document.getElementById(nome).style.height = document.getElementById(nome).contentWindow.document.body.offsetHeight + "px";
            //parent.document.getElementById(nome).style.width = this.document.body.offsetWidth + "px";
        }
        else if (document.getElementById) {
        parent.document.getElementById(nome).style.height = (document.getElementById(nome).contentWindow.document.body.scrollHeight + 20) + "px";
            //parent.document.getElementById(nome).style.width = this.document.body.scrollWidth + "px"
        }
    }

    function altezzaFrameParent(nome) { // v.1.0
        //copyright 2004 Eddie Traversa http://www.dhtmlnirvana.com/
        if (!window.opera && !document.mimeType && document.all && document.getElementById) {
            parent.document.getElementById(nome).style.height = this.document.body.offsetHeight + "px";
        }
        else if (document.getElementById) {
            //alert(this.document.body.scrollHeight)
            //alert(nome)
            parent.document.getElementById(nome).style.height = this.document.body.scrollHeight + "px"
        }
    }




    function IFShowHide(id) {
        var ifram = document.getElementById('moduli' + id);

        //var Mylink = document.getElementById('LinkModuli' + id);

        //alert('LinkModuli' + id);
        //alert(trim(Mylink.innerHTML));

        //if (trim(Mylink.innerHTML) == 'COMPILA IL MODULO') {
        //alert("sss");
        ifram.style.display = '';
        //altezzaFrame('moduli' + id);
        resizeIframeMyNew('moduli' + id);
        //Mylink.innerHTML = "NASCONDI MODULO"

        //    }
        //else {
        //alert("nascondi");
        //    ifram.style.display = 'none';
        //Mylink.innerHTML= 'COMPILA IL MODULO';
        //}
    }

    function trim(stringa) {
        while (stringa.substring(0, 1) == ' ') {
            stringa = stringa.substring(1, stringa.length);
        }
        while (stringa.substring(stringa.length - 1, stringa.length) == ' ') {
            stringa = stringa.substring(0, stringa.length - 1);
        }
        return stringa;
    }


    /**************** New **********************************/
    function resizeIframeMyNew(frameid) {
        //alert("Height");
        var F = document.getElementById(frameid);
        //var the_height = document.getElementById(frameid).contentWindow.document.body.scrollHeight;
        if (F.contentDocument) {
            the_height = F.contentDocument.documentElement.scrollHeight + 30; //FF 3.0.11, Opera 9.63, and Chrome
        } else {
            the_height = F.contentWindow.document.body.scrollHeight + 30; //IE6, IE7 and Chrome
        }

        //alert(the_height);
        //change the height of the iframe
        F.height = the_height;

    }

   
