// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

/*Home Tabs
-----------------------------------------------------*/
current_tab = 'tab-california';

function switchTabs(tab) {
	if(current_tab != tab) {
		// Find a Home
		Effect.toggle(tab + '-regions', 'appear', {duration: .5});
		$(current_tab + '-regions').hide();
		$('image-' + current_tab).src = '../images/' + current_tab + '-off.gif';
		$('image-' + tab).src = '../images/' + tab + '.gif';

		/* Move-in Ready Homes
		Effect.toggle(tab + '-home-in-regions', 'appear', {duration: .5});
		$(current_tab + '-home-in-regions').hide();
		$('image-' + current_tab + '-home-in').src = '../images/' + current_tab + '-off.gif';
		$('image-' + tab + '-home-in').src = '../images/' + tab + '.gif';
		*/
		current_tab = tab;
	}
}

/* Suckerfish Dropdown (http://www.htmldog.com/articles/suckerfish/dropdowns/)
-----------------------------------------------------*/
sfHover = function() {
	if(document.getElementById("navigation")) {
		var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
