// (c)2001 robertolucarda@hotmail.com

var n=0, d=document;
d.BOB_images=new Array();

function BOB_errorImage (imgName1, mypath) {
	//alert(imgName1);
	if ((x = BOB_findObj(imgName1, d)) != null) {
		x.src = mypath + "image/copertine/blanc.gif";
		
	}
}

function BOB_pluginShockwave () {
//Look for a version of Internet Explorer that supports ActiveX (i.e., one that's
//running on a platform other than Mac or Windows 3.1) or a browser that supports
//the plugin property of the navigator object and that has Flash Player 2.0
//installed.
	if ((navigator.appName == "Microsoft Internet Explorer" &&
    navigator.appVersion.indexOf("Mac") == -1 && navigator.appVersion.indexOf("3.1") == -1) 
	|| (navigator.plugins && navigator.plugins["Shockwave Flash"])
                       || navigator.plugins["Shockwave Flash 2.0"]) {
   		//Load a pre-defined HTML page with Flash Player in it into the browser window.
    	return true;
	} else {
    	return false;
	}	
}

function BOB_updateFrame(myPage, myFrame, nParent) {
	var i;
	var myWin;
	
	myWin = self.parent;
	for (i=1;i< nParent;i++) {
		myWin = myWin.parent;
	}
	myWin.frames[myFrame].location = myPage
}

function BOB_checkForm(lingua) {
	if (document.bob_formo.name.value == "") {
		if (lingua == "ita") alert ("Il campo [Nome] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [Name] is required!")
		else alert ("The field [Name] is required!");
		document.bob_formo.name.focus()
	} else {
	if (document.bob_formo.surname.value == "") {
		if (lingua == "ita") alert ("Il campo [Cognome] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [Surname] is required")
		else alert ("The field [Surname] is required");
		document.bob_formo.surname.focus()
	} else {
	if (document.bob_formo.address.value == "") {
		if (lingua == "ita") alert ("Il campo [Indirizzo] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [Address] is required")
		else alert ("The field [Address] is required");
		document.bob_formo.address.focus()
	} else {
	if (document.bob_formo.city.value == "") {
		if (lingua == "ita") alert ("Il campo [Città] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [City] is required")
		else alert ("The field [City] is required");
		document.bob_formo.city.focus()
	} else {
	if (document.bob_formo.zip.value == "") {
		if (lingua == "ita") alert ("Il campo [CAP] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [ZIP] is required")
		else alert ("The field [ZIP] is required");
		document.bob_formo.zip.focus()
	} else {
	if (document.bob_formo.country.value == "") {
		if (lingua == "ita") alert ("Il campo [Stato] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [Country] is required")
		else alert ("The field [Country] is required");
		document.bob_formo.country.focus()
	} else {
	//Joe's add - codice fiscale, partita iva
	if (document.bob_formo.codfisc.value == "") {
		if (lingua == "ita") alert ("Il campo [Codice Fiscale] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [National Insurance Number] is required")
		else alert ("The field [Fiscal Code] is required");
		document.bob_formo.codfisc.focus()
	} else {
	//Joe's add - codice fiscale, partita iva
	if ((document.bob_formo.email.value == "") || ((document.bob_formo.email.value).indexOf("@")==-1)) {
		if (lingua == "ita") alert ("Il campo [e-mail] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [e-mail] is required")
		else alert ("The field [e-mail] is required");
		document.bob_formo.email.focus()
	} else {
	if (document.bob_formo.phone.value == "") {
		if (lingua == "ita") alert ("Il campo [Telefono] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [Phone] is required")
		else alert ("The field [Phone] is required");
		document.bob_formo.phone.focus()
	} else {
	//if (document.bob_formo.cc[0].checked == false && document.bob_formo.cc[1].checked == false) {	
	if (document.bob_formo.cc.checked == false) {			
		if (lingua == "ita") alert ("Il campo [Pagamento] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [Payment] is required")
		else alert ("The field [Payment] is required");
		//document.bob_formo.cc[0].focus()
		document.bob_formo.cc.focus()
	} else {
	if (document.bob_formo.Carrier[0].checked == false && document.bob_formo.Carrier[1].checked == false && document.bob_formo.Carrier[2].checked == false && document.bob_formo.Carrier[3].checked == false && document.bob_formo.Carrier[4].checked == false && document.bob_formo.Carrier[5].checked == false) {	
		if (lingua == "ita") alert ("Il campo [Corriere] è obbligatorio!")
		else if (lingua == "eng") alert ("The field [Carrier] is required")
		else alert ("The field [Carrier] is required");
		document.bob_formo.Carrier[0].focus()
	} else {
	//if (document.bob_formo.cc[0].checked == true && document.bob_formo.Carrier[0].checked == false && document.bob_formo.Carrier[2].checked == false) {	
	if (document.bob_formo.cc.checked == true && document.bob_formo.Carrier[0].checked == false && document.bob_formo.Carrier[2].checked == false) {	
		if (lingua == "ita") alert ("Il corriere scelto impone il pagamento con Carta di Credito!")
		else if (lingua == "eng") alert ("The Carrier selected require the Credit Card!")
		else alert ("The Carrier selected require the Credit Card!")
	} else {
		document.bob_formo.submit()
	}}}}}}}}}}}}
}

function BOB_checkForm2(lingua) {
	
	var i, sName;
	for (i=0;i < document.bob_formo.length; i++) {
		sName = document.bob_formo.elements[i].name;
		
		if (sName.charAt(0) != "_") {
			//alert("sName: " + sName)
		
			// aggiornamento 14/04/2002
			if (document.bob_formo.elements[i].value == "") {			
				if (lingua == "ita") alert ("Il campo  [ " + sName + " ]  è obbligatorio!")
				else if (lingua == "eng") alert ("Please compile the [ " + sName + " ]  obligatory field!")
				else alert ("...");
				
				document.bob_formo.elements[i].focus();
				
				break
			} else {
				if ((sName == "email") && ((document.bob_formo.email.value).indexOf("@")==-1)){
					if (lingua == "ita") alert ("L'email inserita non è valida!")
					else if (lingua == "eng") alert ("Please insert a valid e-mail address!")
					else alert ("...");
					
					document.bob_formo.email.focus();
					
					break
				}
			}

		}
	}
	
	return (i == document.bob_formo.length)
}

function BOB_showWindow(pagina, finestra, scrollbars, wide, high, top, left) {
	parameters = 'scrollbars=' + scrollbars + ',width=' + wide + ',height=' + high + ',top=' + top + ',left=' + left;
	window.open(pagina,finestra,parameters)
}


function BOB_preloadImages(imgName, imgSrc1, imgSrc2) {
  if (d.images){
	
	d.BOB_images[n] = new Array(3);
	
	d.BOB_images[n][0] = imgName;
	
	d.BOB_images[n][1] = new Image();
	d.BOB_images[n][1].src = imgSrc1;	
	
	if (imgSrc2) {
		d.BOB_images[n][2] = new Image();
		d.BOB_images[n][2].src = imgSrc2;
	}
	
	n++;
	
  }
}


function BOB_findObj(imgName, d1) {
  var p,i,x;
  
  if (!d1) d1=document;
  
  if ((p=imgName.indexOf("?"))>0 && parent.frames.length) {
    d1=parent.frames[imgName.substring(p+1)].document; 
	n=imgName.substring(0,p);
  }

  if (!(x=d1[imgName]) && d1.all) x=d1.all[imgName];
  
  //for (i=0;!x && i<d1.forms.length;i++) x=d1.forms[i][n];
  
  //for(i=0;!x && d1.layers && i<d1.layers.length;i++) x=BOB_findObj(imgName,d1.layers[i].document);
  
  return x;
}


function BOB_offImage(imgName) {
  var i, x;
  if (d.images && d.BOB_images) {
		if ((x = BOB_findObj(imgName, d)) != null) {
			  for (i=0;i<n;i++) {				
				if (d.BOB_images[i][0] == imgName) {
					x.src = d.BOB_images[i][1].src					
				}
			}
		}
   }
}


function BOB_onImage(imgName) {
  var i, x;
  if (d.images && d.BOB_images) {
		if ((x = BOB_findObj(imgName, d)) != null) {
			  for (i=0;i<n;i++) {				
				if (d.BOB_images[i][0] == imgName) {
					x.src = d.BOB_images[i][2].src
				}
			}
		}
   }
}


function click() {
	if (event.button==2) { 
		alert(' Sorry the right button has been blocked !');
	}
}

//document.onmousedown=click;