// Funzione per l'aggiunta del sito ai bookmark e relative variabili

var bookmarkurl = "http://www.forzespecial.it"
var bookmarktitle = "DeltaForce - materiale militare"

function addbookmark() {
	
 if (navigator.appName == "Microsoft Internet Explorer")	 
  window.external.AddFavorite(bookmarkurl, bookmarktitle);
 else
  alert("Per aggiungere questo sito ai tuoi bookmark premere la combinazione di tasti CTRL-D");
  
}

function MM_findObj(theObj, theDoc){
  var p, i, foundObj;
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++){
    foundObj = theDoc.forms[i][theObj];
  }
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++){
    foundObj = findObj(theObj,theDoc.layers[i].document);
  }
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  return foundObj;
}

function pop_up_0(url, name, width, height) {
 settings = "toolbar=no,location=no,directories=no,"+"status=no,menubar=no,scrollbars=yes,"+"resizable=yes,width="+width+",height="+height;
 MyNewWindow = window.open(url, name, settings);
}

function controlla_articolo(form) {
 var form_ok = true;
   
 if (form.quantita.value < 1) {
  form_ok = false;
  alert("La quantità deve essere almeno 1.");
 }
 
 if (form.taglia.value == "-") {
  form_ok = false;
  alert("Scegliere la taglia.");
 }
 
 if (form.colore.value == "-") {
  form_ok = false;
  alert("Scegliere il colore.");
 }
 
 if (form.codice_articolo.value == "-") {
  form_ok = false;
  alert("Scegliere l'articolo.");
 }
 
 
 if (form_ok == true)
 form.submit();
 
}

function controlla_ordine(form) {
 var form_ok = true;
  
 if (form.nome.value == "") {
  form_ok = false;
  alert("E' necessario introdurre il nome del cliente.");
 }
 
 if (form.cognome.value == "") {
  form_ok = false;
  alert("E' necessario introdurre il cognome del cliente.");
 }
 
 if (form.telefono.value == "") {
  form_ok = false;
  alert("E' necessario introdurre il numero di telefono della azienda");
 }
 
 if (form.indirizzo.value == "") {
  form_ok = false;
  alert("E' necessario introdurre l'indirizzo del cliente.");
 }
 
 if (form.numero_civico.value == "") {
  form_ok = false;
  alert("E' necessario specificare il numero civico relativo all'indirizzo del cliente.");
 }
 
 if (form.citta.value == "") {
  form_ok = false;
  alert("E' necessario introdurre la citta' del cliente.");
 }
 
 if (form.cap.value == "") {
  form_ok = false;
  alert("E' necessario introdurre la cap.");
 }
 
 if (form.provincia.value == "") {
  form_ok = false;
  alert("E' necessario introdurre la provincia.");
 }
 if (form.stato.value == "") {
  form_ok = false;
  alert("E' necessario introdurre lo stato.");
 }
 
 if (form.accetto.checked == "") {
  form_ok = false;
  alert("E' necessario accettare i termini di legge prima di inviare il modulo");
 }
 
 if (form_ok == true)
 form.submit();
 
}
