var time = 3000;
var numofitems = 2;
var new_window;
var mi1;
var mi2;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
	this.numberofmis = allitems;
	this.caller = document.getElementById(callname);
	this.thediv = document.getElementById(divname);
	this.thediv.style.visibility = startstate;
}
				 
//menu methods
function ehandler(event,theobj){
sub_menu=document.getElementById("subcontent");
 sub_menu.style.visibility="hidden";
try {
  for (var i=1; i<= theobj.numberofmis; i++){
	  var shutdiv =eval("mi"+i+".thediv");
    shutdiv.style.visibility="hidden";
	}
	theobj.thediv.style.visibility="visible";
	theobj.thediv.style.left=theobj.caller.offsetLeft;
	} catch(e) {
	return;
	}
}
				
function closesubnav(event){
try {
	for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('mi'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		}
	} catch(e) {
	return;
	}
}


function show_submenu()
{
sub_menu=document.getElementById("subcontent");
sub_menu.style.visibility="visible";

}

function hide_submenu(event,sub_menu)
{
sub_menu=document.getElementById("subcontent");
sub_menu.style.visibility="hidden";

}
function confirmDelete()
{
var agree=confirm("Sei sicuro di voler cancellare?");
if (agree)
return true ;
else
return false ;
}
function open_window(url)
{
cwin = window.open(url,"attach","width=350,height=400,toolbar=no,resizable=yes");
}
function ptoutput(theText)
{
document.write(theText);
}

function show_date()
{

}

function set_search()
{
//document.forms.action="index.php?action=searchresults";
//if (a.nuovo.checked) a.action+="&restore[]="+a.nuovo.value;
//if (a.da_rist.checked) a.action+="&restore[]="+a.da_rist.value;
//if (a.rist.checked) a.action+="&restore[]="+a.rist.value;
//alert(document.forms.qsearch.action);
}
