//questa funzione serve nel menu per la viualizzazione 
//della fraccia a fianco al menu
function changeStyle(id,blnOn)
{
var eForm = document.getElementById(id);
if (blnOn==1)
	eForm.src = "/img/freccia.gif";
else
	eForm.src = "/img/spaziomenu.gif";
}

//apre l'immagine passata all'interno della pagina nell'objCustum ZoomInPage
// se type e F visulizzo il flash, se I visualizzo una immagine
function switchImage(imgPath, imgId, Type, imgFlash){
	var curImg = document.getElementById(imgId);
		
	if (Type == "I"){		
	
			var Immagine = "<table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td>";		
			Immagine += "<img src='" + imgPath + "' border='0' id='idImm' >";
			Immagine += "</td></tr><tr><td bgcolor='#c4c4c4' class='foglio3' >";	
			Immagine += "<table cellpadding='3' cellspacing='0' border='0' width='100%'><tr><td>";	
			Immagine += "<input type='image'  id='VimgBtnClose' src='/img/close1.gif'  border='0' />";	
			Immagine += "</td><td align='left'><a class='foglio3' href=javascript:switchImage('" + imgFlash + "','" + imgId + "','F');>CLOSE</a></td>";	
			Immagine += "<td align='right' width='90%'></td>";	
			Immagine += "</tr></table></td></tr></table>";				
		
			curImg.innerHTML = Immagine;
					
		}else{
			var Immagine = "<table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td>";
			Immagine += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='383' height='169' id='ShockwaveFlash1'>";
			Immagine += "<param name='movie' value='" + imgPath + "'>";
			Immagine += "<param name='quality' value='high'>";
			Immagine += "<embed src='" + imgPath + "' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='383' height='169'>";
			Immagine +="</embed>";
			Immagine +="</object>";
			Immagine += "</td></tr></table>";	
			
			curImg.innerHTML = Immagine;	
		}
}


function OpenZoomWindow(sImg,sTitle,sWidth,sHeight,sClose,sDescription){
	if(sClose==null) sClose = "close";
	var sTotHeight;
	if(sDescription!=null && sDescription!='')
		sTotHeight = (sHeight/1+40);
	else
		sTotHeight = (sHeight/1+17);
	var oWin = window.open('','','status=0,scrollbars=0,height=' + sTotHeight + 'px,width='+sWidth+'px');
	var sHtml = '<html>\n';
	sHtml += '<head><title>' + sTitle + '</title>\n';
	sHtml += '<style type=\"text/css\">\n';
	sHtml += '.fntDefault { text-decoration: none; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #514C3C }\n';
	sHtml += '</style>\n</head>\n';
	sHtml += '<body bgcolor=\"#ffffff\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n';
	sHtml += '<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n';
	sHtml += '<tr><td align=\"center\" valign=\"middle\"><img border=\"0\" src=\"'+sImg+'\"></td></tr>\n';
	if(sDescription!=null && sDescription!=''){
		sHtml += '<tr height=\"15\" style=\"padding:4px\"><td align=\"left\" valign=\"top\" class=\"fntDefault\">' + sDescription + '</td></tr>\n';
	}
	sHtml += '<tr height=\"2\"><td bgcolor=\"#F4F4F4\"><img src=\"img/shared/np.gif\" height=\"2\"></td></tr>\n';	
	sHtml += '<tr height=\"15\"><td bgcolor=\"#F4F4F4\" align=\"right\" valign=\"middle\" class=\"fntDefault\"><a class=\"fntDefault\" href=\"javascript:window.close()\">' + sClose + '</a>&nbsp;&nbsp;</td></tr>\n';
	sHtml += '</table>\n';
	sHtml += '</body>\n';
	sHtml += '</html>';
	oWin.document.write(sHtml);
}
function voidFunction(){
	//ie bug
	
}
function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function changeImageBox(v_strImageBoxName,v_strImage){
	var objImageBox = findObj(v_strImageBoxName);
	//var objImageBox = window.document.imageBox;
	objImageBox.SetVariable("_root.imageToLoad", v_strImage);
	objImageBox.GoToFrame(1);
}
function npwidthmax(){
	//calcola width della pagina, toglie larghezza menu sinistra e larghezza menu destra return (la differenza)
	size = parseInt(window.innerWidth) - 440;
	return size;
}
function credits(){
	window.open("credits.htm","credits","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=320,height=140");
}
function PopUpWindow(v_strFile,v_strWidth,v_strHeight){
	window.open(v_strFile,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + v_strWidth + ",height=" + v_strHeight);
}