//THIS SECTION IS RESERVED FOR ASK IT/UW
function isBlank(q) {
  var whitespace = new String(" \t\n\r");
 
  for (var i = 0; i<q.length; i++) {
    if (whitespace.indexOf(q.charAt(i)) == -1) {
      return false;
    }
  }
 
  return true;
}
 
function submitForm(){
  var d = document.questionForm;
  if (!isValidForm())
    return;
 
  d.submit();
}
 
function isValidForm(){
  var d = document.questionForm;
  if (d.question.value==defaultStr  ||  isBlank(d.question.value)) {
    return false;
  }
 
  d.action=cURL+'results.jsp';
  d.requestType.value='NormalRequest';
  return true;
}
 
function topTen(){
  var d = document.questionForm;
  d.action=cURL+'topQuestions.jsp';
  d.submit();
  d.action=cURL+'results.jsp';
}
 
function clearForm(){
  var d = document.questionForm;
  d.id.value=-1;
  d.reset();
  d.question.focus();
  d.question.value='';
}
//This function allows for the first level menu item to stay highlighted,
//while the second level menu is used. Triggered by onmouseover defined in
//Script Library: makePopupMenu
function highlightParentMenu(hiWho){
	if(hiWho.parentNode){
		if((hiWho.parentNode).parentNode){
			var myParent = (hiWho.parentNode).parentNode;
			var anchorChildren = new Array();
			anchorChildren = myParent.childNodes;
			myParent.style.backgroundColor = '#FE0B21';
			myParent.style.color = '#FFFFFF';
			for(var knt = 0; knt < anchorChildren.length; knt++){
				if(anchorChildren[knt].tagName == 'A'){
					anchorChildren[knt].style.backgroundColor = '#FE0B21';
					anchorChildren[knt].style.color = '#FFFFFF';
				}
			}
		}
	}
}
//This function removes any style properties assigned to the first level menu item
//in the function highlightParentMenu. Triggered by onmouseout defined in
//Script Library: makePopupMenu
function lowlightParentMenu(loWho){
	if(loWho.parentNode){
		if((loWho.parentNode).parentNode){
			var myParent = (loWho.parentNode).parentNode;
			var anchorChildren = new Array();
			anchorChildren = myParent.childNodes;
			myParent.removeAttribute('style');
			for(var knt = 0; knt < anchorChildren.length; knt++){
				if(anchorChildren[knt].tagName == 'A'){
					anchorChildren[knt].removeAttribute('style');
				}
			}
		}
	}
}
