function browserIsIE7(){
   if (document.all && !window.opera && window.XMLHttpRequest) { return true;}
   else { return false; }
}
function browserLessThanIE7(){
   return navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;
}
function resizePage()  {
	var theDiv = $("#side .pane");
	var paddingPane=parseInt(theDiv.css("padding-top"))+parseInt(theDiv.css("padding-bottom"));
	var minHeight = theDiv.height()+paddingPane;
	var minHeight2 = $('#contentPane .pane').height()+paddingPane;
	if (minHeight2>minHeight) {
		minHeight = minHeight2;
	}
	if ($(window).height()<=minHeight) {
		$('#side').css("height",minHeight);
		$('#content').css("height",minHeight);
		$('#global').css("height",minHeight);
	} else {
		$('#side').css("height","100%");
		$('#content').css("height","100%");
		$('#global').css("height","100%");
	}
	if (browserIsIE7() || browserLessThanIE7()) {
		if ($('#closeButton').css("margin-left").replace("px", "")<0) {
			$('#content').css("width",$(window).width()-$('#side').width()-$('#side').css("padding-left").replace("px", "")-$('#side').css("padding-right").replace("px", ""));
		} else {
			$('#content').css("width",$(window).width()-$('#closeButton').width());
		}
	}
	$('#closeButton').css("margin-top",$('#content').height()/2-152);
}
$(window).resize(resizePage);
$(document).ready(resizePage);

