function MM_preloadImages() { //v3.0
  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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}





function initTree(){
	var nodoBase = document.getElementById("treeSedute");
	var aUl = nodoBase.getElementsByTagName('ul');
	var aImg = nodoBase.getElementsByTagName('img');
	
	for (var i=0; i < aUl.length; i++){
		aUl[i].style.display = 'none';
	}
	for (var i=0; i < aImg.length; i++){
		aImg[i].setAttribute("src", "images/plusblk.gif");
	}
}



function Toggle(node){
	n = node.parentNode.parentNode.parentNode.parentNode.nextSibling ;
	//alert(n.nodeName);
	if (n.nodeName == '#text') n = n.nextSibling;
	
	if (n.style.display == 'none' || n.style.display == ''){
		n.style.display = 'block';
		if (node.firstChild.nodeName.toLowerCase() == "img"){
			node.firstChild.src='images/minusblk.gif';
			node.firstChild.setAttribute('alt', 'Comprimi');
		}else{
			node.parentNode.parentNode.firstChild.firstChild.firstChild.src='images/minusblk.gif';
			node.parentNode.parentNode.firstChild.firstChild.firstChild.setAttribute('alt', 'Comprimi');
		}
	}else{
		n.style.display = 'none';
		if (node.firstChild.nodeName.toLowerCase() == "img"){
			node.firstChild.src='images/plusblk.gif';
			node.firstChild.setAttribute('alt', 'Espandi');
		}else{
			node.parentNode.parentNode.firstChild.firstChild.firstChild.src='images/plusblk.gif';
			node.parentNode.parentNode.firstChild.firstChild.firstChild.setAttribute('alt', 'Espandi');
		}
	}		
}


function SwitchAllClose()
{							
	oTablesList=document.getElementsByName('DivNode');
	for (i=0;i<oTablesList.length;i++)
	{				
		oTablesList[i].style.display='none';
	}
	AssignImages(true);
}


function AssignImages(b)
{
	if (b) sImg="images/plusblk.gif"; else sImg="images/minusblk.gif";
	oImgList=document.getElementsByName("Switch")
	for (i=0;i<oImgList.length;i++) oImgList[i].src=sImg;
}



function chiudiFrame(){	
	sWidthCols = parent.parent.document.getElementById('myframeset').cols;
	aCols = sWidthCols.split(",");
	sDesWidth = aCols[2];		
		parent.parent.document.getElementById('myframeset').cols = '0,*,' + sDesWidth ;	
}	





//*********************************************************************

	function ApriMenuSx(){
		sWidthCols = parent.parent.document.getElementById('myframeset').cols;
		aCols = sWidthCols.split(",");
		sSinWidth = aCols[0];
		sDesWidth = aCols[2];
		if (sSinWidth == '*' || sSinWidth == 0 || sSinWidth == "0%"){
			parent.parent.document.getElementById('myframeset').cols = '30%,*,' + sDesWidth;
		}
	}
	
	function BuildData(){
		document.getElementById("data_a").value=document.getElementById("data_da").value=document.getElementById('ddGiorno').value+"/"+document.getElementById('ddMese').value+"/"+document.getElementById('ddAnno').value;
	}
	
	function gotoPage (pageUrl) {
		parent.frames["centro"].document.location.href = pageUrl;
		document.location.replace("top.php");
	}
	
	function chiudiFrame(){	
		sWidthCols = parent.parent.document.getElementById('myframeset').cols;
		aCols = sWidthCols.split(",");
		sDesWidth = aCols[2];		
		parent.parent.document.getElementById('myframeset').cols = '0,*,' + sDesWidth;	
	}
