//######################################################################################
			//# Project			: Net4App
			//# Author			: Gagandeep Singh
			//# Author's Email	: gagandeep.s@net4.in
			//# Created Date	: 07-12-2005
			//# Description		: This file contains JavaScript Validation functions
//######################################################################################

var strError;



//Compare 2 strings
// Parameters Description:
// stringVal1			:	First String value
// stringVal2			:	Second String value
function isCompareStrings(stringVal1,stringVal2)
{
	if(stringVal1 == stringVal2)
	{
		return true;
	}
	return false;
}




//Compare 2 integers
// Parameters Description:
// intVal1			:	First integer value
// intVal2			:	Second integer value
function isCompare_LessThan(intMinVal,intMaxVal, ErrorLabelID)
{
	var strError = "";
	if((intMaxVal - intMinVal)<0 )
	{	
		strError = ShowError(536);	
	}
	else
	{
		strError = "";
	}
	intMinVal =0;
	intMaxVal =0;
	SetErrorLabel (ErrorLabelID, strError);
	return strError;
}





//Compare 2 integers
// Parameters Description:
// intVal1			:	First integer value
// intVal2			:	Second integer value
function isCompareGreaterThan(intMaxVal,intMinVal, ErrorLabelID)
{
	var strError = "";
	if(intMaxVal < intMinVal)
	{
		strError = ShowError(538)
		
	}
	SetErrorLabel (ErrorLabelID, strError);
	return strError;
}



//Compare 2 integers
// Parameters Description:
// intVal1			:	First integer value
// intVal2			:	Second integer value
function isCompareIntegers(intVal1,intVal2)
{
	if(intVal1 == intVal2)
	{
		return true;
	}
	return false;
}


//Check if control value lies b/w min & max length
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
// intMinLength			:	Min Length
// intMaxLength			:	Max Length
//##### ERROR CODE: 501 ######

function isValidLength(objControl, strCaption, intMinLength, intMaxLength, ErrorLabelID)
{
	strError = "";
	if (objControl.value.length >= intMinLength && objControl.value.length <= intMaxLength )
	{
		strError = "";
	}
	else
	{
		strError = ShowError(501, strCaption, intMinLength, intMaxLength);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
	
}



//check if field is empty
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 502 ######

function isEmpty(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	if (strValue.length == 0)
	{
		
		strError = ShowError(502, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check if field is alpha-numeric
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 503 ######

function isAlphaNumeric(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9]+$");		

	if(reg.test(strValue) == false)
	{
		strError = ShowError(503, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



function isAlphaNumericDBPassword(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9!@#$%^&*()_+|\\=-`~:\"\';?.><,]+$");		

	if(reg.test(strValue) == false)
	{
		strError = ShowError(503, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


//check if field is alpha-numeric with underscore
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 533 ######

function isOperation(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9 ]{1,50}$");		

	if(reg.test(strValue) == false)
	{
		strError = ShowError(533, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check if field is alpha-numeric with underscore
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 534 ######

function isAbbrivation(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9]{1,15}$");		

	if(reg.test(strValue) == false)
	{
		strError = ShowError(534, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}




//check if field contains alphabets only
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 504 ######

function isAlphabets(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("([a-zA-Z]+)$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(504, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check if field contains Digits only
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 505 ######

function isDigit(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9]{1}[0-9]*$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(505, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isDigitOnly(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[0-9]+$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(505, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

// Check for valid registeration Number 
function isRegisterNumber(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[0-9]{9}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(547, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check for Valid Country Code
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control.
//##### ERROR CODE: 506 ######

function isCountryCode(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9][0-9]{0,2}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(506, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isCountryCheck(objCountryControl, objTypeControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strCountryValue = Trim(objCountryControl.value);
	var strTypeValue = Trim(objTypeControl.value);
	
	if(strTypeValue == "INTCUST" && strCountryValue == "IN")
	{
		strError = ShowError(558, strCaption);
		objCountryControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid Area Code
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 507 ######

function isAreaCode(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9]{1}[0-9]{1,4}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(507, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isAreaCodePhoneNumber(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9]{1}[0-9]{5,11}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(507, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isNumeric(objControl)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([1-9]*[0-9]+)$");

	if(reg.test(strValue) == false)
	{
		
		strError = "Please enter a numeric value greater than 0.";
		
	}
	else
	{
		strError = "";
		
	}
	
	return strError;
}



//check for Valid Phone Number
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 508 ######


function isPhoneNumber(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([1-9]{1}[0-9]{4,7})$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(508, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isPhone(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([1-9]{1}[0-9]{4,14})$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(565, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isLegalName(objControl, strCaption, ErrorLabelID)
{	
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[ a-zA-Z0-9!@{[,.:#|$}\\]&/(\\)_-]{4,100}$");
	
	if(reg.test(strValue) == false)
	{
		strError = ShowError(566, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check for Valid Mobile Number
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 509 ######

function isMobileNumber(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([0]{0,1}[1-9]{1}[0-9]{9,14})$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(509, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isValidMobileNumber(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^(91[1-9]{1}[0-9]{9})$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(563, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isValidMobileNumbers(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	if(strValue.indexOf(',') != -1)
	{
	reg = new RegExp("^(91[1-9]{1}[0-9]{9},)+(91[1-9]{1}[0-9]{9})$");
	}
	else
	{
	reg = new RegExp("^(91[1-9]{1}[0-9]{9})$");
	}

	if(reg.test(strValue) == false)
	{
		strError = ShowError(564, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


//##### ERROR CODE: 527 ######

function isValidAttributeName(objControl, strCaption, ErrorLabelID)
{

	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[0-9a-zA-Z\' ]{2,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(527, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isValidCompanyName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[0-9a-zA-Z\'. ]{2,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(527, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 553 ######

function isValidAttributeFLName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[0-9 a-z A-Z]{2,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(553, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 552 ######
function isValidAttributeMName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z]{1,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(552, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 554 ######
// added for check of attribute name in addcategory attribute
function isValidCategoryAttributeName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[0-9a-zA-Z ']{2,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(554, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 535 ######
//	ADDED BY DHEERAJ TYAGI FOR VALID OPERATION ATTRIBUTE NAME 
function isValidOperationAttribute(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9 ]{1,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(535, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


//##### ERROR CODE: 537 ######
//	ADDED BY DHEERAJ TYAGI FOR VALID CONTROL NAME 
function isValidControlName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9 ]{1,25}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(537, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 510 ######

function isValidName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9]{2,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(510, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid User Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 511 ######

function isUserName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([a-zA-Z0-9]){1}+([_]{0,1}[0-9a-zA-Z]){4,15}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(511, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check for Valid User Name for Biz mail with length at max 20 
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 561 ######

function isBizUserName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([a-zA-Z0-9]){1}+([_]{0,1}[0-9a-zA-Z]){4,19}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(561, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid City
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 512 ######

function isValidCity(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z]{1}[ a-zA-Z]{1,20}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(512, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid Organisation Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 513 ######

function isValidOrganisation(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	//reg = new RegExp("^([a-zA-Z0-9]+[-_',.&amp; ]{0,6}[a-zA-Z0-9]*)+$");
	reg = new RegExp("^[a-zA-Z0-9]{1}[a-zA-Z0-9\-_,\. ]{1,28}[a-zA-Z0-9\.]{1}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(513, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid Postal Code
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 514 ######

function isPostalCode(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	//reg = new RegExp("^[1-9a-zA-Z]{1}[a-zA-Z0-9 \s\-]{2,6}[0-9a-zA-Z]{1}$");
	reg = new RegExp("^[0-9a-zA-Z]{1}[a-zA-Z0-9 \s\-]{2,6}[0-9a-zA-Z]{1}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(514, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid Domain Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 515 ######

function isDomainName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([a-zA-Z0-9]+([-]{0,1}[a-zA-Z0-9])*)$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(515, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check for Valid Domain Name with tld
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 569 ######

function isDomainFullName(objControl, strCaption, ErrorLabelID) {    
    strError = "";
    var strValue = Trim(objControl.value); 
    //reg = new RegExp("^([a-z][a-z0-9\-]+(\.|\-*\.))+([a-z]{2,3})$");
    reg = new RegExp("^(?!http|www|https|ftp|HTTP|FTP|WWW|HTTPS)+([a-zA-Z0-9]+([-]{0,1}[a-zA-Z0-9])*)[.]{1}[a-zA-Z]{1,5}(([.]{1}[a-zA-Z]{1,3})*)$");
    if (reg.test(strValue) == false) {
        strError = ShowError(569, strCaption);
        objControl.focus();
    }
    SetErrorLabel(ErrorLabelID, strError);
    return strError;
}

//check for Valid Domain Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 515 ######

function isTldOnly(objControl, strCaption, ErrorLabelID) {
    strError = "";
    var strValue = Trim(objControl.value);
    reg = new RegExp("^([a-zA-Z.]{2,6})$");

    if (reg.test(strValue) == false) {
        strError = ShowError(570, strCaption);
        objControl.focus();
    }
    SetErrorLabel(ErrorLabelID, strError);
    return strError;
}
//check for Valid Domain Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 515 ######

function isDomainNameOnly(strstrValue) {
    strError = "";
    var strValue = Trim(strstrValue);
    reg = new RegExp("^([a-zA-Z0-9]+([-]{0,1}[a-zA-Z0-9])*)$");

    if (reg.test(strValue) == false) {
        strError = "Domain Name must be between 3 and 63 characters in length. Allowed characters are numbers [0-9], upper and lowercase alphabets [a-z, A-Z], and hyphen (-). It should not begin with http:// or www:// or ftp:// or https://.";
    }
    else {    
        strError = "";
    }

    return strError;
}


//check for Valid IP Address
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 516 ######

function isIPAddress(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b$");
	
	if(reg.test(strValue) == false)
	{
		strError = ShowError(516, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isValidIPAddress(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(516, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isSplitEmailID(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	var mytool_array = strValue.split(",");
	reg = new RegExp("^([a-zA-Z]{1}[\\w-\\'\\.]{1,50})@((([\\w-]{3,50}\\.){1}))(([a-zA-Z]{2,4})|(([a-zA-Z]{2,4})\\.([a-zA-Z]{2})))$");
	var part_num=0;
	while (part_num < mytool_array.length)
	{
		var email = Trim(mytool_array[part_num]);
		if(email == "")
		{
			
		}
		else if(reg.test(email) == false)
		{
			strError = ShowError(517, strCaption);
			objControl.focus();
			SetErrorLabel(ErrorLabelID,strError);
			break;
		}
		part_num+=1;
	}
	return strError;
}

//check for Valid E-Mail ID's
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 517 ######

function isEmailID(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([a-zA-Z0-9]{1}([\\w-\\'\\.]{0,1}[a-zA-Z0-9]+){1,50})@((([\\w-\\.]{2,50}){1}))(([a-zA-Z]{2,4})|(([a-zA-Z]{2,4})\\.([a-zA-Z]{2})))$");
	//reg = new RegExp("^([\\w-]{1}[\\w-\\'\\.]{1,50})@((([\\w-]{3,50}\\.){1}))(([a-zA-Z]{2,4})|(([a-zA-Z]{2,4})\\.([a-zA-Z]{2})))$");
	
	
	if(reg.test(strValue) == false)
	{
		strError = ShowError(549, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check if combo is selected
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 518 ######

function isSelected(objControl, strCaption, ErrorLabelID)
{
	strError = "";

	if (objControl.selectedIndex == -1 || objControl.selectedIndex == 0)
	{
		strError = ShowError(518, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


//check if combo is selected
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 518 ######

function isListBoxSelected(objControl, strCaption, ErrorLabelID)
{
	strError = "";

	if (objControl.selectedIndex == -1)
	{
		strError = ShowError(518, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid Designation
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 519 ######

function isDesignation(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^(([a-zA-Z0-9 ]){5,30})$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(519, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}





//check for Valid Password
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 520 ######

function isPwd(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	//reg = new RegExp("^[a-zA-Z0-9!=?@{[:#|$}\\]+%^&/*(\\)_-]{5,16}$");
	reg = new RegExp("^[a-z.A-Z0-9_-]{5,16}$");
	if(reg.test(strValue) == false)
	{
		strError = ShowError(520, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isDBPwd(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9!=@{[#|$}\\].+%^&*(\\)_-]{5,16}$");
	//reg = new RegExp("^[a-z.A-Z0-9_-]{5,16}$");
	if(reg.test(strValue) == false)
	{
		strError = ShowError(557, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isEmailNewPwd(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9!=@{[#|$}\\].+%^&*(\\)_-]{5,8}$");
	//reg = new RegExp("^[a-z.A-Z0-9_-]{5,16}$");
	if(reg.test(strValue) == false)
	{
		strError = ShowError(560, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check for Valid User Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 511 ######

function isOrganizationName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([a-zA-Z0-9]){1}+([_]{0,1}[0-9a-zA-Z]){4,99}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(562, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//check if field value is complex(i.e. contain atleast 1 character , 1 digut and i special character) or not
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 503 ######

function isCheckComplexity(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);	
	reg = new RegExp("^[a-zA-Z]");
	var firstChar=0;
	var i = 0;
	var countChar = 0,countDigit = 0,countSpl = 0;
	for (i=0; i < strValue.length; i++)
    {
		firstChar = strValue.charAt(i);
		reg = new RegExp("^[a-zA-Z]");
		if(reg.test(firstChar) == true)
		{
			countChar = countChar + 1;
		}
		reg = new RegExp("^[0-9]");
		
		if(reg.test(firstChar) == true)
		{	
			countDigit = countDigit + 1;
		}
		reg = new RegExp("^[!=@{[#|$}\\].+%^&*(\\)_-]$");
		if(reg.test(firstChar) == true)
		{	
			countSpl = countSpl + 1;
		}		
	}	
	if(countChar == 0 || countDigit == 0 || countSpl == 0)
	{
		strError = ShowError(559, strCaption);
		objControl.focus();	
	}	
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isemailPwd(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9!=?@{[:#|$}\\]+%^&/*(\\)_-]{5,16}$");
	
	if(reg.test(strValue) == false)
	{
		strError = ShowError(548, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isemailPwd_old(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9!=?@{[:#|$}\\]+%^&/*(\\)_-]{4,20}$");
	
	if(reg.test(strValue) == false)
	{
		strError = ShowError(548, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check for Valid Service Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 521 ######

function isService(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([1-9a-zA-Z]{1})([0-9a-zA-Z]*([_ ]{0,1}[0-9a-zA-Z])){4,50}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(521, strCaption);		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}




//check for Valid Host Name
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 522 ######
function isHostName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^(?!http|www|https|ftp|HTTP|FTP|WWW|HTTPS)+([a-zA-Z1-9]+\.)+(?:com|edu|biz|org|gov|int|info|mil|net|name|museum|coop|aero|[a-z][a-z])$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(522, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 524 ######

function isNewValidCity(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([a-zA-Z]){1}([ ]{0,1}[a-zA-Z]){3,15}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(524, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 546 ######

function isNewOrgName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([a-zA-Z]){1}([ ]{0,1}[a-zA-Z0-9 ]){2,50}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(546, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


//check for Valid Request Title
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 525 ######

function isRequestTitle(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9\. ']{1,200}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(525, strCaption);		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}




//check for Valid Request Title
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 526 ######

function isCRNID(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	//reg = new RegExp("^[a-zA-Z0-9]{5,15}$");
	reg = new RegExp("^[0-9]{9}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(526, strCaption);		
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

/*
function isValidCategory(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([-\/()'_1-9a-zA-Z."]{1})([0-9a-zA-Z. "]*([-\()'_]*[/]{0,1}[0-9a-zA-Z-\()/'_."])){1,60}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(528, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}*/

//##### ERROR CODE: 528 ######
// check for valid user type 
function isValidValue(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([1-9a-zA-Z]{1})([0-9a-zA-Z]*([_ ]{0,1}[0-9a-zA-Z])){1,60}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(528, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}
//##### ERROR CODE: 529 ######
// check for valid emp code
function isValidEmpCode(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z]{1}[a-zA-Z0-9\/]{4,29}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(529, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//check if field is alpha-numeric
// Parameters Description:
// objControl			:	Control to Validate
// strCaption			:	Name or Description of the Control
//##### ERROR CODE: 532 ######

function isRegistrationNo(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9]{9}$");		

	if(reg.test(strValue) == false)
	{
		strError = ShowError(532, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isValidUrl(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("[~`'$#^@]+");

	if(reg.test(strValue) == true)
	{
		strError = ShowError(541, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//type cast web control label to html label and set error text
// Parameters Description:
// controlID			:	Error label Control ID
// strError				:	Error
function SetErrorLabel(controlID,strError)
{
	var lblError = document.getElementById(controlID);
	lblError.innerHTML = strError;
}
		
function isNewValidName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[a-zA-Z0-9]{4,16}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(530, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 531 ######
// check for valid user type 
function isValidUserType(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9a-zA-Z][0-9a-zA-Z]*([_ ]{0,1}[0-9a-zA-Z]+){4,16}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(531, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 544 ######
// check for valid user type 
function isAlias(objControl, strCaption, ErrorLabelID)
{ 
	strError = "";
	var strValue = Trim(objControl.value);
	
	
	//reg = new RegExp("^[a-zA-Z0-9-_.]{2,50}$");
	reg = new RegExp("^[a-zA-Z1-9]{1}([\w\._-]{0,1}[a-zA-Z1-9]+){1,50}$");
	if(reg.test(strValue) == false)
	{
		strError = ShowError(544, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 545 ######
// check for valid URL. 
function isURL(objControl, strCaption, ErrorLabelID)
{ 
	strError = "";
	var strValue = Trim(objControl.value);
	
	//reg = new RegExp("^(((ht|f)tp(s?))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$");
	var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/

	if(regexp.test(strValue) == false)
	{
		strError = ShowError(545, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


//##### ERROR CODE: 539 ######
// check for valid user type 
function isSelectCheckBoxList(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var i,j = 0;
	for(i = 0; i < objControl.length; i++)
	{
		if(objControl[i].type == 'checkbox')
		{
			if(objControl[i].checked == true)
			{
				j = j + 1;
			}
		}
	}
	if(j == 0)
	{
		strError = ShowError(539, strCaption);
	}
	//alert(strError);
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//##### ERROR CODE: 540 ######
// check for valid user type 
function ValidateWithRegExp(objControl, RegulerExp, ErrorLabelID, strErrMsg)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp(RegulerExp);

	if(reg.test(strValue) == false)
	{
		strError = strErrMsg;
		//objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}



//##### ERROR CODE: 542 ######
// check for valid user type 
function isSelectRadioButtonList(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var i,j = 0;
	for(i = 0; i < objControl.length; i++)
	{
		if(objControl[i].type == 'radio')
		{
			if(objControl[i].checked == true)
			{
				j = j + 1;
			}
		}
	}
	if(j == 0)
	{
		strError = ShowError(542, strCaption);
	}
	//alert(strError);
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 543 ######
// check for valid user type 
function isValidOther(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^([1-9a-zA-Z]{1})([0-9a-zA-Z]*([_ ]{0,1}[0-9a-zA-Z])){1,30}$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(500, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

function isFullDomainName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^(?!http|www[.]|https|ftp|HTTP|FTP|WWW[.]|HTTPS)+([a-zA-Z0-9]+([-]{0,1}[a-zA-Z0-9])*)[.]{1}[a-zA-Z]{1,5}(([.]{1}[a-zA-Z]{1,3})*)$");

	if(reg.test(strValue) == false)
	{
		strError = ShowError(550, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isAmount(objControl, strCaption, ErrorLabelID)

{

	strError = "";
	
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9]{1}[0-9]*$");
	
	if(reg.test(strValue) == false)
	{
		strError = ShowError(551, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}


function isRechargeAmount(objControl, strCaption, ErrorLabelID)
{

	strError = "";
	
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9]{1}[0-9]*$");
	
	if(reg.test(strValue) == false)
	{
		strError = ShowError(567, strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 555 ######
// check for link name
function isLinkName(objControl, strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[1-9a-zA-Z][0-9a-zA-Z]*([ ]{0,1}[0-9a-zA-Z]+){1,97}$");
	if(reg.test(strValue) == false)
	{
		strError = ShowError(555,strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
}

//##### ERROR CODE: 556 #####
// Check for color code
function IsColorCode(objControl,strCaption, ErrorLabelID)
{
	strError = "";
	var strValue = Trim(objControl.value);
	reg = new RegExp("^[#]{1}[0-9a-fA-F]{6}$");
	if(reg.test(strValue)==false)
	{
		strError = ShowError(556,strCaption);
		objControl.focus();
	}
	SetErrorLabel(ErrorLabelID,strError);
	return strError;
	
}

//Error Descriptions
// Parameters Description: discovers all arguments and throws 
//						   error messages based on error code
function ShowError()
{
	switch (arguments[0])
	{
		case 500:
				//check for first name/ middle name/ last name
				
				return arguments[1]+" must be between 2 and 30 characters in length. Allowed characters are numbers [0-9] and upper and lowercase alphabets [A-Z, a-z].";
				break;
				
		case 501:
				//field is between 
				//min and max characters
				
				return(arguments[1] + " must be " + arguments[2] + "-" + arguments[3]+ " characters");
				break;
			
		case 502:
				//field is empty
				
				return(arguments[1] + " is Empty");
				break;
		case 503:
				//check for
				//alpha numerics
				
				return(arguments[1] + " should contain alpha-numeric characters only.");
				break;

		case 504:
				//check for
				//alphabets only
				
				return(arguments[1] + " should contain alphabets only.");
				break;

		case 505:
				//check for
				//digits only
				
				return(arguments[1] + " should contain digits only.");
				break;

		case 506:
				//check for
				//valid country code
				
				return(arguments[1] + " must be between 1 and 3 characters in length. Enter as numbers only [0-9]. It should not begin with zero (0).");
				break;


		case 507:
				//check for
				//valid
				//area code
				
				return(arguments[1] + " must be between 2 and 5 characters in length. Enter as numbers only [0-9]. It should not begin with zero (0).");
				break;

		case 508:
				//check for 
				//valid phone number
				
				return(arguments[1] + " must be between 5 and 8 characters in length. Enter as numbers only [0-9]. It should not begin with zero (0).");
				break;
			
		case 509:
				//check for
				//valid mobile no.
				
				return(arguments[1] + " must be between 10 and 14 characters in length. Enter as numbers only. Do not include space or non-numeric characters.");
				break;


		case 510:
				//check for first name/ middle name/ last name
				
				return arguments[1]+" must be between  2 and 30 characters in length. Allowed characters are numbers [0-9] and upper and lowercase letters [a-z, A-Z]. ";
				break;
		
				
		case 511:
				//valid user name
				
				return(arguments[1] + " must be between 5 and 16 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and underscore (_).");
				break;


		case 512:
				//valid city name
				
				return(arguments[1] + " must be between 2 and 20 characters in length. Allowed characters are upper and lowercase letters [a-z, A-Z] and space.");
				break;

		case 513:
				//valid organisation name
				
				return(arguments[1] + " must be between 3 and 30 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], [.], and space.");
				break;

		case 514:
				//Postal Code 
				
				return(arguments[1] + " must be between 4 and 8 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], hyphen (-) and spaces.");
				break;

		case 515:
				//valid domain name
				
				return(arguments[1] + " must be between 3 and 63 characters in length. Allowed characters are numbers [0-9], upper and lowercase alphabets [a-z, A-Z], and hyphen (-). It should not begin with http:// or www:// or ftp:// or https://.");
				break;
	
		case 516:
				//valid IP address
				
				return(arguments[1] + " is a string of four numbers separated by period (.). It must be between 7 and 15  numeric characters {0-9} in length.");
				break;

		case 517:
				//email ID
		
				return(arguments[1] + " ID is Invalid. It must be at least two (2) characters long. Allowed characters are numbers (0-9), lowercase letters (a-z), hyphen (-) and underscore (_) but no spaces or special characters. Please make sure your Email ID is entered in this format(e.g. myname@mycompany.com).");
				break;			

		case 518:
				//combo not selected
				
				return(arguments[1] + " is not selected");
				break;	

		case 519:
				//Designation
				
				return(arguments[1] + " must be between 5 and 30 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and space.");
				break;
		
		case 520:
				//Password
				
				return(arguments[1] + " should contain 5-16 valid characters in length.");
				break;				

		case 521:
				//Service Name
				
				return(arguments[1] + " must be between 5 and 50 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [a-z, A-Z], underscore (_) and space.");
				break;					
							
		case 522:
				//Host name
				
				return(arguments[1] + " must be between 2 and 63 characters in length. Allowed characters numbers [0-9], upper and lowercase letters [A-Z, a-z], slash (\), and period (.). It should not begin with http/www/ftp/https.");
				break;	
				
		case 523:
				//Host name and IP empty
			
				return("Invalid combination of Host Name and IP Address.");
				break;
							
		case 524:
				//valid New city name
				
				return(arguments[1] + " must be between 4 and 16 characters in length. Allowed characters are upper and lowercase letters [A-Z, a-z] and space.");
				break;							
				
		case 525:
				//valid Request Title
				
				return(arguments[1] + " can contain up to 200 characters in length.  Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], single quote ('), period(.) and spaces.");
				break;				
				
		case 526:
				//valid Request Title

		    //				return(arguments[1] + " must be between 5 and 15 characters in length. Allowed characters are numbers [0-9], lowercase letters [a-z], and space.");
		        return (arguments[1] + " must be 9 characters in length. Allowed characters are numbers [0-9].");
				break;
				
		case 527:

				//check for first name/ middle name/ last name
				
				return arguments[1]+" must be between 2 and 30 characters in length. Allowed characters are numbers [0-9] and upper and lowercase letters [A-Z, a-z].";
				break;
		
		case 528:
				//valid Request Title
				
				return(arguments[1] + "must be between 2 and 60 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], special characters {-_'()} and spaces.");
				break;
				
		case 529:
			//valid Request Title
		
				return(arguments[1] + "  must be between 5 and 30 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and slash (/). It should begin with an alphabetic character {a-z, A-Z}.");
				break;
		
		case 530:
				//check for first name/ middle name/ last name

				
				return arguments[1]+" must be between  4 and 16 characters in length. Allowed characters are numbers [0-9] and upper and lowercase letters [A-Z, a-z].";
				break;
				
		case 531:
				//check for user type
				
				return arguments[1]+" must be between  5 and 16 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and underscore(_).";
				break;
				
		case 532:
				//check for user type
				
				return arguments[1]+" must be 20 characters in length. Allowed characters are numbers [0-9] and upper and lowercase letters [A-Z, a-z].";
				break;
				
		case 533:
				//check for operation name
				
				return arguments[1]+"  must be between 1 and 50 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z] and space.";
				break;
						
		case 534:
				//check for Abbrivation.
				
				return arguments[1]+"  must be between 1 and 15 characters in length. Allowed characters are numbers [0-9] and upper and lowercase letters [A-Z, a-z].";
				break;
					
		case 535:
				//check for Abbrivation.
				
				return arguments[1]+" must be between 1 and 30 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z] and space.";
				break;
		
		case 536:
				//	get error message for Minimum and maximum query value 
				//return 'Minumum value should be less than maximum value.';
				return 'Minimum query limit should be less than maximum query limit.';
				break;
		
		case 537:
				//check for Abbrivation.
				
				return arguments[1]+"  must be between 1 and 25 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z] and space.";
				break;
		
		case 538:
				//	get error message for Minimum and maximum query value 
				return 'Maximum length should be greater than or equal to minimum length.';
				break;

		case 539:

				return 'Please select ' + arguments[1];
				break;						
				
				
		case 540:

				return 'Please select ' + arguments[1];
				break;
				
		case 541:

				return arguments[1]+" should not contain {~,`,',$,#,^,@}";
				break;
		
				
		case 542:
				//validation for radio button list
				return arguments[1]+" is not selected";
				break;
				
						
		case 544:

				return arguments[1]+" must be between 2 and 40 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], hyphen (-), underscore (_) and period (.).";
				break;				
				
		case 545:

				return arguments[1]+" should contain valid characters. Please enter in this format (http://www.domainname.extn).";
				break;			
		
		case 546:
				//valid New city name
				
				return(arguments[1] + " must be between 3 and 50 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and space.");
				break;								

		case 547:
				//valid New city name
				
				return(arguments[1] + " must be 9 characters in length. Enter as numbers only.");
				break;
		case 548:
				//Password
				
				return(arguments[1] + " must be between 5 and 16 characters in length. Enter valid characters only except '~' and space.");
				break;									

		case 549:
				//email ID
				return(arguments[1] + " must be at least two (2) characters long. Allowed characters are numbers [0-9], lowercase letters [a-z], hyphen (-) and underscore (_) but no spaces or special characters. Please make sure your Email ID is entered in this format(e.g. myname@mycompany.com).");
				break;			
		
		case 550:
				//valid domain name
				
				return(arguments[1] + " must be between 2 and 63 characters in length. Allowed characters are numbers [0-9], upper and lowercase alphabets [a-z, A-Z], and hyphen (-). It should not begin with http:// or www:// or ftp:// or https://.");
				break;
		case 551:
				//valid domain name
				
				return(arguments[1] + " must be entered as numbers [0-9] only. It can contain one decimal point(.).");
				break;
				
		case 552:

				//check for middle name
				
				return arguments[1]+" must be between 1 and 30 characters in length. Allowed characters are upper and lowercase letters [A-Z, a-z].";
				break;
		case 553:

				//check for first/last name
				
				return arguments[1]+" must be between 2 and 30 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z].";
				break;
			
		case 554:	
				//check for category name
				
				return arguments[1]+" must be between 2 and 30 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z] and spaces.";
				break;
				
		case 555:
				// check for link name
				
				return arguments[1] + "must be between 2 and 100 characters in length. Allowed characters are numbers [0-9] and upper and lowercase letters [A-Z, a-z].";
				break;
		
		case 556:
				// check for colorcode
				
				return arguments[1] + "should begin with hash{#} followed by alpha-numerics {0-9, a-f, A-F}.";
				break;
				
		case 557:
				//check for
				//alpha numerics and special characters
				
				return(arguments[1] + " should contain 5-16 valid characters in length. Allowed characters are numbers [0-9] , upper and lowercase letters [A-Z, a-z] and special characters like !=@{[#|$}\\].+%^&*(\\)_-]$.");
				break;
				
		case 558:
				//check for
				//alpha numerics and special characters
				
				return("You have selected International Customer above, please choose a country other than India.");
				break;
				
		case 559:
				//check for
				//alpha numerics and special characters
				
				return("The Password set by you is weak. You must use a combination of alphabets, numbers and special characters like !=@{[#|$}\\].+%^&*(\\)_-]$.");
				break;
				
		case 560:
				//Password
				
				return(arguments[1] + " must be between 5 and 8 characters in length. Enter valid characters only.");
				break;
				
		case 561:
				//valid user name for length at max 20 
				
				return(arguments[1] + " must be between 5 and 20 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and underscore (_).");
				break;
				
		case 562:
				//Organization name
				
				return(arguments[1] + " must be between 5 and 100 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and underscore (_).");
				break;
		
		case 563:
				//Bulk SMS Mobile number
				
				return(arguments[1] + " must be 10 digit number with 2 digit no. as a country code. All characters allowed along with numbers [0-9].");
				break;
				
		case 564:
				//Bulk SMS Mobile numbers
				
				return(arguments[1] + " must be 10 digit number with 2 digit no. as a country code. Separate each no. with a comma. All characters allowed along with numbers [0-9],.");
				break;	
				
		case 565:
				//check for 
				//valid phone number
				
				return(arguments[1] + " must be between 5 and 14 characters in length. Enter as numbers only [0-9]. It should not begin with zero (0).");
				break;
				
		case 566:
				//check for 
				//valid phone number
				
				return(arguments[1] + " must be between 5 and 100 characters in length. Allowed characters are numbers [0-9], upper and lowercase letters [A-Z, a-z], and valid special characters.");
				break;
		case 567:
				//valid domain name
				
				return(arguments[1] + " must be entered as numbers [0-9] only.");
				break;
		case 568:
				//valid domain name
				
				return("Please indicate your agreement.");
				break;
        case 569:
            //valid domain name

            return (arguments[1] + " must be between 3 and 63 characters in length. Allowed characters are numbers [0-9], upper and lowercase alphabets [a-z, A-Z], and hyphen (-).");
            break;	
        case 570:
            //valid domain name

            return (arguments[1] + " do not use space or non-numeric and special characters.");
            break;
        case 1000:
            return (arguments[1] + " must be between 3 and 63 characters in length.");
            break;								
		default :
				alert("An error has occured in the page");
				return true;
	}
}



//used to trim left spaces in a string
function LTrim(strTrimStr)
{
	var intTotLen = strTrimStr.length;
    var strWhtSpcs = new String(" \t\n\r");
    var strCpyStr = new String(strTrimStr);

    if (strWhtSpcs.indexOf(strCpyStr.charAt(0)) != -1)
    {
        var intjCtr=0, intiCtr = strCpyStr.length;

        while (intjCtr < intiCtr && strWhtSpcs.indexOf(strCpyStr.charAt(intjCtr)) != -1)
        	intjCtr++;
        strCpyStr = strCpyStr.substring(intjCtr, intTotLen);
    }
    return strCpyStr;
}
        
        
        
//used to trim right spaces in a string
function RTrim(strTrimStr)
{
	var intTotLen = strTrimStr.length;
    var strWhtSpcs = new String(" \t\n\r");
    var strCpyStr = new String(strTrimStr);

    if (strWhtSpcs.indexOf(strCpyStr.charAt(intTotLen-1)) != -1)
    {
        var intiCtr = intTotLen-1;

        while (intiCtr >= 0 && strWhtSpcs.indexOf(strCpyStr.charAt(intiCtr)) != -1)
                        intiCtr--;

        strCpyStr = strCpyStr.substring(0, intiCtr+1);
    }
    return strCpyStr;
}
        
    
    
        
//used to trim  spaces in a string
function Trim(pstrTrimStr)
{
    return RTrim(LTrim(pstrTrimStr));
}

//used to open Popupwindow for helpdesk
function openWin(fileName,height,width)
{
	var windowprops="height=" + height + ",width=" + width + ",location=no,scrollbars=yes,"
	+ "menubars=no,toolbars=no,resizable=yes,titlebar=no";
	var URL=fileName;
	popup=window.open(URL,"MenuPopup",windowprops);
}
//To open separate popup for matchservice,autologin& Whois in HelpDesk
function openWinMatch(fileName,height,width)
{
	var windowprops="height=" + height + ",width=" + width + ",location=no,scrollbars=yes,"
	+ "menubars=no,toolbars=no,resizable=yes,titlebar=no";
	var URL=fileName;
	popup=window.open(URL,"MenuPopup1",windowprops);
}
function openWinAutoLogin(fileName,height,width)
{
	var windowprops="height=" + height + ",width=" + width + ",location=no,scrollbars=yes,"
	+ "menubars=no,toolbars=no,resizable=yes,titlebar=no";
	var URL=fileName;
	popup=window.open(URL,"MenuPopup2",windowprops);
}
function openWinWhois(fileName,height,width)
{
	var windowprops="height=" + height + ",width=" + width + ",location=no,scrollbars=yes,"
	+ "menubars=no,toolbars=no,resizable=yes,titlebar=no";
	var URL=fileName;
	popup=window.open(URL,"MenuPopup3",windowprops);
}

