// JavaScript Document
function truncateText(tId)	{
	var len = 200;
	var p = document.getElementById(tId);
	if (p) {
	
	  var trunc = p.innerHTML;
	  if (trunc.length > len) {
	
		/* Truncate the content of the P, then go back to the end of the
		   previous word to ensure that we don't truncate in the middle of
		   a word */
		trunc = trunc.substring(0, len);
		trunc = trunc.replace(/\w+$/, '');
	
		/* Add an ellipses to the end and make it a link that expands
		   the paragraph back to its original size */
		trunc += '<a class="expandCollapse" href="#" ' +
		  'onclick="this.parentNode.innerHTML=' +
		  'unescape(\''+escape(p.innerHTML)+'\');return false;">' +
		  '[+] more<\/a>';
		p.innerHTML = trunc;
	  }
	}
}


function validateRegistration()	{
	var reqFields = new Array('title','fName','lName','organization','address1','city','state','zip','phone','email');
	errString = "";
	for(n in reqFields)	{
		if (document.register[reqFields[n]].value == "") {
			errString += "\n"+reqFields[n];
		}
	}
	if (errString != "")	{
		alert("Missing required fields"+errString);	
	} else {
		document.register.submit()	
	}
	
}
