

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	
	//same as $(document).ready();
	$(function() {

		
		$('#slide-featured ul')
		.after('<div id="feature-nav">') 
		.cycle({ 
		    fx:     'fade', 
		    speed:  'fast', 
		    timeout: 3000, 
		    pager:  '#feature-nav' 
		});

	   	$('.product').hover(function(event){
    		$(this).stop().children(".product-meta").fadeIn(200);
		},function(event){
    		$(this).stop().children(".product-meta").fadeOut(200);      		
		});
		
		$('#search').hide();
		
		$('#show-search').click(function(event){
			if($('#search').is(":visible"))
			{
    			$('#search').fadeOut('1000');
    		} 
    		else
    		{
    			$('#search').fadeIn('1000');
    		}
		});
		
		if($('a.fancy').length){
		$("a.fancy").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200
		});
		}
		
	});

	//When everything is loaded
	$(window).bind("load", function() {
		
		
	
	});
	
})(jQuery);
