$(document).ready(function(){
	startList();
	fixPanelHeights();
	enterLoginSubmit();
}); //end ready


function enterLoginSubmit()
{
	$("#password").keydown(function(e){
		
		var key = e.charCode || e.keyCode || 0;  
		
		//if the enter key was pressed
		if(key == 13)
		{
			document.forms['frm_upper_login'].submit();
		}
		
	});
}


//hack function for the drop down menus for ie
function startList() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("pre_reg_nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}//end function startList


//function to fix the main panel's height if it is shorter than
//the right side bar
function fixPanelHeights()
{
	if($("#right_sidebar").length <=0) return
	
	$rt_ht = $("#right_sidebar").css("height").replace("px", "");
	$lt_ht = $("#main_content").css("height").replace("px", "");

	if($rt_ht > $lt_ht)
	{
	  $("#main_content").css("height", $rt_ht);
	  $(".side_menued_content").css("height", $("#main_content").height() - 15 + 'px');
	}
}//end function fixPanelHeights


