var $jq = jQuery.noConflict();

$jq(document).ready(function() {
	// check if user is authenticated
	if ($jq('.login').html().match("Logout")) {
		$jq('#menu').addClass("admin");
		$jq('#header #header-links .login').css('display','block');
	}
	
	// register widget display toggle
	$jq("#register-form").hide(0); // hidden by default
	$jq("#register-slide").click(function() {
		$jq("#register-form").slideToggle("normal");
	});
	$jq("#register-float .close").click(function() {
		$jq("#register-form").slideToggle("normal");
	});
	
	// fix #content height if there is not enough content
	if ($jq(document).height() <= $jq(window).height()) {
		$jq('#content').css('height', ($jq(window).height()-262) + "px");
		
		// remove empty cells
		$jq('#content td').each(
			function(){
				if ($jq(this).hasClass('DNNEmptyPane')) {$jq(this).remove();}
			}
		)		
		// remove empty rows
		$jq('#content tr').each(
			function(){
				if ($jq(this).children().length == 0) {$jq(this).remove();}
			}
		)
	
		// align remaining conent
		$jq('#content td').attr("valign", "top");
		$jq('#content tr').attr("valign", "top");
	}

});   