function valPromo(strCode)
{
strCode = strCode.trim();
var blnRtn = (strCode.length == 0); 
var strConCode = strCode.toLowerCase();

switch (strConCode)
 {
	case "nvst" : blnRtn = true;
		      break;
	case "nacva": blnRtn = true;
		      break;
	case "amaa" : blnRtn = true;
		      break;
	case "bv3g1" : blnRtn = true;
		      break;
	case "nr0901" : blnRtn = true;
		      break;

	default:
		if (strCode.length > 2)
			{if (blnNumAlpha(strCode))
				{
	     	 		 var chrCD = strConCode.substr(strConCode.length-1,1); 		 
		 		//window.alert('chrCD.charCodeAt(0)-48= ' + (chrCD.charCodeAt(0)-48) + ' intCheckDigit(strConCode)= ' + intCheckDigit(strConCode));
		 		if ("0123456789abcdefghijklmnopqrstuvwxyz".indexOf(chrCD) > -1)
		 			{blnRtn = true;}
		 		else
		 			{blnRtn = false;}
		 		}
					/*{ blnRtn = (intCheckDigit(strConCode)== (chrCD.charCodeAt(0)-48));}		
				}*/
			}
 }
if (!blnRtn)
	{window.alert("Invalid promotion code");} 
return (blnRtn);
}

function intCheckDigit(strCode)
{
var intChar;
var intCode;
var intCD;
var intAlphaSum = 0;
var intSum = 0;
var intLen = strCode.length - 2;
var intMod10;
for (var intIdx=0; intIdx <= intLen; intIdx++)
	{intChar = (strCode.substr(intIdx,1).charCodeAt(0));
	 if (intChar > 96)
		{intCode = intChar - 96; 
		 intAlphaSum += 2*intCode;//2*g+ 2*h + 2*j= alphasum
		 intSum += intCode;}    //g+h+j
 	 else
		{intCode = (intChar - 48);
		 intSum += 2*intCode; }	 //2*i		
	//window.alert('intCode= ' + intCode + 'intSum ' + intSum)
	
	}

intSum += intAlphaSum;
intMod10 = intSum%10
if (intMod10 == 0)
	{intCD=0;}
else
	{intCD = 10 - intMod10;}
//window.alert ('intMod10 ' + intMod10);

return (intCD);
}

// 5/9/05 - Trims white space off both ends of this string and returns the result - dt.
String.prototype.trim = function() 
{
  return( this.replace(/^\s*([^\s]*[^\s])\s*$|^\s*$/,'$1') ); 
}
