function navMenu(pag){
	document.getElementById("m"+pag).style.color = "#c00";
// 	document.getElementById("m"+pag).style.fontSize = "12px";
	//document.getElementById("m"+pag).style.fontWeight = "bold";
}


function stampa(){
	var a = window.open('','','width=800, height=600, scrollbars=yes');
	a.document.open("text/html");
	a.document.write(document.getElementById('divStampa').innerHTML);
	a.document.close();
	a.print();
	a.close();
}


function checkPaypal(val){
	var strValidChars = "0123456789.-";
    var strChar;
	var str = document.getElementById('paypalForm').quantity.value;
    
    for (i=0; i<str.length; i++){
		strChar = str.charAt(i);
		if(strValidChars.indexOf(strChar) == -1){
			document.getElementById('paypalForm').quantity.value = 1;
        }
    }
	
	titolo = val + " [ prenotato per il "+document.getElementById('paypalForm').dataTour.value+" ] ";
	document.getElementById('paypalForm').item_name.value = titolo;
}


//inizio EVENTI ___________________________________________________
function controllo(val){
 	var intQtaRes = document.getElementById("QRes"+val).value;
 	var intQtaIns = document.getElementById("QIns"+val).value;
	intQtaRes = intQtaRes * 1;
	intQtaIns = intQtaIns * 1;
	
	if(intQtaIns > intQtaRes){
		document.getElementById("QIns"+val).style.color = "#FF0000";
		document.getElementById("QIns"+val).value = intQtaRes;
		return false;
	}
	
	if(intQtaIns == 0){
		document.getElementById("QIns"+val).style.color = "#FF0000";
		document.getElementById("QIns"+val).value = intQtaRes;
		return false;
	}
	
	return IsNumeric(val);
}

function IsNumeric(val){
    var strValidChars = "0123456789.-";
    var strChar;
	var str = document.getElementById("QIns"+val).value;
	var intQtaRes = document.getElementById("QRes"+val).value;
    
    for (i=0; i<str.length; i++){
		strChar = str.charAt(i);
		if(strValidChars.indexOf(strChar) == -1){
			document.getElementById("QIns"+val).style.color = "#FF0000";
			document.getElementById("QIns"+val).value = intQtaRes;
			return false;
        }
    }
    
	document.getElementById("QIns"+val).style.color = "#000000";
	return true;
}
//fine EVENTI


//<![CDATA[
// function load(nome, coordinate){
// 	nuoveCoordinate = coordinate.split("/");
// 	latitudine = nuoveCoordinate[0];
// 	longitudine = nuoveCoordinate[1];
// 	
// 	if (GBrowserIsCompatible()){
// 		var map = new GMap2(document.getElementById("map"));
// 		map.addControl(new GLargeMapControl());
// 		map.addControl(new GMapTypeControl());
// 		map.addControl(new GOverviewMapControl());
// 		map.setCenter(new GLatLng(latitudine, longitudine), 14);
// 		var icon1 = new GIcon();
// 		icon1.shadow = "images/mm_20_shadow.png";
// 		icon1.iconSize = new GSize(32, 22);
// 		icon1.shadowSize = new GSize(22, 20);
// 		icon1.iconAnchor = new GPoint(16, 11);
// 		icon1.infoWindowAnchor = new GPoint(5, 1);
// 		var marker = new GMarker(map.getCenter());
// 		GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml("<img src='immagini/header/logo-mappa.png' alt='' />");});
// 		map.addOverlay(marker);
// 		GEvent.trigger(marker, "click");
//  	}
// }
//]]>

// var galleriaFileTotale;
// tb_pathToImage = livelliPercorso + "immagini/carosello/loading-thickbox.gif";
// 
// function mycarousel_itemLoadCallback(carousel, state){
//     if (carousel.has(carousel.first, carousel.last)){
//         return;
//     }
// 	
//     $.get(
//         livelliPercorso+'moduli/carica-galleria.php',
//         {
//         	id:$('#idVoceCatalogo').val(),
//             first: carousel.first,
//             last: carousel.last
//         },
//         function(xml){
//              mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
//         },
//         'xml'
//     );
// }
// 
// function mycarousel_itemAddCallback(carousel, first, last, xml){
//     galleriaFileTotale = parseInt($('total', xml).text());
//     carousel.size(galleriaFileTotale);
//     
// 	$('image', xml).each(function(i){
// 		var item = $(mycarousel_getItemHTML($(this).text())).get(0);
// 		tb_init(item);  // applico il thickbox
// 		carousel.add(first + i, item);
// 	});
// }
// 
// function mycarousel_getItemHTML(url){
// 	var extFile = url.split('.').pop(); // recupero l'estensione del file
// 	var nomeFile = url.substring(0, url.indexOf('.'+extFile)); // recupero il nome del file, eliminando l'estensione
// 	return '<a href="' + livelliPercorso + 'file/galleria/' + $('#idVoceCatalogo').val() + '/g/' + url + '" title="' + nomeFile + '"><img src="' + livelliPercorso + 'file/galleria/' + $('#idVoceCatalogo').val() + '/p/' + url + '" width="100" height="100" alt="' + url + '" /></a>';
// }



