	function funDelay(pmRedirectURL)
	{
		//alert(pmRedirectURL);
		window.setTimeout('window.location="' + pmRedirectURL + '"',3000);
	}

	function gPauseSplKeys(pmKeyType)
	{
		/* Function that allows only Alpahabets,Numbers. This is to be called in the "KeyPress" event of a Text control 
		   pmKeyType  - 1 (Only Alphabets) and some special character  "white space - / ,'"
		   pmKeyType  - 2 (Only Numeric)
		   pmKeyType  - 3 (For Alphanumeric)
		   pmKeyType  - 4 (For Email)
		   pmKeyType -  5 (For Phone) */
		   
		// Variable to store the value of "KeyCode".
		vKeyCode = window.event.keyCode;
		
		// Check if the "KeyCode" is from "A" to "Z".
		if((vKeyCode > 64 && vKeyCode < 91) && (pmKeyType == 1 || pmKeyType == 3 || pmKeyType == 4))
		{
			window.status ="Done";
			window.event.keyCode = vKeyCode; 
		}
		// Check if the "KeyCode" is from "a" to "z".
		else if((vKeyCode > 96 && vKeyCode < 123) && (pmKeyType == 1 || pmKeyType == 3 || pmKeyType == 4))
		{
			window.status = "Done";
			window.event.keyCode = vKeyCode; 
		}
		// Check if the "KeyCode" is from "0" to "9".
		else if((vKeyCode > 47 && vKeyCode < 58) && (pmKeyType == 2 || pmKeyType == 3 || pmKeyType == 4 || pmKeyType == 5))
		{
			window.status ="Done";
			window.event.keyCode = vKeyCode; 
		}
		// Check if the "KeyCode" is  "()-"
		else if(((vKeyCode == 40) || (vKeyCode == 41) || (vKeyCode == 45)) && (pmKeyType == 5))
		{
			window.status ="Done";
			window.event.keyCode = vKeyCode; 
		}
		// Check if the "Keycode" is "white space - / '"
		else if((vKeyCode == 32 || vKeyCode == 47 || vKeyCode == 45 || vKeyCode == 39 || vKeyCode == 44) && (pmKeyType == 1 || pmKeyType == 3))
		{
			window.status ="Done";
			window.event.keyCode = vKeyCode; 
		}
		// Check if the "KeyCode" is "@._"
		else if(((vKeyCode == 64) || (vKeyCode == 46) || (vKeyCode == 95)) && (pmKeyType == 4))
		{
			window.status ="Done";
			window.event.keyCode = vKeyCode; 
		}
		// Check if the "KeyCode" is anyother character, mentioned above.
		else 
		{
			window.status = "Invalid Character."
			window.event.keyCode = 0; 
		}
	}
	
	function maxAllowedCharacter(pmObject, pmAllowedLength)
	{
		/* Function will check whether the object contains the character within the specified limit. */
		if(!pmObject) return false;
		else if (trim(pmObject.value).length > parseInt(pmAllowedLength,10)) {
			pmObject.value = pmObject.value.substring(0,parseInt(pmAllowedLength,10));
			return false;	
		} 
		else return true;	
	} 
	
	function trim(pmString)
	{
		/* Function will remove the left and right white spaces within the string */
		return pmString.replace( /^ +/, "" ).replace( / +$/, "" );
	}
	
	function textTrim(pmString)
	{
		/* Function will remove the starting leading blanks (white space, \n, \t, \r) of the string */
		var vWhiteSpace = new String(" \t\n\r");
		var vString     = new String(pmString);
		if (vWhiteSpace.indexOf(vString.charAt(0)) != -1) 
		{
			var j=0, vLength = vString.length;
			while (j < vLength && vWhiteSpace.indexOf(vString.charAt(j)) != -1)
			j++;
			vString = vString.substring(j, vLength);
		}
	 	return vString;
	}
	
	function getRadialValue(pmFormObject, pmRadioObject)
	{
		/* Function return the radial value of the checked radio button */
	   var vRadioLength = document.pmFormObject.pmRadioObject.length;
	   if(vRadioLength)
	   {
			for (var vLoop=0; vLoop < vRadioLength; vLoop++)
			{
				if(document.pmFormObject.pmRadioObject[vLoop].checked)
				{
					var vRadioValue = document.pmFormObject.pmRadioObject[vLoop].value;
					return vRadioValue;
				}
			}
			return false;
	   }
	   else
	   {
			var vRadioValue = document.pmFormObject.pmRadioObject.value;
			return vRadioValue;	
	   }     
	}
	
	function commonWindowOpen(pmFile, pmTitle, pmHeight, pmWidth, pmScroll, pmTop, pmLeft)
	{
		/* Function will open the popup window with the specified parameters */
		var d = new Date();
		d = Date.parse(d);
		window.open(pmFile, pmTitle+d, "height="+pmHeight+",width="+pmWidth+",scrollbars="+pmScroll+",top="+pmTop+",left="+pmLeft);
	}
	
	
	function isProperString(pmString, pmDisAllowedChars)
	{
		/* Function will check whether the string does not contains the disallowed characters. */
	   if (!pmString) return false;
	   
	   var vLength = pmString.length;
	   for (var i = 0; i < vLength; i++) {
		  if (pmDisAllowedChars.indexOf(pmString.charAt(i)) != -1)
			 return false;
	   }
	   return true;
	}
	
	function isValidEmail(pmEmail)
	{
		/* Function will check whether the given email is valid or not. */
		if (!pmEmail) return false;
		pmEmail = trim(pmEmail);
		pmEmail = pmEmail.replace(/\r\n|\r|\n/g, ''); 
		
		if (isRegExpSupported())
		{
			
			var vPattern = "^[A-Za-z0-9](([_\\.\\-]?[a-zA-Z0-9_]+)*)@([A-Za-z0-9]+)(([\\_.\\-]?[a-zA-Z0-9]+)*)\\.([A-Za-z]{2,})$";
			var vRegExp = new RegExp(vPattern);
			return (vRegExp.test(pmEmail));
		}
		else
		{
			if(pmEmail.indexOf('@') == -1 || pmEmail.indexOf('.') == -1 || pmEmail.indexOf(' ') != -1) return false;
			else
			{
				var vSplit = pmEmail.split("@");
				if(vSplit.length > 2) return false;
				else 
				{
					var vDomain = vSplit[1].split('.');
					var vLength = vDomain.length;
					for(var vLoop = 0; vLoop < vLength; vLoop++)
						if(vDomain[vLoop].length <= 0)	return false;
					return true;
				}
			} 
		}
	}
	
	function isValidMultiEmail(pmEmail, pmMultiple, pmCharLimit)
	{
		/* Function will check whether the given mails are valid or not. */
		if(!pmCharLimit) pmCharLimit = 100;
		if (!pmEmail) return false;
		var vStatus = true;
		if(pmMultiple)
		{
			pmEmail = pmEmail.replace(/;/g, ",");
			var aEmailId = pmEmail.split(",");
			for(var vLoopEmail = 0; vLoopEmail < aEmailId.length; vLoopEmail++)
			{
				aEmailId[vLoopEmail] = trim(aEmailId[vLoopEmail]);
				aEmailId[vLoopEmail] = aEmailId[vLoopEmail].replace(/\r\n|\r|\n/g, ''); 
				if(aEmailId[vLoopEmail] != "")
				{
					if(aEmailId[vLoopEmail].length > parseInt(pmCharLimit))
					{
						vStatus = false;
						break;
					}
					else if(!isValidEmail(aEmailId[vLoopEmail]))
					{
						vStatus = false;
						break;
					}
				}
			}
		}
		else 
		{
			vStatus = isValidEmail(pmEmail)
		}
		return vStatus;
	} 
	
	function isValidUrl(pmUrl)
	{
		/* Function will check whether the given mails are valid or not. */
		if(!pmUrl) return false;
		
		pmUrl = pmUrl.toLowerCase()
		var vStatus    = true;
		var vLength    = pmUrl.length;
		var vValidChar = "1234567890qwertyuiopasdfghjklzxcvbnm_./-:"		
		
		for(var vLoop=0; vLoop <= vLength; vLoop++)
		{
			if (vValidChar.indexOf(pmUrl.substr(vLoop,1)) < 0)
			{
				vStatus = false;
				return vStatus;				
			}
		}
		return vStatus;
	}
	
	function isRegExpSupported()
	{
		/* Function will check whether the regular expression supported by the browser */
		if (window.RegExp)
		{
			var vTempStr = "a";
			var vTempReg = new RegExp(vTempStr);
			return (vTempReg.test(vTempStr));
		}
		return (false);
	} 
	
	function isValidPhoneNo(pmPhNo, pmMinLength, pmMaxLength)
	{ 
		/* Function will check whether the given phone number is valid or not */
		if(!(pmPhNo && pmMinLength && pmMaxLength)) return false;
		
		var vValidChar = "0123456789()-+,  ext.";
		var vLength = pmPhNo.length;
		var vPhoneNo;
		
		for(var vLoop = 0; vLoop < vLength; vLoop++)
		{   
			vPhoneNo = pmPhNo.charAt(vLoop);
			if(vPhoneNo == "-") pmMinLength++;
			if(vValidChar.indexOf(vPhoneNo) == -1) return false;
		}
		if(vLength > pmMaxLength || vLength < pmMinLength) return false;
		else return true;
	}
	
	function isValidUSPhone(pmPhNo)
	{
		/* Function will check whether the given US phone number is valid or not */
		var vPattern = '^(\\(?\\d\\d\\d\\)?)?( |-|\\.)?\\d\\d\\d( |-|\\.)?\\d{4,4}(( |-|\\.)?[ext\\.]+ ?\\d+)?$';
		var vRegExp = new RegExp(vPattern);
		return (vRegExp.test(pmPhNo));
	}
	
	function isZipcode(pmZipCode)
	{
		/* Function will check whether the given zip code is valid or not */
		if(!trim(pmZipCode)) return false;
		
		var vInValidChar = "!!*|,\":<>[]{}`\';()@&$#%";
		var vLength = pmZipCode.length;
		
		for (var vLoop = 0; vLoop < vLength; vLoop++) 
		{
			if (vInValidChar.indexOf(pmZipCode.charAt(vLoop)) != -1) return false;
		}
		return true;
	}
	
	function isPersonName(pmString)
	{
		/* Function will check whether the person name is valid or not */
		if(!trim(pmString)) return false;
		if(isRegExpSupported())
		{
			var vPattern = "(^([a-zA-Z0-9 '.'-]+)?)$";	
			var vRegExp = new RegExp(vPattern);
			return (vRegExp.test(pmString));
		} 
		else
		{
			var vPattern = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 '.";
			var vLength  = pmString.length;
			for (var vLoop = 0; vLoop < vLength; vLoop++) 
				if (vPattern.indexOf(pmString.charAt(vLoop)) == -1) return false;
			return true;
		}
	}
	
	function isEmailExists(pmStr, pmObject)
	{
		var vFLag = 0;
		pmStr = pmStr.replace(/;/g,",");
		temp = pmStr;
		aTempEmailId = trim(temp).split(",");
		pmStr = pmStr.toUpperCase(); 
		aEmailIds = trim(pmStr).split(",");
		vExists = "";	
		for(vLoopEmail = 0; vLoopEmail < aEmailIds.length; vLoopEmail++)
		{
			vEmail  = trim(aEmailIds[vLoopEmail]);
			vEmail  = vEmail.replace(/\r\n|\r|\n/g, ''); 
			vEmail  = vEmail.replace(/\r\n/g,'');
			vEmail  = vEmail.replace(/\r/g,'');
			vEmail  = vEmail.replace(/\n/g,'');
			vEmail	= trim(vEmail);
			
			vTemp  = trim(aTempEmailId[vLoopEmail]);
			vTemp  = vTemp.replace(/\r\n|\r|\n/g, ''); 
			vTemp  = vTemp.replace(/\r\n/g,'');
			vTemp  = vTemp.replace(/\r/g,'');
			vTemp  = vTemp.replace(/\n/g,'');
			vTemp	= trim(vTemp);
			
			if(vEmail != "") 
			{
				if(vExists.toUpperCase().indexOf("|" + vEmail + "|") == -1)
				{
					vExists = vExists + "|" + vTemp + "|,";
					vPreValue = vExists;
				}
				else
				{
					//#-- modified by senthil
					vFLag = 1;
				}
			}
		}
		//#-- this part added by Senthil Kumar N.S
		if(vFLag == 1)
		{
			pmObject.value = vPreValue.replace(/\|/g,'');
			return false;
		}
		//#--
		return true;
	} //#-- close of isEmail()

	
	