
// this external javascript file is used by all pages on the site that contain the navigation bar.


images_dir	= 'images/';	// directory where rollover images are kept
map_dir		= 'maps/';		// directory where PHP map files are kept

// map file names should be the name of the section (as defined in map tag) plus the '.php' extension. 

over_section = '';
rolling = false;


function roll(section_name)
{
	if (document.images)
	{
		document.images.rollovertext.src = images_dir + 'rollovertext_' + section_name + '.gif';
	}
	return true;
}

function roll_nav(section_name)
{
	if (document.images)
	{
		rolling = true;
		hilite_section(section_name);
	}

	return true;
}

function roll_out()
{
	rolling = false;
	window.setTimeout('kill_roll()', 100);
	return true;
}

function kill_roll()
{
	if (! rolling)
	{
		hilite_section(cur_section);	
	}
}
function hilite_section(section_name)
{
	if (document.images)
	{
		if (over_section) 
		{
			document.images[over_section].src = images_dir + 'blank.gif';
			document.images.subnavroll.src = images_dir + 'blank.gif';
		}
		if (section_name)
		{
			document.images[section_name].src = images_dir + 'line.gif';
			document.images.subnavroll.src = images_dir + 'nav_' + section_name + '.gif';
		}
		over_section = section_name;
	}	
}

function click_nav(a_tag)
{
	a_tag.href = map_dir + over_section + '.php';
	if (over_section != "") {
		return true;
	} else {
		return false;
	}
}


function preload_nav() 
{
	a = new Array ('nav_lease.gif','nav_research.gif','nav_mydeals.gif','nav_aboutus.gif','nav_services.gif','rollovertext_tenant.gif','rollovertext_landlords.gif','rollovertext_brokers.gif','blank.gif','line.gif','nav_search.gif');
	
	if(document.images)
	{ 
		if(! document.prepics) 
		{
			document.prepics=new Array();
		}
		var j = document.prepics.length; 
    	for(var i = 0; i < a.length; i++)
    	{
    		if (a[i].indexOf("#") != 0)
    		{ 
    			document.prepics[j] = new Image; 
    			document.prepics[j++].src = images_dir + a[i];
    		}
   		}
		roll_nav(cur_section);
	}
}
