
jQuery(document).ready(function() {
	//contentHeight = jQuery('#content').height()+634;
	contentHeight = jQuery('#content').height()+629;	
	footerTabsHeight = 440;
	windowHeight = jQuery(window).height();
	
	if( windowHeight > contentHeight ) { contentHeight = windowHeight-79; }
	
	jQuery(window).bind('resize', function() {
		windowHeight = jQuery(window).height();
		if( windowHeight > contentHeight ) { contentHeight = windowHeight-79; }
		posFooter(contentHeight);
    }).trigger('resize');
	
	posFooter(contentHeight);
	
	jQuery("#footerSlides").wslide({
		width: 660,
		height: 350,
		autolink: false,
		duration: 2000,
		horiz: true
	});
	
	jQuery('a.footerBtn').click(function(){
		jQuery("#footerTabs").animate({
				height: footerTabsHeight+'px',
				top: contentHeight+40-footerTabsHeight+'px'
			}, {
				duration:1500,
				easing:'easeOutExpo'
		});
		jQuery('a.footerBtn').removeClass("active");
		jQuery(this).addClass("active");
		jQuery("#footerTabs").css('overflow', 'none');
	});
	
	jQuery('.footerClose').click(function(){
		jQuery('a.footerBtn').removeClass("active");
		jQuery("#footerTabs").animate({
				height: '40px',
				top: contentHeight+'px'
			}, {
				duration:1500,
				easing:'easeOutExpo'
			});
		jQuery("#footerTabs").css('overflow', 'hidden');
	});
	
	jQuery("a[rel^=lightbox]").colorbox();
});


function posFooter(contentHeight) {
	jQuery('#footerTabs').css('top', contentHeight+'px').css('overflow', 'hidden');
}
