function display(id,loc) {
	document.getElementById('sub_nav').style.display = "block";
	document.getElementById('sub_nav').style.left = loc;
	document.getElementById('links').innerHTML = id;
}
function hide() {
	document.getElementById('sub_nav').style.display = "none";
}
function show() {
	document.getElementById('sub_nav').style.display = "block";
}

function _gel(id) {
  return document.getElementById(id);
}

function updateCharCount(CharCountId, LabelId, TextAreaId, intMaxChars) {
  if(TextAreaId.value.length > intMaxChars) {
    if(_gel(LabelId).innerHTML != "Character overage:") {
      _gel(LabelId).innerHTML = "Character overage:";
    }
    _gel(CharCountId).value = (TextAreaId.value.length - intMaxChars);
  }
  else {
    if(_gel(LabelId).innerHTML != "Characters remaining:") {
      _gel(LabelId).innerHTML = "Characters remaining:";
    }
    _gel(CharCountId).value = (intMaxChars-TextAreaId.value.length);
  }
}


function submenuMouseoutHandler(event) {
	var toElement = null;
	if (event.relatedTarget)
		toElement = event.relatedTarget;
	else if (event.toElement)
		toElement = event.toElement;

		//while (toElement && toElement.id != submenuId)
		//toElement = toElement.parentNode;
		while (toElement && toElement.tagName != "DIV")
			toElement = toElement.parentNode;
		if (!toElement) {
			alert('out of div');
	}
}