<!--
function updated(idNum)
{
	var field=eval("document.family.changed"+idNum);
	field.value="t";
}

function dobchange(index)  
{
	if(index == 0)
	{
		document.myform.month.options.selectedIndex = 0;
		document.myform.day.options.selectedIndex = 0;
		document.myform.year.options.selectedIndex = 0;
	}
}

var submitcount=0;
function submitonce()
{
	if(submitcount == 0)
	{
		submitcount++;
		return true;
  	}
  	else
  	{
		alert("This form has already been submitted.  Thanks!");
		return false;
  	}
}

function ClearSearchField()
{
	if (document.headsearch.xretailer.value == 'Site Search') 
	{
		document.headsearch.xretailer.value = '';
	}
}

function check(max, type, maxrestore, coverpoints)
{
    var redeem = document.orderform.xlpredeem1.value;
    if(redeem==0) redeem=0;
    if(redeem > max)
	{
       alert("You CANNOT use more loyalty points than you have! Please Re-enter...");
	   return false;
	}
    else if(redeem > coverpoints)
	{
       alert("You CANNOT use so many loyalty points! Please Re-enter...");
	   return false;
	}
    else if(!(redeem/2 >= 0))
	{
       alert("You have entered and INVALID Loyalty Points value! Please Re-enter...");
	   return false;
	}
    else
       {
        if(type=='proceed')
        {document.orderform.SubmitButton.value = 'Proceed..';} else {document.orderform.SubmitButton.value='Refresh Cart';}
        document.orderform.xlpredeem.value = redeem;
        document.orderform.submit();
       }
}

function CheckCC(CC_Num) 
{
	
  CC_Num=CC_Num.toLowerCase();
  if (CC_Num.substring(0, 5) != "check") {

     var CCN_digits = ""
     for (var i = 0; i < CC_Num.length; i++) {
           if ((CC_Num.charAt(i) == "0") || (CC_Num.charAt(i) == "1") || (CC_Num.charAt(i) == "2") ||
               (CC_Num.charAt(i) == "3") || (CC_Num.charAt(i) == "4") || (CC_Num.charAt(i) == "5") ||
               (CC_Num.charAt(i) == "6") || (CC_Num.charAt(i) == "7") || (CC_Num.charAt(i) == "8") ||
               (CC_Num.charAt(i) == "9"))
             {CCN_digits = CCN_digits + CC_Num.charAt(i);}
           }


   // initialize final returned var, orig=false, set to true if all goes well.
       var validcard = false;

   // msgind is a flag that specifies the alert message 1=bad first digit, 2=bad length
       var msgind = 0;

   // the correct card type is based on first digit
      if ((CCN_digits.substring (0, 2) == "34") || (CCN_digits.substring (0, 2) == "37")) {
          CC_Type="American Express";
          if (CCN_digits.length == 15)
             {validcard = true;}
          else {msgind = 2;}
      }
      else if (CCN_digits.substring(0, 4)=="6011") {
          CC_Type="Discover";
          if (CCN_digits.length == 16)
             {validcard = true;}
          else {msgind = 2;}
      }
      else if ((CCN_digits.substring (0, 2) >= "51") &&  (CCN_digits.substring (0, 2) <= "55")) {
          CC_Type="MasterCard";
          if (CCN_digits.length == 16)
             {validcard = true;}
          else {msgind = 2;}

      }
      else if (CCN_digits.substring (0, 1) == "4") {
          CC_Type="Visa";
          if ((CCN_digits.length == 16) || (CCN_digits.length ==13))
             {validcard = true;}
          else {msgind = 2;}
      }
      else {msgind = 1;
      }



      // if card is now valid, perform mod10 checksum

     if (validcard) {
      var CheckSum=0;
      for (var x = 1; x <= CCN_digits.length; x++) {
           var CurrentDigit = CCN_digits.charAt(CCN_digits.length - x);  // WALK DOWN NUMBER FROM RIGHT TO LEFT
           if (x%2 == 0) {              // IF NUMBER IS IN AN EVEN POSITION, DOUBLE IT
               var WorkDigit = CurrentDigit * 2;
               if (WorkDigit > 9) {     // IF DOUBLED VALUE>9, ADD MOD10 PLUS 1 TO CHECKSUM TALLY
                   CheckSum = CheckSum + (WorkDigit % 10) + (1-0);
               }
               else {                   // IF DOUBLED VALUE<=9, ADD IT TO THE CHECKSUM TALLY
                   CheckSum = CheckSum + (WorkDigit-0);
               }
           }
           else {  // IF NUMBER IS IN AN ODD POSITION, JUST ADD TO CHECKSUM TALLY
               CheckSum = CheckSum + (CurrentDigit-0);
           }
       }  // END FOR LOOP

        // FINAL CHECKSUM
       if (CheckSum % 10 > 0) {   // IF MOD10 OF CHECKSUM IS NOT ZERO...
           validcard = false;
           msgind=3;
       }
      }

       if (!validcard) {
          if (msgind==1) {
              alert ("The credit card number you entered is not valid.\nPlease verify the information and enter it again.");
          }
          else if (msgind==2) {
              alert ("The credit card number you entered is not valid.\nPlease verify the information and enter it again.");
          }
          else if (msgind==3) {
              alert ("The credit card number you entered is not valid.\nPlease verify the information and enter it again.");
          }
        }
       return (validcard);
  }  // endif user is paying by check or not.
} 

function launchpop(newURL, newName, newFeatures, orgName) {
      var remote = window.open(newURL, newName, newFeatures);
}

function launchpopwindow(passURL, type) {
     myRemote = launchpop(passURL, "PopUpAd", "dependent=no,height=230,width=250,location=no,menubar=no,resizable=no,screenX=30,left=30,screenY=30,top=30,scrollbars=no,status=no,toolbar=no","PopUpAd");
}

// used for footer popup to LT.com site
function STMRCWindow(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,dependent=no,directories=no,width=455,height=540,x=50,y=50");
}

function launchstofwindow(newURL, newName, newFeatures, orgName) {
	var remote = open(newURL, newName, newFeatures);
	if (remote.opener == null)
	remote.opener = window;
	remote.opener.name = orgName;
	return remote;
}

function launchstof(passURL, type) {
	myRemote = launchstofwindow(passURL, "sendtofriend", "dependent=no,height=300,width=350,location=no,menubar=no,resizable=no,screenX=30,left=30,screenY=30,top=30,scrollbars=no,status=no,toolbar=no","SendToAFriend");
}

 function launch(newURL, newName, newFeatures, orgName)
{
	var remote = open(newURL, newName, newFeatures);
	if (remote.opener == null)
		remote.opener = window;
	remote.opener.name = orgName;
	
	return remote;
}

function launchRemote(passURL, type)
{
      myRemote = launch(passURL, "EditItem", "dependent=no,height=450,width=450,location=no,menubar=no,resizable=yes,screenX=30,left=30,screenY=30,top=30,scrollbars=yes,status=no,toolbar=no","ViewITEM");
}
function imgOn(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "on.src");
    }
}
function imgOff(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "off.src");
    }
}
function subform(picked,sid) {
	if (picked!=-1)
	{
		document.expertselect.submit();
	}
	else
	{
		window.location = "experts.php?sid="+sid;
	}
}


var refexit=1;
var ref = new Array()  
  ref[0] = 'https://webjfunk.bankanytime.com/';
  ref[1] = 'https://webtest.bankanytime.com/';
  ref[2] = 'https://livetest.bankanytime.com/';
  ref[3] = 'https://secure.bankanytime.com/';
  ref[4] = 'https://beta.integra.afsnyc.com/';
  ref[5] = 'https://beta.rewardme.bankanytime.com/';
  ref[6] = 'https://rewardme.bankanytime.com/';
    
  for(i=0;i<ref.length;i++) {  
	if (document.referrer.match(ref[i])==ref[i]) refexit=0;
  }  


if (top.frames.length!=0 && refexit!=0) top.location=self.location;

function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}


// -->
