var toshow = "none";
function changeshow(value){toshow=value;}
var timerID;

function changeTimer(obj){
	clearTimeout(timerID);
	timerID = setTimeout("switchmenu('" + obj + "')",500);
}

function switchmenu(obj){

	clearTimeout(timerID);
        if(document.getElementById && toshow){

        var el = document.getElementById(obj);

        var ar = document.getElementById("maindiv").getElementsByTagName("span");
 
                //if(el.style.display != "block"){

                        for (var i=0; i<ar.length; i++){

                                if (ar[i].className=="submenu")
 
                                ar[i].style.display = "none";

                        }

                //        el.style.display = "block";

                        el.style.display = toshow;

                //}else{

                //        el.style.display = "none";

                //}

        }

	timerID = setTimeout("switchmenu('" + obj + "')",500);
}
