<!--
function trim(stringValue){
	len = stringValue.length;
	if(len == 0)
		return stringValue;
	LeftIndex = 0;
	index = 0;
	for( index=0 ; (index < len)  ; index++ ){
		if( stringValue.charAt(index) != ' ' && stringValue.charAt(index) != '\t' ){
			LeftIndex = index;
			break;
		}
	}

	if (LeftIndex != index)
		LeftIndex = index;
	
	RightIndex = len;
	for( index=len-1 ; (index >= 0)  ; index-- ){
		if( stringValue.charAt(index) != ' ' && stringValue.charAt(index) != '\t' ){
			RightIndex = index+1;
			break;
		}
	}
	
	strTempValue = "";
	for( index=0 ; (index < len)  ; index++ ){
		if( index >= LeftIndex && index < RightIndex ) 
			strTempValue += stringValue.charAt(index);
	}
	return strTempValue;
}

function isIntegerInput(strValue, allowNegative, allowDecimal, allowZero){
    if (strValue.value=="")
     strValue.value=0;
    AllNumbers = true;
    NotFirstSign = false;
    intCounter = 0;
    intDecimals = 0;
    aChar = ' ';
    intLength = 0;
    if(trim(strValue.value) == "")
    {
        strValue.value = '';
        strValue.focus();
        return false;
    }
    strInput = new String(trim(strValue.value));
    strValid = new String('0123456789');
    if (allowNegative)
        strValid = strValid + '-';
    if (allowDecimal)
        strValid = strValid + '.';
    intLength=strInput.length;
    for (intCounter = 0; intCounter < intLength; intCounter++)
	{
        aChar = strInput.substring(intCounter,intCounter+1);
        if(aChar == '.')
            intDecimals++;
        if(aChar == '-' && intCounter != 0)
				NotFirstSign = true;
        if(strValid.indexOf(aChar) == -1)
            AllNumbers = false;
	}

    if (!AllNumbers || intDecimals > 1 || (intDecimals == 1 && !allowDecimal) 
		|| NotFirstSign)
	{
       //alert(getErrorMessage(allowNegative, allowDecimal));
        strValue.value = '';
        strValue.focus();
        return false;
	}

    if(Math.abs(strInput) == 0 && !allowZero)
	{
        strValue.value = '';
        strValue.focus();
        return false;
	}
    else
	{
		strValue.value = Math.abs(strInput);
		return true;
	}
}

function setDateFormat(DateControl, bDisplayFormat, sFormatType){
	if (bDisplayFormat == "FALSE")
	{
		DateControl.CustomFormat = sFormatType;
	}
	else
	{
		DateControl.CustomFormat = " ";
	}
}

function changeFocus(lObj)
{
 lObj.focus();
}

function getDate_mmddyyyy(sDate , argDateFormat) 
{
 //return date string in mm/dd/yyyy format by referring to system date format.
 var lretDateStr;
 argDateFormat = argDateFormat.toLowerCase();
 lretDateStr = argDateFormat;
 switch (argDateFormat)
 {
 case "dd/mm/yy" :
  lretDateStr = sDate.substr(3,2) + "/" + sDate.substr(0,2) + "/" + sDate.substr(6,2);
  break;
 case "dd/mm/yyyy" :
  lretDateStr = sDate.substr(3,2) + "/" + sDate.substr(0,2) + "/" + sDate.substr(6,4);
  break;
 case "dd-mm-yy" :
  lretDateStr = sDate.substr(3,2) + "/" + sDate.substr(0,2) + "/" + sDate.substr(6,2);
  break;
 case "dd-mm-yyyy" :
  lretDateStr = sDate.substr(3,2) + "/" + sDate.substr(0,2) + "/" + sDate.substr(6,4)
  break;
// case "dd/mmm/yy" :
//  lretDateStr = sDate.substr(3,2) + "/" + Mid(MonthName(CLng(Mid(sDate, 1, 2))), 1, 3) + "/" + Mid(sDate, 9, 2)
//  break;
// case "dd/mmm/yyyy" :
//  lretDateStr = Mid(sDate, 4, 2) + "/" + Mid(MonthName(CLng(Mid(sDate, 1, 2))), 1, 3) + "/" + Mid(sDate, 7)
//  break;
// case "dd-mmm-yy" :
//  lretDateStr = Mid(sDate, 4, 2) + "-" + Mid(MonthName(CLng(Mid(sDate, 1, 2))), 1, 3) + "-" + Mid(sDate, 9, 2)
//  break;
// case "dd-mmm-yyyy" :
//  lretDateStr = Mid(sDate, 4, 2) + "-" + Mid(MonthName(CLng(Mid(sDate, 1, 2))), 1, 3) + "-" + Mid(sDate, 7)
//  break;
 }
 return lretDateStr;
}

function callDoNothing(){
	// Uncomment this line whenever this function is coded.
	//document.frm.encoding='application/x-www-form-urlencoded';
}

function CheckEmailId(sEmailId)
{
 var SearchEmailId,i,Searchlen,empEmailId,lenEmailId ,bMatch,charEmailId,cnt1,Searchindx,charindx;
 SearchEmailId = new String("@ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-");
 empEmailId = new String(sEmailId);
 //Searchlen=SearchEmailId.length;
 lenEmailId= empEmailId.length;
 //alert("lenEmailId: " + lenEmailId);
 cnt1=0;
 charindx=-1;
 for(i=0;i<lenEmailId;i++)
 {
	bMatch=false;
	charEmailId=empEmailId.charAt(i).toUpperCase();
	//alert(charEmailId);
	Searchindx=SearchEmailId.indexOf(charEmailId);
	//alert("charEmail " + charEmailId + " Searindx " + Searchindx);
	if (Searchindx==-1)//email character not found
	{
		break;
	}
	else
	{
		bMatch=true;
		if(charEmailId=="@")
		{
			cnt1 = cnt1 + 1;
			//alert(empEmailId.indexOf(charEmailId));
			charindx=empEmailId.indexOf(charEmailId);
		}
	}
	if(cnt1 > 1)
	{
		break;
	}
	
 }
 if(bMatch==false || cnt1 > 1)
 {
	alert("EmailId can consist of letters(A-Z/a-z) or numbers(0-9) or '_' or '-' and single '@'");
	return false;
 }
 if(cnt1 == 0)
 {
	alert("EmailId can consist of letters(A-Z/a-z) or numbers(0-9) or '_' or '-' and single '@'");
	return false;
 }
 if(cnt1 == 1)
 {
	if((charindx==(lenEmailId - 1)) || (charindx == 0))
	{
		alert("Invalid EmailId format");
		return false;
	}
 }
return true;
}

function loginclick(sUserType)
{
  document.frmlogin.hUserType.value = sUserType;
  document.frmlogin.action = "login.php";
  document.frmlogin.submit();
}

//-->

