function OpenZoomWindow(sImg,sTitle,sWidth,sHeight){
	var oWin = window.open('','','status=0,scrollbars=0,height='+(sHeight/1+17)+'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+'\"  alt=\"'+sImg+'\"></td></tr>\n';
	sHtml += '<tr height=\"2\"><td bgcolor=\"#EBEAE5\"><img src=\"img/shared/np.gif\" height=\"2\" alt=\"\"></td></tr>\n';
	sHtml += '<tr height=\"15\"><td bgcolor=\"#F8F7F1\" align=\"right\" valign=\"middle\" class=\"fntDefault\"><a class=\"fntDefault\" href=\"javascript:window.close()\">close</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,v_strResizable){
	if(v_strResizable==null)
		v_strResizable = "no";
	window.open(v_strFile,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=" + v_strResizable + ",width=" + v_strWidth + ",height=" + v_strHeight);
}
function goToAnchor(v_strAnchorID){
	document.location.href = "#" + v_strAnchorID
}
function OpenPrintWindow(v_strURLPrint){
	var oWin = window.open(v_strURLPrint,'winPrint','status=0,scrollbars=1,width=550px,height=400px');
	oWin.focus();
}
function LoadDataToPrint(){
	/*
	var objDest = document.getElementById('tdPrint');
	if(objDest!=null){
		var arrSources = new Array();
		arrSources[0] = 'tdPrint';
		arrSources[1] = 'tdPrint1';
		arrSources[2] = 'tdPrint2';
		var i=0;
		for(i=0;i<arrSources.length;i++){
			var strId = arrSources[i];
			var objSource = top.opener.document.getElementById(strId);
			if(objSource!=null)
				objDest.innerHTML += objSource.innerHTML;
			else
				break;
			
		}
	}
	*/
}
function DownloadSelectedItem(strIDListBox, strURLDownloadBase){
	var objListBox = document.all.item(strIDListBox);
	var intSelectedIndex = objListBox.selectedIndex;
	var strURL = objListBox.options[intSelectedIndex].value;
	var strAs = objListBox.options[intSelectedIndex].text;
	var strExtension = strURL.slice(-4,strURL.length);
	if(strAs.slice(-4,strURL.length) != strExtension)
		strAs += strExtension;
	location.href = strURLDownloadBase.replace("DWNLDURL",strURL).replace("DWNLDAS",strAs);
}

function printPage(v_strPage){
	var strPage = "";
	var intStartIndex = 0;
	var intEndIndex = 0;
	
	if(v_strPage == "" || v_strPage == "undefined"){
		strPage = document.location.href;
	}else{
		strPage = v_strPage;
	}
	
	intStartIndex = strPage.lastIndexOf("/") + 1;
	//intEndIndex = strPage.indexOf(".aspx", intStartIndex) + 5;
	
	strPage = strPage.substr(intStartIndex);
	window.open("printPage.asp?page=" + escape(strPage),"printPage","dependent=yes,Height=400,Width=600,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no");
}
