function showsub(d, div){
    closeall('subnav', d, div);
   if(d.length < 1) { return; }
   if(document.getElementById(d).style.display == "none") {
    document.getElementById(d).style.display = "block";
    document.getElementById(div).style.backgroundPosition = "0px -20px";
    }
   else {
    document.getElementById(d).style.display = "none";
    document.getElementById(div).style.backgroundPosition = "-0px -0px";}
  }
  
function closeall(theClass, d, div){
    //Populate the array with all the page tags
    var allPageTags=document.getElementsByTagName("*");
    //Cycle through the tags using a for loop
    for (i=0; i<allPageTags.length; i++) {
        //Pick out the tags with our class name
        if (allPageTags[i].className=='nav' && allPageTags[i] != div) {
            allPageTags[i].style.backgroundPosition = "0px 0px";
        }
        if (allPageTags[i].className==theClass && allPageTags[i].id != d) {
            allPageTags[i].style.display='none';
        }
    }
}
function showsubnav(d, div){
    if(div != ""){
        closeall('editdb', d, div);
    }
   if(d.length < 1) { return; }
   if(document.getElementById(d).style.display == "none") {
    document.getElementById(d).style.display = "block";
    }
   else {
    document.getElementById(d).style.display = "none";
  }
}
  
function confirmdelete(id) {
	var answer = confirm("Are you sure you want to delete this person?");
	if (!answer){
		window.location = "admin.cgi";
	}else{
                window.location = 'admin.cgi?action=delete_event&id=' + id;
        }
}

