$(document).ready(function() {

	setTopNavCurrent();

});


function setTopNavCurrent() {
	if(document.getElementById('current')) {
		var current = document.getElementById('current');
		current.childNodes[0].src = current.childNodes[0].src.substr(0,current.childNodes[0].src.length-4) + "_over.gif";
	}
}

// Rollover effects for top nav
function topNavOn(a)
{
	if(a.id != "current")
	{
		var button = a.childNodes[0];
		button.src = button.src.substr(0,button.src.length-4) + "_over.gif";
	}
}

function topNavOff(a)
{
	var button = a.childNodes[0];

	if(a.id != "current" && button.src.indexOf("_over.gif"))
	{
		button.src = button.src.replace("_over\.gif", "\.gif");
	}
}


var preloadFlag = false;

function preloadImages() {
	var root = "http://www.boxwhine.com/yateswood/";
	
	imgUrls = new Array("images/nav/realEstateBrokerage_over.gif",
		"images/nav/associationMgmt_over.gif",
		"images/nav/propertyMgmt_over.gif",
		"images/nav/accounting_over.gif",
		"images/nav/people_over.gif",
		"images/nav/contact_over.gif",
		"images/nav/home_over.gif",
		"images/listings_area_over.gif",
		"images/homePageContactUs_over.gif");
	
	var imgs = new Array();

	for(i=0; i<imgUrls.length; i++)
	{
		imgs[i] = new Image();
		imgs[i].src = root + imgUrls[i];
		
	}
	
	preloadFlag = true;
}