// JavaScript Document
//function paginaSucc(pagina, cat, lingua){
//document.location.href = "cat.asp"+"?page="+pagina+"&idC="+cat+"&l="+lingua
//}

function paginaSucc_paginazione_articoli(pagina, nomeCat, lingua){
document.location.href = "/"+lingua+"/cat/"+nomeCat+"/index_"+pagina+".htm"
}


//function paginaSucc_paginazione_ricerca(pagina){
//document.pagRicerca.pagina.value = pagina
//document.pagRicerca.submit();
//}

function paginaSucc_paginazione_ricerca(pagina, lingua){
document.location.href = "/"+lingua+"/catalogo/pag_"+pagina+".htm"
}


//aggiumgi ai preferiti
function addbookmark(url, title){
	var bookmarkurl = url
	var bookmarktitle = title
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

//per img gallery
function popUp(url,name,features){
html = '<HTML>\n<HEAD>\n<TITLE> GALLERIA </TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=20>\n<CENTER><IMG SRC="'+url+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width,document.imageTest.height + 100)"></CENTER>\n</BODY>\n</HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,statusbar=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
}


//per carrello

function addQty(fObj){
 var re = /^[0-9]/
 var str = fObj.qty.value
 if(!re.test(str)){
  alert("Inserire quantità");
  return false;
 }
 return true;
}

function popUpStampaScheda(theURL,winName,features) { 
window.open(theURL,winName,features);
}


	
	///per registrazione utenti
	
	function inviaFormRegistrazione(){
	
	
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.nome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.cognome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cognome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.ditta.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Ditta.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.city.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Città.");
		return;
		
		}
		
		var re = /^[0-9]/
		var str = document.nuoviUtenti.tel.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Telefono.");
		return;
		
		}
		
		var re = /^[0-9]/
		var str = document.nuoviUtenti.fax.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Fax.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.mail.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo E-mail.");
		return;
		
		}


		var re =/^[A-Za-z0-9]/
		var str = document.nuoviUtenti.indirizzo.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Indirizzo.");
		return;
		
		}
	
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.username.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Login.");
		return;
		
		}

		var re = /^[A-Za-z0-9]{6,10}/
		var str = document.nuoviUtenti.pwd.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Password.");
		return;
		
		}
		
	if(document.nuoviUtenti.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}
	
	document.nuoviUtenti.submit();
	}


	///controlla form contatti
	
	function inviaFormContatti(){
	
	
		var re = /^[A-Za-z0-9]/
		var str = document.contatti.nome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.contatti.cognome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cognome.");
		return;
		
		}
		
		
		//var re = /^[A-Za-z0-9]/
		//var str = document.contatti.city.value
		//if(!re.test(str)){
		//alert("Compilare correttamente il campo Città.");
		//return;
		
		//}
		
		var re = /^[0-9]/
		var str = document.contatti.tel.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Telefono.");
		return;
		
		}
		
		
		var re = /^[A-Za-z0-9]/
		var str = document.contatti.mail.value
		if(!re.test(str)){
		alert("Compilare il campo E-mail.");
		return;
		
		}


	
		
	if(document.contatti.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}
	
	document.contatti.submit();
	}


//Google map----------------------------------------------------------
   

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.setCenter(new GLatLng(41.887149,12.697657), 10);

        // Create our "tiny" marker icon
        var icon = new GIcon();
        icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        icon.iconSize = new GSize(12, 20);
        icon.iconAnchor = new GPoint(10, 8);
        icon.infoWindowAnchor = new GPoint(15, 1);
		

		//var point = new GLatLng(41.569353,12.8613);		
		var point = new GLatLng(41.887149,12.697657);		
		function createMarker_1(point) {
		var marker = new GMarker(point, icon);
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml("<b>Muller Centro Rattan</b><br>Via Guasila, 8 - 00132 Roma (RM) <br> Tel.: 06.2261643 ");
		});
		return marker;
		}
		
        map.addOverlay(createMarker_1(point));
		
		
      }
    }
	

//-------------------FINR GOOGLE MAP----------------------------------------------------------------------------------------------------------------
