// JavaScript Document
// JavaScript Document

// this function determines whether the event is the equivalent of the microsoft
	// mouseleave or mouseenter events.
	function isMouseLeaveOrEnter(e, handler)
	{		
		var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement;
		while (reltg && reltg != handler) reltg = reltg.parentNode;
		return (reltg != handler);
	}  
			
// Over
function over(event) {
if (isMouseLeaveOrEnter(event,this)) 
	new Effect.Opacity('about', 
					   { from: 0, to: 1, duration: 0.25, transition: Effect.Transitions.sinoidal }); 
}

// Out
function out(event) {
if (isMouseLeaveOrEnter(event,this)) 
	new Effect.Opacity('about', 
					   { from: 1, to: 0, duration: 0.25, transition: Effect.Transitions.sinoidal });
	return false;
}

// Over1
function over1(event) {
if (isMouseLeaveOrEnter(event,this)) 
	new Effect.Opacity('location', 
					   { from: 0, to: 1, duration: 0.25, transition: Effect.Transitions.sinoidal }); 
}

// Out1
function out1(event) {
if (isMouseLeaveOrEnter(event,this)) 
	new Effect.Opacity('location', 
					   { from: 1, to: 0, duration: 0.25, transition: Effect.Transitions.sinoidal });
}

// Load
function loa(event) {
	new Effect.Opacity('about', 
					   { from: 1, to: 0, duration: 0.75, transition: Effect.Transitions.sinoidal });
	new Effect.Opacity('location', 
					   { from: 1, to: 0, duration: 1, transition: Effect.Transitions.sinoidal });
	
}

function addObservers() {
$('hide').observe('mouseover', over1);
$('hide').observe('mouseout', out1);
$('location').observe('mouseover', over);
$('location').observe('mouseout', out);
return loa();
}

Event.observe(window, 'load', addObservers);