//Following function checks whether passed string is enmpty or not
// this function uses another customizes function trim() to remove 
// trailing spaces
function isEmpty(strCheckString){
  strTemp = trim(strCheckString)
    
   if (strTemp == "") 
     return true;
   else
     return false;
}//End of fucntionisEmpty()




/**
 * Function		: validDate(mm,dd,ccyy)
 * Description	: This function will be called from dataVerify() Method. Function takes
 *				  month, day and year as parameter and checks whether date comprise of it
 *				  is valid.
 */
function validDate(jsMM,jsDD,jsCCYY) {
var isLeap	= false;
var jsMonth = 0;
var jsDays	= 0;

    if (jsMM == "")
    {
        return 1;
    }

    if (jsDD == "")
    {
        return 2;
    }

    if (jsCCYY =="")
    {
        return 3;
    }
    else
    {
        if ( jsCCYY.length != 4 )
                return 4;
        else 
        {
            if ( ( jsCCYY.substring(0,2) != "19") && (jsCCYY.substring(0,2) != "20"))
            {	//window.alert("in");
                return 5;
            }
        
            if ( jsCCYY % 4 == 0)
                isLeap = true;
            else
                isLeap = false;			
        }

    }

    jsMonth	= parseInt(jsMM);
    jsDays	= parseInt(jsDD);
    if (( jsMM < 1 ) || (jsMM > 12))
    {
        return 6;
    }
    else
    {
        switch(jsMonth)
        {
            case 1 :
            case 3 :
            case 5 :
            case 7 :
            case 8 :
            case 10 :
            case 12 : if ((jsDays > 31) || (jsDays < 1)) return 7; break;
            case 4 :
            case 6 :
            case 9 :	
            case 11 : if ((jsDD > 30) || (jsDD < 1)) return 8; break;
            case 2 : { if (isLeap == true)	
                    {
                        if ((jsDD > 29) || (jsDD < 1)) 
                            return 9;
                    }
                    else
                    {	
                        if ((jsDD > 28) || (jsDD < 1))
                            return 10;

                    }
                    }
    
        }
    }
    return 0;
}


/**
 * Function     : validDate(mm,dd,ccyy)
 * Description  : This function will be called from dataVerify() Method. Function takes
 *                month, day and year as parameter and checks whether date comprise of it
 *                is valid.
 * Note : this function is oveloaded to work in either way.   
 */
function validDate(jsDateField)
{
var isLeap  = false;
var jsMonth = 0;
var jsDays  = 0;

//Following is chenge in code

        pos = jsDateField.indexOf("/");           //get position of date field
        jsDD = jsDateField.substring(0,pos); // get date field out
        tempStr =   jsDateField.substring(pos+1);   // remove date field
        
        pos = tempStr.indexOf("/");        //get position of Month field
        jsMM = tempStr.substring(0,pos);  //get Month field out 
        jsCCYY =   tempStr.substring(pos+1); //remove month field
       
//The change in oveload function ends here




    if (jsMM == "")
    {
        return 1;
    }

    if (jsDD == "")
    {
        return 2;
    }

    if (jsCCYY =="")
    {
        return 3;
    }
    else
    {
        if ( jsCCYY.length != 4 )
                return 4;
        else 
        {
            if ( ( jsCCYY.substring(0,2) != "19") && (jsCCYY.substring(0,2) != "20"))
            {   //window.alert("in");
                return 5;
            }
        
            if ( jsCCYY % 4 == 0)
                isLeap = true;
            else
                isLeap = false;         
        }

    }

    jsMonth = parseInt(jsMM);
    jsDays  = parseInt(jsDD);
    if (( jsMM < 1 ) || (jsMM > 12))
    {
        return 6;
    }
    else
    {
        switch(jsMonth)
        {
            case 1 :
            case 3 :
            case 5 :
            case 7 :
            case 8 :
            case 10 :
            case 12 : if ((jsDays > 31) || (jsDays < 1)) return 7; break;
            case 4 :
            case 6 :
            case 9 :    
            case 11 : if ((jsDD > 30) || (jsDD < 1)) return 8; break;
            case 2 : { if (isLeap == true)  
                    {
                        if ((jsDD > 29) || (jsDD < 1)) 
                            return 9;
                    }
                    else
                    {   
                        if ((jsDD > 28) || (jsDD < 1))
                            return 10;

                    }
                    }
    
        }
    }
    return 0;
}




/**
 * Function		: trim(str)
 * Description	: This function will remove leading and trailing spaces from passed string value.
 *                function returns string with spaces eliminated. 
 */
function trim(jsStr) 
{
var jsNewStr="";
var jsCtr = 0;
var jsLen =0;

    jsLen = jsStr.length;
    for(i = 0; i<jsLen; i++)
    {
        if (jsStr.charAt(i) !=' ')
        {
         jsCtr = i;	
         jsNewStr = jsStr.substring(i);
         break;
        }
    }
    
    jsLen = jsNewStr.length;
    jsLen = jsLen - 1;
    for(i = jsLen ; i >= 0 ;i--)
    {
        if (jsNewStr.charAt(i) !=' ')
        {
         jsCtr = i + 1;	
         jsNewStr = jsNewStr.substring(0,jsCtr);
         break;
        }
    }
return jsNewStr;
}

/**
 * Function     : checkName(str)
 * Description  : This function will determines whether passed str is Alphabetic.
 *                if passed string string is Alphabetic then function returns true 
 *                else returns false     .
 */
function checkName(jsStr)
{
    var jsCheckOK = " .'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-";
    var jsAllValid = true;
    
    jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
        jsCh = jsStr.charAt(i);
        for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (jsCh == jsCheckOK.charAt(j))
            {   
                    break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
    {
        return false;
    }
    return true;

}


/**
 * Function     : checkName(str)
 * Description  : This function will determines whether passed str is Alphabetic.
 *                if passed string string is Alphabetic then function returns true 
 *                else returns false     .
 */
function checkAlphabetic(jsStr)
{
    var jsCheckOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var jsAllValid = true;
    
    jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
        jsCh = jsStr.charAt(i);
        for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (jsCh == jsCheckOK.charAt(j))
            {   
                    break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
    {
        return false;
    }
    return true;

}


function checknewCreditLimit(jsStr)
{
var jsCheckOK = "0123456789.-";
var jsAllValid = true;

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}




/**
 * Function		: checkAlphabetic(str)
 * Description	: This function will determines whether passed str is Alphabetic.
 *				  if passed string string is Alphabetic then function returns true 
 *				  else returns false 	 .
 */
function checkAlphabetic(jsStr)
{
    var jsCheckOK = ".'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-";
    var jsAllValid = true;
    
    jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
        jsCh = jsStr.charAt(i);
        for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (jsCh == jsCheckOK.charAt(j))
            {	
                    break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
    {
        return false;
    }
    return true;


}

/**
 * Function		: checkAlphaNumeric(str)
 * Description	: This function will determines whether passed str is Alphanumeric.
 *				  if passed string string is Alphanumeric then function returns true 
 *				  else returns false 	 .
 */
function checkAlphaNumeric(jsStr)
{
    var jsCheckOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var jsAllValid = true;

    jsStr = trim(jsStr);

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}

// This function allows alphanumeric characters without any space
function checkAlphaNumericNoSpace(jsStr)
{
    var jsCheckOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var jsAllValid = true;

    //jsStr = trim(jsStr);

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}

/**
 * Function		: checkDecimal(str)
 * Description	: This function will determines whether passed str is Numeric.
 *				  if passed string string is Numeric then function returns true 
 *				  else returns false 	 .
 */

function checkDecimal(jsStr)
{
var jsCheckOK = "0123456789";
var jsAllValid = true;

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}




function checkDecimalNoSpace(jsStr)
{
var jsCheckOK = "0123456789";
var jsAllValid = true;

    //jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}




function checkCardId(jsStr)
{
var jsCheckOK = "0123456789";
var jsAllValid = true;

    jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}// End of checkCardId()



function checkDecimal(jsStr)
{
var jsCheckOK = "0123456789.";
var jsAllValid = true;

    //jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
    {
		return false;
    }	
	if (jsStr.split("."))
	{
		if ((jsStr.split(".").length>2))
		{
			return false;
		}
	}
	return true;
}


function checkDecimalValue(jsStr)
{
var jsCheckOK = "0123456789.";
var jsAllValid = true;

    //jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
    {
		return false;
    }	
	if (jsStr.split("."))
	{
		if ((jsStr.split(".").length>2))
		{
			return false;
		}
	}
	return true;
}

















/**
 * Function		: checkspecialcharacter(str)
 * Description	: This function will determines whether passed str is Numeric.
 *				  if passed string string is Numeric then function returns true 
 *				  else returns false 	 .
 */


function checkSpecialCharacter(jsStr)
{
    var jsCheckOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_";
    var jsAllValid = true;

    jsStr = trim(jsStr);

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}


/**
 * Function		:checkTelephoneNumber(jsStr)
 * Description	: This function will determines whether passed str is valid TelephoneNumber.
 *				  if passed string string is valid TelephoneNumber then function returns true 
 *				  else returns false 	 .
 */


function checkTelephoneNumber(jsStr)
{
    var jsCheckOK = "0123456789.-()";
    var jsAllValid = true;

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}

function checkSpecialCharacter2(jsStr)
{
	var jsCheckOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var jsAllValid = true;

    //jsStr = trim(jsStr);

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}//end of function


function checkAlphanumericSpace(jsStr)
{
	var jsCheckOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
    var jsAllValid = true;

    jsStr = trim(jsStr);

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}//end of function


function checkSpecialCharacter1(jsStr)
{
	//alert("called checkSpecialCharacter1");
	
    var jsCheckOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var jsAllValid = true;

    jsStr = trim(jsStr);

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}//end of function

/**
 * Date  :10-08-2001
 * Author:DilliBabu G
 * Function		: checkTelephoneid(str)
 * Description	: This function will determines whether passed str is anything apart from the character mentioned below it will return false then function returns true 
 * else returns true 	 .
 */
function checkTelephoneid(jsStr)
{
//	alert("called" + jsStr);
	
    var jsCheckOK = "0123456789";
    var jsAllValid = true;

    //jsStr = trim(jsStr);

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
	        {
		        if (ch == jsCheckOK.charAt(j))
			    {	
				    break;
	            }
		    }

			if (j == jsCheckOK.length)
			{
				jsAllValid = false;
				break;
			}
    }

    if  (!jsAllValid)
    {
	    return false;
    }
    return true;
}//end of function checkTelephoneid

function callPreOrder(quotNo){
    document.frmDisplayQuote.txtQNo.value=quotNo;
    //alert(document.frmDisplayQuote.txtQNo.value);
    document.frmDisplayQuote.action = "./EventManager";
    document.frmDisplayQuote.method="post";
    document.frmDisplayQuote.submit();
}

function dateValid(obj1){
    //alert(""+obj1.name);
    //	returnVal = validDate(obj1.value);
    if(validDate(obj1.value) > 0){
    //	obj1.select();
    //	alert ("Please enter valid date:"+obj1.name);
        obj1.focus();
    }
}

function validEmail(mailids)
{
var arr = new Array('.com','.net','.org','.biz','.coop','.info','.museum','.name','.pro'
,'.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag','.ai','.al',
'.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw','.az','.ba','.bb',
'.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm','.bn','.bo','.br','.bs',
'.bt','.bv','.bw','.by','.bz','.ca','.cc','.cd','.cf','.cg','.ch','.ci',
'.ck','.cl','.cm','.cn','.co','.cr','.cu','.cv','.cx','.cy','.cz','.de',
'.dj','.dk','.dm','.do','.dz','.ec','.ee','.eg','.eh','.er','.es','.et',
'.fi','.fj','.fk','.fm','.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh',
'.gi','.gl','.gm','.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy',
'.hk','.hm','.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io',
'.iq','.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li','.lk',
'.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg','.mh','.mk',
'.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt','.mu','.mv','.mw',
'.mx','.my','.mz','.na','.nc','.ne','.nf','.ng','.ni','.nl','.no','.np',
'.nr','.nu','.nz','.om','.pa','.pe','.pf','.pg','.ph','.pk','.pl','.pm',
'.pn','.pr','.ps','.pt','.pw','.py','.qa','.re','.ro','.rw','.ru','.sa',
'.sb','.sc','.sd','.se','.sg','.sh','.si','.sj','.sk','.sl','.sm','.sn',
'.so','.sr','.st','.sv','.sy','.sz','.tc','.td','.tf','.tg','.th','.tj',
'.tk','.tm','.tn','.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug',
'.uk','.um','.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu',
'.ws','.wf','.ye','.yt','.yu','.za','.zm','.zw'); 
var mai = mailids;
var val = true;

var dot = mai.lastIndexOf(".");
var ext = mai.substring(dot,mai.length);
var at = mai.indexOf("@");
var dom = dot - at;
var sp = mai.indexOf(" ");

if(dom >= 2 && at > 3 && sp == -1)
{
for(var i=0; i<arr.length; i++)
{
if(ext == arr[i])
{
val = true;
break;
} 
else
{
val = false;
}
}
if(val == false)
{
return false;
}
}
else
{
return false;
}

return true;
}
//End of function validEmail()


function isValidTime(str){
 if(str.indexOf(":") == -1){
  return false;
 }
	
	if (str.split(":").length>3)
	{
		return false;
	}else
	{
		var strArr = str.split("@");
		var strArrOne = strArr[0];
		var strArrTwo = strArr[1];
		//alert("strArrOne : "+strArrOne);
		//alert("strArrtwo : "+strArrTwo);
		if(!(strArrOne.split("@").length>0))
		{
			//alert("inside strarrone");
			return false;
		}else if (!(strArrTwo.split("@").length>0))
		{
			//alert("inside strarrtwo");
			return false;
		}
	}
 return true;   
}//End of function validEmail()


/**
 * Function		: checkNumeric(str)
 * Description	: This function will determines whether passed str is Numeric.
 *				  if passed string string is Numeric then function returns true 
 *				  else returns false 	 .
 */

function checkNumeric(jsStr)
{

var jsCheckOK = "0123456789";
var jsAllValid = true;

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}

/**
 * Function		: checkNumbers(str)
 * Description	: This function will determines whether passed str is proper value.
 *				  if passed string is proper value then function returns true 
 *				  else returns false 	 .
 */
function checkNumbers(jsStr)
{

var jsCheckOK = "0123456789,";
var jsAllValid = true;

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}



/**
 * Function		: checkNumbers1(str)
 * Description	: This function will determines whether passed str is proper value.
 *				  if passed string is proper value then function returns true 
 *				  else returns false 	 .
 */
function checkNumbers1(jsStr)
{

var jsCheckOK = "0123456789,-";
var jsAllValid = true;

    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}




function checkNegNumeric(jsStr)
{
var jsCheckOK = "0123456789";
var jsAllValid = true;

	if(jsStr.chatAt(0).equals('-')){
		jsStr = jsStr.substring
	}
    for (var i = start;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}

function checkNumericNoSpace(jsStr)
{
var jsCheckOK = "0123456789";
var jsAllValid = true;

    //jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}

function checkCardId(jsStr)
{
var jsCheckOK = "0123456789";
var jsAllValid = true;

    jsStr = trim(jsStr);
    for (var i = 0;  i < jsStr.length;  i++)
    {
            ch = jsStr.charAt(i);
            for (j = 0;  j < jsCheckOK.length;  j++)
        {
            if (ch == jsCheckOK.charAt(j))
            {	
                break;
            }
        }

        if (j == jsCheckOK.length)
        {
            jsAllValid = false;
            break;
        }
    }

    if  (!jsAllValid)
        {
    return false;
    }
    return true;

}// End of checkCardId()



/**
 * Function     : isRepeated(paramVals)
 * Description  : This function will determines whether passed array value contains any repeatation of values.
 *                if passed array contains repeataion of values then function returns true 
 *                else returns false.
 */

function isRepeated(paramVals) {
	for(var i=0; i<paramVals.length;i++) {
		for(var j=0; j<paramVals.length; j++) {
			if(parseInt(paramVals[i]) == parseInt(paramVals[j])) {
				return true;
			}
		}//End: inner for
	}//End: outer for
	return false;
}//[End: isRepeated()]


