/*======================================

		MOVERS TRANSPORT
		----------------
		
		File		:		common.js
		Started	:		03/01/2008 12:23
		By			:		Jim Neath
		
		
======================================*/

var last = 'lounge';

function help_tips()
{
	var buttons = $$('div#quote img.question');
	var last;
	
	buttons.each(function(el) {
		el.observe('click', function(e) {	
			if (last) { last.hide(); }
			last = Event.element(e).adjacent('div.tip').first();
			last.toggle();
			e.stop();
		});			
	});	
}

function swap_form(f)
{
	$$('div.tip').each(function(tip) {
		tip.hide();
	});
	
	if (f == 'full-quote')
	{
		$(f).show();
		$('commercial-quote').hide();
		$('commercial').removeClassName('selected');
		$('full').addClassName('selected');
	}
	else
	{
		$(f).show();
		$('full-quote').hide();		
		$('full').removeClassName('selected');
		$('commercial').addClassName('selected');
	}	
}

function quote_swap(f)
{		
	if (f != last)
	{
		$(last).hide();
		$(last + '-button').removeClassName('active');
		$(f).show();
		$(f + '-button').addClassName('active');
		last = f;
	}
}

function fix_drops()
{
	if (document.all && document.getElementById) 
	{
		navRoot = document.getElementById("nav");
		
		for (i = 0; i < navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			
			if (node.nodeName == "LI") 
			{
				node.onmouseover = function() {
					this.className += " over";
				}
				node.onmouseout = function() {
					this.className = this.className.replace(" over", "");
				}
			}
		}
	}
}

Event.observe(window, 'load', fix_drops);
Event.observe(window, 'load', help_tips);