function sendForm2(dest,tip,met){
    document.form2.c_3.value=dest;
    document.form2.c_2.value=tip;
    document.form2.c_1.value=met;
    document.form2.submit();
}

function selezionaLingua(str)
{
     document.form1.azione.value="CL";
     document.form1.servizio.value=document.form1.servizioFrom.value;
     document.form1.servizioFrom.value = document.form1.servizioFromAppo.value;
     document.form1.lang.value=str;
     document.form1.submit();
}

function SvuotaHidden()
{
    document.form1.renewItem.value="";
    document.form1.newItem.value="";
    document.form1.revItem.value="";
}
// FOOTER 
              function registrati2()
              {
                  document.form1.go_to.value='welcomeLogin';
                  document.form1.servizio.value='datiUtente';
                  document.form1.submit();

              }
              function showPromozioni(){
                 window.location.href="SorrentoGioielli?servizio=listaProdotti&servizioFrom=ricerca&prom=p";
              }
              function dettaglioVis(str){
                        /*
                        document.form1.det.value=str;
                        document.form1.servizio.value="dettaglioProdotto";
                        document.form1.submit();*/
                document.getElementById("ifParziale").src="SorrentoGioielli?servizio=dettaglioProdotto&parziale=S&det="+str;
                     }
                     
           
           function privacy(){
              /*SvuotaHidden();
                document.form1.subPag.value="S";
                document.form1.ulo.value="";
                document.form1.servizio.value="privacy";
                document.form1.submit();*/
                document.getElementById("ifParziale").src="SorrentoGioielli?servizio=privacy&subPag=S&parziale=S";
           }
           function chiSiamo(){
              /*SvuotaHidden();
                document.form1.subPag.value="S";
                document.form1.ulo.value="";
                document.form1.servizio.value="chiSiamo";
                document.form1.submit();*/
                document.getElementById("ifParziale").src="SorrentoGioielli?servizio=chiSiamo&subPag=S&parziale=S"; 
           }
           
           function contatti(){
              /*SvuotaHidden();
                document.form1.subPag.value="S";
                document.form1.ulo.value="";
                document.form1.servizio.value="contatti";
                document.form1.submit();*/
                document.getElementById("ifParziale").src="SorrentoGioielli?servizio=contatti&subPag=S&parziale=S";
           }
            function misureAnelli(){
                SvuotaHidden();
                document.form1.ulo.value="";
                document.form1.servizio.value="misureAnelli";
                document.form1.submit();
            }
            function modUser()
            {
                SvuotaHidden();
                document.form1.ulo.value="S";
                document.form1.servizio.value="datiUtente";
                document.form1.submit();
                    
            }
            function logout()
            {
                SvuotaHidden();
                document.form1.servizio.value="logout";
                document.form1.submit();
                    
            }
            function login()
            {
                SvuotaHidden();
                document.form1.ulo.value="S";
                document.form1.servizio.value="welcomeLogin";
                document.form1.submit();
                    
            }
function vaiCarrello()
{
/*
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.servizio.value="carrello";
    document.form1.submit();
*/

document.getElementById("ifParziale").src="SorrentoGioielli?servizio=carrello&parziale=S";    
}
  
function vaiListaDesideri()
{
    SvuotaHidden();
    document.form1.ulo.value="S";
    document.form1.servizio.value="listaDesideri";
    document.form1.submit();
	
}

function vaiResi()
{
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.servizio.value="richiestaResi";
    document.form1.submit();
	
}

function vaiReclami(){
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.servizio.value="reclamoTipo";
    document.form1.submit();
}

function vaiRicerca()
{
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.servizio.value="ricerca";
    document.form1.submit();

}
 function listaOrd()
 {
    SvuotaHidden();
    document.form1.ulo.value="S";
    document.form1.servizio.value="listaOrdini";
    document.form1.submit();
 }
function vaiLista()
{
    SvuotaHidden();
    document.form1.ulo.value="N";
    document.form1.servizio.value="listaProdotti";
    document.form1.submit();
}  
function home()
{
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.servizio.value="Portale";
    document.form1.submit();
}  
function pagamento()
{
    if(document.form1.pnd!=null)
       if(eval(document.form1.pnd.value))
         if(!confirm ("Ci sono prodotti che potrebbero non essere disponibili. Vuoi continuare comunque?"))
            return ;
    SvuotaHidden();
    document.form1.ulo.value="S";
    document.form1.servizio.value="setIndirizzo";
    //document.form1.servizio.value="sceltaPagSped";
    document.form1.submit();
}
function vaiDatiUtente(){
    SvuotaHidden();
    document.form1.ulo.value="S";
    document.form1.servizio.value="datiUtente";
    document.form1.submit();
}

function condizioni(){
    SvuotaHidden();
    document.form1.subPag="S";
    document.form1.ulo.value="N";
    document.form1.servizio.value="condizioni";
    document.form1.submit();

}
// FINE FOOTER


// attivabuonosconto
  function confermaAttivaBuono()
  {
      document.form1.servizio.value='attivabuonosconto';
      document.form1.ulo.value='N';
      document.form1.step.value='2';
      document.form1.submit();
      
  }

// FINE attivaBuonosconto

// buonosconto
  function confermaBuono()
  {
      document.form1.servizio.value='buonoSconto';
      document.form1.ulo.value='N';
      document.form1.step.value='2';
      document.form1.submit();
      
  }
  function annulla()
  {
      document.form1.servizio.value='prePay';
      document.form1.ulo.value='S';
      document.form1.submit();
  }

// FINE BUONOSCONTO

//CARRELLO
function disItem(str)
{
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.dispItem.value=str;
    document.form1.servizio.value="richiestaDisp";
    document.form1.submit();
	
}	

function modItem(str,str2)
{
    
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.renewItem.value=str;
    if(str2!=null)
       document.form1.det.value=str2;
    document.form1.servizio.value="dettaglioProdotto";
    document.form1.submit();
    /*
    var appo=""
    if(str2!=null)
       appo="&det="+str2;
    
    document.getElementById("ifParziale").src="SorrentoGioielli?parziale=S&servizio=dettaglioProdotto"+appo+"&renewItem="+str;
    */    
	
}	
  function deleteItemCarrello(str)
  {
    /*
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.revItem.value=str;
    document.form1.servizio.value="carrello";
    document.form1.submit();
    */
    document.getElementById("ifParziale").src="SorrentoGioielli?parziale=S&servizio=carrello&revItem="+str;
  }

//FINE CARRELLO

// DATIUTENTE

function registra()
{
  if(controlla()){
      document.form1.servizio.value="datiUtente";
      document.form1.step.value="2";
      document.form1.submit();	
  }
  else
    return;
}
/*
  function controlla(){
    if(document.form1.priv2.checked){
      alert("<%=SitcWEBOut.getProperty("messaggioErr28",request)%>");
      return false;
    }  
    
     if(document.form1.nome.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr5",request)%>");
       return false;
     }  
     if(document.form1.cognome.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr6",request)%>");
       return false;
     }  
     if(document.form1.indirizzo.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr8",request)%>");
       return false;
     }  
     if(document.form1.citta.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr25",request)%>");
       return false;
     }  
     if(document.form1.prov.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr9",request)%>");
       return false;
     }  
     if(document.form1.cap.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr10",request)%>");
       return false;
     }  
     if(document.form1.email.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr7",request)%>");
       return false;
     }  
     if(document.form1.paese.value==""){
       alert("<%=SitcWEBOut.getProperty("messaggioErr27",request)%>");
       return false;
     }  
     return true;
  }
*/
// FINE DATIUTENTE

// dettaglioProdotto_2
function modCarrello(str)
{
    SvuotaHidden();
    document.form1.renewItem.value=str;
    //document.form1.servizio.value="carrello";
    if(document.form1.servizioFromAppo.value!=null &&  document.form1.servizioFromAppo.value!="")
        document.form1.servizio.value=document.form1.servizioFrom.value;
    else 
        document.form1.servizio.value="";
    //document.form1.servizio.value="<%=((request.getParameter("servizioFrom")!=null)?request.getParameter("servizioFrom").toString():"")%>";
    if(document.form1.servizio.value=="listaDesideri")
      document.form1.ulo.value="S";
    document.form1.submit();

}
function addCarrello(str,str2,str3){
      if(str2==null && str3==null)
        _addCarrello1(str)
      else{
        if(str3==null)
            _addCarrello2(str,str2);
        else    
            _addCarrello3(str,str2,str3);
      }  
        
}

function _addCarrello1(str)
{
    document.form1.newItem.value=str;
    document.form1.servizio.value="carrello";
    document.form1.submit();

}
function selezionaImg(e){
    
    var objImg=document.getElementById("imgBig");
    var sorgente = (e.target) ? e.target : e.srcElement;
    var appo=sorgente.src.substr(0,sorgente.src.indexOf("Small"))+
             "Big"+
             sorgente.src.substr(sorgente.src.indexOf("Small")+5);
    objImg.src=appo;
}
function addListaDesideri(str)
{
    SvuotaHidden();
    document.form1.newItem.value=str;
    document.form1.ulo.value="S";
    document.form1.servizio.value="listaDesideri";
    document.form1.submit();
}

// FINE dettaglioProdotto_2


//formReclami
function confermaReclami()
{
  document.form1.servizio.value="insReclami";
  document.form1.step.value="";
  document.form1.submit();	
}

// FINE formReclami

// listaProdotti
 function ric()
 {
    SvuotaHidden();
    document.form1.servizio.value="listaProdotti";
    document.form1.submit();
 }



function _addCarrello2(str,prezzo)
{
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.newItem.value=str;
    document.form1.servizio.value="carrello";
    document.form1.prezzo.value=prezzo;
    document.form1.submit();

}
 function addCarrello2(str)
 {
    SvuotaHidden();
    document.form1.addTo.value="C";
    document.form1.det.value=str;
    document.form1.servizio.value="dettaglioProdotto";
    document.form1.submit();
 }

function setBlocco(num)
{
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.servizio.value="listaProdotti";
    document.form1.blocco.value=num;
    document.form1.submit();
}
 function showImgBig(e){
    boolOnZoom=true;
    var obj=document.getElementById("divImgBig");
    var objImg=document.getElementById("imgBig");
    var sorgente = (e.target) ? e.target : e.srcElement;
    lastID=sorgente.id;
    var objSor=document.getElementById("I"+sorgente.id.substring(1));
    var appo_sp=objSor.src.split("/");//sorgente.src.split("/");
    var appo="";
    for(var i=0;i<appo_sp.length-1;i++)
       appo+=appo_sp[i]+"/";
    //appo+="Big.jpg";
        appo+=appo_sp[appo_sp.length-1].substring(0,appo_sp[appo_sp.length-1].indexOf("Small.jpg")) + "Big.jpg";

    objImg.src=appo;
    if (window.opera) {
        x = e.clientX;
        y = e.clientY;
    } else if (document.all) {
        x = document.body.scrollLeft + event.clientX;
        y = document.body.scrollTop + event.clientY;
    } else if (document.layers || document.getElementById) {
        x = e.pageX;
        y = e.pageY;
    }
    obj.style.top=y-100;//obj.offsetHeight/2;
    obj.style.left=x-100;//obj.offsetWidth/2;
    setTimeout("showImgRelay()",500);
 }
function showImgRelay(){
    if(boolOnZoom){
        var obj=document.getElementById("divImgBig");
        obj.style.display="";
        obj.style.visibility="";
    }    
}
 
 function hideImgBig(e){
    lastID="";
    var obj=document.getElementById("divImgBig");
    obj.style.display="none";
    obj.style.visibility="hidden";
    obj.style.top="0px";
    obj.style.left="0px";
    document.getElementById("imgBig").src="prod/Loading.jpg";
    
 }
 function apriDettaglio(){
     if(lastID!="")
        dettaglio(lastID.substring(1));
 }
 function onMouseOutZoom(e){
   setTimeout("boolOnZoom=false;",10);
 }
 


// FINE listaProdotti

// login
  function confermaLogin()
  {
  var go_to=document.form1.servizioFrom.value;//'<%=request.getParameter("servizio")%>';
      
      if(go_to!= 'login')
         document.form1.go_to.value=go_to;
      document.form1.servizio.value='login';
      document.form1.ulo.value='S';
      document.form1.step.value='1';
      document.form1.submit();
      
  }
  function registratiLogin()
  {
      document.form1.go_to.value=document.form1.servizioFrom.value;//'<%=request.getParameter("servizio")%>';
      document.form1.servizio.value='datiUtente';
      document.form1.submit();
  
  }
  function noFirmaLogin(){
      document.form1.ulo.value='S';
      document.form1.go_to.value=document.form1.servizioFrom.value;//'<%=request.getParameter("servizio")%>';
      document.form1.servizio.value='noFirma';
      document.form1.submit();
  
  }

// FINE LOGIN

// richiestaDisp

    function confermaDisponibilita(){
    document.form1.servizio.value="confermaRichDisp";
    document.form1.submit();

    }

// FINE richiestaDisp

// richiestaResi
function confermaResi()
{
  document.form1.servizio.value="richiestaResi";
  document.form1.step.value="2";
  document.form1.submit();	
}
// FINE richiestaResi

// bonifico
function dettaglioOrd(str){
    SvuotaHidden();
    document.form1.o.value=str;
    document.form1.ulo.value="N";
    document.form1.servizio.value="dettaglioOrdine";
    document.form1.submit();

}
// FINE bonifico

//confermaPayPal
function confermaPagamento()
{
   document.form1.action="ControllerPay";
   document.form1.servizio.value="do";
   document.form1.submit();
}
//FINE confermaPayPal

// dettaglioOrdine
function bonifico(str){
    SvuotaHidden();
    document.form1.o.value=str;
    document.form1.ulo.value="S";
    document.form1.servizio.value="bonifico";
    document.form1.submit();

}
//FINE dettaglioOrdine

//listaDesideri
function _addCarrello3(str,vari,prezzo)
{
    document.form1.variante.value=vari;
    document.form1.newItem.value=str;
    document.form1.servizio.value="carrello";
    document.form1.prezzo.value=prezzo;
    document.form1.submit();

}
  function deleteItemLD(str)
  {
    SvuotaHidden();
    document.form1.ulo.value="";
    document.form1.revItem.value=str;
    document.form1.servizio.value="listaDesideri";
    document.form1.submit();
  }
// FINE listaDesideri

//listaOrdini
function detOrd(str)
{
    SvuotaHidden();
    document.form1.o.value=str;
    document.form1.ulo.value="S";
    document.form1.servizio.value="dettaglioOrdine";
    document.form1.submit();
 }


//FINE listaOrdini

//prePay
function addSconto(){
    SvuotaHidden();
    document.form1.ulo.value="N";
    document.form1.servizio.value="buonoSconto";
    document.form1.submit();
}

function vaiSceltaSpePag()
{
    SvuotaHidden();
    document.form1.ulo.value="S";
    //document.form1.servizio.value="setIndirizzo";
    document.form1.servizio.value="sceltaPagSped";
    document.form1.submit();
}

function pagamentoFinish()
{
   //document.form1.action="ControllerPay";
   document.form1.action=document.form1.appoAction.value;//"<%=c.getPaginaPagamento()%>";
   document.form1.servizio.value="pre";
   document.form1.submit();
}    

// FINE prePay

//sceltaPagSped

  function sceltaPagamento2()
  {
    document.form1.ulo.value="S";
    document.form1.servizio.value="sceltaPagSped";
    document.form1.step.value="2";
    document.form1.submit();
  }	
  function vaiCarrelloSP()
  {
    document.form1.newItem.value="";
    document.form1.servizio.value="carrello";
    document.form1.submit();
  }
//FINE sceltaPagSped


//setIndirizzo
  function controlla(){
     if(document.form1.priv==null || document.form1.priv.value=="N"){
        if(document.form1.priv2.checked){
          alert(messaggioErr28);
          return false;
        }  
     }
     if(document.form1.nome.value==""){
       alert(messaggioErr5);
       return false;
     }  
     if(document.form1.cognome.value==""){
       alert(messaggioErr6);
       return false;
     }  
     if(document.form1.indirizzo==null){
       if(document.form1.ind1.value=="" && document.form1.ind2.value==""){
         alert(messaggioErr8);
         return false;
       }
     }else{
       if(document.form1.indirizzo.value=="" ){
         alert(messaggioErr8);
         return false;
       }
     }    
     if(document.form1.citta.value==""){
       alert(messaggioErr25);
       return false;
     }  
     if(document.form1.prov==null){
       if(document.form1.prov_stato.value==""){
         alert(messaggioErr9);
         return false;
       }
     }else{
     if(document.form1.prov.value==""){
         alert(messaggioErr9);
         return false;
       }  
     }    
     if(document.form1.cap.value==""){
       alert(messaggioErr10);
       return false;
     }  
     if(document.form1.email.value==""){
       alert(messaggioErr7);
       return false;
     }  
     if(document.form1.paese.value==""){
       alert(messaggioErr27);
       return false;
     }  
     if(document.form1.tel!=null && document.form1.tel.value==""){
       alert(messaggioErr26);
       return false;
     }  
     return true;
  }
  function sceltaPagamento()
  {
    if(!controlla()) return;
    document.form1.ulo.value="S";
    document.form1.servizio.value="sceltaPagSped";
    document.form1.servizioFrom.value="setIndirizzo";
    document.form1.step.value="1";
    document.form1.submit();
  }	
//FINE setIndirizzo

//portale

 function addListaDesideri2(str)
 {
    SvuotaHidden();
    document.form1.addTo.value="D";
    document.form1.det.value=str;
    document.form1.servizio.value="dettaglioProdotto";
    document.form1.submit();
 }

 
 function dettaglio(str)
 {
    /*SvuotaHidden();
    document.form1.det.value=str;
    document.form1.servizio.value="dettaglioProdotto";
    document.form1.submit();*/
    dettaglioVis(str);
 }
//FINE portale
