function voidFunction(){
	//ie bug
}

function credits(){
	window.open("credits.htm","credits","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=320,height=140");
}

function getObject(v_strIdImage){
	var vObj;
	
	var strBrowserName = whatbrowser();
	
	switch(strBrowserName){
		case "NN6":
		case "NN4":{
			vObj = document.getElementById(v_strIdImage);
			break;
		}
		case "ie4":
		case "ie6":
		case "ieMac":{
			vObj = document.all(v_strIdImage);
			break;
		}
		default:{
			vObj = document.all(v_strIdImage);
		}
	}
	
	return(vObj);
}


//whatbrowser()
//
//determina con quale browser l'utente è collegato e restituisce la sigla corrispondente
//
//argomenti:
//	nessuno
//
//valore di ritorno:
//	stringa	=	sigla corrispondente al browser con cui l'utente è collegato
//				NN4	=	netscape4
//				NN6	=	netscape6
//				ie	=	internet explorer
function whatbrowser(){
	var thisbrowser = "";	//sigla del browser utilizzato dall'utente
	var strAppVersion = navigator.appVersion;

	var blnIsIe4 = (strAppVersion.indexOf("MSIE 4") == -1) ? 0 : 1;
	var blnIsIe5 = (strAppVersion.indexOf("MSIE 5") == -1) ? 0 : 1;
	var blnIsIe6 = (strAppVersion.indexOf("MSIE 6") == -1) ? 0 : 1;
	var blnIsMac = (strAppVersion.indexOf("Macintosh") == -1) ? 0 : 1;
	
	//interrogo l'oggetto document per capire quale broeser sta utilizzando l'utente
    if(document.layers){
        thisbrowser="NN4";
    }
    if(document.all){
         if(blnIsIe4 == 1 || blnIsIe5==1) thisbrowser="ie4";
         else if(blnIsIe6 == 1) thisbrowser="ie6";
         else if(blnIsMac == 1) thisbrowser="ieMac";
         else thisbrowser="ie";
         
         //alert(thisbrowser);
    }
    if(!document.all && document.getElementById){
         thisbrowser="NN6";
    }
    
    return(thisbrowser);
}

//npwidthmax()
//
//calcola width della pagina, toglie larghezza menu sinistra e larghezza menu 
//destra return (la differenza)
function npwidthmax(){
	size = parseInt(window.innerWidth) - 161;
	return size;
}


function MM_preloadImages() {
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function OpenImageZoomWindow(v_strIdImage,v_strTitle,v_strCharatteristics)
{
	var l_strZoomPageUrl = "";
	l_strZoomPageUrl = "tools/ZoomWindow.aspx?img=" + v_strIdImage + "&title=" + escape(v_strTitle) + "&chrt=" + escape(v_strCharatteristics);
	window.open(l_strZoomPageUrl,"zoomImage","dependent=no,Height=0,Width=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no");
}

function createMedia(mediaType,src,width,height,bgcolor,wmode,swliveConn,embedMovie){
    //si tratta di flash
    if (mediaType == 0){
		if (navigator.appVersion.indexOf("MSIE") != -1){
			var strContent = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
			//se non sono definiti width e height ==> non li setto
			if (width != "") strContent += 'width="' + width + '" ';
			if (height != "") strContent += 'height="' + height + '"';
			strContent += '>';
			strContent += '<param name="movie" value="'+src+'">';
			strContent += '<param name="quality" value="high">';
			strContent += '<param name="bgcolor" value="'+bgcolor+'" />';
			strContent += '<param name="wmode" value="'+wmode+'">';
			
			if (swliveConn != "") strContent += '<param name="SwLiveConnect" value="'+swliveConn+'">';
			if (embedMovie != "") strContent += '<param name="EmbedMovie" value="'+embedMovie+'">';
			
			strContent += 'Flash plug-in not installed.';
			strContent += '</object>';
			document.write(strContent);
		}else{
			document.write('<object type="application/x-shockwave-flash" data="'+src+'" ');
			
			//se non sono definiti width e height ==> non li setto
			if (width != "") document.write('width="'+width+'" ');
			if (height != "") document.write('height="'+height+'" ');
			
			document.write('wmode="'+wmode+'" bgcolor="'+bgcolor+'" ');
			
			if (swliveConn != "") document.write('SwLiveConnect="'+swliveConn+'" ');
			if (embedMovie != "") document.write('EmbedMovie="'+embedMovie+'"');
			
			document.write('>Flash plug-in not installed.</object>');
		}
	}
}

function switchImage(imgPath, imgId){
	var curImg = document.getElementById(imgId);
	curImg.src = imgPath;
}

function OpenWin(path,name)
{
	window.open(path,name,"dependent=no,Height=600,Width=800,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no");
}
