// JavaScript Document

<!--
if (document.images)
{
  pic1= new Image(100,25); 
  pic1.src="images/closeMenuBar.png"; 
}
//-->




var isOpen = 0;

$(document).ready(function () {
    reCenter();
});

$(window).resize(function(){
	reCenter();
});


function reCenter(){
$("#navMain").css("margin-left","0px");
var theWidth = $(document).width();
var navWidth = $("#navMain").width();

if(navWidth < theWidth){
var theMargin = ((theWidth - navWidth)/2);
/* $("#navMain").css("margin-left", theMargin + "px"); */
}else{
/* $("#navMain").css("margin-left","0px"); */
}
}

$(document).ready(function(){
	 	$('#buttonHolder').click(dropClose);         			
});

function dropClose(event){
if (isOpen == 0){
$("#navMain").animate({height: 325 , opacity: 0.9}, 500);
$("#navContent").animate({height: 278}, 500);
$("#navMain").css("background","transparent url(images/closeMenuBar.png) no-repeat bottom left");
$("#theButton").css("margin-top","282px");
isOpen = 1;
}else{
$("#navContent").animate({height: 0}, 500);
$("#navMain").animate({height: 43 , opacity: 1}, 500);
$("#navMain").css("background","transparent url(images/viewMenuBar.png) no-repeat bottom left");
$("#theButton").css("margin-top","0px");
isOpen = 0;
}
event.preventDefault();
}
