function isNumeric(e)
{   
	
	var c = (window.Event) ? e.which : e.keyCode;
	

	if ((c < 48 || c > 57) && (c!=8))
	{
	e.returnValue=false;
	}
	
}

function isDecimals(e)
{   
	
	var c = (window.Event) ? e.which : e.keyCode;
	
	if (c==13) return;
	if ((c < 48 || c > 57) && (c!=8) && (c!=46))
	{
		e.returnValue=false;
	}
	
}


function isAlpha(e)
{   
	var c = (window.Event) ? e.which : e.keyCode;
	if (c==13) return;
	if (c==32 || c==46 || c==44  || c==13) return;
	if ((c < 65 || c > 90) && (c < 97 || c > 122)) 
	{
	
	e.returnValue=false;
	}
	
}

function isPower(e)
{   
	var c = (window.Event) ? e.which : e.keyCode;
	if (c==13) return;
	if (c==45 || c==43 || c==46 )  return;
	if ((c < 48 || c > 57) && (c!=8))
	{
	e.returnValue=false;
	}
	
}
function isAlpha_Numeric(e)
{   

	var c = (window.Event) ? e.which : e.keyCode;
	if (c==13) return;
	if ((c < 65 || c > 90) && (c < 97 || c > 122) && (c < 48 || c > 57) && c!=32 && c!=46  ) 
	{
	e.returnValue=false;
	}
	
}

function isNumericForPhone(e)
{   
	var c = (window.Event) ? e.which : e.keyCode;
	
	if (c==13) return;
	if ((c < 48 || c > 57) && (c!=8)  && (c!=45) )
	{
	e.returnValue=false;
	}
	
}

function isNumericForDocPhone(e)
{   
	var c = (window.Event) ? e.which : e.keyCode;
	
	if (c==13) return;
	if (((c < 48 || c > 57) && (c!=8))  || (c==45) )
	{
	
	e.returnValue=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);
}

function isEmail(FormName, FieldName)
{
	var objEmailId = document.forms[FormName].elements[FieldName];
	var EmailIdvalue = objEmailId.value;
    if (EmailIdvalue.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
    {
        return true;
    }
    else
    {
		alert("Invalid E-mail Address! Please re-enter.");
		objEmailId.select();
		objEmailId.focus();
        return false;
    }
}



function limitText(limitField, limitCount, limitNum)
 {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
function chkVal(limitField,limitNum)
 {
	if (limitField.value > limitNum)
	 {
		alert("Please enter the correct month")
		limitField.focus()
	//} else {
	//	limitCount.value = limitNum - limitField.value.length;
	}
}
function isRupee(e)
{
	var c = (window.Event) ? e.which : e.keyCode;
	if (c==13) return;
	if (c==82 || c==83 || c==85 || c==36 || c==115 || c==46 || c==32) return;
	if (((c < 48 || c > 57) && (c!=8))  )
	{
	
	e.returnValue=false;
	}

}