function setFooter(){
	
	var cHeight = jQuery(".headerContainer").height()+jQuery(".contentContainer").height();
	var dHeight = jQuery(window).height();
	if(cHeight+60 > dHeight){
		jQuery(".mainFrame").css({'height': (cHeight+60)+'px'});
	}else{
		jQuery(".mainFrame").css({'height': (dHeight)+'px'});
	}
}

function slideSwitch() {
//alert(jQuery('#slideshow IMG').length);
	if(jQuery('#slideshow IMG').length == 1){
		jQuery('#slideshow IMG').addClass("active");
		return false;
	}

	var active = jQuery('#slideshow IMG.active');

    if ( active.length == 0 ) {
		active = jQuery('#slideshow IMG:last');
	}
	
	var next =  active.next().length ? active.next() : jQuery('#slideshow IMG:first');
	
    active.addClass('last-active');
	
	next.css({opacity: 0.0})
        .addClass('active').delay(2500)
        .animate({opacity: 1.0}, 1500, function() {
            active.removeClass('active last-active');
            slideSwitch();
        });
}

jQuery(window).resize(function() {
  setFooter();
});

jQuery(window).load(function(){  
	var t = 0;
	jQuery("#slideshow IMG").each(function () {
		if ( jQuery(this).height() > t ) {
			t = jQuery(this).height();
		}
	});

	jQuery('#slideshow').css("height", t+"px");
	setFooter();	
});

$j = jQuery.noConflict();
$j(document).ready(function(){
	$j(".navHolder>.mod_navigation>ul>li>a").mouseenter(function () {
		if(!$j(this).hasClass("trail") && !$j(this).hasClass("home") ){	
			$j(this).animate({ marginTop: "-5px" }, 500 );			  
		}
	});
	
	$j(".navHolder>.mod_navigation>ul>li>a").mouseleave(function () {
		if(!$j(this).hasClass("trail") && !$j(this).hasClass("home")){
			$j(this).animate({ marginTop: "-50px"}, 200 );			  
		}
	});
	
	
	$j(".mod_login .opener").click(function(){
		if($j(".mod_login").width() > 36){
			$j(".mod_login").animate({width: 36});
			$j(".mod_iso_cart").animate({width: 36});
		}else{					
			$j(".mod_login").animate({width: 178});
			$j(".mod_iso_cart").animate({width: 178});
		}
	});

});


