function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
    
function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor)
source.style.backgroundColor=highlightcolor
}

function genera_codice_disdetta() 
 { 
 questaData = new Date(); 
 var mesecorrente= questaData.getMonth(); 
 var p=Math.floor(questaData. getTime()/3600000)-339775; 
 var mesicod= new Array("J", "K", "W", "X", "Y","A","G","I","H","Q","M","L");  
 var mystr= new String(p); 
 var j=mystr.length; 
 for (var i=1;i<=5-j;i++) mystr="0" + mystr;  
  document.write (mesicod[mesecorrente] + mystr); 
 }

function checkFormAddon() 
 
{ 
 
 with (document.forms['ordine'])  
  { 
    if (idr.value.length==0) {alert ("Inserire codice cliente");return (0);} 
    if (idr.value.length!=6) {alert ("Codice cliente errato");return (0);} 
   
    if(commenti.value.indexOf("href")>=0) return(0); 
  }   
return (1); 
}

function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement))
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
    
function check_domain(domain)
{
 var str="http://reports.internic.net/cgi/whois?type=domain&whois_nic=";
 str=str+domain;
 open(str,'com' , 'status=yes,toolbar=no,directories=no,menubar=no,scrollbars=yes');

}


function check_domain_it(domain)
{
 var str="http://www.nic.it/StatoReg";
 //str=str+domain;alert(str);
 open(str,'it' , 'status=yes,toolbar=no,directories=no,menubar=no,scrollbars=yes');
 
 //document.location="http://www.nic.it/cgi-bin/StatoReg/search.cgi?Object=pippo.it";
}


function test_email(email)
{
  
  if((email.indexOf("@")==-1) || (email.indexOf(".")==-1))
    {
        alert("L'indirizzo di posta elettronica non  valido.");
        return(1);
    }
    
  return(0);  
    
}


function test_form2()
{
  with(document.forms['ordine']) 
    {  
        if(test_email(elements["email"].value)) return; 
        submit();
    }    

}    
    


function test_form(refer)
{
 with(document.forms['ordine']) 
    {  
    
    if(test_email(elements["email"].value)) return;
        
    if (!accetto.checked) 
        {
        alert("Per procedere all'ordine si deve barrare la casella di accettazione delle condizioni generali di abbonamento");
        return;
        }   
    if(refer=="MAINER") recipient.value="orders@euroweb97.com";  
    submit();
    }
}


function no_tipo(tipo)
{
    
 var res;
 res="Selezionare il tipo abbonamento per la formula "+ tipo+"!";

    alert(res);

}    

 function checkDisdette()  
  
{  
  
 with (document.forms['disdette'])   
  {  
    if (idr.value.length==0) {alert ("Inserire codice cliente");return (0);}  
    if (idr.value.length!=6) {alert ("Codice cliente errato");return (0);}  
    if (Nome.value.length==0) {alert ("Inserire Nome");return (0);}  
    if (Cognome.value.length==0) {alert ("Inserire Cognome");return (0);}  
    if (EMAIL.value.length==0) {alert ("Inserire un'indirizzo email valido");return (0);}  
    if (Dominio.value.length==0) {alert ("Inserire il nome dominio");return (0);} 
    if (Ragione.options.selectedIndex==0)  {alert ("Inserire la ragione della disdetta");return (0);} 
    if (test_email(EMAIL.value)) {alert ("Inserire un'indirizzo email valido");return (0);}  
    if(commenti.value.indexOf("href")>=0) return(0);  
  }    
return (1);  
}

function submit_order_adsl()
{
 var base=0;
 var plus=0;
 var pro=0;
 var lan=0;
 var lanplus=0;
 var modem=0;
 var router=0;
 var ip=0;
 var price_modem=13;
 var price_router=18;
 var setup_router=98;
 
 
 var op_index;
  with(document.forder)
  { 
    // BASE
    
    op_index=base_mth.options.selectedIndex;
    if(op_index) 
        {
            base=parseInt(base_mth.options[op_index].text,10);
            if(base==3) {price=101;setup=129;}
            else {price=347;setup=129;}
            if (base_modem[0].checked) modem=base*price_modem;
            else modem=0;     
            op_index=base_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            base=(price+setup+modem)*op_index;
        }
   
   //PLUS
     
     op_index=plus_mth.options.selectedIndex;
    if(op_index) 
        {
            plus=parseInt(plus_mth.options[op_index].text,10);
            if(plus==3) {price=119;setup=129;}
            else {price=421;setup=129;}
            if (plus_modem[0].checked) modem=plus*price_modem;
            else modem=0; 
            op_index=plus_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            plus=(price+setup+modem)*op_index;
        }
        
    //PRO
    
     op_index=pro_mth.options.selectedIndex;
    if(op_index) 
        {
            pro=parseInt(pro_mth.options[op_index].text,10);
            if(pro==3) {price=215;setup=129;}
            else {price=775;setup=129;}
            if (pro_modem[0].checked) modem=pro*price_modem;
            else modem=0;
            if (pro_ip[0].checked) ip=pro*5;
            else ip=0;
            op_index=pro_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            pro=(price+setup+modem+ip)*op_index;
        }
      
    //LAN    
        
     op_index=lan_mth.options.selectedIndex;
    if(op_index) 
        {
            lan=parseInt(lan_mth.options[op_index].text,10);
            if(lan==3) {price=414;setup=232;}
            else {price=1487;setup=232;}
            if (lan_router[0].checked) router=lan*price_router;
            else router=0;
            op_index=lan_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            lan=(price+setup+router+setup_router)*op_index;
        }         
     
    //LANPLUS 
     
      op_index=lanplus_mth.options.selectedIndex;
    if(op_index) 
        {
            lanplus=parseInt(lanplus_mth.options[op_index].text,10);
            if(lanplus==3) {price=586;setup=232;}
            else {price=2107;setup=232;}
            if (lanplus_router[0].checked) router=lanplus*price_router;
            else router=0;
            op_index=lanplus_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            lanplus=(price+setup+router+setup_router)*op_index;
        }
     
   totale=base+plus+pro+lan+lanplus;
   if(!totale) {alert("Hai dimenticato di indicare il servizio richiesto.");return;}
  
 
 
 //alert(totale); return;
 
    m_iAA3.value=totale;
    m_iAA3.name="m_iAA*3";

    m_iAA2.value=1;
    m_iAA2.name="m_iAA*2";
    
    m_iAA1.value=0;
    m_iAA1.name="m_iAA*1";   
  
    
    submit();    
   }
}



function submit_order_hrivenditori()
{
 var serv=0;
 
 
 var op_index;
  with(document.forder)
  { 
   
    
    op_index=server.options.selectedIndex;
    if(op_index) 
        {
            serv=parseInt(server.options[op_index].value,10);
            
            op_index=mesi.options.selectedIndex;
            if(!op_index) op_index=1;
            mth=parseInt(mesi.options[op_index].value,10);
            
            op_index=mirroring.options.selectedIndex;
            if(op_index) serv=serv+parseInt(mirroring.options[op_index].value,10);
            op_index=backup.options.selectedIndex;
            if(op_index)  serv=serv+parseInt(backup.options[op_index].value,10);
            
        }
   
   if(!serv) {alert("Hai dimenticato di indicare il server richiesto.");return;}
  
 
 totale=serv*mth/100;
  
    m_iAA3.value=totale;
    m_iAA3.name="m_iAA*3";

    m_iAA2.value=1;
    m_iAA2.name="m_iAA*2";
    
    m_iAA1.value=0;
    m_iAA1.name="m_iAA*1";   
  
    
    submit();    
   }
}




    
function submit_order()
{
 var smart=0;
 var price=0;
 var web200=0;
 var setup=0;
 var you=0;

 var mini=0;
 var easy=0;
 var light=0;
 var lightlinux=0;
 var webcommerce=0;
 var giga=0; 
 var provider=0;
 var multidominio=0;
 var multidominio10=0;
 var multidominioplus=0;
 var multidominioasp=0;
 var it=0;
 var com=0;
 var info=0;
 var tv=0;
 var jp=0;
 var wsph=0;
 var cc=0;
 var ftpplus=0;
 var mailboxplus=0;
 var spaceplus200=0;
 var spaceplus500=0;
 var spaceplus1000=0;
 var sslsupport=0;
 var shoppingcart=0;
 var sqlserver50=0;
 var sqlserver100=0;
 var mysql50=0;
 
 var op_index;
 
 with(document.forder)
  { 
    
    
    // SMART
    
    op_index=smart_qty.options.selectedIndex;
    
    if(op_index) 
        {
            smart=parseInt(smart_qty.options[op_index].text,10);
            price=19;
            
            /*
            if(smart_tipo[0].checked) price=19;
            else if(smart_tipo[1].checked) price=26;
            else {no_tipo("Smart");return;}
            */
        }
    smart=smart*price;
    


    
    // MINI
    
    op_index=mini_qty.options.selectedIndex;
    
        if(op_index) 
        {
           
           
           mini=parseInt(mini_qty.options[op_index].text,10);
     
            if(mini_tipo[0].checked) price=49;
            else if(mini_tipo[1].checked) price=49;
            else {no_tipo("Mini");return;}
              
            mini=mini*price;
           
                        
        }
    
    
    // NT LIGHT
    
    
    op_index=ntlight_mth.options.selectedIndex;
        if(op_index) 
        {
           
            light=parseInt(ntlight_mth.options[op_index].text,10);
            
            if(light==3) light=38;
            if(light==6) light=68;
            if(light==12) light=119;
            
            
            if(ntlight_tipo[0].checked) setup=0;
            else if(ntlight_tipo[1].checked)
                {
                 setup=0;
                 if(light==38) light=40;
                 if(light==68) light=72;
                     
                
            } 
            else  {no_tipo("Power Hosting");return;}
            
            //if(!ntlight_tipo[0].checked && !ntlight_tipo[1].checked) {no_tipo("NT Light");return;}
            
            
            //if(light==155) light=119;
            if(ntlight_tipo[0].checked && light==119) light=119;
            //else if(ntlight_tipo[1].checked);
            //else  {no_tipo("NT Light");return;}
            
            light=light+setup;
            op_index=ntlight_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            light=light*op_index;
            
            
        }
    
   // if(op_index) light=parseInt(ntlight_qty.options[op_index].text,10);
   // light=light*155; 
    
    
    op_index=ntlightlinux_mth.options.selectedIndex;
        if(op_index) 
        {
           
            lightlinux=parseInt(ntlightlinux_mth.options[op_index].text,10);
            
            if(lightlinux==3) lightlinux=38;
            if(lightlinux==6) lightlinux=68;
            if(lightlinux==12) lightlinux=119;
            
            
            if(ntlightlinux_tipo[0].checked) setup=0;
            else if(ntlightlinux_tipo[1].checked)
                {
                 setup=0;
                 if(lightlinux==38) lightlinux=40;
                 if(lightlinux==68) lightlinux=72;
                     
                
            } 
            else  {no_tipo("Power Hosting");return;}
            
            //if(!ntlightlinux_tipo[0].checked && !ntlightlinux_tipo[1].checked) {no_tipo("NT lightlinux");return;}
            
            
            //if(lightlinux==155) lightlinux=119;
            if(ntlightlinux_tipo[0].checked && lightlinux==119) lightlinux=79;
            //else if(ntlightlinux_tipo[1].checked);
            //else  {no_tipo("NT lightlinux");return;}
            
            lightlinux=lightlinux+setup;
            op_index=ntlightlinux_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            lightlinux=lightlinux*op_index;
            
            
        }
    
    
    // WEB200
    
    op_index=web200_mth.options.selectedIndex;
    if(op_index) 
        {
            web200=parseInt(web200_mth.options[op_index].text,10);
            
            //web200=web200*26;
            if(web200==3) web200=83;
            if(web200==6) web200=155;
            if(web200==12) web200=239;
            
            
            
            if(web200_tipo[0].checked) {setup=0; if(web200==279) web200=239;} //if(web200==155) web200=120;}
            else if(web200_tipo[1].checked) setup=0;
            else  {no_tipo("Professional Hosting");return;}
            
            web200=web200+setup;

            op_index=web200_qty.options.selectedIndex;
            if(!op_index) op_index=1;
            web200=web200*op_index;
        }
     
     
     // WEB COMMERCE
   
   op_index=webcommerce_mth.options.selectedIndex;
    if(op_index) 
        {
            webcommerce=parseInt(webcommerce_mth.options[op_index].text,10);
            if(webcommerce_tipo[0].checked) setup=0;
            else if(webcommerce_tipo[1].checked) setup=0;
            else  {no_tipo("Web Commerce");return;}
            if(webcommerce==3) webcommerce=362;
            if(webcommerce==6) webcommerce=671;
            if(webcommerce==12) webcommerce=990;
            webcommerce= webcommerce+setup;  
        }
        
        

    
    
    // PROVIDER
    
  op_index=provider_qty.options.selectedIndex;
    if(op_index) 
        {
            provider=parseInt(provider_qty.options[op_index].text,10);
            if(provider_tipo[0].checked) setup=0;
            else if(provider_tipo[1].checked) setup=0;
            else  {no_tipo("Provider");return;}
            provider=provider*1549+setup;
        } 
     
     // MULTIDOMINIO   

/*
  
  op_index=multidominio_qty.options.selectedIndex;
    if(op_index) 
        {
            
            if(multidominio_tipo[0].checked) {setup=0;multidominio=195;}
            else if(multidominio_tipo[1].checked) {setup=0;multidominio=195;}
            else  {no_tipo("Multidominio");return;}
            
            op_index=parseInt(multidominio_qty.options[op_index].text,10);
            multidominio=(multidominio+setup)*op_index;
        }
      
 */     
      // MULTIDOMINIO PLUS
        
    op_index=multidominioplus_qty.options.selectedIndex;
    if(op_index) 
        {
            if(multidominioplus_tipo[0].checked) {setup=0;multidominioplus=450;}
            else if(multidominioplus_tipo[1].checked) {setup=0;multidominioplus=450;}
            else  {no_tipo("Multidominio Plus");return;}
            
            op_index=parseInt(multidominioplus_qty.options[op_index].text,10);
            multidominioplus=(multidominioplus+setup)*op_index;
            
            
        }
        
        
        // MULTIDOMINIO ASP
        
     op_index=multidominioasp_qty.options.selectedIndex;
    if(op_index) 
        {
            if(multidominioasp_tipo[0].checked) {setup=0;multidominioasp=595;}
            else if(multidominioasp_tipo[1].checked) {setup=0;multidominioasp=595;}
            else  {no_tipo("Multidominio ASP");return;}
            
            op_index=parseInt(multidominioasp_qty.options[op_index].text,10);
            multidominioasp=(multidominioasp+setup)*op_index;
            
           
        }             
      
      // MULTIDOMINIO 10
        
     op_index=multidominio10_qty.options.selectedIndex;
    if(op_index) 
        {
            if(multidominio10_tipo[0].checked) {setup=0;multidominio10=850;}
            else if(multidominio10_tipo[1].checked) {setup=0;multidominio10=850;}
            else  {no_tipo("Multidominio 10");return;}
            
            op_index=parseInt(multidominio10_qty.options[op_index].text,10);
            multidominio10=(multidominio10+setup)*op_index;
            
           
        } 
      
      
    op_index=it_qty.options.selectedIndex;
    if(op_index) 
        {
            it=it_qty.options[op_index].text;
            it=it*20; 
        }
        
        
    op_index=com_qty.options.selectedIndex;
    if(op_index) 
        {
            com=com_qty.options[op_index].text;
            if(com_tipo[1].checked) price=55;
            else price=30;
            com=com*price; 
        }                     
    
    
    op_index=info_qty.options.selectedIndex;
    if(op_index) 
        {
            info=info_qty.options[op_index].text;
            info=info*46;
        }  
        
    op_index=tv_qty.options.selectedIndex;
    if(op_index) 
        {
            tv=tv_qty.options[op_index].text;
            tv=tv*93;
        }      
    
    op_index=jp_qty.options.selectedIndex;
    if(op_index) 
        {
            jp=jp_qty.options[op_index].text;
            jp=jp*176;
        }  
     
    
    op_index=wsph_qty.options.selectedIndex;
    if(op_index) 
        {
            wsph=wsph_qty.options[op_index].text;
            wsph=wsph*119;
        }      
   
     op_index=cc_qty.options.selectedIndex;
    if(op_index) 
        {
            cc=cc_qty.options[op_index].text;
            cc=cc*176;
        }   
 
 
    op_index=ftpplus_qty.options.selectedIndex;
    if(op_index) 
        {
            ftpplus=ftpplus_qty.options[op_index].text;
            ftpplus=ftpplus*89; 
        }

/*        
    op_index=mailboxplus_qty.options.selectedIndex;
    if(op_index) 
        {
            mailboxplus=mailboxplus_qty.options[op_index].text;
            mailboxplus=mailboxplus*52; 
        }    
*/
/*    
    op_index=spaceplus200_qty.options.selectedIndex;
    if(op_index) 
        {
            spaceplus200=spaceplus200_qty.options[op_index].text;
            spaceplus200=spaceplus200*190; 
        }   
 */   
    op_index=spaceplus500_qty.options.selectedIndex;
    if(op_index) 
        {
            spaceplus500=spaceplus500_qty.options[op_index].text;
            spaceplus500=spaceplus500*239; 
        }   
/*    
    op_index=spaceplus1000_qty.options.selectedIndex;
    if(op_index) 
        {
            spaceplus1000=spaceplus1000_qty.options[op_index].text;
            spaceplus1000=spaceplus1000*750; 
        }   
*/    
    op_index=sslsupport_qty.options.selectedIndex;
    if(op_index) 
        {
            sslsupport=sslsupport_qty.options[op_index].text;
            sslsupport=sslsupport*52; 
        }   
    
    op_index=shoppingcart_qty.options.selectedIndex;
    if(op_index) 
        {
            shoppingcart=shoppingcart_qty.options[op_index].text;
            shoppingcart=shoppingcart*350; 
        }  
 
 
 
    
    op_index=mysql50_qty.options.selectedIndex;
    if(op_index) 
        {
            mysql50=mysql50_qty.options[op_index].text;
            mysql50=mysql50*121; 
        }  
 
    
 
    op_index=sqlserver50_qty.options.selectedIndex;
    if(op_index) 
        {
            sqlserver50=sqlserver50_qty.options[op_index].text;
            sqlserver50=sqlserver50*304; 
        }  
 
 
    op_index=sqlserver100_qty.options.selectedIndex;
    if(op_index) 
        {
            sqlserver100=sqlserver100_qty.options[op_index].text;
            sqlserver100=sqlserver100*400; 
        }    
 totale=you+smart+ +easy+mini+light+lightlinux+web200+webcommerce+giga+provider+multidominio+multidominioplus+multidominioasp+multidominio10+it+com+info+tv+jp+wsph+cc;
 totale=totale+ ftpplus+mailboxplus+spaceplus200+spaceplus500+spaceplus1000+sslsupport+shoppingcart+mysql50+sqlserver50+sqlserver100
 if(!totale) {alert("Hai dimenticato di indicare il servizio richiesto.");return;}
  

 
 //alert(totale); return;
 
    m_iAA3.value=totale;
    m_iAA3.name="m_iAA*3";

    m_iAA2.value=1;
    m_iAA2.name="m_iAA*2";
    
    m_iAA1.value=0;
    m_iAA1.name="m_iAA*1";   
  
    
    submit();
 }
  
}



function send_form()
{

document.forms['700motori'].elements["Keywords"].value=document.forms['700motori'].elements["Chiave1"].value+","+document.forms['700motori'].elements["Chiave2"].value+","+document.forms['700motori'].elements["Chiave3"].value+","+document.forms['700motori'].elements["Chiave4"].value+","+document.forms['700motori'].elements["Chiave5"].value+","+document.forms['700motori'].elements["Chiave6"].value+","+document.forms['700motori'].elements["Chiave7"].value+","+document.forms['700motori'].elements["Chiave8"].value;
document.forms['700motori'].submit();

}

