// JavaScript Document

<!--
if (document.images)
{
  pic1= new Image(100,25); 
  pic1.src="images/closeMenuBar.png"; 
}
//-->




var isOpen = 0;

$(document).ready(function () {
    //reCenter();
    
    $('#buttonHolder').click(dropClose);
    
});

$(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");
}
}

function dropClose(event){
	event.preventDefault();
	if (isOpen == 0){
		$("#navMain").animate({height: 288 , opacity: 0.9}, 500);
		$("#navContent").animate({height: 244}, 500);
		$("#navMain").css("background","transparent url(images/nav_close.png) no-repeat bottom left");
		$("#theButton").css("margin-top","244px");
		isOpen = 1;
	}else{
		$("#navContent").animate({height: 0}, 500);
		$("#navMain").animate({height: 43 , opacity: 1}, 500);
		$("#navMain").css("background","transparent url(images/nav_view.png) no-repeat bottom left");
		$("#theButton").css("margin-top","0px");
		isOpen = 0;
	}
}
