
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function popUpWindow_scroll(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function cs(obj)
{

// type="open" i menu rimangono aperti | type="close" i menu si chiudono automaticamente
var type="close"
	
	if (type=="open"){
		objs=document.getElementsByTagName("ul")
		for (x=0;x<=objs.length-1;x++){		
			if (objs[x].id==obj.name){
			status = objs[x].style.display
			if (status=="none") objs[x].style.display="";
			if (status=="") objs[x].style.display="none";}}
	}
		
	if (type=="close"){	
		objLiv=parseInt(obj.name.substr(obj.name.length-1,1))
		objs=document.getElementsByTagName("ul")
		for (x=0;x<=objs.length-1;x++){
			ulLiv=parseInt(objs[x].id.substr(objs[x].id.length-1,1))
			if (ulLiv >= objLiv){
				objs[x].style.display="none";
				if (objs[x].id==obj.name) objs[x].style.display="";
			}
		}
	}
}
