/**
* The below two variables denote which button (submit OR normal button) calls a function.
* They are introduced to do away with the IllegalStateException.
* CALLED_ON_SUBMIT is to be used when function is called from a <input type="image"> button
* CALLED_OTHERWISE is to be used when function is called from any other link. 
*/
var CALLED_ON_SUBMIT = 1;
var CALLED_OTHERWISE = 0;


/*
This function is called from the isValid function for the Special Character Validation.
function checkSpecialCharacter takes 2 parameters vValue, vDescription.
vValue takes the value of the parameter which has to be validated for Special Characters like &,>,<,",'.
vDescription is typically the name of the feild e.g. Customer Name.
if the "value" fails the validation the function returns the message to be
displayed, if the "value" passes through the validation the function returns true.
*/

//arrays for password validity.
var specialCharArray = new Array("!","@","#","$","%","^","&","*","(",")","_","+","=","[","]","{","}","|","<",">",",","'");
var charArray = new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
var numArray = new Array("1","2","3","4","5","6","7","8","9","0");
var isNumberPresent = false;
var isCharPresent = false;


function fnCheckSpecialCharacter(vValue, vDescription)
{
	spFlag = true;

	var x1 = vValue;
	var errMsg ="";
	for(i=0; i<x1.length; i++)
	{
		
		var x11 = x1.charAt(i);
		if(x11 == "&")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[34] + vDescription ;
			break;
		}
		if(x11 == "<")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[35]+ vDescription ;
			break;
		}
		if(x11 == ">")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[36]+ vDescription ;
			break;		
		}
		if(x11 == "\'")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[37]+ vDescription ;
			break;
		}
		if(x11 == "\"")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[38]+ vDescription ;
			break;
		}		
		if(x11 == "!")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[39]+ vDescription ;
			break;
		}
		if(x11 == "@")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[40]+ vDescription ;
			break;
		}
		if(x11 == "#")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[41]+ vDescription ;
			break;
		}
		if(x11 == "$")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[42]+ vDescription ;
			break;
		}
		if(x11 == "%")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[43]+ vDescription ;
			break;
		}
		if(x11 == "^")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[44]+ vDescription ;
			break;
		}
		if(x11 == "(")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[45]+ vDescription ;
			break;
		}

		if(x11 == ")")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[46]+ vDescription ;
			break;
		}
		if(x11 == "{")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[47]+ vDescription ;
			break;
		}
		if(x11 == "}")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[48]+ vDescription ;
			break;
		}
		if(x11 == "[")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[49]+ vDescription ;
			break;
		}
		if(x11 == "]")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[50]+ vDescription ;
			break;
		}

	}
	if(spFlag == true)
	{
		return true;
	}
	else
	{
		alert(errMsg)
		return false;
	}

	return true;
}



//this sets the default focus to the frst element in the form
function fnSetDefaultFocus(frmName)
{
	var n = -1;
	
	for(i=0;i<frmName.elements.length;i++)
	{
		if ((frmName.elements[i].type != "hidden")&&(frmName.elements[i].type != "button")&&(frmName.elements[i].type != "submit")&&(frmName.elements[i].type != "reset")&&(frmName.elements[i].type != "radio")&&(frmName.elements[i].type != "checkbox"))
		{
			n = i
			break;
		}
	
	}
	if(n != -1)
	{
		frmName.elements[n].focus();
		//frmName.elements[n].select();
	}
	return;
}

//returns the appropriate message depends on teh parameter
function fnGetMessage(label,action,sel)
{
	if (action == "Modify")
	{
		if (sel=="notselected")
		{
			//alert("Please select "+label+" to modify");
			alert(errMsgs[9] +label+ errMsgs[10]);
		}
		else if (sel == "multipleselected")
		{
			//alert("Please select only one "+label+" to modify");
			alert(errMsgs[11] +label+ errMsgs[10]);
		}
		
	}
	else if (action == "Details")
	{
		if (sel=="notselected")
		{
			//alert("Please select "+label+" to view details");
			alert(errMsgs[9] +label+ errMsgs[13]);
		}
		else if (sel == "multipleselected")
		{
			//alert("Please select only one "+label+" to view details");
			alert(errMsgs[11] +label+ errMsgs[13]);
		}
	}
	else if (action == "Delete")
	{
		if (sel=="notselected")
		{
			//alert("Please select "+label+" to delete");
			alert(errMsgs[9] +label+ errMsgs[14]);
		}
	} 
	else if (action == "Hold")
	{
		//alert("Please select " + label + " to " + action);
		alert(errMsgs[9] + label + errMsgs[15] + action);
	}

}

//counts the no of check boxes selected, and returns the number
//accepts the checkbox name in the form as input parameter
function fnCountSelectedCheckBoxes(selectedCheck)
{
	var countSelectedID = 0;
	if(selectedCheck.length > 1)
	{
		for(i=0; i<selectedCheck.length; i++)
		{
			if(selectedCheck[i].checked == true)
			{
				countSelectedID = countSelectedID + 1;
			}
		}
	}
	else
	{
		if(selectedCheck.checked == true)
		{
			countSelectedID = countSelectedID + 1;
		}
	}
	return countSelectedID;
}

/*
function fnTrimValue takes one parameter value
which has to be Trimmed
The value is trimmed and returend back
*/
function fnTrimValue(s)
{
	var temp = '';
	var temp1 = ''; 

	this.ss = s;

	for(var i=0; i<=ss.length; ++i)
	{ 
		if(ss.charAt(i) != ' ')
		{
			temp = ss.substring(i);	
			break;
		}
	}

	if(temp == '')
	{
		return '';
	}

	var m = temp.length;
	m--;

	for(var j=m; j>=0; j--) 
	{
		if(temp.charAt(j) != ' ')
		{
			j++;
			temp1 = temp.substring(0, j);
			return temp1;
		}
	}
	return false;
}

/*
This function is called  for not null Validation.
function fnCheckEmpty takes 2 parameters value1 and label.
vValue takes the value of the parameter which has to be validated for a not null.
vDescription is typically the name of the feild e.g. Customer Name.
if the "value" fails the validation the function returns the message to be
displayed, if the "value" passes through the validation the function returns true.
*/
function fnCheckEmpty(vValue, vDescription)
{
	var value = fnTrimValue(vValue);
	if (value == "")
	{
		if (vDescription != null)
		{
			alert(vDescription + errMsgs[1]);
		}
		return false;
	}
	return true;
}


/*
function fnHasSpace takes one parameter str.
str takes the value of the parameter which has to be checked for spaces.
returns true if spaces are found false otherwise.
*/
function fnHasSpace(str)
{
	var x, ch;

	for(x=0; x<str.length; x++)
	{
		ch = str.substr(x,1);
		if(ch == ' ' || ch == '\t')
		{
			return true;
		}
	}
	return false;
}


/*
function fnCheckValidCombo takes 2 parameters vValue and vDescription
vValue takes the value of the parameter which has to be validated.
vDescription is typically the name of the feild e.g. Country.
if the "vValue" fails the validation the function returns the message to be
displayed, if the "vValue" passes through the validation the function returns true.

*/
function fnCheckValidCombo(vValue,vDescription)
{
	if(vValue == "-1" || vValue == null || vValue == "")
	{
		alert(errMsgs[9] + vDescription);
		return false;
	}
	return true;
}

//Checks for single or double quotes in the argument passed.
//returns true if single or double quotes were found false otherwise
function fnHasQuote(str)
{
	var atPos;

	atPos = str.indexOf('\'');
	if(atPos != -1)
	{
		return true;
	}
	
	atPos = str.indexOf('\"');
	if(atPos!=-1)
	{
		return true;
	}

	return false;
}

//1st parameter=the field on the form
//2nd parameter=description of the field
//3rd parameter=true for required, false for not required
//4th parameter=true for space, false no space
function fnIsValidText(formObj, vDescription, vRequired,vCanHaveSpace)
{
	var vValue = formObj.value;
	var blnSuccess = true;
	//Trim the value first
	vValue=fnTrimValue(vValue);
	if( vRequired == true && (fnCheckEmpty(vValue, vDescription) == false) )
	{
		formObj.focus();
		return false;
	}
	if(vValue != "")
	{
		if (vCanHaveSpace == false && (fnHasSpace(vValue) == true))
		{
			//alert(vDescription + " cannot contain spaces");
			alert(vDescription + errMsgs[5]);
			formObj.focus();
			return false;
		}
	}
	return true;
}

/*
function fnIsAlphaNumeric takes 4 parameter values
1-element or field,
2-the description of the field,
3-to check if it is mandatory,
4-if space is required
if noSpaceRequired is true, space is not accepted as a part of the value,
otherwise it returns false
*/
function fnIsAlphaNumeric(formObj, vDescription, vRequired, noSpaceRequired)
{
	var vValue = formObj.value;
	//Trim the value first
	vValue=fnTrimValue(vValue);

	if( vRequired == true && (fnCheckEmpty(vValue, vDescription) == false) )
	{
		formObj.focus();
		return false;
	}
	if (noSpaceRequired == true)
	{
		
		if(fnHasSpace(vValue) ==true)
		{
			//alert(vDescription + " cannot contain space.");
			alert(vDescription + errMsgs[5]);
			formObj.focus();
			return false;	
		}

		for(var  i=0;i<vValue.length;i++)
		{
							
				if((vValue.charCodeAt(i) >= 48) && (vValue.charCodeAt(i) <= 57 ) ||
				   (vValue.charCodeAt(i) >= 65) && (vValue.charCodeAt(i) <= 90 ) ||
				   (vValue.charCodeAt(i) >= 97) && (vValue.charCodeAt(i) <= 122 ) ||
				   (vValue.charCodeAt(i) == 45))
				{
						
				}
				
				else
				{
						
						//alert(vDescription +" is not valid ");
						alert(vDescription + errMsgs[2] + errMsgs[115]);
						formObj.focus();
						return false;
				}

		}
		return true;
	}
	
else if(noSpaceRequired == false)
	{
		for(var  i=0;i<vValue.length;i++)
		{
			
					
			if((vValue.charCodeAt(i) >= 48) && (vValue.charCodeAt(i) <= 57 ) ||
			   (vValue.charCodeAt(i) >= 65) && (vValue.charCodeAt(i) <= 90 ) ||
			   (vValue.charCodeAt(i) >= 97) && (vValue.charCodeAt(i) <= 122 )||
			   (vValue.charCodeAt(i) == 32) || (vValue.charCodeAt(i) == 45))
			{
				
				//alert(vDescription +" is not if with sapce valid ");
				
			}
			
			else
			{
					
					//alert(vDescription +" is not valid ");
					alert(vDescription +errMsgs[2]);
					formObj.focus();
					return false;
			}
		 }
		return true;
	
	}
	
	
}

//called from resultpage.jsp for redirecting to the page where the user came from 
//before the deletion failed
function fnResultPage(formObjPassed, filterURL)
{		
	formObjPassed.method = "post";
	formObjPassed.action = filterURL;
	formObjPassed.submit();
}



/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

Functions for seeting the mouse pointer to an Hourglass and resetting it.
This can only be achieved in Internet Explorer 4 and above. 
Before running the long process, execute the setPointer(), function, when the process has completed run the resetPointer() function
- Jatin Desai
*/

	function setPointer() 
	{ 
		if (document.all) 
			for (var i=0;i < document.all.length; i++) 
				document.all(i).style.cursor = 'wait'; 
	} 
	
	function resetPointer() 
	{ 
		if (document.all) 
			for (var i=0;i < document.all.length; i++) 
			document.all(i).style.cursor = 'default'; 
	} //-->

/*
function checkMaxLength takes 3 parameters value1,num and label.
value1 takes the value of the parameter which has to be validated.
num is the total length required of the value entered in the text area.
label is typically the name of the feild e.g. Description .
if the "value" fails the validation the function returns the message to be
displayed, if the "value" passes through the validation the function returns true.
*/

function fnCheckMaxLength(formObj,num,label)
{
	var value1 = formObj.value;
	var value = fnTrimValue(value1);
	var intLength = value.length;
	var blnSuccess = true;

/*	if(!(fnCheckSpecialCharacter(value1,label)))
	{
		return false;
	}
*/	
	if (intLength > num)
	{
		//alert(label+" cannot be more than "+num+" characters long");
		alert(label+ errMsgs[3] +num+ errMsgs[4]);
		return false;
	}
	return true;
}

//---Validations for email----start---

//1st parameter=the field on the form
//2nd parameter=description of the field
//3rd parameter=true for required, false for not required
function isValidEmail(formObj, vDescription, vRequired)
{
	var vValue = formObj.value;
	var blnSuccess = true;
	//Trim the value first
	vValue=fnTrimValue(vValue);
	//E-mail validation 
	if( vRequired == true && (fnCheckEmpty(vValue, vDescription) == false) )
	{
		formObj.focus();
		return false;
	}
	if(vValue != "")
	{
		if (fnCheckEmail(vValue, vDescription) == false)
		{
			formObj.focus();
			return false;
		}
	}
	return true;
}

/*
This function is called from the isValid function for Email Address validation.
function fnCheckEmail takes two parameters emailStr1 and label.
emailStr1 take the value of the parameter which has to be validated for a email address.
label is typically the name of the feild e.g. Email Address .
if the "value" fails the validation the function returns the message to be
displayed, if the "value" passes through the validation the function returns true.
*/
function fnCheckEmail(emailStr1,label)
{
	var spFlag = true;
	var emailStr = fnTrimValue(emailStr1);

	if(!(fnCheckEmailCharacter(emailStr,label)))
	{
		return false;
	}

	/* The following pattern is used to check if the entered e-mail address
	fits the user@domain format.  It also is used to separate the username
	from the domain. */
	var emailPat=/^(.+)@(.+)$/
	
	/* The following string represents the pattern for matching all special
	characters.  We don't want to allow special characters in the address. 
	These characters include ( ) < > @ , ; : \ " . [ ]    */
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"

	/* The following string represents the range of characters allowed in a 
	username or domainname.  It really states which chars aren't allowed. */
	var validChars="\[^\\s" + specialChars + "\]"

	/* The following pattern applies if the "user" is a quoted string (in
	which case, there are no rules about which characters are allowed
	and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
	is a legal e-mail address. */
	var quotedUser="(\"[^\"]*\")"

	/* The following pattern applies for domains that are IP addresses,
	rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
	e-mail address. NOTE: The square brackets are required. */
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/

	/* The following string represents an atom (basically a series of
	non-special characters.) */
	var atom=validChars + '+'

	/* The following string represents one word in the typical username.
	For example, in john.doe@somewhere.com, john and doe are words.
	Basically, a word is either an atom or quoted string. */
	var word="(" + atom + "|" + quotedUser + ")"
	// The following pattern describes the structure of the user
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")

	/* The following pattern describes the structure of a normal symbolic
	domain, as opposed to ipDomainPat, shown above. */
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

	/* Finally, let's start trying to figure out if the supplied address is
	valid. */

	/* Begin with the coarse pattern to simply break up user@domain into
	different pieces that are easy to analyze. */
	var matchArray=emailStr.match(emailPat);

	if (matchArray == null)
	{
		/* Too many/few @'s or something; basically, this address doesn't
		even fit the general mould of a valid e-mail address. */
		//alert(label + "seems incorrect (check @ and .'s)");
		alert(label + errMsgs[54]);
		return false;
	}

	var user=matchArray[1];
	var domain=matchArray[2];

	// See if "user" is valid 
	if (user.match(userPat) == null)
	{
		// user is not valid
		//alert("The username doesn't seem to be valid.");
		alert(errMsgs[55]);
		return false;
	}

	/* if the e-mail address is at an IP address (as opposed to a symbolic
	host name) make sure the IP address is valid. */
	var IPArray=domain.match(ipDomainPat);

	if (IPArray!=null)
	{
		// this is an IP address
		for (var i=1;i<=4;i++)
		{
			if (IPArray[i]>255)
			{
				//alert("Destination IP address is invalid!");
				alert(errMsgs[56]);
				return false;
			}
		}
	}

	// Domain is symbolic name
	var domainArray=domain.match(domainPat);

	if (domainArray==null)
	{
		//alert("The domain name doesn't seem to be valid.");
		alert(errMsgs[57]);
		return false;
	}

	/* domain name seems valid, but now make sure that it ends in a
	three-letter word (like com, edu, gov) or a two-letter word,
	representing country (uk, nl), and that there's a hostname preceding 
	the domain or country. */

	/* Now we need to break up the domain to get a count of how many atoms
	it consists of. */
	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;

	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3)
	{
		// the address must end in a two letter or three letter word.
		//alert(label + "must end in a three-letter domain, or two letter country");
		alert(label + errMsgs[58]);
		return false;
	}

	// Make sure there's a host name preceding the domain.
	if (len<2)
	{
		// var errStr="This address is missing a hostname!"
		//alert(label + "is missing a hostname!");
		alert(label + errMsgs[59]);
		return false;
	}
	return true;
}

/*
This function is called from the checkEmail function for Email Address validation.
function fnCheckEmailCharacter takes two parameters vValue and vDescription.
vValue takes the value of the parameter which has to be validated for a email address.
vDescription is typically the name of the feild e.g. Email Address.
In this function only @, -, _ and . are allowed.Other special characters are disallowd.
if the "value" fails the validation the function returns the message to be
displayed, if the "value" passes through the validation the function returns true.
*/

function fnCheckEmailCharacter(vValue,vDescription)
{
	// this is for checking special characters in isvalid function
	spFlag = false;

	var x1=vValue;
	for(i=0;i<x1.length;i++)
	{
		var x11=x1.charAt(i);	

		if((x11 >= "A" && x11 <= "Z") || (x11 >= "0" && x11 <= "9") ||	(x11 >= "a" && x11 <= "z") ||
		(x11 == "-") || (x11 == "_") || (x11 == ".") || (x11 == "@"))
		{
			spFlag = false;
		}
		else
		{
			spFlag = true;
			break;
		}
	}

	if(spFlag == true)
	{
		//alert(vDescription + " can contain alphabets, numerals, @, -, _ and . only");
		alert(vDescription + errMsgs[60]);
		return false;
	}
	else
	{
		return true;
	}
}
//---Validations for email----end---
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

var wbPageSubmitted = false;
TrapClicksForHowManySeconds = 3;
TrapTime = 0;
function fnSetPageSubmitted()
{
	wbPageSubmitted = true;
}

function fnGetPageSubmitted()
{
	if(TrapTime == 0)
	{
		var tDate = new Date;
		TrapTime = tDate.valueOf();
	}
	else
	{
		var tDate = new Date;
		var localTrapTime = tDate.valueOf();
		if((localTrapTime - TrapTime) > (TrapClicksForHowManySeconds * 1000))
		{
			//alert("localTrapTime : " + localTrapTime);
			//alert("TrapTime: " + TrapTime);
			TrapTime = 0;
			wbPageSubmitted = false;
			//alert("flag : " + wbPageSubmitted);
		}
		else
		{
			wbPageSubmitted = true;
		}
	}
	if (wbPageSubmitted)
	{
		alert(errMsgs[16]);
	}
	return wbPageSubmitted;
}

/** Disables multiple submits */
function fnSubmitForm(formObjSF)
{
	//alert(fnGetPageSubmitted());
	if (fnGetPageSubmitted())
	{
		return;
	}
	else
	{	
		formObjSF.method = "post";
		formObjSF.submit();
		fnSetPageSubmitted();
	}
}


/*
This function is called from the isValid function for the Special Character Validation.
function checkSpecialCharacter takes 2 parameters vValue, vDescription.
vValue takes the value of the parameter which has to be validated for Special Characters like *_+|:¿?\;¿,./
vDescription is typically the name of the feild e.g. Customer Name.
if the "value" fails the validation the function returns the message to be
displayed, if the "value" passes through the validation the function returns true.
*/
function fnCheckSpecialCharacterForLDAP(vValue, vDescription)
{
	spFlag = true;

	var x1 = vValue;
	var errMsg ="";
	for(i=0; i<x1.length; i++)
	{
		
		var x11 = x1.charAt(i);
		if(x11 == "*")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[63] + vDescription ;
			break;
		}
		if(x11 == "_")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[64]+ vDescription ;
			break;
		}
		if(x11 == "+")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[65]+ vDescription ;
			break;		
		}
		if(x11 == "|")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[66]+ vDescription ;
			break;
		}
		if(x11 == ":")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[67]+ vDescription ;
			break;
		}		
		if(x11 == "¿")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[68]+ vDescription ;
			break;
		}
		if(x11 == "?")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[69]+ vDescription ;
			break;
		}
		if(x11 == "\\")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[70]+ vDescription ;
			break;
		}
		if(x11 == ";")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[71]+ vDescription ;
			break;
		}
		if(x11 == ",")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[72]+ vDescription ;
			break;
		}
		if(x11 == ".")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[73]+ vDescription ;
			break;
		}

		if(x11 == "/")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[62]+ vDescription ;
			break;
		}
		if(x11 == "~")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[2451]+ vDescription ;
			break;
		}
		if(x11 == "`")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[2452]+ vDescription ;
			break;
		}
		if(x11 == "=")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[5001]+ vDescription ;
			break;
		}
		if(x11 == "§")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[5002]+ vDescription ;
			break;
		}
		if(x11 == "-")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[5003]+ vDescription ;
			break;
		}
		if(x11 == "°")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[5004]+ vDescription ;
			break;
		}
		if(x11 == "µ")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[5005]+ vDescription ;
			break;
		}
		if(x11 == "€")
		{
			spFlag = false;
			errMsg = errMsg + errMsgs[5006]+ vDescription ;
			break;
		}
	}
	if(spFlag == true)
	{
		return true;
	}
	else
	{
		alert(errMsg)
		return false;
	}

	return true;
}

function savepopupmessage(save)
{
	//alert(save);
	if(save!="")
	{
		alert(errMsgs[82]);
	}
}

//Checks the length of 2 passwords
function fnCheckLength(string)
{
	if(string.length >= 8)
	{
		return true;
	}
	return false;
}

//Checks the presense of number 
function fnCheckNumber(string1)
{	
	for(i = 0; i < numArray.length; i++)
	{//alert(i+"="+numArray[i]);
		if(string1.indexOf(numArray[i]) != -1)
			return true;
			//isNumberPresent = true;
		//alert(i+"isNumberPresent="+isNumberPresent);
	}
	/*if(isNumberPresent)
		return true;
	else
		return false;*/
		return false;

}

//Checks the presense of Character
function fnCheckChar(string1)
{
	for(i = 0; i < charArray.length; i++)
	{
		if(string1.indexOf(charArray[i].toLowerCase()) != -1 || string1.indexOf(charArray[i].toUpperCase()) != -1)
			isCharPresent = true;
	}
	if(isCharPresent)
		return true;
	else
		return false;
}

//Checks the presense of Special Character
function fnCheckSpecialChar(string1)
{
	for(i = 0; i < specialCharArray.length; i++)
	{
		if(string1.indexOf(specialCharArray[i]) != -1)
		//	isCharPresent = true;
		return true;
	}
/*	if(isCharPresent)
		return false;
	else
		return true;*/
		return false;
}

