function CheckEmail(element)
{
  var result = false
  var theStr = new String(element.value)
  var index = theStr.indexOf("@");

  if (theStr.length > 0) {

     if (index > 0)
     {
       var pindex = theStr.indexOf(".",index);
       if ((pindex > index+1) && (theStr.length > pindex+1))
   	result = true;
     }

    if (!result) {
   	alert("Please enter a valid email address");
	element.select();
	element.focus();
    }
  }
}


function CheckPhone(element)
{
  var result = false
  var theStr = new String(element.value)

  if (theStr.length > 0) {


	theNewStr = theStr.replace(/-/g, "");
	
     if (theNewStr.length == 10 ) {
		result = true;
     }

	if (!result) {
		alert("Please enter a valid phone number starting with your area code \n Format: 555-555-5555 " );
		//alert("Please enter a valid phone number starting with your area code \n Format: 555-555-5555 \n You Entered: " + theStr + " \n Converted to: " + theNewStr );
		element.select();
		element.focus();
    }
  }
}