/*
 * Change the background of the menu1 div and its containing links
 */
function changeNavMenu1BGColor(new_color) {
	if(document.getElementById){
		// change div background
		document.getElementById("nav-menu1").style.backgroundColor = new_color;
		// grab all links from the list in the nav-menu1 iv
		links = document.getElementById("nav-menu1").getElementsByTagName("a");
		// change bg color and border of each link 
		for (var i=0; i < links.length; i++) {
			links[i].style.backgroundColor = new_color;
			links[i].style.borderColor = new_color;
		}
	}
}

/*
 * Count the chars in one field and display it in another
 * fldTarget  - field whose characters to count (text field or a textarea)
 * fldCounter - field to use as a counter
 * maxLimit   - maximum number of characters allowed in fldTarget
 */
function countCharsLimiter(fldTarget, fldCounter, maxLimit) {
	if (fldTarget.value.length > maxLimit)
    	fldTarget.value = fldTarget.value.substring(0, maxLimit);
	else
		fldCounter.value = maxLimit - fldTarget.value.length;
}