//*********************************************************************
// File Name               : common_script.js
// Scope Of Program        : validation script for  blank, numeric,
//			     alpha-numeric,email id form field.
// Created On              : 10/03/2004
// Modified On             : 11/03/2004
// Reason of Modification  : Add date validation function
// Special Remark          :
//*********************************************************************


function validate_Password(doc)
{
	var password = doc.frmPswd.value;
	re  =  new RegExp("[A-Za-z0-9]","g");
	
	tmp_ret = true;		
	
	for(var i=0; i< password.length; i++)
	{
		var c = password.charAt(i);
		var num = c.search(re);
		
		if( num == -1)
		{
			alert("Please enter numeric or alpha-numeric password");
			tmp_ret = false;  
			break;
		}
	}
	
	return tmp_ret;
}

function validate(doc,msg)
{
	if(!(isAggree(doc,msg)))
	{
		return false;
	}	
	
	return true;
	
}

function isAggree(doc,msg)
{	
	if(!(doc.frmTerm.checked))
	{
		alert("tick box must be activated in order to complete the "+msg);
		return false;
	}
	else
	{
		return true;
	}
}