//is -1 if no section is open, otherwise is set to the number of the open section
	var openSection_int=-1;	
	//true if the rolled-over button has no subnav, false otherwise
	var simpleBut_bol = false;
	//hides open nav
	function hideOpen()
	{
		//if there is an open section
		if(openSection_int !=-1)
		{
			//main button goes to off state
			eval("b"+openSection_int+"_but").Out();
			//menu disappears
			
			eval("mL"+openSection_int).hide();	
			//reset open section tracker
			openSection_int = -1;
		}	
	}
	
	//reset navigation on Click (Netscape only)
	if(detect_obj.is_nav4)
	{
		window.captureEvents(Event.CLICK);
		window.onClick = function()
		{
			hideOpen();
		}
		
	}
	
	//mouse over for main nav buttons
	//which_int - position of button - integer
	function generalMouseOver(which_int)
	{
		
		if(openSection_int==which_int)
			return;
		
		eval("b"+which_int+"_but").Over();
		
		//close all subnavs if existent
		hideOpen(); 
		
		// Added by FC 2003-06-12
		// To check if there is a menu object
		//   There may be no menu object defined if there should not be a submenu
		if (!eval("mL"+which_int+"._name")) 
		{
			simpleBut_bol=true;
		}
		else
		{
			//show corresponding subnav if existent
			if(eval("mL"+which_int))
				eval("mL"+which_int).show();
			
			//set memory for open subnav 
			openSection_int=which_int; 
			
			
			//stop and reset timer
			Stop(); 
			Reset();
		}	
	}
	
	function generalMouseOut(which_int)
	{
		
		if(simpleBut_bol==true)
		{	//button roll over
			eval("b"+which_int+"_but").Out();
			simpleBut_bol=false;
		}	
		Start();
	}
	
	//error message for search form
	var error_str = "Enter key-word";
	
	//validate search form
	function searchValidation(searchForm)
	{
		
		//if nothing enetered
		if(searchForm.elements[0].value=="")
		{
			//show error message
			searchForm.elements[0].value = error_str;
			
			//color message will red in ns6 and ie browsers
			if(!detect_obj.is_nav4)
				searchForm.elements[0].style.color ="red"
                        return;
		}
                 else{	
                  searchForm.action="http://c250.cc.columbia.edu/cgi-bin/htsearch";
                  searchForm.method="post"; 
                  searchForm.submit(); 
                 } 
            }
	
	//clera form on focus
	function clearForm(field)
	{
		//if error message displayed
		if(field.value == error_str)
		{
			//clear erroe message
			field.value = "";
			
			//turn color back off, to black
			if(!detect_obj.is_nav4)
				field.style.color ="black"		
		}
	}
