var alphabet  = 1;
var mandatory = 2;
var numeric   = 4;
var floatnum  = 8;
var email     = 16;
var zip	      = 32;
var alnum     = 64;
var phone     = 128;
var other     = 256;
var date      = 512;
var length    = 1024;

var error;


function checkTextArea(textArea,len, textAreaName){
	
	if(textArea.value)	
	{
		if(textArea.value.length > len){
			alert(textAreaName+" should not contain more than "+len+" characters.\n");
			textArea.focus();
			return false;
		}else{
			return true;
		}
	}
		return true;
}


function trim(st) 
{
	var len = st.length
	var begin = 0, end = len - 1;
	while (st.charAt(begin) == " " && begin < len) {
		begin++;
	}
	while (st.charAt(end) == " " && begin < end) {
		end--;
	}
	return st.substring(begin, end+1);
}
function setNameValue(object, name, value)
{
	object.validName = name;
	object.validValue = value;

}
function verify_password(passwd)
{
	//var passwd = trim(document.LoginForm.password.value);
	if(passwd.length==0)
	{
		alert("Please enter the password");
		return false;
	}
	else
	{
		var flag = 0;
		
		// check for atleast one alphabet
		for(var i=0;i< passwd.length;i++)
		{
	 		if((passwd.charAt(i) >='A' && passwd.charAt(i)<='Z')
	 		   || (passwd.charAt(i) >='a' && passwd.charAt(i)<='z'))
	 		{
	 			flag = 0;
	 			break;
	 		}
	 		else
	 		{
	 			flag = 1;
	 		}
	 	}
	 	if(flag==1)
	 	{
	 		alert("Please enter atleast one alphabet in the password field.");
	 		return false;
	 	}
	 	
	 	flag=0;
		// check for atleast one number
		for(var i=0;i< passwd.length;i++)
		{
	 		if(passwd.charAt(i) >='0' && passwd.charAt(i)<='9' )
	 		{
	 			flag = 0;
	 			break;
	 		}
	 		else
	 		{
	 			flag = 1;
	 		}
	 	}
	 	if(flag==1)
	 	{
	 		alert("Please enter atleast one number in the password field.");
	 		return false;
	 	}
	 	
		/*flag=0;
	 	// check for atleast one special char
	 	for(var i=0;i< passwd.length;i++)
		{
	 		if (passwd.charAt(i) >' ' && passwd.charAt(i)<= '~') 
	 		{
	 		   	if((passwd.charAt(i) >='0' && passwd.charAt(i)<='9' )
	 		   	|| (passwd.charAt(i) >='A' && passwd.charAt(i)<='Z' )
	 		   	|| (passwd.charAt(i) >='a' && passwd.charAt(i)<='z' ))
	 		   	{
	 		   		flag = 0;
	 		   	}
	 		   	else
	 		   	{
	 		   		flag = 1;
	 		   		break;
	 		   	}
	 		   }
	 		   else
	 		   {
	 		   	flag = 0;
	 		   }
	 	}
	 	if(flag==0)
	 	{
	 		alert("Please enter atleast one special character in the password field.");
	 		return false;
	 	}
	 	
	 	// check for duplicate char
		for(var i=0;i< passwd.length;i++)
		{
	 		for(var j=1;j< passwd.length;j++)
			{
				if(i==j) continue;
				if(passwd.charAt(i)==passwd.charAt(j))
	 			{
	 				alert("Please do not enter any character more than once in the password field.");
					return false;
	 			}
	 		}
	 	}*/
	 	return true;
	}
}

function validateForm(f)
{
	var errMessages="";
	var boolSuccess = true;

	var j=0;
	for ( var i = 0, j=0; i < f.length; i++)
	{
		//Each of the form element is expected to have two dynamically set properties
		//validName and validValue

		if ( !f.elements[i].validName )
			continue;
		if (f.elements[i].type == "select-one" || f.elements[i].type =="select-multiple")
		{
			if ( f.elements[i].selectedIndex != 0 )
			{
				var obj = f.elements[i].options[f.elements[i].selectedIndex];
				obj.validName = f.elements[i].validName;
				obj.validValue = f.elements[i].validValue;
				var result = elementCheck(obj) ;
			}
			else
			{
				var obj = new Object();
				obj.validName = f.elements[i].validName;
				obj.validValue = f.elements[i].validValue;
				obj.value="";
				var result = elementCheck(obj) ;
			}
		}
		else
		{
			var result = elementCheck(f.elements[i]) ;
		}
		//result = false;
		if ( result != true )
		{
			boolSuccess = false;
			//errMessages += (++j  +". " +  f.elements[i].validName +" " + result +"\n");
			errMessages += (f.elements[i].validName +" " + result +"\n");
		}
	}
	if ( ! boolSuccess )
	{
		/*var errHeader  = "______________________________________________________\n\n";
		errHeader += "The form was not submitted because of the following error(s).\n";
		errHeader += "Please correct these error(s) and re-submit.\n";
		errHeader += "______________________________________________________\n\n";
		errHeader +=errMessages;
		alert(errHeader);*/
		alert(errMessages);
		return false;
	}
	else
		return true;
}

function isBlank(s)
{
    
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}

function checkExtension(checkString,ext)
{
	if(checkString == "")
	{
		return false;
	}
	var dot=false;
	var FileExtn=checkString.substr(checkString.lastIndexOf('.')+1);
	if(isEqualString(FileExtn,ext))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isEqualString(objOne, objTwo)
{
	var objOneLen=objOne.length;
	var objTwoLen=objTwo.length;

	if(objOneLen==objTwoLen)
	{	for(var i=0;i<objOneLen;i++)
		{
			if(objOne.charAt(i) != objTwo.charAt(i)) return false;
		}
		return true;
	}
	else
		return false;


}

function elementCheck(sobject )
{


	var retval=false;
	var fieldName = sobject.validName;
	var iOptionval = sobject.validValue;

	//Mandatory check done first. If not mandatory, and if the data is not entered,
	//Data is considered to be valid
	error="" ;

	if (iOptionval & 2 )
	{
		    if(isBlank(sobject.value))
			{
				error += " Mandatory";
			}
	}
	else
	{
		if ( isBlank(sobject.value))
		{
			return true;
		}
	}

	if(iOptionval & 1)
	{
		if (!checkalpha(sobject.value))
		{
			error += " accepts only Aphabets";
		}
	 }

	if ( iOptionval & 4 )
	{
		if (!checkNumber(sobject.value))
		{
			error += " accepts only Numerics";
		}
	}
	if ( iOptionval & 8)
	{
			if (!checkfloat(sobject.value))
			{
				error += " accepts only Positive Floats";
			}
	}

	if ( iOptionval & 16)
	{
			if (! checkEmail(sobject.value))
			{
				error+=" Accepts only Email-Id";
			}
	}
	if (iOptionval & 32)
	{
			if (! checkZip(sobject.value))
			{
				error+=" Accepts only Zip Codes";
			}
	}

	if (iOptionval & 64)
	{
			if (!checkalnum(sobject.value))
			{
				error+=" Accepts only Alpha Numerics";
			}
	}

	if (iOptionval & 128)
	{
			//Validating Phone...
	}

	if (iOptionval & 256)
	{
		if (!checkalnumandother(sobject.value))
			{
				error+=" Accepts only Alphas, Numerics and Others";
			}
	}

	if (iOptionval & 512)
	{
			if (!checkDate(sobject))
			{
				error+=" Accepts only Date in the format MM/DD/YYYY ";
			}
	}

	if (iOptionval & 1024)
	{
           if ( ! checkLength(sobject))
           {
				error+="Length Exceeded";

           }
	}
	if ( error != "" )
		return error;
	return true;
}


function checkfloat(checkString)
{
	if ( parseInt(checkString) < 0)
		return false;
	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;


    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);


        if ((ch >= "0" && ch <= "9") || (ch == ".")) {
            newString += ch;
        }
    }
	 if (checkString != newString)
    {
        return false;
     }
    return true;

}


function checkTag(checkString)
{
	for (i = 0; i < checkString.length; i++)
	{
	        ch = checkString.charAt(i);
		if((ch == '<')||(ch == '>'))
		return false;
	}
return true;
}


function checkNumber(checkString)
{
	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++)
    {
        ch = checkString.substring(i, i+1);

        if ((ch >= "0" && ch <= "9"))
        {
            newString += ch;
        }
    }

    if (checkString != newString)
    {
        return false
     }
    return true;
}

function checkZip(checkString)
{
	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++)
    {
        ch = checkString.substring(i, i+1);

        if ((ch >= "0" && ch <= "9") || (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || (ch == " ") || (ch == "-"))
        {
            newString += ch;
        }
    }

    if (checkString != newString) 
    {
    	return false;
     }
    return true;
}


function checkPhone(checkString)
{
	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++)
    {
        ch = checkString.substring(i, i+1);

        if ((ch >= "0" && ch <= "9") || (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || (ch == " ")||(ch == "-") || (ch == ".") )
        {
            newString += ch;
        }
    }

    if (checkString != newString)
    {
    	return false;
     }
    return true;
}



function checkLength(checkString,length)
{
	if ( checkString == "" )
		return false;

   if (checkString.value.length > length)
    {
      	return false
     }
    return true;
}

function isEmpty(checkString)
{
	if ( checkString == "" )
	{
		return false;
	}

	if(checkString.value == null || checkString.value == "")
	{
		return true;
	}
	return  false;

}

function checkalnum(checkString)
{
	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);


        if ((ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") ||
            (ch >= "0" && ch <= "9") || (ch=='-') || (ch=='_')) {
            newString += ch;
        }
    }

   if (checkString != newString)
	{
		 return false;
	 }
	return true;

}

function checkalphanum(checkString)
{
	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);


        if ((ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") ||
            (ch >= "0" && ch <= "9") || (ch=='_')) {
            newString += ch;
        }
    }

   if (checkString != newString)
	{
		 return false;
	 }
	return true;

}




function checkalnumandspace(checkString)
{

    if ( checkString == "" )
    return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);

        if ((ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") ||
            (ch >= "0" && ch <= "9") || (ch==' ') ||(ch=='-') || (ch=='_')) {
            newString += ch;
        }
    }

   if (checkString != newString)
   {
	 return false;
   }
   
   return true;

}











function checkalnumandother(checkString)
{
	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;
    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);
        if (ch >= " " && ch <= "~") {
            newString += ch;
        }
    }

    if (checkString != newString)
	{
		 return false;
	 }
	return true;



}


function checkRequiredFields(sobject,requiredFields,fieldNames)
{


    var fieldCheck   = true;
    var fieldsNeeded = "\nA value must be entered in the following field:\n\n\t";


    for(var fieldNum=0; fieldNum < requiredFields.length; fieldNum++) {
        if ((sobject.elements[requiredFields[fieldNum]].value == "") ||
            (sobject.elements[requiredFields[fieldNum]].value == " ")) {

            fieldsNeeded += fieldNames[fieldNum] + "\n\t";
			alert(fieldsNeeded);
			sobject.elements[requiredFields[fieldNum]].focus();
            fieldCheck = false;
			return false;

        }
    }


    if (fieldCheck == true)
    {
        return true;
    }


}




/****************************************************************/

/* PURPOSE:  Returns true if the string is a valid date number.
	A method is passed in (1 = month, 2 = day).  If the string is
	nonnumeric, false is passed back.  If the day in the date string
	is greater than 31, false is returned.  If the month is greater
	than 12, an error is returned.
*/

function isDateNumber(strNum,method)
{
	var str = new String(strNum);
	var i = 0;

	if (isNaN(parseInt(str)) || parseInt(str) < 0) return false;

	if (method == 2)
		if (parseInt(str) > 31)
			return false;
	if (method == 1)
		if (parseInt(str) > 12)
			return false;
	if ( method == 3 )
		if ( strNum.length < 4 ) return false;

	for (i = 0; i < str.length; i++)
		if (str.charAt(i) < '0' || str.charAt(i) > '9')
			return false;


	return true;
}


/****************************************************************/

/* PURPOSE:  Returns No of days different between two dates
objDate1-objDate2

*/

function DateDiff(objDate1,objDate2)
{
	var Date1=new Date(objDate1);
	var Date2=new Date(objDate2);
	//Always set today's time to 00:00:00. In Solaris today's time alway start from 12:00. So subtract -12.

	var msPerDay = 24 * 60 * 60 * 1000;
 	var daysLeft = (Date1.getTime() - Date2.getTime()) / msPerDay;
	daysLeft = Math.round(daysLeft);
	return daysLeft;

}


/****************************************************************/

/* PURPOSE:  Returns true if the first date is greater or equal
    to the second date
*/

function isDateGreater(strNum1,strNum2)
{

 var newDate1 = new Date(strNum1);
 var newDate2 = new Date(strNum2);

 var y1 = newDate1.getFullYear();
 var y2 = newDate2.getFullYear();

 var m1 = newDate1.getMonth();
 var m2 = newDate2.getMonth();

 var d1 = newDate1.getDate();
 var d2 = newDate2.getDate();

if(y1>y2) return true;

if(y1<y2) return false;

if (y1==y2)
{
   if (m1>m2) return true;
   if (m1<m2) return false;
   if (m1==m2)
   {
      if (d1>d2) return true;
      else return false;
   }
}

}

function showStatus(message)
{
    window.status=message;
}
function showWaitStatus()
{
    window.status="Please Wait. System is responding to your request..";
}
function clearStatus()
{
    window.status="";
}

function wIsDateGreater(object1, object2 )
{
    if ( isDateGreater(object1.value, object2.value) == true )
    {
        window.alert(object2.validName + " Cannot be less than " + object1.validName );
        return false;
    }
    return true;
}


/****************************************************************/

/* PURPOSE: Checks to see if the string is a valid date.  A valid
	date is defined as any of the following:

		MM/DD/YY, MM/DD/YYYY, M/D/YY, M/D/YYYY,
		MM-DD-YY, MM-DD-YYYY, M-D-YY, M-D-YYYY
*/

function checkDate(str)
{
	var i = 0, count = str.length, j = 0;
	while ((str.charAt(i) != "/" && str.charAt(i) != "-") && i < count)
		i++;

	if (i == count || i > 2) {

		return false;
	}

	var addOne = false;
	if (i == 2) addOne = true;

	if (!isDateNumber(str.substring(0,i),1)) {
		return false;
	}

	j = i+1;
	i = 0;

	while ((str.charAt(i+j) != "/" && str.charAt(j+i) != "-") && i+j < count)
		i++;

	if (i+j == count || i > 2) {
		return false;
	}

	if (!isDateNumber(str.substring(j,i+j),2)) {
		return false;
	}

	j = i+3;
	i = 0;

	if (addOne) j++;

	while (i+j < count)
		i++;

	if (i != 2 && i != 4) {
		return false;
	}

	if (!isDateNumber(str.substring(j,i+j),3)) {
		return false;
	}

	return true;
}

/****************************************************************/
/* Checks for single quotes -- Returns true if single quote is present */
function checkSingleQuote(checkString)
{
    if ( checkString == "" )
	return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);
        if (ch != "'") {
            newString += ch;
        }
    }

    if (checkString != newString)
    {
	 return true;
    }
    return false;
}
/************************************************************/


function checkalpha(checkString)
{

	if ( checkString == "" )
		return false;

    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);


        if ((ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z" )|| ch==" ") {
            newString += ch;
        }
    }

    if (checkString != newString)
		{
		 return false;
		 }
	return true;
}
  
function checkEmail(str)
{
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	var state = true;
	if (str.indexOf(at)==-1){
	   state=false;
	}
	
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   state=false;
	}
	
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    state=false;
	}
	
	 if (str.indexOf(at,(lat+1))!=-1){
	    state=false;
	 }
	
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    state=false;
	 }
	
	 if (str.indexOf(dot,(lat+2))==-1){
	    state=false;
	 }
	
	 if (str.indexOf(" ")!=-1){
	    state=false;
	 }
	 //no successive two dots
	 for(var i=0; i<str.length-1; i++)
		if((str.charAt(i)==dot)&&(str.charAt(i+1)==dot))
			state=false;
	
	 //the first and last char cannot be "."
	 var l= str.length;
	 if((str.charAt(0)==".")||(str.charAt(l-1)=="."))
		state=false;
	
	 //the first and last char cannot be "@"
	 if((str.charAt(0)=="@")||(str.charAt(l-1)=="@"))
		state=false;	
	
	 return state;
}

  /****************************************************************/
/*PURPOSE:The Previous function for date memberof the class considers
  date as a whole object and not as string.
  In this function 4 parameters month,day & year and the error data are
  passed and the returns 0 for no error,1 for error in month,2 for error in day
  & 3 for error in year
*/

function dateCheck(month,day,year,strFieldname)
{
       day=parseInt(day);
       year=parseInt(year);
       month=parseInt(month);
	   if(day<=0) {alert(strFieldname+" : Invalid Day");return 2;}
                   if(month<=0) {alert(strFieldname+" : Invalid Month");return 1;}
	   if(year<=0) {alert(strFieldname+" : Invalid Year");return 3;}
	   //if(isNaN(day)){alert(strFieldname+" : Should not be a string");return 2;}
	   if (month == 2 )
		{
			febdays = daysInFebruary(year);
			if (day>febdays)
			{
				alert(strFieldname+":February  has only "+febdays+" days in " + year + " !");
				return 2;
			}
		}
		else if (month>12) {alert(strFieldname+":Follows mm/dd/yyyy,Month Should be<12"); return 1;}

		else if ((month == 4) || (month == 6) ||(month == 9) ||(month == 11) )
		{
			if (day >30)
			{
				alert (strFieldname+":This month ( " + month + " ) has only 30 days !");
				return 2;
			}
		}
		else if (day >31)
			{
				alert ( strFieldname+" : Day Value Should be Less Than 31");
				return 2;
			}

		if(year>99)
		{if((year<1900)||(year>3000)) {alert(strFieldname+":Enter Valid Year");return 3;}}

	    return 0;
}

function daysInFebruary (year)
{
	// February has 29 days in any year evenly divisible by four,
	// EXCEPT for centurial years which are not also divisible by 400.
	return (  ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) ? 29 : 28 );
}

// The following methods added by Virupakshan.T.S on 23/07/2001.

// This function will display the error message supplied in the alert box and
// will shift focus to the form element specified.
function displayErrorMessage(fld,msg){
	alert(msg);
	fld.focus();
	fld.select();
}

// This function will replace all the occurences of str to rstr in the string input.
function replaceInString(input,str,rstr){
	var output = "";
	arr1=input.split(str);
	for(i=0;i<arr1.length-1;i++)
		output += arr1[i]+rstr;
	output += arr1[arr1.length-1];
	return output;
}

// This function will select the option which has the value val in the select box selfield.
function selectField(selfield,val)
{
	for(var i = 0; i<selfield.options.length; i++)
	{
		if(selfield.options[i].value==val)
		{
			selfield.options[i].selected=true;
			i = selfield.options.length-1;
		}
	}
}

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isFloat (s)
{   var i;
    var seenDecimalPoint = false;
    var decimalPointDelimiter = ".";
    if (s == decimalPointDelimiter) return false;
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if ((c == decimalPointDelimiter) && !seenDecimalPoint) seenDecimalPoint = true;
        else if (!isDigit(c)) return false;
    }
    return true;
}

function insertNewLine(input)
{
	// Converts Carriage returns to newlines
	var output = "";
	for (var i = 0; i < input.length; i++)
	{
		if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)) {
			i++;
			output += "\n";
		}
		else
		{
			output += input.charAt(i);
   		}
	}
	return output;
}
// This function sets the image size based on the aspect ratio of the image and the max screen size.
// Used by Photo Component.
// For use in IE only.
// Author: Virupakshan.T.S
function setImageSize(imgObj,maxWidth,maxHeight,imgWidth,imgHeight){
	maxAspectRatio = maxWidth/maxHeight;
	imgAspectRatio = imgWidth/imgHeight;
	if(imgWidth>maxWidth && imgHeight>maxHeight){
		if(imgAspectRatio > 1){
			imgObj.width = maxWidth;
			imgObj.height = Math.round(maxWidth/imgAspectRatio);
		}
		else if(imgAspectRatio < 1){
			imgObj.width = Math.round(maxHeight*imgAspectRatio);
			imgObj.height = maxHeight;
		}
		else{
			imgObj.width = maxWidth;
			imgObj.height = maxHeight;
		}
	}
	else if(imgWidth>maxWidth){
		imgObj.width = maxWidth;
		imgObj.height = Math.round(maxWidth/imgAspectRatio);
	}
	else if(imgHeight>maxHeight){
		imgObj.width = Math.round(maxHeight*imgAspectRatio);
		imgObj.height = maxHeight;
	}
	else{
		imgObj.width = imgWidth;
		imgObj.height = imgHeight;
	}
}

// Checks whether atleast one of the checkbox in the array of checkbox is checked.
function isAnyCheckBoxChecked(chkbox){
	if(chkbox.length!=null){
		for(i=0;i<chkbox.length;i++){
			if(chkbox[i].checked)
				return true;
		}
		return false;
	}
	else{
		if(chkbox.checked)
			return true;
		else
			return false;
	}
}

//Check for valid values..
function checkValidText(checkString,stringName)
{
    newString = "";
    count = 0;

    for (i = 0; i < checkString.length; i++)
    {
        ch = checkString.substring(i, i+1);

        if ((ch >= "0" && ch <= "9") || (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || (ch=="_") || (ch =="*" ))
        {
            newString += ch;
        }
    }
    if (checkString != newString )
    {
    	alert('Error:Only Alpha numeric characters(0 to 9,a to z)  and _ are allowed.\nPlease enter valid value for \''+ stringName+'\''  );
        return false
     }
    return true;
}

// Added By Siva For Validating Alphanumeric ZIP Code Value -- Start
function isAlphanumeric(string,ignoreWhiteSpace) 
{
	var boolvar = true;
	if(!isEmpty(string))
	{
		if (string.search)
		{
			if ((ignoreWhiteSpace && string.search(/[^\w\s]/) != -1) || (!ignoreWhiteSpace && string.search(/\W/) != -1)) 
				return false;
		}
	}
	return true;
}
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

// Added By Siva For Validating Alphanumeric ZIP Code Value -- Start