$.noConflict();

jQuery.fn.resizeElement = function(diff) {   			
	this.css('height', this.height() + diff);
};

jQuery(document).ready(function($) {
	var contentHeight = $('#cpad1').height();
	var wrapperHeight = $('#content_frame').height();
	if (contentHeight > wrapperHeight) {
		var diff = contentHeight - wrapperHeight + 40;
		$('#content_frame, #center_container').each(function() {
			$(this).resizeElement(diff)
		});
		$('#footer').css('top', $('#footer').css('top').toInt() + diff);
		// alert('content: ' + contentHeight + '  wrapper: ' + wrapperHeight);
	}
	var winHeight = $(window).height();
	// console.log(winHeight + " : " + $('#content_frame').height());
	if ($('#content_frame').height() > ( winHeight - 290)) {
		$('#footer').css({position: 'fixed', bottom: '0px', top: 'auto'});
	}; 
});
