$(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" );
			}				
		);
		

		// gallery //
		var gv = $('#hozGallery').galleryView({
			panel_width: 728,
			panel_height: 350,
			frame_width: 60,
			frame_height: 40,
			nav_theme	: "light",
			panel_scale : "nocrop",		
			transition_speed: 1000,  
			transition_interval: 5000,		
			show_filmstrip : false,
			filmstrip_position : 'bottom',
			filmstrip_size: 0,
			pause_on_hover: true
		});		
        
		$('#coda-slider-1').codaSlider({
			dynamicArrows 		: false,
			dynamicTabsAlign 	: "left",
			showTitle			: false,
			autoHeight			: true
		});
		
});

if (window.addEventListener)
{	
	window.addEventListener("load", init, false);
}else if (window.attachEvent) //IE exclusive method for binding an event
{
	window.attachEvent("onload", init);

}else if (document.getElementById) //support older modern browsers
{
	window.onload = init;
}

function init()
{	
	initLoadSequence("#hozGallery");
	$().galleryView.start();
}

