$(document).ready(function() {
   // do stuff when DOM is ready
	 $("h1#title").hide(0);

	 $("#navbar li.top").hover(function(){
	 clearePrevious();
	 $(this).addClass("subnavroll");
	 $(this).find("ul").slideDown("fast");
	 $(this).find("ul").css({'visibility' : 'visible'});
	 },function(){
	 $(this).removeClass("subnavroll");
	    $(this).find("ul").slideUp(0);
	 });
	// $('#content div ul li a').lightBox();
});

function clearePrevious(){
	$("#navbar li.top").each(function(index) {
    $(this).find("ul").slideUp(0);
	//alert(index + ': ' + $(this).text());
  });
	
	
	
}

function swapclasses(n,m){
	sectional=n;
	document.getElementById(n).className=m;
	if (thewindowtoclose){
		clearInterval(thewindowtoclose);
	}
}


function swapclassesTO(o){
	thewindowtoclose=window.setInterval(CTN(o),500);
}

function CTN(p){
	document.getElementById(p).className="nav_off";
	thewindowtoclose=null;}
	
function popme(u,w,h){
	window.open(u,'pop','width='+w+',height='+h+',scrollbars=0,toolbars=0');
}
