// JavaScript Document

function CheckEmail(Form,Field)
{ 
	var fld;
	fld =document[Form][Field].value;
	if (!oneOnly(fld,'@',true))
		return 0;			// test for only one @
	
	if (adjacent(fld,'@.') || adjacent(fld,'.@')|| adjacent(fld,'..'))
		return 0;		// test that .@ @. and .. do not occur

	// other validations for this field to be added here
	return 1;
}

function alltrim(strval)
{
myval=strval;
if (myval.length!=0 )
{
  // this is for ltrim()
  while( myval.substring(0,1)==" ")
  {
	myval=myval.substring(1,myval.length);
		if (myval.length==0)
		{
		 myval="";	
		 break;
		}
  }
}

if (myval.length!=0 )
{
  // this is for rtrim()
  while( myval.substring(myval.length-1,myval.length)==" ")
  {
	myval=myval.substring(0,myval.length-1);
		if (myval.length==0)
		{
		 myval="";	
		 break;
		}
  }
}
	return myval;
}
