var ar_activeHighItemLayer = new Array();	// serve per la visualizzazione a rotazione degli highligt dei box

function toggleVisibility(id, mode) {
	var NNtype = (mode == "show") ? mode : "hidden";
	var IEtype = (mode == "show") ? "visible" : "hidden";
	var WC3type = (mode == "show") ? "visible" : "hidden";
	if (document.getElementById) {
		eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
	} else {
		if (document.layers) {
			document.layers[id].visibility = NNtype;
		} else {
			if (document.all) {
				eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
			}
		}
	}
}


// funzione per la visualizzazione dei div dei box highlight
function change_layerDivHiglightItems(id_to,div_prefix,NoHighItems,arID){
	if (id_to == ''){
		var id_to = div_prefix + '_item_' + ar_activeHighItemLayer[arID];
		ar_activeHighItemLayer[arID] = ar_activeHighItemLayer[arID] + 1;
		if (ar_activeHighItemLayer[arID] > NoHighItems){
			ar_activeHighItemLayer[arID] = 1;
		}
	}
	
	var element_to=document.getElementById(id_to);
	
	// nasconde tutti i div degli items
	var elementCD=document.getElementById(div_prefix + '_areaItems');
	if (elementCD.hasChildNodes()) {
		 // Get all children of node
	     var children = elementCD.childNodes;   
	
	     // Loop through the children
	     for(var c=0; c < children.length; c++) {
	      if(children[c].style) {
	       children[c].style.display = 'none';
	      }
	     }
	 }
	 element_to.style.display="block";
}



// FUNZIONE PER TAKEOVER //

function clickBg(e,actionurl) {
evt = e || window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // Safari bug
targ = targ.parentNode;

if (targ.id == 'bodyBG') {
window.open(actionurl);
}
}




 
  function switchvis(objid) {
   var elemento = document.getElementById(objid);
   if (elemento.style.display == 'none') {
    elemento.style.display = 'block';
   }
   else {
    elemento.style.display = 'none'
   }
  }
 
 
 
