<script>
window.setTimeout(function() {
;(function() {
var fullLangName = $('.masthead_langname1').html().toUpperCase()
// Step 1: Create dom nodes
var productDescription = ''
+ '<div class="product-desc">'
+ ' <div class="oct_2016_language_header">Learn ' + fullLangName + '</div>'
+ ' <h3>SUBSCRIPTION BOX</h3>'
+ ' <p>'
+ ' Grab the classic Rosetta Stone box and get access to a 24 month. '
+ ' subscription, which also includes a code to download Rosetta Stone'
+ ' on your computer. Featuring TruAccent® speech-recognition technology,'
+ ' it’s the only program that gets you talking like a local.'
+ ' </p>'
+ ' <div class="guarantee">'
+ ' <div></div>'
+ ' <div>'
+ ' <h3>PURCHASE WITH CONFIDENCE</h3>'
+ ' <p>'
+ ' No long-term commitments. Cancel anytime.'
+ ' 30-Day Money back guarantee.'
+ ' </p>'
+ ' </div>'
+ ' </div>'
+ '</div>'
;
var stripes = ''
+ '<svg class="gifting_bg" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 0;" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid slice">'
+ ' <rect x="0" y="0" width="100%" height="100%" style="fill: url(#yllines);"></rect>'
+ ' </svg>'
+ ' <svg aria-hidden="" id="gifting_bg_defs" width="1px" height="1px" style="z-index: -1; position: absolute; left: -100vw; border: 5px solid black">'
+ ' <defs>'
+ ' <pattern id="redlines" x="0" y="0" width="20" height="100" patternUnits="userSpaceOnUse" patternTransform="rotate(50)"></pattern>'
+ ' <rect x="0" y="0" height="100" width="10" style="stroke: none; fill: #ffffff; fill-opacity: .10;"></rect>'
+ ' </pattern>'
+ ' <pattern id="redlinesb" x="0" y="0" width="20" height="100" patternUnits="userSpaceOnUse" patternTransform="translate(-6.1, 0) rotate(50)">'
+ ' <rect x="0" y="0" height="100" width="10" style="stroke: none; fill: #ffffff; fill-opacity: .10;"></rect>'
+ ' </pattern>'
+ ' <pattern id="yllines" x="0" y="0" width="30" height="100" patternUnits="userSpaceOnUse" patternTransform="translate(-1, 0) rotate(50)" style="display: inline;">'
+ ' <rect x="0" y="0" height="100" width="15" style="stroke: none; fill: #ffffff; fill-opacity: .15;"></rect>'
+ ' </pattern>'
+ ' </defs>'
+ ' </svg>'
;
// This is the "Learn {lang}. Subscription Box. lorem lorem lorem.."
$('.oct_2016_gold_bg .js_product_boxes_desktop').prepend(productDescription)
// The grey header over the product section
$('.oct_2016_gold_bg .oct_2016_product_square.js_oct_2016_product').eq(-1)
.find('.oct_2016_product_square_content .oct_2016_product_square_header')
.show().find('span').html('24-MONTH').siblings('div')
.html('SUBSCRIPTION BOX')
// Yellow stripes in gold bg section
$('.oct_2016_container.oct_2016_gold_bg').append(stripes)
$('.rs_classic span').html('SUBSCRIPTION BOX')
// Step 2: magic
var productImg, ptoSku, msrp;
switch (lang)
{
case 'eng':
productImg = 'English_box_DL_24.png'
ptoSku = 91190
break;
case 'fra':
productImg = 'French_box_DL_24.png'
ptoSku = 91192
break;
case 'deu':
productImg = 'German_box_DL_24.png'
ptoSku = 91194
break;
case 'ita':
productImg = 'Italian_box_DL_24.png'
ptoSku = 91196
break;
case 'esp':
productImg = 'SpanishLA_box_DL_24.png'
ptoSku = 91198
break;
case 'chi':
productImg = 'Chinese_box_DL_24.png'
ptoSku = 91200
break;
case 'jpn':
productImg = 'Japanese_box_DL_24.png'
ptoSku = 91208
break;
default:
productImg = 'Agnostic_box_DL_24.png'
ptoSku = 91187
break;
}
$('.oct_2016_gold_bg .oct_2016_product_square.js_oct_2016_product')
.css({
'background-image' : 'url("https://www.rosettastone.com/lp/globals/img/retailboxes/' + productImg + '")'
})
$cartButton = $('.oct_2016_gold_bg .oct_2016_addtocart_square.js_oct_2016_addtocart.js_cddl_media').eq(2)
var currentHref = $cartButton.attr('href')
var newHref = currentHref.replace(/\/sku\/\d+/i, '/sku/' + ptoSku)
console.log(newHref)
$cartButton.attr('href', newHref)
})();
}, 1000)
</script>