// Home Page Feature
$(document).ready(function(){
		$.featureList(
				$("#tabs li a"),
				$("#output li"), {
					start_item	:	0
				}
			);

		});


//New Arrivals Homepage  
$(function($){   
	$('#slideshow_g').cycle({
		timeout:	   0,  // milliseconds between slide transitions (0 to disable auto advance)
		fx: 'scrollHorz', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		easing: 'easeInOutExpo', 
		speed:1000,
		next: '#next',  // selector for element to use as click trigger for next slide
	   	prev: '#previous',  // selector for element to use as click trigger for previous slide
		pause:		   1,	  // true to enable "pause on hover"
	   pauseOnPagerHover: 1 // true to pause when hovering over pager link
	});	  
	
	
}); 


//Special Offers Homepage  
$(function($){   
	$('#slideshow_s').cycle({
		timeout:	   0,  // milliseconds between slide transitions (0 to disable auto advance)
		fx: 'blindY', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		easing: 'easeInQuad', 
		speed:600,
		next: '#next_s',  // selector for element to use as click trigger for next slide
	   	prev: '#previous_s',  // selector for element to use as click trigger for previous slide
		pause:		   1,	  // true to enable "pause on hover"
	   pauseOnPagerHover: 1 // true to pause when hovering over pager link
	});	  
	
	
}); 


//preloading 
$(function () {
	//$('.preload').hide();//hide all the images on the page
	$('.play,.magnifier').css({opacity:0});
	$('.preload').css({opacity:0});
	$('.preload').addClass("animated");
	$('.play,.magnifier').addClass("animated_icon");
});

var i = 0;//initialize
var cint=0;//Internet Explorer Fix
$(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
	var cint = setInterval("doThis(i)",70);//500 is the fade in speed in milliseconds

});

function doThis() {
	var images = $('.preload').length;//count the number of images on the page
	if (i >= images) {// Loop the images
		clearInterval(cint);//When it reaches the last image the loop ends
	}
	//$('.preload:hidden').eq(i).fadeIn(500);//fades in the hidden images one by one
	$('.animated_icon').eq(0).animate({opacity:1},{"duration": 500});
	$('.animated').eq(0).animate({opacity:1},{"duration": 500});
	$('.animated').eq(0).removeClass("animated");
	$('.animated_icon').eq(0).removeClass("animated_icon");
	i++;//add 1 to the count
}
