function apriPopup(){
window.open('immagini_small.php','finestra','width=300,Height=530, location=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=yes');
} 
function apriScheda(id){
window.open('alberghi_small.php?lang=<?php echo $lang; ?>&id='+id,'finestra','width=640,Height=480, location=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no');
} 
function apriRegolamento(id,lang){
window.open("regolamenti_view.php?lang="+lang+"&id="+id,"finestra","width=800,Height=600, location=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no");
} 
function apriCarrello(id,lang){
window.open("carrelli_view.php?lang="+lang+"&id="+id,"finestra","width=800,Height=600, location=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no");
} 
function stampaNews(url){
window.open(url,'finestra','width=800,Height=600, location=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=yes');
} 
function salvaNews(url){
window.open(url,'finestra');
} 
function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}
/* - - - - - - - - - - - - - - - - - - - - - - -
 JavaScript
 venerdì 6 giugno 2008 12.47.56
 - - - - - - - - - - - - - - - - - - - - - - - */

var b = 2;
var i = 2;
var u = 2;
var q = 2;
var c = 2;
var url = 2;
var img = 2;

//Function for creating non-font tags
function a2cifre(x) {
var c = String(Math.round(x*100));
while (c.length < 3) c = '0' + c;
return c.replace(/([0-9][0-9])$/,".$1");
}
function showDiv(id){
if ( document.getElementById(id).style.display == 'block') {
      document.getElementById(id).style.display='none';
      } else {
      document.getElementById(id).style.display='block';
      }
}

function totale(albergo,offerte,sconto){
         prezzotot = 0;
         for (z=0; z<offerte; z++) {
         if (document.getElementById("offerta_"+albergo+"_"+z).checked) {
         prezzotot += parseFloat(document.getElementById('prezzo_'+albergo+'_'+z).value);
         }
         }
         document.getElementById('prezzo_tot_'+albergo).value = a2cifre(Math.round(prezzotot*100)/100);
         if (sconto == 1) {
         document.getElementById('prezzo_scont_'+albergo).value = a2cifre(Math.round(prezzotot*90)/100);
         }
}
function show_sel(id){
       if (id != "nord") document.getElementById("nord").style.display='none';
       if (id != "centro") document.getElementById("centro").style.display='none';
       if (id != "sud") document.getElementById("sud").style.display='none';
       document.getElementById(id).style.display='inline';
       for (i=0; i<=19; i++){
       document.getElementById(i).style.display='none';
       }
}
function show_borghi(id){
       id = parseInt(id);
       for (i=0; i<=19; i++){
       if (i == id) { document.getElementById(i).style.display='block'; }
       else { document.getElementById(i).style.display='none'; }
       }

}

function tag(v, tagadd, newbut, tagclose, oldbut, name) {
    if (eval(v)%2 == 0) {
        eval("window.document.form_news."+name+".value = newbut;");
        var testo = window.document.form_news.testo.value;
        window.document.form_news.testo.value = testo + tagadd;
        window.document.form_news.testo.focus();
    } else {
        eval("window.document.form_news."+name+".value = oldbut;");
        var testo = window.document.form_news.testo.value;
        window.document.form_news.testo.value = testo + tagclose;
        window.document.form_news.testo.focus();
    }
    eval(v+"++;");
}

function textarea_wrap_text(obj, str_pre, str_post) {
  if (document.selection) { // Internet Explorer
    obj.focus();
    sel = document.selection.createRange();
    sel.text = str_pre + sel.text + str_post;
  } else if (obj.selectionStart || obj.selectionStart == '0') { // Others
    var pos_1 = obj.selectionStart;
    var pos_2 = obj.selectionEnd;
    obj.value = obj.value.substring(0, pos_1)
                + str_pre
                + obj.value.substring(pos_1, pos_2)
                + str_post
                + obj.value.substring(pos_2, obj.value.length);
  } else { // Fallback
    obj.value += str_pre + str_post;
  }
}

function textarea_wrap_img(obj) {
    id_img = document.getElementById("id_img").value;
    align_sx = document.getElementById("sx").checked;
    align_dx = document.getElementById("dx").checked;
    align_is = document.getElementById("is").checked;
    if (align_sx) align = "s";
    else if (align_dx) align = "d";
    else if (align_is) align = "i";
    if (id_img != "") {
  if (document.selection) { // Internet Explorer
    obj.focus();
    sel = document.selection.createRange();
    sel.text = "[img="+id_img+align+"]";
    show('ins_img');
    show('view_img');

  } else if (obj.selectionStart || obj.selectionStart == '0') { // Others
    var pos_1 = obj.selectionStart;
    var pos_2 = obj.selectionEnd;
    obj.value = obj.value.substring(0, pos_1)
                + "[img="+id_img+align+"]"
                + obj.value.substring(pos_1, pos_2)
                + obj.value.substring(pos_2, obj.value.length);
    document.getElementById("id_img").value = "";
    show('ins_img');
    show('view_img');
  } else { // Fallback
    obj.value += "[img=]";
  }
}
}
function textarea_wrap_doc(obj) {
    id_img = document.getElementById("id_doc").value;
    if (id_img != "") {
  if (document.selection) { // Internet Explorer
    obj.focus();
    sel = document.selection.createRange();
    sel.text = "[doc="+id_img+"]";
    show('ins_doc');
  } else if (obj.selectionStart || obj.selectionStart == '0') { // Others
    var pos_1 = obj.selectionStart;
    var pos_2 = obj.selectionEnd;
    obj.value = obj.value.substring(0, pos_1)
                + "[doc="+id_img+"]"
                + obj.value.substring(pos_1, pos_2)
                + obj.value.substring(pos_2, obj.value.length);
    document.getElementById("id_doc").value = "";
    show('ins_doc');
  } else { // Fallback
    obj.value += "[doc=]";
  }
}
}
function textarea_wrap_url(obj) {
    url = document.getElementById("url").value;
    url_text = document.getElementById("url_text").value;
    if (url != "" && url_text != "") {
  if (document.selection) { // Internet Explorer
    obj.focus();
    sel = document.selection.createRange();
    sel.text = "[url="+url+"]"+url_text+"[/url]";
    show('ins_url');
  } else if (obj.selectionStart || obj.selectionStart == '0') { // Others
    var pos_1 = obj.selectionStart;
    var pos_2 = obj.selectionEnd;
    obj.value = obj.value.substring(0, pos_1)
                + "[url="+url+"]"+url_text+"[/url]"
                + obj.value.substring(pos_1, pos_2)
                + obj.value.substring(pos_2, obj.value.length);
    document.getElementById("url").value = "";
    document.getElementById("url_text").value = "";
    show('ins_url');
  } else { // Fallback
    obj.value += "[doc=]";
  }
}
}

function showMenu(id){
id = id.substring(4);
id = parseInt(id);
if ( document.getElementById('menu'+i).style.display == 'block') {
      document.getElementById('menu'+i).style.display='none';
      } else {
      document.getElementById('menu'+i).style.display='block';
      }
}

function controllaForm () {
        var oEmail = document.getElementById("email");
        var oSubject = document.getElementById("subject");
        var oMessage = document.getElementById("message");

        var oErroreUser = document.getElementById("erroreNome");



        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oSubject.value == ""){
            oSubject.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Oggetto Richiesto!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oSubject.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oMessage.value == ""){
            oMessage.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un messaggio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oMessage.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


document.form_email.action = "index.php?sel=send";
document.form_email.submit();

}
function controllaRistorante () {
        var oNome = document.getElementById("nome");
        var oSpecialita = document.getElementById("specialita");
        var oPrezzo = document.getElementById("prezzo");
        var oMenu = document.getElementById("menu");
        var oDescrizione = document.getElementById("descrizione");
        var oBorgosel = document.getElementById("borgosel");
        var oEmail = document.getElementById("email");
        var Borgoarrow = document.getElementById("borgoarrow");

        var oErroreUser = document.getElementById("erroreUser");
        var oErrore2 = document.getElementById("errore2");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oSpecialita.value == ""){
            oSpecialita.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oSpecialita.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oPrezzo.value == ""){
            oPrezzo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oPrezzo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oMenu.value == ""){
            oMenu.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oMenu.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oDescrizione.value == ""){
            oDescrizione.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oDescrizione.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oBorgosel.value == ""){
            Borgoarrow.style.display = "block";
            oErroreUser.innerHTML = "Devi selezionare il borgo!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              Borgoarrow.style.display = "none";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (document.form_reg.inform[1].checked) {
            oErrore2.innerHTML = "E' Obbligatorio Il Consenso Al Trattamento Dei Dati";
            oErrore2.style.fontSize = "12px";
            oErrore2.style.textDecoration = "blink";
            oErrore2.style.backgroundColor = "#FF0000";
            oErrore2.style.color = "#000000";
            oErrore2ore.style.padding = "5px";
           return null;
        }
        else {
        oErrore2.innerHTML = "";
        oErrore2.style.backgroundColor = "#FFffff";
        }


document.form_reg.action = "index.php?sel=registra_ristorante";
document.form_reg.submit();

}
function controllaLavora () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEta = document.getElementById("eta");
        var oProfessione = document.getElementById("professione");
        var oTitolo = document.getElementById("titolo");
        var oTelefono = document.getElementById("telefono");
        var oEmail = document.getElementById("email");
        var oCitta = document.getElementById("citta");
        var oEsperienze = document.getElementById("esperienze");

        var oErroreUser = document.getElementById("erroreNome");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Nome Richiesto!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Cognome Richiesto!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oEta.value == ""){
            oEta.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Età Richiesta!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oEta.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oProfessione.value == ""){
            oProfessione.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Professione Richiesta!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oProfessione.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oTitolo.value == ""){
            oTitolo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Titolo di studi Richiesto!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oTitolo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oTelefono.value == ""){
            oTelefono.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Telefono Richiesto!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oTelefono.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oCitta.value == ""){
            oCitta.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Città Richiesta!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCitta.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oEsperienze.value == ""){
            oEsperienze.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci le tue esperienze!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oEsperienze.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


document.form_email.action = "index.php?sel=lavora_send";
document.form_email.submit();

}


function controllaUserAdmin () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oUser = document.getElementById("user");
        var oPass = document.getElementById("pass");
        var oEmail = document.getElementById("email");

        var oErroreNome = document.getElementById("erroreNome");
        var oErroreUser = document.getElementById("erroreUser");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Devi inserire il nome!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCognome.value == ""){
              oCognome.style.backgroundColor = "#FF7C7C";
              oErroreNome.innerHTML = "I Campi In Rosso Sono Obbligatori!";
              oErroreNome.style.color = "#ffffff";
              oErroreNome.style.backgroundColor = "#FF0000";
              oErroreNome.style.padding = "5px";
           return null;
        }else{
        oCognome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }


        if (oUser.value == ""){
            oUser.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I Campi In Rosso Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oUser.value.length < 6){
                  oUser.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "Il nome utente deve contenere almeno 6 caratteri alfanumerici, senza spazi!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oUser.value) ) {
                         oUser.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oUser.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "Il nome utente non è valido. Utilizza solo lettere minuscole e numeri senza spazi!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oPass.value == ""){
            oPass.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I Campi In Rosso Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oPass.value.length < 6){
                  oPass.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "La password deve contenere almeno 6 caratteri alfanumerici!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oPass.value) ) {
                         oPass.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oPass.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "La password non è valida. Utilizza solo lettere minuscole e numeri!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I Campi In Rosso Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#FFffff";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserire un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }



document.form_utenti.action = "index.php?sel=users_admin&sel_2=up_users";
document.form_utenti.submit();

}

function controllaTO () {
        var oNome = document.getElementById("nome");
        var oReferente = document.getElementById("referente");
        var oQualifica = document.getElementById("qualifica");
        var oTelefono = document.getElementById("telefono");
        var oNazione = document.getElementById("nazione");
        var oLingua = document.getElementById("lingua");
        var oCitta = document.getElementById("citta");
        var oUser = document.getElementById("user");
        var oPass = document.getElementById("pass");
        var oEmail = document.getElementById("email");

        var oErroreNome = document.getElementById("erroreNome");
        var oErroreUser = document.getElementById("erroreUser");
        var oErrore2 = document.getElementById("errore2");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oReferente.value == ""){
            oReferente.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oReferente.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oQualifica.value == ""){
            oQualifica.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oQualifica.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }


        if (oTelefono.value == ""){
            oTelefono.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        } else {
          var strCellulare = oTelefono.value;
          if ( /[0-9]{4,15}/.test(strCellulare) )  {
              oTelefono.style.backgroundColor = "";
              oErroreNome.innerHTML = "";
              oErroreNome.style.backgroundColor = "#FFffff";
          } else {
            oTelefono.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Inserire soltanto il numero, senza altri caratteri (/, -)!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
           return null;
          }
        }

        if (oNazione.value == ""){
            oNazione.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNazione.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oLingua.value == ""){
            oLingua.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oLingua.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCitta.value == ""){
            oCitta.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oCitta.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oUser.value == ""){
            oUser.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oUser.value.length < 6){
                  oUser.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "Il nome utente deve contenere almeno 6 caratteri alfanumerici, senza spazi!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oUser.value) ) {
                         oUser.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oUser.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "Il nome utente non è valido. Utilizza solo lettere minuscole e numeri senza spazi!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oPass.value == ""){
            oPass.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oPass.value.length < 6){
                  oPass.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "La password deve contenere almeno 6 caratteri alfanumerici!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oPass.value) ) {
                         oPass.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oPass.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "La password non è valida. Utilizza solo lettere minuscole e numeri!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#FFffff";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserire un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (document.form_reg.inform[1].checked) {
            oErrore2.innerHTML = "E' Obbligatorio Il Consenso Al Trattamento Dei Dati";
            oErrore2.style.fontSize = "12px";
            oErrore2.style.textDecoration = "blink";
            oErrore2.style.backgroundColor = "#FF0000";
            oErrore2.style.color = "#000000";
            oErrore2ore.style.padding = "5px";
           return null;
        }
        else {
        oErrore2.innerHTML = "";
        oErrore2.style.backgroundColor = "#FFffff";
        }



document.form_reg.action = "index.php?sel=to_reg";
document.form_reg.submit();

}
function controllaADV () {
        var oNome = document.getElementById("nome");
        var oReferente = document.getElementById("referente");
        var oQualifica = document.getElementById("qualifica");
        var oTelefono = document.getElementById("telefono");
        var oNazione = document.getElementById("nazione");
        var oLingua = document.getElementById("lingua");
        var oCitta = document.getElementById("citta");
        var oUser = document.getElementById("user");
        var oPass = document.getElementById("pass");
        var oEmail = document.getElementById("email");

        var oErroreNome = document.getElementById("erroreNome");
        var oErroreUser = document.getElementById("erroreUser");
        var oErrore2 = document.getElementById("errore2");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oReferente.value == ""){
            oReferente.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oReferente.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oQualifica.value == ""){
            oQualifica.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oQualifica.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }


        if (oTelefono.value == ""){
            oTelefono.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        } else {
          var strCellulare = oTelefono.value;
          if ( /[0-9]{4,15}/.test(strCellulare) )  {
              oTelefono.style.backgroundColor = "";
              oErroreNome.innerHTML = "";
              oErroreNome.style.backgroundColor = "#FFffff";
          } else {
            oTelefono.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Inserire soltanto il numero, senza altri caratteri (/, -)!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
           return null;
          }
        }

        if (oNazione.value == ""){
            oNazione.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNazione.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oLingua.value == ""){
            oLingua.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oLingua.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCitta.value == ""){
            oCitta.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oCitta.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oUser.value == ""){
            oUser.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oUser.value.length < 6){
                  oUser.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "Il nome utente deve contenere almeno 6 caratteri alfanumerici, senza spazi!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oUser.value) ) {
                         oUser.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oUser.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "Il nome utente non è valido. Utilizza solo lettere minuscole e numeri senza spazi!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oPass.value == ""){
            oPass.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oPass.value.length < 6){
                  oPass.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "La password deve contenere almeno 6 caratteri alfanumerici!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oPass.value) ) {
                         oPass.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oPass.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "La password non è valida. Utilizza solo lettere minuscole e numeri!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#FFffff";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserire un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (document.form_reg.inform[1].checked) {
            oErrore2.innerHTML = "E' Obbligatorio Il Consenso Al Trattamento Dei Dati";
            oErrore2.style.fontSize = "12px";
            oErrore2.style.textDecoration = "blink";
            oErrore2.style.backgroundColor = "#FF0000";
            oErrore2.style.color = "#000000";
            oErrore2ore.style.padding = "5px";
           return null;
        }
        else {
        oErrore2.innerHTML = "";
        oErrore2.style.backgroundColor = "#FFffff";
        }



document.form_reg.action = "index.php?sel=adv_reg";
document.form_reg.submit();

}

function controllaAmici () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEta = document.getElementById("eta");
        var oIndirizzo = document.getElementById("indirizzo");
        var oCivico = document.getElementById("civico");
        var oCap = document.getElementById("cap");
        var oNazione = document.getElementById("nazione");
        var oLingua = document.getElementById("lingua");
        var oCitta = document.getElementById("citta");
        var oUser = document.getElementById("user");
        var oPass = document.getElementById("pass");
        var oEmail = document.getElementById("email");

        var oErroreNome = document.getElementById("erroreNome");
        var oErroreUser = document.getElementById("erroreUser");
        var oErrore2 = document.getElementById("errore2");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oCognome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oEta.value == ""){
            oEta.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oEta.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oIndirizzo.value == ""){
            oIndirizzo.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oIndirizzo.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCivico.value == ""){
            oCivico.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oCivico.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCap.value == ""){
            oCap.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oCap.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }



        if (oNazione.value == ""){
            oNazione.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNazione.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oLingua.value == ""){
            oLingua.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oLingua.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCitta.value == ""){
            oCitta.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oCitta.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }


        if (oUser.value == ""){
            oUser.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oUser.value.length < 6){
                  oUser.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "Il nome utente deve contenere almeno 6 caratteri alfanumerici, senza spazi!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oUser.value) ) {
                         oUser.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oUser.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "Il nome utente non è valido. Utilizza solo lettere minuscole e numeri senza spazi!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oPass.value == ""){
            oPass.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oPass.value.length < 6){
                  oPass.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "La password deve contenere almeno 6 caratteri alfanumerici!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oPass.value) ) {
                         oPass.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oPass.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "La password non è valida. Utilizza solo lettere minuscole e numeri!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }

        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti I Campi Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#FFffff";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserire un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (document.form_reg.inform[1].checked) {
            oErrore2.innerHTML = "E' Obbligatorio Il Consenso Al Trattamento Dei Dati";
            oErrore2.style.fontSize = "12px";
            oErrore2.style.textDecoration = "blink";
            oErrore2.style.backgroundColor = "#FF0000";
            oErrore2.style.color = "#000000";
            oErrore2ore.style.padding = "5px";
           return null;
        }
        else {
        oErrore2.innerHTML = "";
        oErrore2.style.backgroundColor = "#FFffff";
        }



document.form_reg.action = "index.php?sel=amici_reg";
document.form_reg.submit();

}

function controllaUserMod () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oPass = document.getElementById("pass");
        var oCellulare = document.getElementById("cellulare");

        var oErroreNome = document.getElementById("erroreNome");
        var oErroreUser = document.getElementById("erroreUser");
        var oErrore2 = document.getElementById("errore2");


        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "I Campi In Rosso Sono Obbligatori!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
            return null;

        }
        else{
        oNome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }

        if (oCognome.value == ""){
              oCognome.style.backgroundColor = "#FF7C7C";
              oErroreNome.innerHTML = "I Campi In Rosso Sono Obbligatori!";
              oErroreNome.style.color = "#ffffff";
              oErroreNome.style.backgroundColor = "#FF0000";
              oErroreNome.style.padding = "5px";
           return null;
        }else{
        oCognome.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }


        if (oCellulare) {
        if (oCellulare.value != ""){
          var strCellulare = oCellulare.value;
          if ( /[3]{1}[0-9]{8,10}/.test(strCellulare) )  {
              oCellulare.style.backgroundColor = "";
              oErroreNome.innerHTML = "";
              oErroreNome.style.backgroundColor = "#FFffff";
          } else {
            oCellulare.style.backgroundColor = "#FF7C7C";
            oErroreNome.innerHTML = "Inserire soltanto il numero, senza altri caratteri (/, -)!";
            oErroreNome.style.color = "#ffffff";
            oErroreNome.style.backgroundColor = "#FF0000";
            oErroreNome.style.padding = "5px";
           return null;
          }
        }else{
        oCellulare.style.backgroundColor = "";
        oErroreNome.innerHTML = "";
        oErroreNome.style.backgroundColor = "#FFffff";
        }
        }


        if (oPass.value == ""){
            oPass.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I Campi In Rosso Sono Obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        }
        else { if (oPass.value.length < 6){
                  oPass.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "La password deve contenere almeno 6 caratteri alfanumerici!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oPass.value) ) {
                         oPass.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oPass.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "La password non è valida. Utilizza solo lettere minuscole e numeri!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }


document.form_utente.action = "index.php?sel=dati_user&op=mod";
document.form_utente.submit();

}

function sendPass () {
        var oEmail = document.getElementById("email");

        var oErroreUser = document.getElementById("erroreUser");

        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Devi inserire l'indirizzo e-mail!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#FFffff";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserire un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }


document.get_pass.action = "index.php?sel=get_pass&op=send";
document.get_pass.submit();

}

function controllaTransfer () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEmail = document.getElementById("email");
        var oDa = document.getElementById("da");
        var oA = document.getElementById("a");
        var oPersone = document.getElementById("persone");
        var data = document.getElementById("data_servizio");

        var oErroreUser = document.getElementById("erroreNome");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oDa.value == ""){
            oDa.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oDa.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oA.value == ""){
            oA.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oA.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oPersone.value == ""){
            oPersone.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oPersone.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (data.value == ""){
            data.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              data.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }



document.form_transfer.action = "index.php?sel=transfer_up";
document.form_transfer.submit();

}

function controllaGuide () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEmail = document.getElementById("email");
        var oBorgo = document.getElementById("borgosel");
        var oOre = document.getElementById("ore");
        var oPersone = document.getElementById("persone");
        var data = document.getElementById("data_servizio");

        var oErroreUser = document.getElementById("erroreNome");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oBorgo.value == ""){
            oBorgo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Devi selezionare un Borgo!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oBorgo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oPersone.value == ""){
            oPersone.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oPersone.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oOre.value == ""){
            oOre.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oOre.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
                if (data.value == ""){
            data.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              data.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }




document.form_guide.action = "index.php?sel=guide_up";
document.form_guide.submit();

}

function controllaEscursioni () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEmail = document.getElementById("email");
        var oPersone = document.getElementById("persone");
        var oBorgo = document.getElementById("borgosel");
        var oRichiesta = document.getElementById("richiesta");
        var data = document.getElementById("data_servizio");

        var oErroreUser = document.getElementById("erroreNome");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oPersone.value == ""){
            oPersone.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oPersone.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (data.value == ""){
            data.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              data.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oBorgo.value == ""){
            oBorgo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Devi selezionare un Borgo!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oBorgo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oRichiesta.value == ""){
            oRichiesta.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oRichiesta.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }



document.form_escursioni.action = "index.php?sel=escursioni_up";
document.form_escursioni.submit();

}

function controllaNoleggioBarche () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEmail = document.getElementById("email");
        var oPersone = document.getElementById("persone");
        var oBorgo = document.getElementById("borgosel");
        var oRichiesta = document.getElementById("richiesta");
        var data = document.getElementById("data_servizio");

        var oErroreUser = document.getElementById("erroreNome");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oPersone.value == ""){
            oPersone.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oPersone.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (data.value == ""){
            data.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              data.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oBorgo.value == ""){
            oBorgo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Devi selezionare un Borgo!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oBorgo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oRichiesta.value == ""){
            oRichiesta.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oRichiesta.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }



document.form_noleggio_barche.action = "index.php?sel=noleggio_barche_up";
document.form_noleggio_barche.submit();

}

function controllaLove () {
        var oNome = document.getElementById("nome");
        var oEmail = document.getElementById("email");
        var oPersone = document.getElementById("persone");
        var dataarrivo = document.getElementById("data_arrivo");
        var datapartenza = document.getElementById("data_partenza");

        var oErroreUser = document.getElementById("erroreNome");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oPersone.value == ""){
            oPersone.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oPersone.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (dataarrivo.value == ""){
            dataarrivo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              dataarrivo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (datapartenza.value == ""){
            datapartenza.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              datapartenza.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }



document.form_offerte.action = "index.php?sel=offerte_up";
document.form_offerte.submit();

}
function controllaMese () {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEmail = document.getElementById("email");
        var oPersone = document.getElementById("persone");
        var dataarrivo = document.getElementById("data_arrivo");
        var datapartenza = document.getElementById("data_partenza");

        var oErroreUser = document.getElementById("erroreNome");

        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oPersone.value == ""){
            oPersone.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oPersone.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (dataarrivo.value == ""){
            dataarrivo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              dataarrivo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (datapartenza.value == ""){
            datapartenza.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              datapartenza.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }



document.form_mese.action = "index.php?sel=mese_up";
document.form_mese.submit();

}

function prenota(albergo,offerte) {
        form_name="ricerca"+albergo;
        var aaa = 0;
        for (i=0; i<offerte; i++) {

            if (document.getElementById("offerta_"+albergo+"_"+i).checked){
               aaa++;
            }

        }

        if (aaa > 0) {
        document.getElementById(form_name).action = "index.php?sel=prenota";
        document.getElementById(form_name).submit();
        }

}

function prenota2(albergo,offerte) {
        form_name="ricerca"+albergo;
        var aaa = 0;
        for (i=0; i<offerte; i++) {

            if (document.getElementById("offerta_"+albergo+"_"+i).checked){
               aaa++;
            }

        }

        if (aaa > 0) {
        document.getElementById(form_name).action = "index.php?sel=prenota_ris";
        document.getElementById(form_name).submit();
        }

}

function conferma() {
        var oNome = document.getElementById("nome");
        var oCognome = document.getElementById("cognome");
        var oEmail = document.getElementById("email");

        var oErroreUser = document.getElementById("errore");
        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

document.form_conferma.action = "index.php?sel=conferma";
document.form_conferma.submit();

}
function contattaRistorante(id) {
        var oNome = document.getElementById("nome"+id);
        var oCognome = document.getElementById("cognome"+id);
        var oEmail = document.getElementById("email"+id);
        var oMessaggio = document.getElementById("messaggio"+id);
        var form = document.getElementById("form_contatta"+id);
        var oErroreUser = document.getElementById("errore"+id);
        if (oNome.value == ""){
            oNome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }
        if (oCognome.value == ""){
            oCognome.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCognome.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


        if (oEmail.value == ""){
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Indirizzo E-mail obbligatorio!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
          var strEmail = oEmail.value;
          if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(strEmail) )  {
              oEmail.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          } else {
            oEmail.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Inserisci un indirizzo e-mail valido!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
          }
        }

        if (oMessaggio.value == ""){
            oMessaggio.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Tutti i campi sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oMessaggio.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


form.action = "index.php?sel=contatta_rist&id="+id;
form.submit();

}

function controllaProfilo() {
        var oEta = document.getElementById("eta");
        var oIndirizzo = document.getElementById("indirizzo");
        var oCivico = document.getElementById("civico");
        var oCap = document.getElementById("cap");
        var oCitta = document.getElementById("citta");
        var oNazione = document.getElementById("nazione");
        var oLingua = document.getElementById("lingua");
        var oPass = document.getElementById("pass");

        var oErroreUser = document.getElementById("errore");

        if (oEta.value == ""){
            oEta.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oEta.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oIndirizzo.value == ""){
            oIndirizzo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oIndirizzo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oCivico.value == ""){
            oCivico.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCivico.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oCap.value == ""){
            oCap.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCap.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oCitta.value == ""){
            oCitta.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oCitta.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oNazione.value == ""){
            oNazione.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oNazione.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oLingua.value == ""){
            oLingua.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "I campi con asterisco sono obbligatori!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              oLingua.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (oPass.value != ""){
         if (oPass.value.length < 6){
                  oPass.style.backgroundColor = "#FF7C7C";
                  oErroreUser.innerHTML = "La password deve contenere almeno 6 caratteri alfanumerici!";
                  oErroreUser.style.color = "#ffffff";
                  oErroreUser.style.backgroundColor = "#FF0000";
                  oErroreUser.style.padding = "5px";
                  return null;
                  } else {
                         if ( /^[a-z0-9]+$/.test(oPass.value) ) {
                         oPass.style.backgroundColor = "";
                         oErroreUser.innerHTML = "";
                         oErroreUser.style.backgroundColor = "#FFffff";
                         } else {
                         oPass.style.backgroundColor = "#FF7C7C";
                         oErroreUser.innerHTML = "La password non è valida. Utilizza solo lettere minuscole e numeri!";
                         oErroreUser.style.color = "#ffffff";
                         oErroreUser.style.backgroundColor = "#FF0000";
                         oErroreUser.style.padding = "5px";
                         return null;
                         }
                  }
        }


document.form_mod.action = "index.php?sel=amici_profilo&sel_2=up";
document.form_mod.submit();

}


function controllaCarrello(idcarrello,somma) {
        var cro = document.getElementById("cro");
        var importo = document.getElementById("importo");

        var oErroreUser = document.getElementById("errore");

        if (cro.value == ""){
            cro.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Devi inserire il CRO!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {
              cro.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }

        if (importo.value == ""){
            importo.style.backgroundColor = "#FF7C7C";
            oErroreUser.innerHTML = "Devi inserire l'importo del bonifico!";
            oErroreUser.style.color = "#ffffff";
            oErroreUser.style.backgroundColor = "#FF0000";
            oErroreUser.style.padding = "5px";
           return null;
        } else {

              importo.value = importo.value.replace(",",".");
              if (document.getElementById("check_promo")) {
                 var scontato = document.getElementById("importo_scontato").value;

                 if (document.getElementById("check_promo").checked) {
                    if (importo.value != scontato) {
                    importo.style.backgroundColor = "#FF7C7C";
                    oErroreUser.innerHTML = "L'importo inserito deve essere uguale al prezzo scontato!";
                    oErroreUser.style.color = "#ffffff";
                    oErroreUser.style.backgroundColor = "#FF0000";
                    oErroreUser.style.padding = "5px";
                    return null;
                    }
                 } else {
                    if (importo.value != somma) {
                    importo.style.backgroundColor = "#FF7C7C";
                    oErroreUser.innerHTML = "L'importo inserito deve essere uguale al prezzo totale!";
                    oErroreUser.style.color = "#ffffff";
                    oErroreUser.style.backgroundColor = "#FF0000";
                    oErroreUser.style.padding = "5px";
                    return null;
                    }

                 }

              } else {
                 if (importo.value != somma) {
                    importo.style.backgroundColor = "#FF7C7C";
                    oErroreUser.innerHTML = "L'importo inserito non corrisponde!";
                    oErroreUser.style.color = "#ffffff";
                    oErroreUser.style.backgroundColor = "#FF0000";
                    oErroreUser.style.padding = "5px";
                    return null;
                  }
              }



              importo.style.backgroundColor = "";
              oErroreUser.innerHTML = "";
              oErroreUser.style.backgroundColor = "#000";
          }


document.form_offerta.action = "index.php?sel=conferma_ordine_amici&id_carrello="+idcarrello;
document.form_offerta.submit();

}



