function dim_win(){
    dimx = new Array();
    var width = document.body.clientWidth;
    var height = document.body.clientHeight;
    dimx [0]= width;
    dimx [1]= height;
    return dimx;
}
/*larghezza scrollbar*/
function scroll_width(){
    var scr = null;
    var inn = null;
    var wNoScroll = 0;
    var wScroll = 0;
    scr = document.createElement('div');
    scr.style.position = 'absolute';
    scr.style.top = '100px';
    scr.style.left = '100px';
    scr.style.width = '200px';
    scr.style.height = '150px';
    inn = document.createElement('div');
    inn.style.width = '100%';
    inn.style.height = '200px';
    scr.appendChild(inn);
    document.body.appendChild(scr);
    scr.style.overflow = 'hidden';
    wNoScroll = inn.offsetWidth;
    scr.style.overflow = 'scroll';
    wScroll = inn.offsetWidth;
    if (wNoScroll == wScroll) wScroll = scr.clientWidth;
    document.body.removeChild(document.body.lastChild);
    var a = (wNoScroll - wScroll);
    return a;
}
/*larghezza scrollbar*/
function getCookie(sNome) {
    var asCookies = document.cookie.split("; ");
    for (var iCnt = 0; iCnt < asCookies.length; iCnt++)
    {
      var asCookie = asCookies[iCnt].split("=");
      if (sNome == asCookie[0]) { 
        return (unescape(asCookie[1]));
      }
    }

    return("");
}
function testo_in(stringa){
    stringa.replace("’","&#39;");
    stringa.replace("“","&quot;");
    stringa.replace("”","&quot;");
    stringa.replace("€","&euro;");
    /*stringa.replace("?","'");*/
    return stringa;
}
/* Login */
function sf(){
    document.fmpas.usern.focus();
}
function encrypt(pag) {
    var challengeword="";
    challengeword = getCookie("challenge");
    var pw = document.fmpas.pass.value ;
    if (pw) {
       pw = hex_md5 (pw) ;
       pw = pw + challengeword;
       pw = hex_md5 (pw) ;
       document.fmpas.pass.value = '' ;
       document.fmpas.md5ed.value = pw ;
       document.fmpas.action=pag;
       document.fmpas.submit();
    }
}
function CheckNumericKeyInfo(char, mozChar, form, pag) {
    if(mozChar != null) {
        if( mozChar == 13){
            //funx();
            vai_search(form,pag);
        }
    } else {
        if( char == 13){
            //funx();
            vai_search(form,pag);
        }
    }
}
function KeyCode(char, mozChar){
    if(mozChar != null) {
        if( mozChar == 13){
            alert(char + " - " + mozChar);
        }
    } else {
        if( char == 13){
            alert(char + " - " + mozChar);
        }
    }
}
/*ricerca news*/
function search_news(pag){
    var cerca_news = document.formricnews.cerca_news.value;
    var anno_news = document.formricnews.anno_news.value;
    var mese_news = document.formricnews.mese_news.value;
    var cat_news = document.formricnews.cat_news.value;
    document.formricnews.action=pag + '.php';
    document.formricnews.submit();
    return true;
}
function delcatNews(){
    var idnews_cat = document.formricnews.cat_news.value;
    if(idnews_cat > 0){  
        if(confirm('Attenzione!!\nCon questa operazione cancellerai\ntutte le notizie di questa categoria\nVuoi continuare?')){
            window.open('del_catnews.php?idnews_cat=' + idnews_cat + '&cat_del=1','_self');
        };
    }    
}
/*ricerca comunicati*/
function search_com(pag){
    var cerca_com = document.formriccom.cerca_com.value;
    var anno_com = document.formriccom.anno_com.value;
    var mese_com = document.formriccom.mese_com.value;
    document.formriccom.action=pag + '.php';
    document.formriccom.submit();
    return true;
}
/*ricerca albo*/
function search_albo(pag){
    document.formricalbo.action=pag + '.php';
    document.formricalbo.submit();
    return true;
}
/*ricerca corsi*/
function search_corsi(pag){
    var cerca_corsi = document.formriccorsi.cerca_corsi.value;
    var anno_corsi = document.formriccorsi.anno_corsi.value;
    var mese_corsi = document.formriccorsi.mese_corsi.value;
    document.formriccorsi.action=pag + '.php';
    document.formriccorsi.submit();
    return true;
}
/*ricerca bacheca*/
function search_bak(pag){
    var cerca_bak = document.formricbak.cerca_bak.value;
    var anno_bak = document.formricbak.anno_bak.value;
    var mese_bak = document.formricbak.mese_bak.value;
    var cat_bak = document.formricbak.cat_bak.value;
    document.formricbak.action=pag + '.php';
    document.formricbak.submit();
    return true;
}
/*end ricerca bacheca*/
/*FORUM*/
/*messaggi forum*/
function vai_forumex(form,indir){
    var doc  = document.forms[form];
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Il titolo è un campo obbligatorio.");
        doc.titolo.focus();
        return false;
    };
    if (testox=="" || testox=="undefined"){
        alert("Il testo è obbligatorio.");
        doc.testo.focus();
        return false;
    };
    doc.action=indir;
    doc.submit();
    return true;
}
/*end messaggi forum*/
/*discussioni forum*/
function vai_forumdisx(form,indir){
    var doc  = document.forms[form];
    var titolo_discx = doc.titolo_disc.value;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolo_discx=="" || titolo_discx=="undefined"){
        alert("Il titolo è un campo obbligatorio.");
        doc.titolo_disc.focus();
        return false;
    };
    if (titolox=="" || titolox=="undefined"){
        alert("Il titolo del messaggio è un campo obbligatorio.");
        doc.titolo.focus();
        return false;
    };
    if (testox=="" || testox=="undefined"){
        alert("Il testo è obbligatorio.");
        doc.testo.focus();
        return false;
    };
    doc.action=indir;
    doc.submit();
    return true;
}
/*end discussioni forum*/
/*iscrizione forum*/
function vai_forumiscr(form,indir){
    var doc  = document.forms[form];
    var usern_regx = doc.usern_reg.value;
    var pass_regx = doc.pass_reg.value;
    var cpass_regx = doc.cpass_reg.value;
    var cemail_regx = doc.cemail_reg.value;
    var email_regx = doc.email_reg.value;
    var captchax = doc.captcha.value;
    if (usern_regx=="" || usern_regx=="undefined"){
        alert("username è un campo obbligatorio.");
        doc.usern_reg.focus();
        return false;
    };
    if (pass_regx=="" || pass_regx=="undefined"){
        alert("password è un campo obbligatorio.");
        doc.pass_reg.focus();
        return false;
    };
    if (cpass_regx=="" || cpass_regx=="undefined"){
        alert("conferma password è un campo obbligatorio.");
        doc.cpass_reg.focus();
        return false;
    };
    if(pass_regx==cpass_regx){
    }else{
        alert("le password inserite non corrispondono.");
        return false;
    } 
    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
    if (!email_reg_exp.test(email_regx) || (email_regx == "") || (email_regx == "undefined")) {
        alert("Inserire un indirizzo email corretto.");
        form.email_reg.select();
        return false;
    };
    if (!email_reg_exp.test(cemail_regx) || (cemail_regx == "") || (cemail_regx == "undefined")) {
        alert("Inserire un indirizzo email corretto.");
        form.cemail_reg.select();
        return false;
    };
    if(email_regx==cemail_regx){
    }else{
        alert("gli indirizzi email inseriti non corrispondono.");
        return false;
    } 
    if (doc.privacy.checked){
    }else{
        alert("Devi accettare il trattamento dei dati personali.");
        return false;
    };
    if (doc.regola.checked){
    }else{
        alert("Devi accettare il regolamento del forum.");
        return false;
    };
    if (captchax=="" || captchax=="undefined"){
        alert("il codice di sicurezza è un campo obbligatorio.");
        doc.captcha.focus();
        return false;
    };
    doc.action=indir;
    doc.submit();
    return true;
}
/*end iscrizione forum*/

/*aggiungi moderatore*/
function vaiaddMod(indir){
    var doc = document.formedit;
    var usernx = doc.usern.value;
    var passx = doc.pass.value;
    
    if (usernx=="" || usernx=="undefined"){
        alert("Nome utente è un campo obbligatorio.");
        doc.usern.focus();
        return false;
    };
    if (passx=="" || passx=="undefined"){
        alert("Password è un campo obbligatorio.");
        doc.pass.focus();
        return false;
    };
    doc.action=indir;
    doc.submit();
    return true;
}
/*end aggiungi moderatore*/
/*elimina moderatore*/
function vaiDelMod(indir){
    var doc = document.formelemod;
    if(confirm('Attenzione!!\nCon questa operazione elimerai il moderatore\nanche dai forum che esso modera.\nVuoi continuare?')){
        doc.action=indir;
        doc.submit();
        return true;
    };
}
/*end moderatore*/
/*modfica moderatore*/
function vaieditMod(indir){
    var doc = document.formedit;
    var usernx = doc.usern.value;
    var passx = doc.pass.value;
    
    if (usernx=="" || usernx=="undefined"){
        alert("Nome utente è un campo obbligatorio.");
        doc.usern.focus();
        return false;
    };
    if (passx=="" || passx=="undefined"){
        alert("Password è un campo obbligatorio.");
        doc.pass.focus();
        return false;
    };
    xmlhttpPostMod(indir);
    return true;
}
function xmlhttpPostMod(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageMod(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringMod());
}
function getquerystringMod() {
    var form     = document.forms['formedit'];
    
    var nome = form.nome.value;
    var cog = form.cog.value;
    var usern = form.usern.value;
    var pass = form.pass.value;
    var h_pass = form.h_pass.value;
    var email = form.email.value;
    var idmod = form.idmod.value;
    
    qstr = 'idmod=' + escape(idmod) + '&nome=' + escape(nome) + '&cog=' + escape(cog) + '&usern=' + escape(usern) + '&pass=' + escape(pass) + '&h_pass=' + escape(h_pass) + '&email=' + escape(email);
    return qstr;
}
function updatepageMod(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica moderatore*/
/*modfica scheda utenti*/
function vaieditUtenti(indir){
    var doc = document.formedit;
    var usernx = doc.usern.value;
    var passx = doc.pass.value;
    var emailx = doc.email.value;
    
    if (usernx=="" || usernx=="undefined"){
        alert("Nome utente è un campo obbligatorio.");
        doc.usern.focus();
        return false;
    };
    if (passx=="" || passx=="undefined"){
        alert("Password è un campo obbligatorio.");
        doc.pass.focus();
        return false;
    };
    if (emailx=="" || emailx=="undefined"){
        alert("Email è un campo obbligatorio.");
        doc.email.focus();
        return false;
    };
    xmlhttpPostUtenti(indir);
    return true;
}
function xmlhttpPostUtenti(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageUtenti(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringUtenti());
}
function getquerystringUtenti() {
    var form     = document.forms['formedit'];
    
    var datanasc = form.datanasc.value;
    var citta = form.citta.value;
    var email = form.email.value;
    var usern = form.usern.value;
    var pass = form.pass.value;
    var h_pass = form.h_pass.value;
    
    var att = form.att.value;
    if (document.getElementById("att").checked){
        var valatt=1;
    }else{
        var valatt=0;
    }
    
    var idreg = form.idreg.value;
   
    
    qstr = 'idreg=' + escape(idreg) + '&datanasc=' + escape(datanasc) + '&citta=' + escape(citta) + '&email=' + escape(email) + '&usern=' + escape(usern) + '&pass=' + escape(pass) + '&h_pass=' + escape(h_pass) + '&att=' + escape(valatt);
    return qstr;
}
function updatepageUtenti(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica scheda utenti*/

/*END FORUM*/
/*AREA PROTETTA*/
/*elimina categorie progetti*/
function delcatProj(){
    var idproj_cat = document.formedit.cat_proj.value;
    if(idproj_cat > 0){  
        if(confirm('Attenzione!!\nCon questa operazione cancellerai\ntutti i proggetti di questa categoria\nVuoi continuare?')){
            window.open('del_catproj.php?idproj_cat=' + idproj_cat + '&cat_del=1','_self');
        };
    }    
}

/*end elimina categorie progetti*/
function del_dati(thetarg){
    var eltarg = document.getElementById(thetarg);
    eltarg.innerHTML  = "";
}
function clear_data(thetarg){
    timerID=setTimeout("del_dati('" + thetarg + "')",3000);
}
/*aggiungi news*/
function vaiaddNews(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testo_homex = doc.testo_home.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    
    if ((testo_homex=="" || testo_homex=="undefined") || (testox=="" || testox=="undefined")){
        alert("Devi inserire almeno un testo.");
        return false;
    };
    doc.action='add.php';
    doc.submit();
    return true;
}
/*end aggiungi news*/
/*modfica news*/
function vaieditNews(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testo_homex = doc.testo_home.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    
    if ((testo_homex=="" || testo_homex=="undefined") || (testox=="" || testox=="undefined")){
        alert("Devi inserire almeno un testo.");
        return false;
    };
    xmlhttpPostNews(indir);
    return true;
}
function xmlhttpPostNews(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNews(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNews());
}
function getquerystringNews() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo_home = form.testo_home.value;
    var testo = form.testo.value;
    var primo = form.primo.value;
    if (document.getElementById("primo").checked){
        var valprimo=1;
    }else{
        var valprimo=0;
    }
    var idnews = form.idnews.value;
    var idnews_cat = form.idnews_cat.value;
    var cat_news = form.cat_news.value;
    qstr = 'idnews=' + escape(idnews) + '&idnews_cat=' + escape(idnews_cat) + '&titolo=' + escape(titolo) + '&testo_home=' + escape(testo_home) + '&testo=' + escape(testo) + '&primo=' + escape(valprimo) + '&cat_news=' + escape(cat_news);
    return qstr;
}
function updatepageNews(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica news*/

/*numero docs*/
function vai_ndocs(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocs(indir);
    return true;
}
function xmlhttpPostNdocs(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocs(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocs());
}
function getquerystringNdocs() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idnews = form.idnews.value;
    var idnews_cat = form.idnews_cat.value;
    qstr = 'idnews=' + escape(idnews) + '&idnews_cat=' + escape(idnews_cat) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocs(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero docs*/

/*aggiungi comunicati*/
function vaiaddCom(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    doc.action=indir;
    doc.submit();
    return true;
}
/*end aggiungi comunicati*/
/*modfica comunicati*/
function vaieditCom(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostCom(indir);
    return true;
}
function xmlhttpPostCom(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageCom(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringCom());
}
function getquerystringCom() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    
    var idcom = form.idcom.value;
    qstr = 'idcom=' + escape(idcom) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageCom(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica comunicati*/
/*numero comunicati*/
function vai_ndocsCom(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsCom(indir);
    return true;
}
function xmlhttpPostNdocsCom(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsCom(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsCom());
}
function getquerystringNdocsCom() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idcom = form.idcom.value;
    qstr = 'idcom=' + escape(idcom) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsCom(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero comunicati*/
/*modifica corsi*/
function vaieditCorsi(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostCorsi(indir);
    return true;
}
function xmlhttpPostCorsi(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageCorsi(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringCorsi());
}
function getquerystringCorsi() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    
    var idcorsi = form.idcorsi.value;
    qstr = 'idcorsi=' + escape(idcorsi) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageCorsi(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica corsi*/
/*numero corsi*/
function vai_ndocsCorsi(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsCorsi(indir);
    return true;
}
function xmlhttpPostNdocsCorsi(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsCorsi(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsCorsi());
}
function getquerystringNdocsCorsi() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idcorsi = form.idcorsi.value;
    qstr = 'idcorsi=' + escape(idcorsi) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsCorsi(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero corsi*/
/*modifica incontri*/
function vaieditInco(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostInco(indir);
    return true;
}
function xmlhttpPostInco(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageInco(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringInco());
}
function getquerystringInco() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    
    var idinco = form.idinco.value;
    qstr = 'idinco=' + escape(idinco) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageInco(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica incontri*/
/*numero incontri*/
function vai_ndocsInco(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsInco(indir);
    return true;
}
function xmlhttpPostNdocsInco(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsInco(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsInco());
}
function getquerystringNdocsInco() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idinco = form.idinco.value;
    qstr = 'idinco=' + escape(idinco) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsInco(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero incontri*/
/*modifica viaggi*/
function vaieditTrip(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostTrip(indir);
    return true;
}
function xmlhttpPostTrip(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageTrip(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringTrip());
}
function getquerystringTrip() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    
    var idtrip = form.idtrip.value;
    qstr = 'idtrip=' + escape(idtrip) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageTrip(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica viaggi*/
/*numero viaggi*/
function vai_ndocsTrip(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsTrip(indir);
    return true;
}
function xmlhttpPostNdocsTrip(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsTrip(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsTrip());
}
function getquerystringNdocsTrip() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idtrip = form.idtrip.value;
    qstr = 'idtrip=' + escape(idtrip) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsTrip(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero viaggi*/
/*modifica eventi*/
function vaieditEven(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostEven(indir);
    return true;
}
function xmlhttpPostEven(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageEven(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringEven());
}
function getquerystringEven() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    
    var ideven = form.ideven.value;
    qstr = 'ideven=' + escape(ideven) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageEven(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica eventi*/
/*numero eventi*/
function vai_ndocsEven(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsEven(indir);
    return true;
}
function xmlhttpPostNdocsEven(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsEven(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsEven());
}
function getquerystringNdocsEven() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var ideven = form.ideven.value;
    qstr = 'ideven=' + escape(ideven) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsEven(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero eventi*/
/*modifica workshop*/
function vaieditWork(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostWork(indir);
    return true;
}
function xmlhttpPostWork(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageWork(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringWork());
}
function getquerystringWork() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    
    var idwork = form.idwork.value;
    qstr = 'idwork=' + escape(idwork) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageWork(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica workshop*/
/*numero workshop*/
function vai_ndocsWork(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsWork(indir);
    return true;
}
function xmlhttpPostNdocsWork(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsWork(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsWork());
}
function getquerystringNdocsWork() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idwork = form.idwork.value;
    qstr = 'idwork=' + escape(idwork) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsWork(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero workshop*/

/*modifica concorsi*/
function vaieditConcorsi(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostConcorsi(indir);
    return true;
}
function xmlhttpPostConcorsi(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageConcorsi(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringConcorsi());
}
function getquerystringConcorsi() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    var idconco = form.idconco.value;
    qstr = 'idconco=' + escape(idconco) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageConcorsi(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica concorsi*/
/*numero concorsi*/
function vai_ndocsConcorsi(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsConcorsi(indir);
    return true;
}
function xmlhttpPostNdocsConcorsi(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsConcorsi(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsConcorsi());
}
function getquerystringNdocsConcorsi() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idconco = form.idconco.value;
    qstr = 'idconco=' + escape(idconco) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsConcorsi(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero concorsi*/
/*modifica bacheca*/
function vaieditBak(indir){
    var doc = document.formedit;
    var titolox = doc.titolo.value;
    var testox = doc.testo.value;
    
    if (titolox=="" || titolox=="undefined"){
        alert("Devi inserire il titolo.");
        doc.titolo.focus();
        return false;
    };
    xmlhttpPostBak(indir);
    return true;
}
function xmlhttpPostBak(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageBak(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringBak());
}
function getquerystringBak() {
    var form     = document.forms['formedit'];
    var titolo = form.titolo.value;
    var testo = form.testo.value;
    var idbak = form.idbak.value;
    var idbak_cat = form.idbak_cat.value;
    qstr = 'idbak=' + escape(idbak) + '&idbak_cat=' + escape(idbak_cat) + '&titolo=' + escape(titolo) + '&testo=' + escape(testo);
    return qstr;
}
function updatepageBak(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica bacheca*/
/*numero bacheca*/
function vai_ndocsBak(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsBak(indir);
    return true;
}
function xmlhttpPostNdocsBak(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsBak(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsBak());
}
function getquerystringNdocsBak() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idbak = form.idbak.value;
    var idbak_cat = form.idbak_cat.value;
    qstr = 'idbak=' + escape(idbak) + '&idbak_cat=' + escape(idbak_cat) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsBak(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero bacheca*/

/*ricerca*/
function vai_search(form,ind){
    var doc  = document.forms[form];
    var cercatop = doc.cercatop.value;
    if (cercatop=="" || cercatop=="undefined"){
        alert("Inserire un testo da cercare.");
        doc.cercatop.focus();
        return false;
    }else{
        doc.action = ind;
        doc.submit();
        return true;
    }
}
/*end ricerca*/
function vai_upimg(form,ind){
    var doc  = document.forms[form];
    doc.action = ind;
    doc.submit();
    return true;
}
function chiudipop(pag,stringa){
		window.opener.location.href = pag + ".php" + stringa;
		window.close();
};

function delimg(form, chk, elnum){
    var doc  = document.forms[form];
    var nmr= document.getElementById(elnum).value;
    if (nmr==0){
        alert("Nessun elemento");
        return false;
    }else{
        var conta=0;
        for (elx=0; elx<nmr; elx++){
            if (document.getElementById(chk + elx).checked){
                conta++;
            }
        }
        if (conta > 0){
            if (confirm(conta + " Elementi/i verranno eliminati.\nSei sicuro?")){
                doc.action='dettagli.php';
                doc.submit();
                return true;
            }else{
                return false;
            }
        }else{
            alert("Nessun elemento selezionato.");
            return false;
        }
    }
};

/*numero modulistica*/
function vai_ndocsGen(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNdocsGen(indir);
    return true;
}
function xmlhttpPostNdocsGen(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNdocsGen(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNdocsGen());
}
function getquerystringNdocsGen() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    qstr = '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNdocsGen(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero modulistica*/

/*aggiungi iscritto albo*/
function vaiaddAlbo(indir){
    var doc = document.formedit;
    var nomex = doc.nome.value;
    var cogx = doc.cog.value;
    var matrx = doc.matr.value;
    
    if (nomex=="" || nomex=="undefined"){
        alert("Il nome è un campo obbligatorio.");
        doc.nome.focus();
        return false;
    };
    if (cogx=="" || cogx=="undefined"){
        alert("Il cognome è un campo obbligatorio.");
        doc.cog.focus();
        return false;
    };
    if (matrx=="" || matrx=="undefined"){
        alert("La matricola è un campo obbligatorio.");
        doc.matr.focus();
        return false;
    };
    doc.action=indir;
    doc.submit();
    return true;
}
/*end aggiungi iscritto albo*/
/*modfica scheda albo*/
function vaieditAlbo(indir){
    var doc = document.formedit;
    var nomex = doc.nome.value;
    var cogx = doc.cog.value;
    var matrx = doc.matr.value;
    
    var pass = doc.pass.value;
    var r_pass_w = doc.r_pass_w.value;
    var h_pass = doc.h_pass.value;
    
    
    if (nomex=="" || nomex=="undefined"){
        alert("Il nome è un campo obbligatorio.");
        doc.nome.focus();
        return false;
    };
    if (cogx=="" || cogx=="undefined"){
        alert("Il cognome è un campo obbligatorio.");
        doc.cog.focus();
        return false;
    };
    if (matrx=="" || matrx=="undefined"){
        alert("La matricola è un campo obbligatorio.");
        doc.matr.focus();
        return false;
    };
    
    
    var flg_pass = true;
    if(pass == h_pass){
    }else{
        if(  (r_pass_w=="") || (r_pass_w=="undefined")   ){
            alert("Ripeti password");
            return false;
        }else{
            if(pass==r_pass_w){
            
            }else{
                alert("Attenzione!\nLe due password non corrispondono");
                return false;
            }
        }
    }
    xmlhttpPostAlbo(indir);
    return true;
}
function xmlhttpPostAlbo(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageAlbo(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringAlbo());
}
function getquerystringAlbo() {
    var form     = document.forms['formedit'];
    var nome = form.nome.value;
    var cog = form.cog.value;
    var matr = form.matr.value;
    var codf = form.codf.value;
    var piva = form.piva.value;
    var nascita = form.nascita.value;
    var datanasc = form.datanasc.value;
    var citta = form.citta.value;
    var indi = form.indi.value;
    var cap = form.cap.value;
    var tel = form.tel.value;
    var cittastudio = form.cittastudio.value;
    var indistudio = form.indistudio.value;
    var capstudio = form.capstudio.value;
    var telstudio = form.telstudio.value;
    var annoabilita = form.annoabilita.value;
    var email = form.email.value;
    var sito = form.sito.value;
    var usern = form.usern.value;
    var pass = form.pass.value;
    var h_pass = form.h_pass.value;
    var constec = form.constec.value;
    if (document.getElementById("constec").checked){
        var valconstec=1;
    }else{
        var valconstec=0;
    }
    var sic = form.sic.value;
    if (document.getElementById("sic").checked){
        var valsic=1;
    }else{
        var valsic=0;
    }
    var previn = form.previn.value;
    if (document.getElementById("previn").checked){
        var valprevin=1;
    }else{
        var valprevin=0;
    }
    var sosp = form.sosp.value;
    if (document.getElementById("sosp").checked){
        var valsosp=1;
    }else{
        var valsosp=0;
    }
    var pianter = form.pianter.value;
    if (document.getElementById("pianter").checked){
        var valpianter=1;
    }else{
        var valpianter=0;
    }
    
    var idalbo = form.idalbo.value;
    var idalbo_cat = form.idalbo_cat.value;
    var cat_albo = form.cat_albo.value;
    
    qstr = 'idalbo=' + escape(idalbo) + '&idalbo_cat=' + escape(idalbo_cat) + '&nome=' + escape(nome) + '&cog=' + escape(cog) + '&matr=' + escape(matr) + '&codf=' + escape(codf) + '&piva=' + escape(piva) + '&nascita=' + escape(nascita) + '&datanasc=' + escape(datanasc) + '&citta=' + escape(citta) + '&indi=' + escape(indi) + '&cap=' + escape(cap) + '&tel=' + escape(tel) + '&cittastudio=' + escape(cittastudio) + '&indistudio=' + escape(indistudio) + '&capstudio=' + escape(capstudio) + '&telstudio=' + escape(telstudio) + '&annoabilita=' + escape(annoabilita) + '&email=' + escape(email) + '&usern=' + escape(usern) + '&pass=' + escape(pass) + '&h_pass=' + escape(h_pass) + '&constec=' + escape(valconstec) + '&sic=' + escape(valsic) + '&previn=' + escape(valprevin) + '&sosp=' + escape(valsosp) + '&pianter=' + escape(valpianter) + '&cat_albo=' + escape(cat_albo) + '&sito=' + escape(sito);
    return qstr;
}
function updatepageAlbo(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica scheda albo*/
/*automodfica scheda albo*/
function vaieditAutoAlbo(indir){
    var form = document.forms['formedit'];
  
    var pass_w = form.pass_w.value;
    var r_pass_w = form.r_pass_w.value;
    var h_pass = form.h_pass.value;
    
    var flg_pass = true;
    if(pass_w == h_pass){
    }else{
        if(  (r_pass_w=="") || (r_pass_w=="undefined")   ){
            alert("Ripeti password");
            flg_pass = false;
        }else{
            if(pass_w==r_pass_w){
            
            }else{
                alert("Attenzione!\nLe due password non corrispondono");
                flg_pass = false;
            }
        }
    }
    if(flg_pass){
        xmlhttpPostAutoAlbo(indir);
        return true;
    }else{
        return false;
    }
}
function xmlhttpPostAutoAlbo(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageAutoAlbo(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringAutoAlbo());
}
function getquerystringAutoAlbo() {
    var form     = document.forms['formedit'];
    var codf = form.codf.value;
    var piva = form.piva.value;
    var nascita = form.nascita.value;
    var datanasc = form.datanasc.value;
    var citta = form.citta.value;
    var indi = form.indi.value;
    var cap = form.cap.value;
    var tel = form.tel.value;
    var cittastudio = form.cittastudio.value;
    var indistudio = form.indistudio.value;
    var capstudio = form.capstudio.value;
    var telstudio = form.telstudio.value;
    var annoabilita = form.annoabilita.value;
    var email = form.email.value;
    var sito = form.sito.value;
    
    var pass_w = form.pass_w.value;
    var r_pass_w = form.r_pass_w.value;
    var h_pass = form.h_pass.value;
    
    var idalbo = form.idalbo.value;
  
    qstr = 'idalbo=' + escape(idalbo) + '&codf=' + escape(codf) + '&piva=' + escape(piva) + '&nascita=' + escape(nascita) + '&datanasc=' + escape(datanasc) + '&citta=' + escape(citta) + '&indi=' + escape(indi) + '&cap=' + escape(cap) + '&tel=' + escape(tel) + '&cittastudio=' + escape(cittastudio) + '&indistudio=' + escape(indistudio) + '&capstudio=' + escape(capstudio) + '&telstudio=' + escape(telstudio) + '&annoabilita=' + escape(annoabilita) + '&email=' + escape(email) + '&sito=' + escape(sito) + '&pass_w=' + escape(pass_w) + '&h_pass=' + escape(h_pass);
    return qstr;
    
}
function updatepageAutoAlbo(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end automodfica scheda albo*/

/*aggiungi scheda normativa*/
function vaiaddNorma(indir){
    var doc = document.formedit;
    var nomex = doc.nome.value;
    var leggex = doc.legge.value;
    if (nomex=="" || nomex=="undefined"){
        alert("Devi inserire il titolo.");
        doc.nome.focus();
        return false;
    };
    if (leggex=="" || leggex=="undefined"){
        alert("Devi inserire il riferimento alla legge.");
        return false;
    };
    doc.action=indir;
    doc.submit();
    return true;
}
/*end aggiungi scheda normativa*/
/*modfica scheda normativa*/
function vaieditNorma(indir){
    var doc = document.formedit;
    var nomex = doc.nome.value;
    var leggex = doc.legge.value;
    
    if (nomex=="" || nomex=="undefined"){
        alert("Devi inserire il titolo.");
        doc.nome.focus();
        return false;
    };
    if (leggex=="" || leggex=="undefined"){
        alert("Devi inserire il riferimento alla legge.");
        return false;
    };
    xmlhttpPostNorma(indir);
    return true;
}
function xmlhttpPostNorma(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNorma(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNorma());
}
function getquerystringNorma() {
    var form     = document.forms['formedit'];
    var nome = form.nome.value;
    var legge = form.legge.value;
    var testo = form.testo.value;
    var ordine = form.ordine.value;
    var idnorme = form.idnorme.value;
    qstr = 'idnorme=' + escape(idnorme) + '&nome=' + escape(nome) + '&legge=' + escape(legge) + '&testo=' + escape(testo) + '&ordine=' + escape(ordine);
    return qstr;
}
function updatepageNorma(str){
    document.getElementById("edit_line_ris").innerHTML = str;
}
/*end modfica scheda normativa*/
/*numero norme*/
function vai_nnorme(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNnorme(indir);
    return true;
}
function xmlhttpPostNnorme(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNnorme(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNnorme());
}
function getquerystringNnorme() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    var idnorme = form.idnorme.value;
    qstr = 'idnorme=' + escape(idnorme) + '&ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNnorme(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero norme*/
/*numero iscrizione*/
function vai_niscr(indir){
    var doc = document.form_n_docs;
    xmlhttpPostNiscr(indir);
    return true;
}
function xmlhttpPostNiscr(strURL) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageNiscr(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystringNiscr());
}
function getquerystringNiscr() {
    var form     = document.forms['form_n_docs'];
    var ndocs = form.ndocs.value;
    if(ndocs==0){
        ndocs=1;
    }
    qstr = 'ndocs=' + escape(ndocs);
    return qstr;
}
function updatepageNiscr(str){
    document.getElementById("news_overlay_docs").innerHTML = str;
}
/*end numero iscrizione*/
/*END AREA PROTETTA*/
/*INVIO MAIL*/
function resetform(trgf){
    document.forms[trgf].reset();
};
function contachar(n_modulo,n_testo,n_disp,lungh){
    var modulo=document.getElementById(n_modulo);
    var testo=document.getElementById(n_testo);
    var disp=document.getElementById(n_disp);
    var lenMax=lungh;
    var strlength=testo.value.length;
    total = eval(lungh);
    char = eval(testo.value.length);
    left = eval(total - char);
    if (left <= "-1"){
      var dif = eval(char - lungh);
      var value = testo.value.substr(0,char-dif);
      var left = left;
      disp.value=left;
      return false;	
    }else{
      disp.value=left;	
      return true;	
    }
}
function vaiMail(form,indir) {
    var form = document.forms[form];
    var messag = form.messag.value;
    var lamail = form.lamail.value;
    var captcha = form.captcha.value;
    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
    if (!email_reg_exp.test(lamail) || (lamail == "") || (lamail == "undefined")) {
        alert("Inserire un indirizzo email corretto.");
        form.lamail.select();
        return false;
    };
    if ((messag=="") || (messag=="undefined")){
        alert('Non hai inserito il testo');
          form.messag.focus();
        return false;
    };
    
    if (form.privacy.checked){
    }else{
        alert("Devi accettare il trattamento dei dati personali.");
        return false;
    };
    if (captcha=="" || captcha=="undefined"){
        alert("il codice di sicurezza è un campo obbligatorio.");
        form.captcha.focus();
        return false;
    };
    
    var nomecog = form.nomecog.value;
    qstr = 'nomecog=' + escape(nomecog) + '&lamail=' + escape(lamail) + '&messag=' + escape(messag) + '&captcha=' + escape(captcha);
    var nomecogx = document.getElementById("nomecog");
    nomecogx.value  = "";
    var lamailx = document.getElementById("lamail");
    lamailx.value  = "";
    var messagx = document.getElementById("messag");
    messagx.value  = "";
    var captchax = document.getElementById("captcha");
    captchax.value  = "";
    xmlhttpPostMail(indir,qstr,"pagcont_ris");

}
function xmlhttpPostMail(strURL,qString,targetris) {
    var xmlHttpReq = false;
    var self = this;
    // Xhr per Mozilla/Safari/Ie7
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // per tutte le altre versioni di IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
       self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
       self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageMail(self.xmlHttpReq.responseText,targetris);
        }
    }
    self.xmlHttpReq.send(qString);
}
function updatepageMail(str,ristrgt){
    document.getElementById(ristrgt).innerHTML = str;
}
function vaisms() {
    if(contachar("formsms","smstesto","quanti",160)){
        var smstesto = document.formsms.smstesto.value;
        if ((smstesto=="") || (smstesto=="undefined")){
            alert('Non hai inserito il testo');
            document.formsms.smstesto.focus();
        }else{
            var formsms = document.forms['formsms'];
            var smstesto = formsms.smstesto.value;
            var mscell = formsms.mscell.value;
            //window.open("http://www.stcompdisabatino.it/sms/inviasms.php?rcpt=" + mscell + "&data=" + smstesto,"frmsms","top=100,left=200,width=400,height=200");
        }
      
    }else{
        alert("Testo troppo lungo");
    }		
}
/*END INVIO MAIL*/
function roll(iddi,img,lnk){
    document.getElementById(iddi).src=img;
    document.getElementById(lnk).style.textDecoration="underline";
}
function roll_out(iddi,img,lnk){
    document.getElementById(iddi).src=img;
    document.getElementById(lnk).style.textDecoration="none";
}
function roll_text(lnk){
    document.getElementById(lnk).style.textDecoration="underline";
}
function roll_out_text(lnk){
    document.getElementById(lnk).style.textDecoration="none";
}

function MioMovieDim(sswf,alte,larg){
    document.write('<object classid="clsid:ecc.ecc." width="' + larg + '" height="' + alte + '">\n');
    document.write('<param name="movie" value="' + sswf + '" />\n');
    document.write('<param name=quality value=high />\n');
    document.write('<param name="wmode" value="transparent" />\n');
    document.write('<embed src="' + sswf + '" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + larg + '" height="' + alte + '" wmode="transparent">')
    document.write('</object>\n');
}
function changeimg(target,nuova){
    document.getElementById(target).src=nuova;
}
function seleziona_select_testo(elem,testo){
    var elem_el = document.getElementById(elem);
    for(var k=0; k<elem_el.options.length; k++){
        if(elem_el.options[k].text==testo){
            elem_el.selectedIndex=k;
            break;
        }
    }
}
function seleziona_select_value(elem,testo){
    var elem_el = document.getElementById(elem);
    for(var k=0; k<elem_el.options.length; k++){
        if(elem_el.options[k].value==testo){
            elem_el.selectedIndex=k;
            break;
        }
    }
}
function reset_istrforma(){
    document.getElementById("istrid_db").value="0";
    document.getElementById("istrday_from").value="00";
    document.getElementById("istrmonth_from").value="00";
    document.getElementById("istryear_from").value="";
    document.getElementById("istrday_to").value="00";
    document.getElementById("istrmonth_to").value="00";
    document.getElementById("istryear_to").value="";
    
    document.getElementById("istrqual").value="";
    document.getElementById("istrorg").value="";
    document.getElementById("istrexi_id").value="xx";
}
function show_links_istrforma(){
    var arrLiLs = glow.dom.get(".show_istr_session");
    arrLiLs.each(function(zz) {
        glow.events.addListener(glow.dom.get(arrLiLs[zz]), "click", function(event) {
            var istrid_db = document.getElementById("istrid_db" + zz).value;
            var istrexi_id = document.getElementById("istrexi_id" + zz).value;
            var istrday_from = document.getElementById("istrday_from" + zz).value;
            var istrmonth_from = document.getElementById("istrmonth_from" + zz).value;
            var istryear_from = document.getElementById("istryear_from" + zz).value;
            if(istryear_from=="0000"){
                istryear_from="";
            }
            var istrday_to = document.getElementById("istrday_to" + zz).value;
            var istrmonth_to = document.getElementById("istrmonth_to" + zz).value;
            var istryear_to = document.getElementById("istryear_to" + zz).value;
            if(istryear_to=="0000"){
                istryear_to="";
            }
            var istrqual = document.getElementById("istrqual" + zz).value;
            var istrorg = document.getElementById("istrorg" + zz).value;
            istrorg = istrorg.replace("&lt;br&gt;","\n");
            istrorg = istrorg.replace(/\<br>/g,"\n");
            if(istrexi_id==0){
                istrexi_id="stx";
            }
            reset_istrforma();
            document.getElementById("istrid_db").value = istrid_db;
            document.getElementById("istrexi_id").value = istrexi_id;
            seleziona_select_testo("istrday_from",istrday_from);
            seleziona_select_value("istrmonth_from",istrmonth_from);
            document.getElementById("istryear_from").value = istryear_from;
            seleziona_select_testo("istrday_to",istrday_to);
            seleziona_select_value("istrmonth_to",istrmonth_to);
            document.getElementById("istryear_to").value = istryear_to;
            document.getElementById("istrqual").value = istrqual;
            document.getElementById("istrorg").value = istrorg;
        });
    });
}
function reset_esperprof(){
    document.getElementById("lavid_db").value="0";
    document.getElementById("lavday_from").value="00";
    document.getElementById("lavmonth_from").value="00";
    document.getElementById("lavyear_from").value="";
    document.getElementById("lavday_to").value="00";
    document.getElementById("lavmonth_to").value="00";
    document.getElementById("lavyear_to").value="";
    document.getElementById("lavdescr").value="";
    document.getElementById("lavexi_id").value="xx";
}

function show_links_esperprof(){
    var arrLiLs = glow.dom.get(".show_lav_session");
    arrLiLs.each(function(zz) {
        glow.events.addListener(glow.dom.get(arrLiLs[zz]), "click", function(event) {
            var lavexi_id = document.getElementById("lavexi_id" + zz).value;
            var lavid_db = document.getElementById("lavid_db" + zz).value;
            var lavday_from = document.getElementById("lavday_from" + zz).value;
            var lavmonth_from = document.getElementById("lavmonth_from" + zz).value;
            var lavyear_from = document.getElementById("lavyear_from" + zz).value;
            if(lavyear_from=="0000"){
                lavyear_from="";
            }
            var lavday_to = document.getElementById("lavday_to" + zz).value;
            var lavmonth_to = document.getElementById("lavmonth_to" + zz).value;
            var lavyear_to = document.getElementById("lavyear_to" + zz).value;
            if(lavyear_to=="0000"){
                lavyear_to="";
            }
            var lavdescr = document.getElementById("lavdescr" + zz).value;
            lavdescr = lavdescr.replace("&lt;br&gt;","\n");
            lavdescr = lavdescr.replace(/\<br>/g,"\n");
            if(lavexi_id==0){
                lavexi_id="stx";
            }
            reset_esperprof();
            document.getElementById("lavexi_id").value = lavexi_id;
            document.getElementById("lavid_db").value = lavid_db;
            seleziona_select_testo("lavday_from",lavday_from);
            seleziona_select_value("lavmonth_from",lavmonth_from);
            document.getElementById("lavyear_from").value = lavyear_from;
            seleziona_select_testo("lavday_to",lavday_to);
            seleziona_select_value("lavmonth_to",lavmonth_to);
            document.getElementById("lavyear_to").value = lavyear_to;
            document.getElementById("lavdescr").value = lavdescr;
        });
    });
} 
function reset_esperdid(){
    document.getElementById("didid_db").value="0";
    document.getElementById("didday_from").value="00";
    document.getElementById("didmonth_from").value="00";
    document.getElementById("didyear_from").value="";
    document.getElementById("didday_to").value="00";
    document.getElementById("didmonth_to").value="00";
    document.getElementById("didyear_to").value="";
    document.getElementById("diddescr").value="";
    document.getElementById("didexi_id").value="xx";
}

function show_links_esperdid(){
    var arrLiLs = glow.dom.get(".show_did_session");
    arrLiLs.each(function(zz) {
        glow.events.addListener(glow.dom.get(arrLiLs[zz]), "click", function(event) {
            var didexi_id = document.getElementById("didexi_id" + zz).value;
            var didid_db = document.getElementById("didid_db" + zz).value;
            var didday_from = document.getElementById("didday_from" + zz).value;
            var didmonth_from = document.getElementById("didmonth_from" + zz).value;
            var didyear_from = document.getElementById("didyear_from" + zz).value;
            if(didyear_from=="0000"){
                didyear_from="";
            }
            var didday_to = document.getElementById("didday_to" + zz).value;
            var didmonth_to = document.getElementById("didmonth_to" + zz).value;
            var didyear_to = document.getElementById("didyear_to" + zz).value;
            if(didyear_to=="0000"){
                didyear_to="";
            }
            var diddescr = document.getElementById("diddescr" + zz).value;
            diddescr = diddescr.replace("&lt;br&gt;","\n");
            diddescr = diddescr.replace(/\<br>/g,"\n");
            if(didexi_id==0){
                didexi_id="stx";
            }
            reset_esperdid();
            document.getElementById("didexi_id").value = didexi_id;
            document.getElementById("didid_db").value = didid_db;
            seleziona_select_testo("didday_from",didday_from);
            seleziona_select_value("didmonth_from",didmonth_from);
            document.getElementById("didyear_from").value = didyear_from;
            seleziona_select_testo("didday_to",didday_to);
            seleziona_select_value("didmonth_to",didmonth_to);
            document.getElementById("didyear_to").value = didyear_to;
            document.getElementById("diddescr").value = diddescr;
        });
    });
}
function reset_confpubb(){
    document.getElementById("confpubbid_db").value="0";
    document.getElementById("confpubbday_from").value="00";
    document.getElementById("confpubbmonth_from").value="00";
    document.getElementById("confpubbyear_from").value="";
    document.getElementById("confpubbday_to").value="00";
    document.getElementById("confpubbmonth_to").value="00";
    document.getElementById("confpubbyear_to").value="";
    document.getElementById("confpubbdescr").value="";
    document.getElementById("confpubbexi_id").value="xx";
}

function show_links_confpubb(){
    var arrLiLs = glow.dom.get(".show_confpubb_session");
    arrLiLs.each(function(zz) {
        glow.events.addListener(glow.dom.get(arrLiLs[zz]), "click", function(event) {
            var confpubbexi_id = document.getElementById("confpubbexi_id" + zz).value;
            var confpubbid_db = document.getElementById("confpubbid_db" + zz).value;
            var confpubbday_from = document.getElementById("confpubbday_from" + zz).value;
            var confpubbmonth_from = document.getElementById("confpubbmonth_from" + zz).value;
            var confpubbyear_from = document.getElementById("confpubbyear_from" + zz).value;
            if(confpubbyear_from=="0000"){
                confpubbyear_from="";
            }
            var confpubbday_to = document.getElementById("confpubbday_to" + zz).value;
            var confpubbmonth_to = document.getElementById("confpubbmonth_to" + zz).value;
            var confpubbyear_to = document.getElementById("confpubbyear_to" + zz).value;
            if(confpubbyear_to=="0000"){
                confpubbyear_to="";
            }
            var confpubbdescr = document.getElementById("confpubbdescr" + zz).value;
            
            confpubbdescr = confpubbdescr.replace("&lt;br&gt;","\n");
            confpubbdescr = confpubbdescr.replace(/\<br>/g,"\n");
            
            if(confpubbexi_id==0){
                confpubbexi_id="stx";
            }
            reset_confpubb();
            document.getElementById("confpubbexi_id").value = confpubbexi_id;
            document.getElementById("confpubbid_db").value = confpubbid_db;
            seleziona_select_testo("confpubbday_from",confpubbday_from);
            seleziona_select_value("confpubbmonth_from",confpubbmonth_from);
            document.getElementById("confpubbyear_from").value = confpubbyear_from;
            seleziona_select_testo("confpubbday_to",confpubbday_to);
            seleziona_select_value("confpubbmonth_to",confpubbmonth_to);
            document.getElementById("confpubbyear_to").value = confpubbyear_to;
            document.getElementById("confpubbdescr").value = confpubbdescr;
        });
    });
}
function reset_lingua(){
    document.getElementById("linguaid_db").value="0";
    document.getElementById("linguaother").value="";
    document.getElementById("linguaasco").value="";
    document.getElementById("linguaexi_id").value="xx";
}
function show_links_lingua(){
    var arrLiLs = glow.dom.get(".show_lingua_session");
    arrLiLs.each(function(zz) {
        glow.events.addListener(glow.dom.get(arrLiLs[zz]), "click", function(event) {
            var linguaid_db = document.getElementById("linguaid_db" + zz).value;
            var linguaexi_id = document.getElementById("linguaexi_id" + zz).value;
            var linguaother = document.getElementById("linguaother" + zz).value;
            var linguaasco = document.getElementById("linguaasco" + zz).value;
            if(linguaexi_id==0){
                linguaexi_id="stx";
            }
            document.getElementById("linguaid_db").value = linguaid_db;
            document.getElementById("linguaexi_id").value = linguaexi_id;
            document.getElementById("linguaother").value = linguaother;
            seleziona_select_value("linguaasco",linguaasco);
        });
    });
}
/*statistiche*/
function vai_mese(pag){
    var doc = document.fm_mese;
    document.fm_mese.action=pag;
    document.fm_mese.submit();					
    return true;
}
/*end statistiche*/
/*GALLERY*/
function getImgDett(theidavx,width_winx,height_winx){
    var the_source_av = document.getElementById("big_img" + theidavx).src;
    var the_width_big_av = document.getElementById("big_width" + theidavx).value;
    var the_height_big_av = parseInt(document.getElementById("big_height" + theidavx).value);
    var the_height_big_plus_av = the_height_big_av + 30;
    var the_left_big_av = parseInt( (width_winx - the_width_big_av) / 2);
    var the_top_big_av = parseInt( (height_winx - the_height_big_plus_av) / 2);
    if(the_top_big_av < 15){
       the_top_big_av = 15;
    }
    var the_new_source_av = the_source_av.replace("small/", "");
    res = new Array(the_left_big_av, the_top_big_av,the_new_source_av);
    return res;
    
}
function getImgDettGallery(theidavx,width_winx,height_winx){
    var the_source_av = document.getElementById("big_img" + theidavx).src;
    var the_width_big_av = document.getElementById("big_width" + theidavx).value;
    var the_height_big_av = parseInt(document.getElementById("big_height" + theidavx).value);
    var the_height_big_plus_av = the_height_big_av + 30;
    var the_left_big_av = parseInt( (width_winx - the_width_big_av) / 2);
    var the_top_big_av = parseInt( (height_winx - the_height_big_plus_av) / 2);
    if(the_top_big_av < 15){
       the_top_big_av = 15;
    }
    /*var the_new_source_av = the_source_av.replace("small/", "");*/
    var the_new_source_av = document.getElementById("big_imgxx" + theidavx).value;
    res = new Array(the_left_big_av, the_top_big_av,the_new_source_av);
    return res;
    
}
/*END GALLERY*/
