$(document).ready(function(){
	// home featured designs
	$('#featured-designs.five-across .jcarousel-skin-keds').jCarouselInit({
		scroll:5, 
		next: '#featured-designs .next', 
		prev: '#featured-designs .prev'
	});
	
	/* landing featured designs */
	$('#featured-designs.four-across .jcarousel-skin-keds').jCarouselInit({
		scroll:4, 
		next: '#featured-designs .next', 
		prev: '#featured-designs .prev'
	});


	/* heros */
	
	$('#hero, #category-hero').switcher({
		cycle:{speed: 2000, timeout:9000}
	});
	Cufon.now();
	
	/* end heros */

	/* add instructional text to form fields */
	$('#search-field').inputDefaultState({text: 'Search Products'});
	$('#SubscriptionEmailAddress').inputDefaultState({text: 'Enter Your Email Address'});
	
	/* over states for designs */
	$('#featured-designs li.jcarousel-item, ul.fresh li')
	.mouseover(function(){
		$(this).addClass('over');
	})
	.mouseout(function(){
		$(this).removeClass('over');
	});

	
	/**
	 * mega menu! this is the shop by size menu in the masthead
	 */
	$("div.mega").makeMegaMenu({
		interval: 100, // how often to check for movement
		sensitivity: 4, // pixels the mouse needs to move during an interval to be considered moving
		timeout: 2000, // how long after the mouse hovers out til we exit
		hoverClass: 'hovering' // class name to give to hovered node
	});

	/**
	 * FOR DEBUG PURPOSES ONLY!
	 * populate the size dropdown with dummy values
	 */
/*
	for(var i=0; i<22; i++){
		$('#size-selector').append('<option value="0' + i + '.0/0' + i + '">0' + i + '.0/0' + i + '</option>');
	}
*/
});
