$(window).resize(function() {
	setContentHeight();
});
$(document).ready(function() {
	if ($('.coda-slider-wrapper').length) {
		$('#coda-slider-1').codaSlider({
			dynamicArrows:false,
			autoSlide:true,
			firstPanelToLoad:1,
			autoSlideInterval:8000,
			autoSlideStopWhenClicked:true,
			dynamicTabsPosition:"bottom",
			dynamicTabsAlign:"center",
			autoHeight:false
		});
	}
});
$(window).load(function() {
	setContentHeight();
//	alert(parseInt($(window).height()) +" "+ parseInt($('body').height()));
});
function setContentHeight(){
	if (parseInt($(window).height()) > parseInt($('body').height())){
		$('#page_footer').css({"position":"fixed","bottom":"0px","width":"100%"});
		if ($('.two_column').length){
			var new_size         = parseInt($(window).height()) - 21 - parseInt($('.two_column').offset().top) - parseInt($('#page_footer').height());
			var left_col_bottom  = parseInt($('#left_column').height());
			var right_col_bottom = parseInt($('#right_column').height());
			var two_col_bottom   = 0;//parseInt($('.two_column').height());
			var tallest          = Math.max(new_size,left_col_bottom,right_col_bottom,two_col_bottom);
			$('.two_column').css({"height":tallest+"px"});		
		}
	}
	if (parseInt($(window).height()) < (parseInt($('body').height()) + parseInt($('body').offset().top) + parseInt($('#page_footer').height()))){
		$('#page_footer').removeAttr("style");
	}
}

