function getElement(id){
return (typeof document.getElementById != "undefined")?document.getElementById(id):document.all[id];
}

function showHide(id){
div = getElement(id);
div.style.visibility = (div.style.visibility=="" || div.style.visibility=="visible")?"hidden":"visible";
}



function scambio(id){
	 if (document.getElementById){
    		if(document.getElementById(id).style.display == 'none'){
      			document.getElementById(id).style.display = 'block';
    		} else {
      			document.getElementById(id).style.display = 'none';
    		}
  	}
}

var bookmarkurl="http://www.webmatica.it";
var bookmarktitle="WebMatica- Web Agency in Milano";

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

function verifica_contatto() 
   { 
   if (document.forms['invio']['contatto'].value=='Inserisci email o telefono' ) 
      { 
      alert("Attenzione: devi inserire un indirizzo di posta elettronica oppure un numero di telefono valido "); 
      document.forms['invio']['contatto'].focus(); 
      return false; 
     } 
   
    if (document.forms['invio']['contatto'].value=='' ) 
      { 
      alert("Attenzione: devi inserire un indirizzo di posta elettronica oppure un numero di telefono valido "); 
      document.forms['invio']['contatto'].focus(); 
      return false; 
   	  }
   
  ////
  
   if (document.forms['invio']['nome'].value=='Inserisci il tuo nome' ) 
      { 
      alert("Attenzione: devi inserire il tuo nome")
      document.forms['invio']['nome'].focus(); 
      return false; 
     } 
   
    if (document.forms['invio']['nome'].value=='' ) 
      { 
      alert("Attenzione: devi inserire il tuo nome "); 
      document.forms['invio']['nome'].focus(); 
      return false; 
     } 	 
	   
   return true;  
  }   


function checkCheckBox(f){

if (f.privacy.checked == false )
{
alert('Devi accettare l informativa.');
return false;
}else
return true;
}

  
  
function openwindow(str) {

        searchWin = window.open(str,'openwindow','scrollbars=yes,resizable=no,width=700,height=500,status=no,location=no,toolbar=no,menubar=no,directories=no,top=10,left=10');

//        searchWin.refer = self;

}
function openwindowcalc(str) {

        searchWin = window.open(str,'openwindowcalc','scrollbars=no,resizable=no,width=275,height=370,status=no,location=no,toolbar=no,top=200,left=110');

//        searchWin.refer = self;

}
function openwindowdatabasepaste(str) {

        searchWin = window.open(str,'openwindowdatabasepast','scrollbars=yes,resizable=no,width=850,height=400,status=no,location=no,toolbar=no,top=30,left=10');

//        searchWin.refer = self;

}

function openwindowdatabasedetails(str) {

        searchWin = window.open(str,'openwindowdatabasedetails','scrollbars=yes,resizable=no,width=500,height=500,status=no,location=no,menubar=no,directories=no,toolbar=no,top=150,left=150');

//        searchWin.refer = self;

}
function cutepaste(str){    window.open(str,'cutepaste','scrollbars=yes,resizable=no,width=850,height=450,status=no,location=no,toolbar=no,top=30,left=10');
}

// incolla massa

function urlimg(valoreparametro) { document.getElementById("massa").value = valoreparametro; }
			  
// incolla larghezza

function urlimg2(valoreparametro) { document.getElementById("lunghezza").value = valoreparametro; }
				  
// incolla lunghezza

function urlimg3(valoreparametro) { document.getElementById("larghezza").value = valoreparametro; }

// incolla passo

function urlimg4(valoreparametro) { document.getElementById("passo").value = valoreparametro; }

// incolla massa2

function urlimg5(valoreparametro) { document.getElementById("massa2").value = valoreparametro; }
			  
// incolla larghezza2

function urlimg6(valoreparametro) { document.getElementById("lunghezza2").value = valoreparametro; }
				  
// incolla lunghezza2

function urlimg7(valoreparametro) { document.getElementById("larghezza2").value = valoreparametro; }

// incolla passo2

function urlimg8(valoreparametro) { document.getElementById("passo2").value = valoreparametro; }

// incolla veicoloa

function urlimg9(valoreparametro) { document.getElementById("veicoloa").value = valoreparametro; }

// incolla veicolob

function urlimg10(valoreparametro) { document.getElementById("veicolob").value = valoreparametro; }
