// JavaScript Document

/* CONFIG */
menuClassName = "menuNavigazione";

/* SCRIPT */
function closeSub(menu) {
	for (var i=0; i<menu.childNodes.length; i++)
		if (menu.childNodes[i].nodeName.toLowerCase()=="li") {
			li = menu.childNodes[i];
			li.onmouseover = li.onactivate = li.onfocus = function() { if (this.subMenu) this.subMenu.className = this.subMenu.className.replace(/subMenu-off/g,"subMenu-on") };
			li.onmouseout = li.ondeactivate = li.onblur = function() { if (this.subMenu) closeSub(this.subMenu) };
			for (j=0; j<li.childNodes.length; j++)
				if (li.childNodes[j].nodeName.toLowerCase()=="ul" || li.childNodes[j].nodeName.toLowerCase()=="ol") closeSub(li.subMenu = li.childNodes[j]);
		}
	menu.className = menu.className.replace(/\s?subMenu-on/g,"")+" subMenu-off";
}

/* ON LOAD */
window.onload = function(e) {
	if(tags_ = document.getElementsByTagName('ul'))
		for(i=0; i<tags_.length; i++) 
			if (tags_[i].className==menuClassName) closeSub(tags_[i]);
	if(tags_ = document.getElementsByTagName('ol'))
		for(i=0; i<tags_.length; i++) 
			if (tags_[i].className==menuClassName) closeSub(tags_[i]);
}

/*
(c) 2004 Gianluca Troiani < g.troiani@constile.org > some rights reserved.
This code is licensed under Creative Commons Attribution-ShareAlike License
< http://creativecommons.org/licenses/by-sa/2.0/ >
*/

var bigpicWin = null;

function showbigimage(url, picwidth, picheight, description){

if (bigpicWin){ bigpicWin.close();}

  if (!bigpicWin || bigpicWin.closed)
  {
    usrwidth = screen.width;
    usrheight = screen.height;

    winwidth = picwidth + 5;
    winheight = picheight + 5;

    var X = (usrwidth - winwidth) / 2;
    var Y = (usrheight - winheight) / 2;

    properties = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width="+winwidth+",height="+winheight+",";

    checkie = navigator.appName.indexOf("icrosoft");
    if (checkie == -1)
    {
      properties = properties+"screenX="+X+",screenY="+Y;
    }
    else
    {
      properties = properties+"left="+X+",top="+Y;
    }

    bigpicWin = window.open('','bigpicWin',properties);

    bigpicWin.document.open();
    bigpicWin.document.write('<HTML><HEAD>');
    bigpicWin.document.write('<TITLE>'+description+'</TITLE>');
    bigpicWin.document.write('</HEAD>');
    bigpicWin.document.write('<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0">');
    bigpicWin.document.write('<A HREF="JavaScript:self.close()"><IMG SRC="'+url+'" HSPACE="0" VSPACE="0" BORDER="0"></A>');
    bigpicWin.document.write('</BODY>');
    bigpicWin.document.write('</HTML>');
    bigpicWin.document.close()

    bigpicWin.focus();
  }
  else
  {
    bigpicWin.focus();
  }
}
