function show(Picture,PictName) {
	document.images[PictName].src=Picture;
};

function openPopUp(img, imageWidth, imageHeight, popUpTitle, resWin, scrollWin) {
	var popTxt = "";
	var posX, posY;
	popTxt += "<html> \n";
	popTxt += "<head> \n";
	if (popUpTitle=="") { popTxt += "<title></title> \n"; }
	else {                popTxt += "<title>" + popUpTitle + "</title> \n"; };
	popTxt += "</head> \n";
	popTxt += "<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" bgcolor=\"#ffffff\"> \n";
	popTxt += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\"> \n";
	popTxt += "<tr> \n";
	popTxt += "<td align=\"center\" valign=\"top\"> \n";
	popTxt += "	<a href=\"javascript: window.self.close();\"><img src=\"" + img + "\" border=\"0\"></a> \n";
	if (popUpTitle!="") { popTxt += "<div style='font-family:verdana;font-size:10px;text-align:center;color:#000000'>" + popUpTitle + "</div>"; };
	popTxt += "</td> \n";
	popTxt += "</tr> \n";
	popTxt += "</table> \n";
	popTxt += "</body> \n";
	popTxt += "</html> \n";
	posX = (window.screen.width/2)-(parseInt(imageWidth,10)/2);
	posY = (window.screen.height/2)-(parseInt(imageHeight,10)/2);
	if (popUpTitle!="") { imageHeight = parseInt(imageHeight,10)+30; };
	if (navigator.appName!="Netscape") { opopup_win = window.open( "", "opopup_win", "toolbar=no,scrollbars="+scrollWin+",directories=no,menubar=no,width="+imageWidth+",height="+imageHeight+",left="+posX+",top="+posY+",resizable="+resWin ); }
	else { opopup_win = window.open( "", "opopup_win", "toolbar=no,scrollbars="+scrollWin+",directories=no,menubar=no,width="+imageWidth+",height="+imageHeight+",screenX="+posX+",screenY="+posY+",resizable="+resWin ); };
	opopup_win.document.write(popTxt);
};

// 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;
};