resizeBackgrounds = function(){};

(function($){
	resizeBackgrounds = function() {
		var dh = $(window).height()
		if (dh > $('.shell').height()) {
			$('.wrap-cnt').height(dh - $('#fullheader').height() - $('.fullfooter').height() - 20);
		}

		$('.first-half').height($('.shell').height());
		$('.second-half').height($('.shell').height());
	}

	$(document).ready(function(){
		resizeBackgrounds();

		$('.sticky-item').hover(function() {
			$(this).find('.sticky-dd').show();
		}, function() {
			$(this).find('.sticky-dd').hide();
		});

		$('.sticky-item:last').addClass('sticky-item-last');
	})
	
	$(window).scroll(function () {
		resizeBackgrounds();
	});
	
	$(window).load(function () {
		var boxes = $('.bottom.box');
		var highest = 0;
		for (var i=0; i < boxes.length; i++) {
			if ($(boxes[i]).height() > highest) {
				highest = $(boxes[i]).height();
			}
		};
		$('.bottom.box').height(highest);
		
		boxes = $('.top.box');
		highest = 0;
		for (var i=0; i < boxes.length; i++) {
			if ($(boxes[i]).height() > highest) {
				highest = $(boxes[i]).height();
			}
		};
		$('.top.box').height(highest);

		$('.blog-outer-header li, #subheader-menu li').hover(function() {
			$(this).find('ul').show();
		}, function() {
			$(this).find('ul').hide();
		});

		resizeBackgrounds();
	})
})(jQuery)
