$(document).ready(function() {

	// Animate home page if this is a new session
	if ($.cookie('homeload') != 1 && $('body').attr('id') == 'home') {

		// Set session cookie for home page so subsequent loads don't animate
		$.cookie('homeload', 1);

		// Hide elements, then sequential fade in each column
		$("body.home div.column").hide(0);
		$("body.home #bottom").hide(0);
		$("body.home #header").hide(0).fadeIn(2000, function() {
			$("body.home div.column").EffectChain({effect: "fadeIn", onComplete:
				function() {
					$("body.ss-2010-front #showcase img.zoom").jScale({w:'394px', h:'580px', speed:2000}, function() {
						$("body.ss-2010-front #showcase img.zoom").fadeOut(1500, function() {
							$(this).remove();
							//$("#showcase ul").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '580px' });
						});
						$("body.ss-2010-front #showcase img.zoom2").animate({opacity: 1.0}, 2000, '', function() {
							$(this).fadeOut(2000, function() {
								$(this).remove();
							});
						});
					});

					$("body.fw-2010-front #showcase ul").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '580px' });
				}
			});
			$("body.home #bottom").fadeIn(3000);
		});

	} else {

		$("body.ss-2010-front #showcase img.zoom").jScale({w:'394px', h:'580px', speed:2000}, function() {
			$("body.ss-2010-front #showcase img.zoom").fadeOut(1500, function() {
				$(this).remove();
				//$("#showcase ul").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '580px' });
			});
			$("body.ss-2010-front #showcase img.zoom2").animate({opacity: 1.0}, 2000, '', function() {
				$(this).fadeOut(2000, function() {
					$(this).remove();
				});
			});
		});

		$("body.ss-2010-front #showcase ul").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '580px' });
		$("body.fw-09-front #showcase ul").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '580px' });
		$("body.fw-2010-front #showcase ul").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '580px' });

		//$("#sidebar ul").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '480px' });
		$("#footwear").innerfade({ animationtype: 'fade', speed: 2500, timeout: 2500, type: 'sequence', containerheight: '580px' });

	}

	// Press image slider
	$("#press").easySlider({
		prevText: '',
		nextText: ''
	});

	// About page
	$("#about").tabs({ fx: { opacity: 'toggle' } });

	// Previous Collections
	$("body.previous-index div.previous-toc li.comingsoon a").click(
		function() {
			$(this).parent().parent().parent("div.previous-toc").children("ul").fadeOut("fast");
			$(this).parent().parent().parent("div.previous-toc").children("div.comingsoon").animate({opacity: 1.0}, 250, '', function() {
				$(this).fadeIn("fast");
			});
			return false;
		}
	);
	$("body.previous-index div.previous-toc div.comingsoon a").click(
		function() {
			$(this).parent().fadeOut("fast", function() {
				$(this).parent().children("ul").fadeIn("fast");
			});
			return false;
		}
	);

});
