// JavaScript Document
function doCancel()
{
	document.forms[0].reset();
	return false;
}
/*-------------------------------------------------------------------------
 *  isEmail -- Check if the given email address is valid
 *    Args:	argEmailValue - email address 
 *    Returns:	If valid email address return true else false
 -------------------------------------------------------------------------*/
function isEmail(argEmailValue)
{
  if(/^[a-zA-Z0-9]+([\.]?[a-zA-Z0-9]+)*([_]?[a-zA-Z0-9]+)*@[a-zA-Z0-9]+([\.]{1}[a-zA-Z0-9]+)*(\.[a-zA-Z]{2,3})+$/.test(argEmailValue))
    {	
      return true;
    }
  return false;
}	/*  End of isEmail		End of isEmail   */

/*-------------------------------------------------------------------------
 *  isAlphaNumeric -- To find whether the given value is alphanumeric or not.
 *    Args:	argValue - value to be checked.
 *    Returns:	true if alpha numeric else false.
 -------------------------------------------------------------------------*/
function isAlphaNumeric(argValue)
{
  var regAlphaNumeric = /^[a-zA-Z]+[a-zA-Z0-9]*$/;
  if(!regAlphaNumeric.test(argValue))
    {
      return false;
    }
  return true;
}	/*  End of isAlphaNumeric		End of isAlphaNumeric   */

/*-------------------------------------------------------------------------
 *  isNumeric -- To find whether the given value is numeric or not
 *    Args:	argValue - value to be checked.
 *    Returns:	true if numeric else false
 -------------------------------------------------------------------------*/
function isNumeric(argValue)
{
  var regNumeric = /^[0-9]+$/;
  if(!regNumeric.test(argValue))
    {
      return false;
    }
  return true;
}	/*  End of isNumeric		End of isNumeric   */

/*-------------------------------------------------------------------------
 *  isPhoneNo -- To find whether the given value is valid phone no.
 *    Args:	argValue - value to be checked
 *    Returns:	true if valid phone no else false.
 -------------------------------------------------------------------------*/
function isPhoneNo(argValue)
{
  var reg = /^[\+]{0,1}[0-9]+[\-0-9]+[0-9]+$/;
  if(!reg.test(argValue))
    {
      return false;
    }
  return true;
}	/*  End of isPhoneNo		End of isPhoneNo   */

/*-------------------------------------------------------------------------
 *  isAlphabet -- To find whether the given value is alphabet.
 *    Args:	argVal - value to be checked.
 *    Returns:	true if the value is alphabet else false
 -------------------------------------------------------------------------*/
function isAlphabet(argVal)
{
  var reg = /^[A-Za-z]+$/;
  if(!reg.test(argVal))
    {
      return false;
    }
  return true;
}	/*  End of isAlphabet		End of isAlphabet   */

/*-------------------------------------------------------------------------
 *  isSpaceAlphabet -- To find whether the given value is alphabet.
 *    Args:	argVal - value to be checked.
 *    Returns:	true if the value is alphabet else false
 -------------------------------------------------------------------------*/
function isSpaceAlphabet(argVal)
{
  var reg = /^[A-Za-z]+[A-Za-z\s]*[A-Za-z]+$/;
  if(!reg.test(argVal))
    {
      return false;
    }
  return true;
}	/*  End of isAlphabet		End of isAlphabet   */


function validateURL(argVal)
{
    //return /^(ftp|https?):\/\/+(www\.)?[a-z0-9\-\.]{3,}\./.test(argVal);
	if(argVal != "")
	{
		return /^(www\.)?[a-z0-9\-\.]{3,}\./.test(argVal);
	}
	else
	{
		return true;
	}
}