/******************************************************/
// the resize.... functions are used to resize elements on the home page according to the design
function resizeElements(){
	resizeBottomContent();
	resizeRightSidebar();
}

// resizes the boxes in the bottom content region so that the borders will consistently be the same size
function resizeBottomContent(){
	var newsHeight = document.getElementById("latest_news").offsetHeight;
	var cccHeight = document.getElementById("client_contact_center").offsetHeight;
	var financialRatingsHeight = document.getElementById("financial_ratings").offsetHeight;
	
	var largestHeight = 0;
	if (newsHeight >= cccHeight){
		if (newsHeight > financialRatingsHeight){
			largestHeight = newsHeight;
		} else {
			largestHeight = financialRatingsHeight
		}
	} else {
		if (cccHeight >= financialRatingsHeight){
			largestHeight = cccHeight;
		} else {
			largestHeight = financialRatingsHeight
		}
	}
	largestHeight += "px";
	document.getElementById("latest_news").style.height = largestHeight;
	document.getElementById("client_contact_center").style.height = largestHeight;
	document.getElementById("financial_ratings").style.height = largestHeight;
}

// resizes the left main content region and the right sidebar so that the bottom corners of the two regions will line up
function resizeRightSidebar(){
	var leftContentHeight = document.getElementById("content_left_wrapper").offsetHeight;
	var sidebarHeight = document.getElementById("right_sidebar").offsetHeight;
	
	if (leftContentHeight >= sidebarHeight){
		//two pixels are subtracted to account for the top and bottom border on the right sidebar
		document.getElementById("right_sidebar").style.height = leftContentHeight - 2 + "px";
	} else {
		/*the difference in pixels is added to the bottom_content sections individually in order to push the content_left_wrapper down and visually align the boxes
		  and also to make sure the box borders come down as well*/
		var heightDifference = sidebarHeight - leftContentHeight;
		if (ieBool){
			document.getElementById("bottom_content_left_rounded").style.bottom -= 10;
			document.getElementById("bottom_content_right_rounded").style.bottom -= 10;
		}
		document.getElementById("bottom_content").style.height = document.getElementById("bottom_content").offsetHeight + heightDifference - 2 + "px";

		document.getElementById("latest_news").style.height = document.getElementById("latest_news").offsetHeight + heightDifference - 2 + "px";
		document.getElementById("client_contact_center").style.height = document.getElementById("client_contact_center").offsetHeight + heightDifference - 2 + "px";
		document.getElementById("financial_ratings").style.height = document.getElementById("financial_ratings").offsetHeight + heightDifference - 2 + "px";

	}
}
/******************************************************/

/******************************************************/
// used to clear out the input field when it gets focus if the default text is currently entered
function clearField(theField, defaultValue){
	if (theField.value == defaultValue){
		theField.value = "";
	}
}

// used to put the default text back in the field when blurred and empty
function fillField(theField, defaultValue){
	if (theField.value == ""){
		theField.value = defaultValue;
	}
}
/******************************************************/