

	function popupDocument(s,w,h){
		var doc = new String(s);
		var dst = new String();
		var pos = doc.lastIndexOf(".")
		var ext = doc.substr(pos,doc.length-pos);
		var res = false;
		var opt = new String();
		if ((w!="") && (w!=undefined)){
			opt=",width="+w;
			if ((h!="") && (h!=undefined)){
				opt+=",height="+h;
			}
		}
		switch (ext){
				case ".jpg":
					res=true;
					dst= doc.substr(0,pos) + ext;
					break;
				case ".jpeg":
					res=true;
					dst= doc.substr(0,pos-1) + ext;
					break;
				default:
					res=false;
					dst=s;
					break;
			}
		

		if (res) {
			var wnd=window.open('about:blank','ing','menubar=no,toolbar=no,status=no,location=no,scrollbars=auto,resizable=yes');
			wnd.document.writeln("<html>");
			wnd.document.writeln("<head>");
			wnd.document.writeln("<title>Ingrandimento</title>");
			wnd.document.writeln("<script language=\"Javascript\">");
			wnd.document.writeln("function dimensionaOttimale(dimx,dimy){");
			wnd.document.writeln("	window.resizeTo(dimx,dimy);");
			wnd.document.writeln("	window.moveTo((screen.width-dimx)/2,(screen.height-dimy)/2);");
			wnd.document.writeln("}</script>");
			wnd.document.writeln("<link rel=\"stylesheet\" href=\"../../../style.css\" type=\"text/css\">");
			wnd.document.writeln("</head>");
			wnd.document.writeln("<body style=\"background-color:white\" scroll=\"auto\"> ");
			wnd.document.writeln("<center>");
			wnd.document.writeln("<table>");
			wnd.document.writeln("<tr>");
			wnd.document.writeln("<td>");
			wnd.document.writeln("<img src=\"../../../images/logogonnelli_piccolo.gif\">");
			wnd.document.writeln("</td>");
			wnd.document.writeln("<td align=\"right\">");
			wnd.document.writeln("<a href=\"#\" onclick=\"window.close()\">close</a>");
			wnd.document.writeln("</td>");
			wnd.document.writeln("</tr>");
			
			wnd.document.writeln("<td colspan=2>");
			wnd.document.writeln("<img src=\"" + dst + "\" onload=\"dimensionaOttimale((this.width+100),(this.height+100))\" >");
			wnd.document.writeln("</td>");
			wnd.document.writeln("</tr>");
			wnd.document.writeln("</table>");
			wnd.document.writeln("</body>");
			wnd.document.writeln("</html>");
		}else{
			var wnd=window.open(s,'doc','menubar=no,toolbar=no,status=no,location=no,scrollbars=yes,resizable=yes' + opt);
		}
	}



	function printPage(){
		var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
		if (isInternetExplorer){
			document.execCommand('Print');
		}else{
			window.print();
		}
	}



	function verificaBrowser(){
		var ws=new Array();
		var i=0;
		var cnt=0;
		var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
		var segnala=false;
		for(i=0;i<ws.length;i++){
			ws[i]="";
		}
		ws[cnt]="<table width='100%' class='VerificaBrowser'>";
		cnt++;
		ws[cnt]="<tr><td><img src='images/warning.gif' align=abs-top>&nbsp;IMPORTANTI INFORMAZIONI SULLA NAVIGAZIONE DEL SITO</td><td><img src='images/warning.gif' align=abs-top>&nbsp;BROWSER SETTINGS INFORMATION</td></tr>"
		if (navigator.userAgent.indexOf("MSIE")<0){
			cnt++;
			ws[cnt]="<tr><td>Il browser potrebbe non essere compatibile. Utilizzare Internet Explorer 5.5 o successive versioni.</td><td>Your browser seems to be not fully compatible with this site. You can browse the site using Internet Explorer 5.5 or higher version.</td></tr>";
			segnala=true;
			
		}
		if (isInternetExplorer){
			if (window.clientInformation.javaEnabled() == false){
				cnt++;
				ws[cnt]="<tr><td>Nessun supporto per Java. Alcune parti del sito potrebbero non essere visualizzate correttamente.</td><td>Java is disabled</td></tr>";	
				segnala=true;
			}
			
		}
		if ((screen.width<1280)|(screen.height<1024)){
			cnt++;
			ws[cnt]="<tr><td>La risoluzione (dimensione) dello schermo non è adeguata. Utilizzare una risoluzione almeno 1280x1024.</td><td>Screen resolution is too low. You may need to increase them at a minimum value of 1280x1024.</td></tr>";
			segnala=true;
		}
		
		if (!detectFlash("8")){
			cnt++;
			ws[cnt]="<tr><td>Il visualizzatore Flash Player deve essere aggiornato alla versione 8.</td><td>The Flash Player must be updated to version 8 or higher.</td></tr>";
			segnala=true;
		}

		if (segnala){
			cnt++;
			ws[cnt]="</table>";
			return (ws.join(""));
		}else{
			return "";
		}
		
	}
	
	function submitForm(p){
		var oForm=document.getElementsByName(p)[0];
		oForm.submit();
	}
	
	function setFrame(frameDoc){
		var sInitDoc="/main.asp?targetPage=";
		if (window.parent.frames.length<=0){
			if (frameDoc!=""){
				sInitDoc=sInitDoc+frameDoc;
			}
			document.location=sInitDoc;		
		}
	}