<!--

	// validate an email address as being well-formed
	function wellFormedEmail(sEmailAddress) {
		
		var bResult = true;
		var iIndexOfAtSign = sEmailAddress.indexOf('@');
		var sDomain;
		var sUser;
		var sValidDomainChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxzy0123456789-.";
		var sValidUserChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxzy0123456789-.!#$%&*+-~/.";
		
		var iChar;
		var sChar;
		
		if (sEmailAddress.length == 0)
			bResult = false;
		else if (iIndexOfAtSign == -1)
			bResult = false;			// there is no '@' sign
		else {
			if (iIndexOfAtSign != sEmailAddress.lastIndexOf('@')) 
				bResult = false;		// more than one '@' character
			else {
			
				// separate the part before the '@' (user) from the part after (domain)
				sDomain = sEmailAddress.substring(iIndexOfAtSign + 1);
				sUser = sEmailAddress.substring(0, iIndexOfAtSign);
				
				// validate the domain portion
				if (sDomain.length == 0) 	
					bResult = false;				// no domain portion
				else {
					if (sDomain.indexOf('..') > -1)
						bResult = false;				// sequence of two dots
					else if (sDomain.indexOf('.') == sDomain.length - 1)
						bResult = false;				// dot at the end
					else if (sDomain.indexOf('.') == - 1)
						bResult = false;				// no dot
					else {
						for (iChar = 0; iChar < sDomain.length; iChar++) {
							sChar = sDomain.substring(iChar, iChar + 1);
							if (sValidDomainChars.indexOf(sChar) == -1) {
								bResult = false;	// invalid character
								break;
							}
						}
					}
				}
				
				// validate the user portion
				if (sUser.length == 0) 	
					bResult = false;				// no user portion
				else {
					if (sUser.indexOf('..') > -1)
						bResult = false;				// sequence of two dots
					else if (sUser.indexOf('.') == sUser.length - 1)
						bResult = false;				// dot at the end
					else {
						for (iChar = 0; iChar < sUser.length; iChar++) {
							sChar = sUser.substring(iChar, iChar + 1);
							if (sValidUserChars.indexOf(sChar) == -1) {
								bResult = false;	// invalid character
								break;
							}
						}
					}
				}
			}
		}
		return (bResult);
	}

function getObject(name)
{
  if (document.getElementById) {
    return document.getElementById(name);
  } else if (document.all) {
    return document.all[name];
  } else if (document.layers) {
    return document.layers[name];
  }
}

function showSection(name)
{
  var section = new getObject(name);

  if (section != null) {
	  section.style.visibility = "visible";
	  section.style.display = "block";
  }
}

function hideSection(name)
{
  var section = new getObject(name);
  
  if (section != null) {
	  section.style.visibility = "hidden";
	  section.style.display = "none";
  }
}

function toggleSection(name)
{
	var section = new getObject(name);
	  
	if (section != null) {
		if (section.style.visibility == "hidden")
		{
			section.style.visibility = "visible";
			section.style.display = "block";
		} else { 
			section.style.visibility = "hidden";
			section.style.display = "none";
		}
	}
}

// -->


