function KEY_CODE_ACCEPTED_MESSAGE(p_source_key)
{
 return "";
// return "Key Code "+
//       p_source_key +
//       " has been accepted!";
}
function KEY_CODE_ACCEPTED(p_source_key)
{
 if (p_source_key=="")
 {
  var sourceKeyMessage = "";
 }
 else
 {
  var sourceKeyMessage = KEY_CODE_ACCEPTED_MESSAGE(p_source_key);
 }
 return "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"266\">" +
        "<tr>" +
        "<td align=\"right\">" +
        "<span class=\"txtCartRwdBig\">" +
        sourceKeyMessage +
        "</span>" +
 //       "<br>" +
//        "<br>" +
        "</td>" +
        "</tr>" +
        "</table>";
}
function REWARD_BUG(p_image,p_message,p_source_key)
{
 if (p_source_key=="")
 {
  var sourceKeyMessage = "";
 }
 else
 {
  var sourceKeyMessage = "<span class=\"txtCartRwdBig\">" +
                          KEY_CODE_ACCEPTED_MESSAGE(p_source_key) +
                         "</span>";
 }
 return "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"266\">" +
        "<tr>" +
        "<td colspan=\"5\" bgcolor=\"#999999\"><img src=\"/images/clear.gif\" width=\"1\" height=\"1\"></td>" +
        "</tr>" +
        "<tr>" +
        "<td bgcolor=\"#999999\"><img src=\"/images/clear.gif\" width=\"1\" height=\"1\"></td>" +
        "<td bgcolor=\"#FFFFFF\"><img src=\"" +
        p_image +
        "\" width=\"86\" height=\"60\"></td>" +
        "<td bgcolor=\"#999999\"><img src=\"/images/clear.gif\" width=\"1\" height=\"60\"></td>" +
        "<td bgcolor=\"#FFFFFF\">" +
        "<table width=\"177\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\">" +
        "<tr>" +
        "<td>" +
        sourceKeyMessage +
        "<span class=\"txtCartRwdSmall\">" +
        p_message +
        "</span>" +
        "</td>" +
        "</tr>" +
        "</table>" +
        "</td>" +
        "<td bgcolor=\"#999999\"><img src=\"/images/clear.gif\" width=\"1\" height=\"1\"></td>" +
        "</tr>" +
        "<tr>" +
        "<td colspan=\"5\" bgcolor=\"#999999\"><img src=\"/images/clear.gif\" width=\"1\" height=\"1\"></td>" +
        "</tr>" +
        "</table>";
}

// EMP
function EMP_DISC_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function EMP_DISC_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_emp_disc.gif";
 var l_message = "Thank you for shopping americangirl.com! " +
 				 "Your 30% employee savings has been applied and is reflected below.";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// GOML
function GOML_TIER_ELIGIBLE(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_goml_tier.gif";
 var l_message = "Add to your savings! " +
                 "Get up to 30% off your Girls of Many Lands purchase. " +
				 "<a class=\"txtCartRwdSmall\" href=\"/pls/ag/AG_rewardthumb?rewardid=24&catid=423235&sectid=375720\"> " +
                 "Learn how</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}
function GOML_TIER_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_goml_tier.gif";
 var l_message = "Add to your savings! " +
                 "Get up to 30% off your Girls of Many Lands purchase. " +
				 "<a class=\"txtCartRwdSmall\" href=\"/pls/ag/AG_rewardthumb?rewardid=24&catid=423235&sectid=375720\"> " +
                 "Learn how</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// SUMMERREAD
function SUMMERREAD_ELIGIBLE(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_src.gif";
 var l_message = "Get a free T-shirt when you order three or more books! " +
                 "To continue shopping, " +
                 "<a class=\"txtCartRwdSmall\" href=\"/pls/ag/AG_shop_home\"> " +
                 "Click here</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}
function SUMMERREAD_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_src.gif";
 var l_message = "Thanks for taking part in our Summer Reading Celebration! You get a free T-shirt with your order. " +
				"<a class=\"txtCartRwdSmall\" href=\"\" " +
				"onclick=\"openResizePopup(\'/store/html/rwd_src.html\',400,400)\;return false\;\">" +
                "See details</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TEN_OFF
function TEN_OFF_ELIGIBLE(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_off.gif";
 var l_message = "You are eligible to save $10 when you spend $100 or more! " +
                 "To continue shopping, " +
                 "<a class=\"txtCartRwdSmall\" href=\"/pls/ag/AG_shop_home\"> " +
                 "Click here</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}
function TEN_OFF_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_off.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save $10 on your order.";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TSHIRT
function TSHIRT_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TSHIRT_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_src.gif";
 var l_message = "<b>Special Offer!</b> " +
 				  "In appreciation for your order, American Girl will send you a T-shirt absolutely free! " +
				  "<a class=\"txtCartRwdSmall\" href=\"\" " +
				"onclick=\"openResizePopup(\'/store/html/rwd_src.html\',400,400)\;return false\;\">" +
                "See details</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// All
function A11_ELIGIBLE(p_source_key)
{
 var l_image = "/store/assets/images/clear.gif";
 var l_message = "We're sorry, we are all out of free doll backpacks. Thank you for shopping with American Girl!";
 return REWARD_BUG(l_image,l_message,p_source_key);
}
function A11_QUALIFIED(p_source_key)
{
var l_image = "/store/assets/images/clear.gif";
 var l_message = "We're sorry, we are all out of free doll backpacks. Thank you for shopping with American Girl!";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// BBR2
function BBR2_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function BBR2_QUALIFIED(p_source_key)
{
// var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
// var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
// return REWARD_BUG(l_image,l_message,p_source_key);
 return KEY_CODE_ACCEPTED(p_source_key);
}

// D11
function D11_ELIGIBLE(p_source_key)
{	
 var l_image = "/store/includes/images/bml_cartbug.gif";
 var l_message = "You&#8217;re eligible to take 90 days to" +
                 "pay <em>Subject to credit approval.</em> <a href=\"https://www.securecheckout.billmelater.com/paycapture-content/fetch?hash=A8D32U4P&amp;content=/bmlweb/coreiw.html\" onclick=\"openSupplPop(\'https://www.securecheckout.billmelater.com/paycapture-content/fetch?hash=A8D32U4P&amp;content=/bmlweb/coreiw.html\',\'500\',\'750\');return false;\">See details.</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}
function D11_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/bml_cartbug.gif";
 var l_message = "You&#8217;re eligible to take 90 days to" +
                 "pay <em>Subject to credit approval.</em> <a href=\"https://www.securecheckout.billmelater.com/paycapture-content/fetch?hash=A8D32U4P&amp;content=/bmlweb/coreiw.html\" onclick=\"openSupplPop(\'https://www.securecheckout.billmelater.com/paycapture-content/fetch?hash=A8D32U4P&amp;content=/bmlweb/coreiw.html\',\'500\',\'750\');return false;\">See details.</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);	
}

// J22
function J22_ELIGIBLE(p_source_key)
{	
 return KEY_CODE_ACCEPTED(p_source_key);
}
function J22_QUALIFIED(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}

// L011
function L011_ELIGIBLE(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_off.gif";
 var l_message = "You are eligible to save $10 when you spend $100 or more! " +
                 "To continue shopping, " +
                 "<a class=\"txtCartRwdSmall\" href=\"/pls/ag/AG_shop_home\"> " +
                 "Click here</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
}
function L011_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_off.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save $10 on your order of $100 or more. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// PJ1
function PJ1_ELIGIBLE(p_source_key)
{
// var l_image = "/store/includes/images/gblo.jpg";
// var l_message = "<span style=\"text-align:left;\"><a class=\"txtCartRwdSmall\" href=\"\" onclick=\"openResizePopup(\'/store/html/rwd_gblo.html\',400,300)\;return false\;\">Special offer</a>&#8212;" + 
// 					"with an order of $40 or more, you can get the <a class=\"txtCartRwdSmall\" href=\"http://store.americangirl.com/agshop/html/ProductPage.jsf/itemId/98604\">Ballet Recital Outfit</a> for just $14 (your 50% savings appears at checkout)!</span>" ;
// return REWARD_BUG(l_image,l_message,p_source_key);
 return KEY_CODE_ACCEPTED(p_source_key);
}
function PJ1_QUALIFIED(p_source_key)
{
// var l_image = "/store/includes/images/gblo.jpg";
// var l_message = "<span style=\"text-align:left;\">Congratulations&#8212;you can add the <a class=\"txtCartRwdSmall\" href=\"http://store.americangirl.com/agshop/html/ProductPage.jsf/itemId/98604\">Ballet Recital Outfit</a> " +
// 					"<a class=\"txtCartRwdSmall\" href=\"\" onclick=\"openResizePopup(\'/store/html/rwd_gblo.html\',400,300)\;return false\;\"> " +
//					"for just $14</a> (your 50% savings appears at checkout)!</span>";
// return REWARD_BUG(l_image,l_message,p_source_key);
 return KEY_CODE_ACCEPTED(p_source_key);
}

// GF11
function GF11_ELIGIBLE(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_bookoffer.gif";
 var l_message = "You are eligible to receive a FREE copy of Raising an American Girl &#8212 " +
                 "just add another item to your bag. " +
 				 "<a class=\"txtCartRwdSmall\" href=\"\" onclick=\"openResizePopup(\'/store/html/bookoffer.html\',400,300)\;return false\;\"> " +
                 "See details.</a>";
return REWARD_BUG(l_image,l_message,p_source_key);
//return KEY_CODE_ACCEPTED(p_source_key);
}
function GF11_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_bookoffer.gif";
 var l_message = "Congratulations &#8212 you are receiving a FREE copy of Raising an American Girl. " +
 				 "<a class=\"txtCartRwdSmall\" href=\"\" onclick=\"openResizePopup(\'/store/html/bookoffer.html\',400,300)\;return false\;\"> " +
                 "See details.</a>";
 return REWARD_BUG(l_image,l_message,p_source_key);
// return KEY_CODE_ACCEPTED(p_source_key);
}

//// TEN_PCT
//function TEN_PCT_ELIGIBLE(p_source_key)
//{
// var l_image = "/store/includes/images/dollstand.jpg";
// var l_message = "Congratulations&#8212;you're eligible to receive a FREE <a class=\"txtCartRwdSmall\" href=\"/agshop/static/dollstand.jsf\">doll stand</a>.";
// return REWARD_BUG(l_image,l_message,p_source_key);
//}
//function TEN_PCT_QUALIFIED(p_source_key)
//{
// var l_image = "/store/includes/images/dollstand.jpg";
// var l_message = "Congratulations&#8212;you added a doll stand for FREE. <a class=\"txtCartRwdSmall\" href=\"\" onclick=\"openResizePopup(\'/store/html/dollstand.html\',400,300)\;return false\;\">See details</a>.";
// return REWARD_BUG(l_image,l_message,p_source_key);
//}

// TENPCT1
function TENPCT1_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT1_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT2
function TENPCT2_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT2_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT3
function TENPCT3_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT3_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT4
function TENPCT4_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT4_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT5
function TENPCT5_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT5_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT6
function TENPCT6_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT6_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT7
function TENPCT7_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT7_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT8
function TENPCT8_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT8_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// KF1
function KF1_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function KF1_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_tote.gif";
 var l_message = "Congratulations&#8212;you've added the <a href=\"/agshop/html/ProductPage.jsf/itemId/142096/itemType/TOY/webTemplateId/3/uniqueId/457/saleGroupId/327\">Pretty Purple Tote</a> for just $5.";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// AGCLUBREG
function AGCLUBREG_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function AGCLUBREG_QUALIFIED(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}

// CBDAYCHM
function CBDAYCHM_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function CBDAYCHM_QUALIFIED(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}

// CDOLLSHOE
function CDOLLSHOE_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function CDOLLSHOE_QUALIFIED(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}

// TENPCT061
function TENPCT061_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT061_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT062
function TENPCT062_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT062_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT063
function TENPCT063_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT063_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT064
function TENPCT064_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT064_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT065
function TENPCT065_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT065_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT066
function TENPCT066_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT066_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT067
function TENPCT067_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT067_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// TENPCT068
function TENPCT068_ELIGIBLE(p_source_key)
{
 return KEY_CODE_ACCEPTED(p_source_key);
}
function TENPCT068_QUALIFIED(p_source_key)
{
 var l_image = "/store/includes/images/img_rwd_ten_pct.gif";
 var l_message = "Thank you for shopping americangirl.com! You will save 10% on your order. ";
 return REWARD_BUG(l_image,l_message,p_source_key);
}

// SCD
function SCD_ELIGIBLE(p_source_key)
{
// var l_image = "/store/includes/images/kit_shirt_pwp.jpg";
// var l_message = "Don&#8217;t forget&#8212;if you spend $20, you can add matching <a href=\"/agshop/html/ProductPage.jsf/itemId/130607\">girl & doll Kit movie tees</a> for only $10. <a href=\"/agshop/static/special.jsf\">See details</a>";
// return REWARD_BUG(l_image,l_message,p_source_key);
 return KEY_CODE_ACCEPTED(p_source_key);
}
function SCD_QUALIFIED(p_source_key)
{
// var l_image = "/store/includes/images/kit_shirt_pwp.jpg";
// var l_message = "Congratulations&#8212;you qualify to add matching <a href=\"/agshop/html/ProductPage.jsf/itemId/130607\">girl & doll Kit movie tees</a> for only $10. <a href=\"/agshop/static/special.jsf\">See details</a>";
// return REWARD_BUG(l_image,l_message,p_source_key);
 return KEY_CODE_ACCEPTED(p_source_key);
}