$(document).ready(function() {
	var docHeight = $(document).height();
	var winHeight = $(window).height();
	var pageHeight;
	if (docHeight > winHeight) {pageHeight = docHeight}
	else {pageHeight = winHeight}
	if ((pageHeight/2) < 500) {
		$('#topContainer').height(pageHeight/2);
		$('#contentContainer').height((pageHeight/2)-54);
	}
	else {
		$('#topContainer').height(500);
		$('#contentContainer').height(pageHeight-429);
	}
	
	
	$(window).resize(function() {
		var docHeight = $(document).height();
		var winHeight = $(window).height();
		if (docHeight > winHeight) {pageHeight = docHeight}
		else {pageHeight = winHeight}
		if ((pageHeight/2) < 500) {
			$('#topContainer').height(pageHeight/2);
			$('#contentContainer').height((pageHeight/2)-54);
		}
		else {
			$('#topContainer').height(500);
			$('#contentContainer').height(pageHeight-429);
		}
	});
	
});
