jQuery(document).ready(function(){

	bheight=jQuery('body').height();

	updateContent();

	var resizeTimer = null;
	jQuery(window).bind('resize', function() {
	if (resizeTimer) clearTimeout(resizeTimer);
		resizeTimer = setTimeout(updateContent, 100);
	});

	if (jQuery(".home-banner").length > 0) {
		jQuery(".home-banner").cycle({ 
			fx:			'scrollLeft',  
			speed:		800, 
			timeout:	10000, 
			random:		1
		});
		jQuery(".home-banner").hover(
			function () {
				jQuery(this).cycle("pause");
			}, 
			function () {
				jQuery(this).cycle("resume");
			}
		);
	}

});

function updateContent() {
	wheight=jQuery(window).height();
	wcontent=jQuery('#content').height();
	padding=wheight-bheight;
	paddinghome=padding+194;
	data = wheight + " : " + wcontent + " : "  + padding + " :: " + bheight + " : " + paddinghome;
	if (padding>0) {
		jQuery('#content').css({'padding-bottom' : padding+'px'});
	}
	if (jQuery('body.home #content').length > 0) {
		jQuery('#content').css({'padding-bottom' : paddinghome+'px'});
	}
	if (jQuery('body.page-id-2 #content').length > 0) {
		paddinghome=padding+174;
		jQuery('#content').css({'padding-bottom' : paddinghome+'px'});
	}
//	jQuery('.company-info .small').html(data);
}
