
//file:     ncp_scripts.js
//date:     2007-05-30
//author:   David Cushman 

  function setDelim(str){   
    str.replace(' ','');
    return (str.replace(/ \s*/g,'|'));	
  }
  
function getEssayLength(obj, str, len){	    
    arr = setDelim(str).split('|');
	return_value = true;
	//Allow a 10% overrun
	if (arr.length > (len*1.1)) {
	  
	  alert("You have " + arr.length + " words.  Your response must be no more than " + len + " words long.");
	  //obj.focus();	
	  return_value = false;
	  }
	  
	  return return_value;
	  
  }
  
  function compareEmailAddresses(obj1,obj2, str1, str2){
	    if (str1 != str2) {
			alert("Email entries must match.  Please try again!");
			obj1.value= '';
			obj2.value='';
			//obj1.focus();
		}
		
  }

