$(document).ready(function() 
{

	// ***** Header Menu Top Buttons *******//

	var btns = $("ul#headerMenu > li > a");
		btns.css("opacity","0");
	var numBtns = btns.size();
	var btnLength = 160;
	for(var i = 0; i<numBtns; i++)
	{		
		var theBtn	= btns[i];			
		$(theBtn).css( "background-position", (-btnLength * i) + "px -42px");
	}		
		// on mouse over
		$("ul#headerMenu > li > a").hover(function () {
			// animate opacity to full
			//$(this).stop().fadeOut(0);		
			$(this)
				.stop()
					.animate(
						{opacity : 1},{
							duration 	: 500,
							easing		: "easeOutQuart"						
						});
		},
		// on mouse out
		function () {			
			$(this).fadeTo(
					"slow",  0
				 );		
			
		});
		
		/**** Suckerfish Hover for IE *************/
		if (window.attachEvent) // check if IE //
		{
			var sfEls = document.getElementById("headerMenu").getElementsByTagName("LI");
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					this.className+=" sfhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
		// ********** Header menu Drop Downs ************ //
		
		// let the js manage the rollOver - rather than the css //
		$("ul#headerMenu > li > ul").css( "left", "auto");
		
		// set menu start pos as height 0 for anim //
		$("ul#headerMenu li ul").slideToggle(0);			

		
		$("ul#headerMenu > li").hover(		
			
				function(){					
					$(this).children("ul").stop(true, true);
					$(this).children("ul").animate({ height: "toggle"}, 400, "easeOutQuart" );					
				},
				
				function(){
					
					$(this).children("ul").stop(true, true);
					$(this).children("ul").animate({ height: "toggle"}, 400, "easeInQuart" );					
				}			
		);
		
		// **********  Side menu rollovers ************ //		
		$("ul#sideBarMenu li ul li").hover(
				
			function(){
				
					$(this).find("a").not(".sideBarActivePage a").animate({ "paddingLeft": "10px"}, 150, "easeOutSine" );				
				},
			
			function(){
				
				$(this).find("a").not(".sideBarActivePage a").animate({ "paddingLeft": 0}, 300, "easeOutSine" );
			}				
		);
});
