// JavaScript Document
	
	var cancel_dropdown = false;			// Dropdown cancel request var
	var dropdown_height = 284;				// Maximum height of dropdown menu
	
	var dropdown_state = "up";				// Up, Down, Going up, Going Down...
	
	// #################################################################
	function tab_mouseover(areaID){
	// #################################################################
	
		// Reset the cancel request.
		cancel_dropdown = false;
		
		// if the dropdown is already down, then must be swapping tab
		if(dropdown_state=="down"){
			display_dropdown(areaID);
		}else{
			// Set the timeout, to send the dropdown request.
			setTimeout (function() {display_dropdown(areaID)},1000);			
		}
	  
	}
	
	// #################################################################
	function tab_mouseout(areaID){
	// #################################################################
	
		// Send the cancel request...
		cancel_dropdown = true;

	}
	
	// #################################################################
	function display_dropdown(areaID){
	// #################################################################
	
		// Make sure cancel request hasn't been sent.  (User hasn't hovered off the tab)
		if (cancel_dropdown == false){
			//alert('go for it');
			
			//alert(document.getElementById('dropdown').style.height);
			
			// If the dropdown is UP, then send it down.
			if(dropdown_state=="up") slide_dropdown("down");
			
			// Display the requested area (hides others)
			display_droparea(areaID);

		}
		
	}	
	
	// #################################################################
	function content_mouseover(){
	// #################################################################
		
		// Slide the dropdown back UP
		slide_dropdown("up");
		
	}

	
	// #################################################################
	function slide_dropdown(direction){
	// #################################################################	

		// Get current dropdown height 
		var curHeight;
		curHeight = document.getElementById('dropdown').clientHeight;
		
		// alert(dropdown_state);
		
		switch(direction){
			
			case "up":
			
				if(dropdown_state=="down"){
					//fadeObject('out','dropdown');
					dropdown_state = "going_up";
					setTimeout ("slide_dropdown('up')", 1);
				}
				if(dropdown_state=="going_up"){
					if(curHeight==0){
						document.getElementById('dropdown').style.display = 'none';
						dropdown_state = "up";
					}else{
						
						if(curHeight>30){
							newHeight = curHeight - 10;
							document.getElementById('dropdown').style.height = newHeight + 'px';						
							setTimeout ("slide_dropdown('up')", 1);	
						}
						
						if(curHeight<=30){
							newHeight = curHeight - 1;
							document.getElementById('dropdown').style.height = newHeight + 'px';
							setTimeout ("slide_dropdown('up')", 5);	
						}
						
					}
				}
		
			break;
			
			
			case "down":
			
				if(dropdown_state=="up"){
					//fadeObject('in','dropdown');
					dropdown_state = "going_down";
					document.getElementById('dropdown').style.display = 'block';	
					setTimeout ("slide_dropdown('down')", 1);
				}

				if(dropdown_state=="going_down"){
					if(curHeight==dropdown_height){
						dropdown_state = "down";
					}else{
						
						if(curHeight<260){
							newHeight = curHeight + 10;
							document.getElementById('dropdown').style.height = newHeight + 'px';								
							setTimeout ("slide_dropdown('down')", 1);	
						}
						
						if(curHeight>=260){
							newHeight = curHeight + 1;
							document.getElementById('dropdown').style.height = newHeight + 'px';	
							setTimeout ("slide_dropdown('down')", 5);	
						}
						
					}					
				}
			
			break;
			
		}

	}
	
	// #################################################################	
	function display_droparea(areaID){
	// #################################################################	
		
		// Hide all areas, (except requested area)
		
		elements = document.getElementById('dropdown').getElementsByTagName('div');
	
		// Only hide others than current	
		for (var i=0;i<elements.length;i++){
			if (elements[i].getAttribute("id")!=areaID){		
				//fadeObject('out',elements[i].getAttribute("id"));
				//changeOpac(0, elements[i].getAttribute("id"));
				document.getElementById(elements[i].getAttribute("id")).style.display = 'none';		
			}
		}
	
		// Display the requested area
		document.getElementById(areaID).style.display = 'block';
		changeOpac(100, areaID);		
		
	}
	
	
	
	
	
	
	
	
	