function checkEmail(myForm) 
{
	//if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(myForm.emailAddr.value) )
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(myForm) )
	{
		return (true)
	}
	alert("Invalid E-mail Address! Please re-enter.")
	return (false)
}


function ltrim(argvalue) 
{
  while (1) 
  {
    if (argvalue.substring(0, 1) != " ")
      break;
    argvalue = argvalue.substring(1, argvalue.length);
  }
  return argvalue;
}


function rtrim(argvalue) 
{
  while (1) 
  {
    if (argvalue.substring(argvalue.length - 1, argvalue.length) != " ")
      break;
    argvalue = argvalue.substring(0, argvalue.length - 1);
  }
  return argvalue;
}


function trim(argvalue) 
{
  var tmpstr = ltrim(argvalue);
  return rtrim(tmpstr);
}

// JavaScript Document


// ********************	CHECK BOX VALIDATIONS	FUNCTIONS	********	

function checkAll(chkAllName, chkboxName, numChar,  frmName)
{
//  checkAll(this,'uid',3,this.form)
//  chkAllName = is the name of checkbox which check/uncheck checkboxes 
//	chkboxNamename = is name of checkboxes which will checked/unchecked on clicking check all checbox
//	numChar is numeric argument which is used to cut character from name of the object and compare
//	with chkboxName string.
//	frmName is the name of form object.

	if(chkAllName.checked )	
		chkFlag=true;		
	else
		chkFlag=false;		

	loopCount = frmName.length;

	for(i=0; i < loopCount; i++)
	{
		elName = frmName.elements[i].name.toString();
		elName = elName.substring(0,numChar);
	
		if( frmName.elements[i].type == "checkbox" &&  elName == chkboxName)
			frmName.elements[i].checked = chkFlag;
	}
}


//('uid',3,this.chkAll,this.form)
function notChkall(chkboxName, numChar,frmName)
{
	chkCount = 1;
	
	loopCount = frmName.length;

	for(i=0; i < loopCount; i++)
	{
		elName = frmName.elements[i].name.toString();
		elName = elName.substring(0,numChar);
	
		if( frmName.elements[i].type == "checkbox" &&  elName == chkboxName)
		{
			if (frmName.elements[i].checked == false)
				chkCount = 0;
		}	
	}

	if(chkCount == 0 )
		frmName.chkAll.checked = false;	
	
	if(chkCount == 1 )
		frmName.chkAll.checked = true;	
}



function isCheck(chkName, frmName, numChar)
{
	tmpFlag = false;
	loopCount = frmName.length;

	for(i=0; i < loopCount ; i++)
	{
		if( frmName.elements[i].type == "checkbox" && frmName.elements[i].name.substr(0,numChar) == chkName)
		{
			if(frmName.elements[i].checked)					
				tmpFlag = true;
		}
		if(tmpFlag == true) break;
	}
	if(tmpFlag == false)
	{
		alert("Please Select Checkbox.");	
		return false;
	}
}
