function CancelResume()
{	
  window.location.href='DirectResumeMenu.asp';
}

function CancelEmp()
{	
  window.location.href='DirectEmpMenu.asp';
}

function isEmail (s)
{   
	if (isEmpty(s)) 
		if (isEmail.arguments.length == 1) return false;
		else return (isEmail.arguments[1] == true);
		
  if (isWhitespace(s)) return false;
  
  var i = 1;
  var sLength = s.length;

  while ((i < sLength) && (s.charAt(i) != "@"))
  { i++
  }

  if ((i >= sLength) || (s.charAt(i) != "@")) return false;
  else i += 2;

  while ((i < sLength) && (s.charAt(i) != "."))
  { i++
  }
  		
	if ((s.indexOf(".com")<5)&&(s.indexOf(".org")<5)
		&&(s.indexOf(".gov")<5)&&(s.indexOf(".net")<5)
		&&(s.indexOf(".mil")<5)&&(s.indexOf(".edu")<5))
	{
		return false;
	}

  if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
  else return true;
}

function isWhitespace (s)
{   
	var whitespace = " \t\n\r";
	var i;

  if (isEmpty(s)) return true;
  for (i = 0; i < s.length; i++)
  {   
    var c = s.charAt(i);
    if (whitespace.indexOf(c) == -1) return false;
  }
  return true;
}

function isDigit (c)
{	return ((c >= "0") && (c <= "9"))
}

function isAllDigit (s)
{   
  var i;
  if (isEmpty(s)) 
     if (isAllDigit.arguments.length == 1) return false;
     else return (isDigital.arguments[1] == true);
  for (i = 0; i < s.length; i++)
  {   
    var c = s.charAt(i);
    if (isDigit(c)==false)
    return false;
  }
  return true;
}

function isEmpty(s)
{   
	return ((s == null) || (s.length == 0))
}

function isStateCode(s)
{
	if (s.length !=2) return false;
	s = s.toUpperCase();
	var USStateCodeDelimiter = "|";
	var USStateCodes = "AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY|AE|AA|AE|AE|AP"
	if (isEmpty(s)) 
		if (isStateCode.arguments.length == 1) return false;
    else return (isStateCode.arguments[1] == true);
	return ((USStateCodes.indexOf(s) != -1) && (s.indexOf(USStateCodeDelimiter) == -1))
}

function trimString(inString) {
	var outString;
	var startPos;
	var endPos;
	var ch;

	// where do we start?
	startPos = 0;
	ch = inString.charAt(startPos);
	while ((ch == " ") || (ch == "\b") || (ch == "\f") || (ch == "\n") || (ch == "\r") || (ch == "\n")) {
		startPos++;
		ch = inString.charAt(startPos);
	}

	// where do we end?
	endPos = inString.length - 1;
	ch = inString.charAt(endPos);
	while ((ch == " ") || (ch == "\b") || (ch == "\f") || (ch == "\n") || (ch == "\r") || (ch == "\n")) {
		endPos--;
		ch = inString.charAt(endPos);
	}

	// get the string
	outString = inString.substring(startPos, endPos + 1);

	return outString;
}
