// fix the left menu being position absolute UI bug
function fixRightContentContainer() {
	var leftContainer = document.getElementById('leftContentContainer');
	var rightContainer = document.getElementById('rightContentContainer');

	if(leftContainer && rightContainer) {
		var leftContainerHeight = leftContainer.offsetHeight;
		var rightContainerHeight = rightContainer.offsetHeight;
		if(leftContainerHeight > rightContainerHeight) {
			if(jQuery.browser.msie && jQuery.browser.version == '6.0') {
				$("div#rightContentContainer").height(leftContainerHeight);
			} else {
				$("div#rightContentContainer").attr("style", "min-height: "+leftContainerHeight+"px");
			}
		}
	}
}



// prepare the form when the DOM is ready 
$(document).ready(function() {
	// below is needed for fix the IBM search menu javascript error for SITE SEARCH
	$("input#searchDisplayFieldName_searchAviva").keypress(function (e) {
		if (e.which == 13) {
			// uncomment the line below makes the site search work in IE 6
			//alert($("input#searchDisplayFieldName_searchAviva").val());
			// http://groups.google.com/group/comp.lang.javascript/msg/e02fd02952dd0d24 for more info on this issue
			// submit the form
			$("form#siteSearchForm").submit();
		}
	});
	
	// kill all table borders 
	$("table[border!='0']").attr("border", "0");

	
	fixRightContentContainer();

	// date picker default setting
	$.datepicker.setDefaults({showOn: 'button', buttonText: '&nbsp;', showAnim: 'show', speed: ''});
}); // end of DOM ready