function Show(Picture,PictName) {
	document.images[PictName].src=Picture;
};

function showFlayer(url_page, imw, imh) {
			imageWidth = imw;
			imageHeight = imh;
			var posX, posY;
			posX = (window.screen.width/2)-(imageWidth/2);
			posY = (window.screen.height/2)-(imageHeight/2);
			 if (navigator.appName!="Netscape") {
				window.open( url_page, "chart_win", "toolbar=no,scrollbars=yes,directories=no,menubar=no, width="+imageWidth+",height="+imageHeight+",left="+posX+",top="+posY+",resizable=yes" );
			 }
			 else {
				window.open( url_page, "chart_win", "toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+imageWidth+",height="+imageHeight+",screenX="+posX+",screenY="+posY+",resizable=yes" );
			 };
};

// carica css in base al browser .. cambuare eventualm. il nome del file css !
// http://www.jsdir.com/staffscripts/script072.asp
function loadCSS(rootPath) {
	var browser = navigator.userAgent.toLowerCase();
	if (document.layers)
		document.write("<link href='" + rootPath + "nn_stylesheet.css' rel='stylesheet' type='text/css'>") // nn
	else
		if (document.all)
			document.write("<link href='" + rootPath + "stylesheet.css' rel='stylesheet' type='text/css'>") // ie
		else
			if (!document.all && document.getElementById)
				document.write("<link href='" + rootPath + "stylesheet.css' rel='stylesheet' type='text/css'>") // Netscape6/Mozilla
			else
				document.write("<link href='" + rootPath + "stylesheet.css' rel='stylesheet' type='text/css'>") // altri
};

// controlla validazione indirizzo e-mail
function validate_email(in_field) {
	if ( in_field.value != "" ) {
		var ok = -1;
		var temp;
		for (var i = 0; i < in_field.value.length; i++) {
			temp = "" + in_field.value.substring(i, i+1);
			if ((temp=="@") && (i>0) && (i<(in_field.value.length-1))) {ok = ok + 1}
		};
		if (ok != 0) {
			alert("Attenzione, Controllare l'indirizzo e-mail");
			in_field.focus();
			in_field.select();
		};
	};
};

// controlla validazione campo input generico
function validate(in_field, valid, NameObj) {
	if ( in_field.value != "" ) {
		var ok = true;
		var temp;
		var illegal;
		for (var i = 0; i < in_field.value.length; i++) {
			temp = "" + in_field.value.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") {
				ok = false;
				illegal=temp;
			}
		};
		if (!ok) {	alert("Attenzione, Controllare "+NameObj+".\r \""+illegal+"\" č un carattere non consentito per questo campo");
			in_field.focus();
			in_field.select();
		};
		return ok;
	};
};
// controlla validazione invio modulo registrazione utente
function check_send() {
	var ok = true;
	if ( document.contatti.nome.value == "" ) { alert("Il campo Nome non puņ essere vuoto"); ok = false; }
	if ( ok && document.contatti.nome.value == "" ) { alert("Il campo Cognome non puņ essere vuoto"); ok = false; }
	if ( ok && document.contatti.email.value == "" ) { alert("Il campo E-Mail non puņ essere vuoto"); ok = false; }
	if ( ok && document.contatti.info.value == "" ) { alert("Il campo Informazioni non puņ essere vuoto"); ok = false; }
	return ok;
};