// Cufon Setup
Cufon.replace('h1, h2, legend span, .main-area h3, .navigation h4', { fontFamily: 'Helvetica Neue Titling' });
Cufon.replace('.tagline p', { fontFamily: 'Helvetica Neue' });
Cufon.replace('.tagline h2, span.amp', { fontFamily: 'Rockwell' });

// Navigation Animation
$(document).ready(function() {
	  $('#search-ap input[type=text]').placeholder();
	  
	  if ($('#banners').length > 0) {
		$('#banners').cycle({ 
			fx:      'scrollHorz',
			speed:    500, 
			timeout:  7000,
			next:   '#next', 
			prev:   '#prev'
		});
	  }
	  
	  /* ampersand replacement */
	  $("h1:contains('&'), h2:contains('&')", document.body)
		  .contents()
		  .each(
			function() {
				if( this.nodeType == 3 ) {
					$(this)
						.replaceWith( this
							.nodeValue
							.replace( /&/g, "<span class='amp'>&</span>" )
						);
				}
			}
		);
	  
	  	/* slick slider dropdowns */
		$('.drop', '.navigation').css('left','0').hide();
		$('#n-products .wide').css('left','-320px');
		
		$('.navigation > ul > li:has(.drop)').bind('mouseenter', function() {
			leftVal = '0'; if ($(this).attr('id') == 'n-products') { leftVal = '-320px'; }
			$('.drop',this).stop().removeAttr('style').css({
									   'display' : 'none',
									   'left' : leftVal
									   }).slideDown();
		});
		
		$('.navigation > ul > li:has(.drop)').bind('mouseleave', function() {
			$('.drop',this).stop().slideUp();
		});
		
	
		 /* customer login tabs */
		 if ($('#login-area').length > 0) {
			 $('#login-area').tabs();
		 }
		 
	
},function(){
	GUnload();
});

function NavHover(o, actionBool){
	if ( ! actionBool ) {
		  actionBool = true;
		  $(o).find('.drop').slideToggle('fast', function() { actionBool = false; });
	}
	return actionBool;
}
