

$(document).ready(function() {
	
	// Hero image rotator
	if ($('#hpHero').length > 0) {
		$('#hpHero img, #hpHero div').css('display','block');
		
		$('#hpHero').cycle({ 
		    fx:      'fade', 
		    speed:    500, 
		    timeout:  8000,
		    pause:	  1,
		    pager:  '#heroNav'
		});
	}
	
	// Nav Dropdowns
	if ($('#nav ul').length > 0) {
		$('#nav ul').load().superfish({
			hoverClass: 'sfHover',
			animation:   {opacity:'none',height:'show'},  // fade-in and slide-down animation 
			speed:       'fast',                          // faster animation speed 
			autoArrows:  false,                           // disable generation of arrow mark-up 
			delay:		 700,
			dropShadows: true,
			pathClass:   'current'
			});
	}

	// initialize the default search word
	searchWord = $('#hdSearchField').val();

	// search field
	$('#hdSearchField').focus(function() {
		if ($(this).val() == searchWord) { 
			$(this).val(''); 
			}
	});
	
	$('#hdSearchField').blur(function() {
		if ($(this).val() == '') { 
			$(this).val(searchWord); 
			}
	});
	

	if ($("#scroller .carouselPanel li").length > 0) {
	
		// Logo Carousel
		$("#scroller .carouselPanel").jCarouselLite({
    			btnNext: ".btnRight",
    			btnPrev: ".btnLeft",
    			visible: 1,
    			scroll: 1
		});
	
		/* ul is hidden in css to prevent too much from being seen before jquery kicks in */
		$('#scroller ul').css('visibility','visible');

    	}
	if ($("#articleScroll .carouselPanel li").length > 0) {
		// Article Carousel
		$("#articleScroll .carouselPanel").jCarouselLite({
    			btnNext: ".scrollRight",
    			btnPrev: ".scrollLeft",
    			visible: 1,
    			scroll:1
		});
	
		$('#articleScroll ul').css('visibility','visible');
	}

});



