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

var bookmarkurl = "http://www.navyequipment.com"
var bookmarktitle = "NavyEquipment: Vendita on line di abbigliamento nautico."

function addbookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

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();
 else 
 	return false;
 
}
function empty( mixed_var ){	return ( mixed_var === "" || mixed_var === 0   || mixed_var === "0" || mixed_var === null  || mixed_var === false  ||  mixed_var === undefined || mixed_var.length === 0  );};function add_cart4(a) {	if(empty($('#footer').html())) {		alert("Attendere il completo caricamento della pagina");		return false;	};	var title = "Carrello di Avventuroso";		var orderCode = a.codice.value;	var quantity = a.quantita.value;	var prezzo = a.prezzo.value;	var nome = a.nome.value;	var taglia = a.taglia.value;	var colore = a.colore.value;	var colore_taglia = a.colore_taglia.value;	var codice_articolo = a.codice_articolo.value;	var id_articolo = a.id_articolo.value;	var Riservato = a.Riservato.value;	if(quantity<1) {alert("La quantità deve essere almeno 1.");return false;}	if(taglia== "-") {alert("Scegliere la taglia.");return false;}	if(colore== "-") {alert("Scegliere il colore.");return false;}	if(codice_articolo== "-") {alert("Scegliere l'articolo.");return false;}	if(colore_taglia== "-") {alert("Scegliere il colore e la taglia.");return false;}	var url = "/cart_action.php?order_code=" + orderCode + "&quantity=" + quantity + "&prezzo=" + prezzo +"&taglia=" + taglia +"&colore=" + colore +"&colore_taglia=" + colore_taglia+"&codice_articolo=" + codice_articolo+"&id_articolo=" + id_articolo+"&Riservato=" + Riservato + "&nome=" + escape(nome) + "&TB_iframe=true&height=400&width=780";	tb_show(title, url, false);		return false;};
function controlla_ordine(form) { var form_ok = true; if (form.tesserino.value == "") {  form_ok = false;  alert("E' necessario introdurre il tesserino del cliente."); } 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.tipo_pagamento.checked == "") {  form_ok = false;  alert("E' necessario introdurre il tipo di pagamento che vuole effettuare il cliente."); } 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(); else return false;};
function controlla_ordine_usr(form) {	  	if (  !form.user.value.match (/^[a-z0-9_\-\.]+@[a-z0-9]+[a-z0-9_\-\.]*\.[a-z]{2,}$/ ) || form.user.length > 256 || form.user.value == "" ) {	  alert("E' necessario introdurre un email corretta.");		return false;	};	if (form.pwd.value == "") {	  alert("E' necessario introdurre la password.");		return false;	}; };function check_cart(form){	var form_ok = false;		for (i=0; i<form.tipo_pagamento.length; i++) {		if(form.tipo_pagamento[i].checked) form_ok =true;	  } ;	if (form_ok == true) form.submit();	else{	 			alert('Errore: E\' necessario introdurre il tipo di pagamento .');            	      return false;	};  };