// JavaScript Document
$(document).ready(function() {
	if (resizeShell()) {
		$('#main_content').css('z-index',1);
		// innerfade
		$('.innerfade').innerfade({ speed: 'slow', timeout: 3000, type: 'sequence' }).fadeIn('fast',function() {
			$(this).css('display','block');
		});
		$('.ads_rotator').innerfade({ speed: 'slow', timeout: 3000, type: 'sequence', containerheight: '160px' });
		$('#nav').supersubs({
			minWidth: 13,
			maxWidth: 25,
			extraWidth: 1
		}).superfish().css('z-index',9999);
		if($.browser.msie) {
			$(".clearfix").css("display","none");
			//$(".clearfix:after").css("display","none");
		}
		$('#text_content').css("height",($('#text_content').height()<300 ? 300 : $('#text_content').height()));
		/* */
		// modmap
		modmap();
		modurl();
		modlinks();
		modColorbox();
		// collection
		if ($('.jcarousel-skin-custom').length>0) {
			var i=0;
			$('ul.jcarousel-skin-custom li').each(function() {
				i++;
			});
			var c = 3;
			var min_items = 2;
			if (i >= min_items) {
				$('.collection_carousel').hide().jCarouselLite({
					//start: 1,
					mouseWheel: true,
					btnNext: i>3 ? "#next" : "",
					btnPrev: i>3 ? "#prev" : "",
					easing: "expoinout",
					speed: 500
				}).hide().fadeIn("slow");
				nav();
			}
			else $('.collection_carousel').hide().fadeIn("slow");
		}
		if (i<4) $('a.button').hide();
		if ($('#collection_big_content').length > 0) {
			$('#collection_big_content').hide().fadeIn("slow");
		}
		main_navSwapDepths();
	}
	$("#newsletter_submit").click(function() {
		if($('#email').attr('title')==$('#email').val()) $('#email').val('');
		$("#newsletter_signup_form").submit();
	});
	/*
	$('a').click(function() {
		$(this).blur();
	});*/
});
$(window).resize(function(){
	resizeShell();
});