$(document).ready(function(){

/*
 * Global Navigation Toggler
 */
$("#navigation li.nav-item").hover(
	function(e){
		currentNav = $(this).closest('ul');
		openNav = $('li#activepage ul');
		$(openNav).hide();
	},
	function(e){
		$(openNav).show();
	}
);

/*
 * Floorplan Switcher
 */
$('#page-subnav a').click(function(){
	var floorplan = $(this).attr('name');
	$('#page-subnav li.active').removeClass('active');
	
	if (!floorplan) {
		$(this).parent().addClass('active');
		$('#floorplans').html('<img src="/images/building/floorplans_intro.gif" alt=""/>');
	} else {
		$(this).parent().addClass('active');
		$('#floorplans').html('<a href="/downloads/floorplans/the834_the_' + floorplan + '.pdf" target="_blank"><img src="/images/building/floorplans/' + floorplan + '.gif " alt="floor plan for ' + floorplan + '"/></a>');
	}
});

});

function loadWin(filename, windowname, width, height)
{       
        sFeatures = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height;
        var wAppWindow = window.open( filename, windowname, sFeatures );
        
        sBrowserInfo = new String( navigator.appVersion );
        
        // If the browser is not Mac or IE3, then bring window to front. This is automatic on Mac IE3 and will cause a javascript error if you force the focus.
        
        if ( sBrowserInfo.indexOf( "Macintosh" ) == -1 && sBrowserInfo.indexOf( "MSIE 3" ) == -1 )
        {
                wAppWindow.window.focus();
        }

}
