- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
// scope vcrypt, sitewide, ppc|sale, catalog pages
// Exclusions to be added on OSUB language - urdu, "Swahili", "Indonesian","Dari","Latin","Pashto"
;(function() {
// Only show RTO if there's 1 product in cart, and it's 179/169.
// The S5 box|download, 24M check is done later
if ( +rs.pixp_cartCount != 1 || !rs.pixp_price.match(/249/) ) return
var promotionalOffer = {};
// delay in ms (keep at least a tiny delay to avoid FOUC)
promotionalOffer.delay_in_ms = 500;
// which campaign: cm, bf, cw?
promotionalOffer.campaign = 'cm';
// which offer? off10, tutoring1, tutoring2, months15
promotionalOffer.offer = 'off10';
// which offer image?
promotionalOffer.offerImages = {
//'tutoring1': 'https://secure.rosettastone.com/lp/cybercampaign/nov2016_tutor_img.png',
//'tutoring2': 'https://secure.rosettastone.com/lp/cybercampaign/nov2016_tutor_img.png',
'off10': 'https://secure.rosettastone.com/lp/cybercampaign/nov2016_rto_lockup.png',
//'months15': 'https://secure.rosettastone.com/lp/cybercampaign/nov2016_rto_lockup.png'
};
// which offer message?
promotionalOffer.offerMessages = {
//'tutoring1': '1 FREE LIVE TUTORING SESSION',
//'tutoring2': '2 FREE LIVE TUTORING SESSIONS',
'off10': 'SAVE AN ADDITIONAL $20',
//'months15': 'GET 15 MONTHS FOR THE PRICE OF 12'
};
// what's the dollar value of the offer?
promotionalOffer.offerValue = {
//'tutoring1': '29',
//'tutoring2': '39',
'off10': '20',
//'months15': '49'
};
promotionalOffer.DollarOfferDetails = {
qualifyingURL : ['sitewide', 'learn-', 'bdi' ]
}
if (+rs.pixp_price == 249) {
promotionalOffer.DollarOfferDetails.promoCodeforAEIPrice = {
'S5': 'niagarafalls_S5',
'24M': 'niagarafalls_24M'
}
}
else if (+rs.pixp_price == 299) {
promotionalOffer.DollarOfferDetails.promoCodeforAEIPrice = {
'S5': 'towerbridge_S5',
'24M': 'towerbridge_24M'
}
}
/*promotionalOffer.tutorOfferDetails = {
1: {sku:90555, promo: 'tutor_1special'}
,2: {sku:90556, promo: 'tutor_2special'}
}
promotionalOffer.additionalMonthsOfferDetails = {
9: {sku:90498, promo: 'budapest_6Mspecial'}
,15: {sku:90496, promo: 'budapest_12Mspecial'}
,30: {sku:90497, promo: 'budapest_24Mspecial'}
}*/
promotionalOffer.setSeenCookie = function(){
document.cookie='rtoseen=true; path=/; domain=.rosettastone.com';
}
promotionalOffer.clockString = '<div id="popup_clock"><div class="popup_timeleft">TIME LEFT:</div><div><span class="popup_time minutes">10</span><span class="popup_smalltext">min</span></div><div><span class="popup_time seconds">00</span><span class="popup_smalltext">sec</span></div></div>';
promotionalOffer.dollarValueHTML = '<div class="nov2016_rto_dollar_value"> <div class="nov2016_rto_dollar_value_price"> <sup class="nov2016_rto_dollar_value_sup">$</sup><span class="nov2016_rto_dollar_value_number">'+promotionalOffer.offerValue[promotionalOffer.offer]+'</span> </div> <div>OFF!</div> </div>';
promotionalOffer.insertHTML = function(campaign, offer){
jQuery('head').append('<style type="text/css"> body{ margin: 0px; } </style> <style> .ribbon_rto{ background-color: rgb(235,191,41); box-shadow: 0px 0px 10px 0px rgba(33,33,33,0.5) inset; overflow: auto; padding: 20px; text-align: center; font-family: gotham_htfbook, gothambook, sans-serif; position: relative; display: none; } .ribbon_rto.bf{ background-color: #222; color: #fff; } .nov2016_clock_and_cta_unit{ display: inline-block; } /******************************************************** DOLLAR VALUE *********************************************************/ .nov2016_rto_dollar_value{ display: inline-block; vertical-align: middle; line-height: 1; padding-right: 10px; font-weight: bold; font-size: 16px; font-family: gotham_htfmedium; } .nov2016_rto_dollar_value_price{ font-size: 40px; } .nov2016_rto_dollar_value_sup{ font-size: 20px; } /******************************************************** LOGOS *********************************************************/ .nov2016_rto_logo{ height: 40px; margin-right: 20px; vertical-align: middle; max-width: 80%; display: none !important; } .nov2016_bf_logo{ display: none; } .nov2016_cmonday_logo{ display: none; } .bf .nov2016_bf_logo{ display: inline-block; } .bf .nov2016_cyberlogo, .cm .nov2016_cyberlogo{ display: none; } .cm .nov2016_cmonday_logo{ display: inline-block; } /******************************************************** OFFER TEXT *********************************************************/ .nov2016_rto_cart_offer_text{ display: inline-block; vertical-align: middle; text-align: left; margin: 0px 20px; font-size: 14px; } .nov2016_rto_cart_offer_text span{ display: block; } .nov2016_rto_cart_offer_text span:first-of-type{ color: #a00; font-weight: bold; } .bf .nov2016_rto_cart_offer_text span:first-of-type{ color: #fff; } .bf .nov2016_rto_cart_offer_text span:nth-child(2){ color: #fdd250; } #popup_rto_x{ display: inline-block; position: absolute; right: 20px; top: calc(50% - 15px); } .nov2016_rto_offerimg{ display: none; vertical-align: middle; height: 40px; } /******************************************************** CLOCK STYLES *********************************************************/ #popup_clock{ color: #fdba3d; font-size: 0px; overflow: hidden; position: relative; border-radius: 4px; display: inline-block; vertical-align: middle; border: 1px solid #000; border-bottom: 1px solid #222; background: #444 none repeat scroll 0% 0%; box-shadow: 0px -35px 25px -15px rgba(22, 22, 22, 0.5) inset; } #popup_clock:after{ content: \'\'; left: 0px; width: 100%; height: 50%; bottom: 0px; position: absolute; background: rgba(33, 33, 33, 0.3) none repeat scroll 0% 0%; } #popup_clock .popup_timeleft{ font-size: 13px; padding: 4px 6px 0px; } #popup_clock > div{ padding: 0; padding-top: 5px; display: inline-block; vertical-align: middle; border-left: 1px solid #333; border-right: 1px solid #555; } #popup_clock > div:last-of-type{ border-right: none; } .popup_time{ width: 35px; font-size: 24px; font-weight: 700; text-align: right; display: inline-block; font-family: gothambold, sans-serif; } .popup_smalltext{ font-size: 16px; padding-left: 6px; padding-right: 10px; } #popup_cta{ color: #fff; font-size: 13px; background: rgb(51,152,220); font-weight: 400; padding: 10px 20px; border-radius: 5px; display: inline-block; text-decoration: none; font-family: gotham_htfbook, gothambold, sans-serif; cursor: pointer; margin: 0px 20px; } #popup_cta:hover{ background: #3274a0; } /******************************************************** SVG CLOSE BUTTON *********************************************************/ .nov2016_close_circle line, .nov2016_close_circle circle{ stroke: #333; stroke-width: 0.7; stroke-linecap: round; } .bf .nov2016_close_circle line, .bf .nov2016_close_circle circle{ stroke: #eee; } @media(max-width:1080px){ .nov2016_clock_and_cta_unit{ display: block; margin-top: 10px; } } @media(max-width:780px){ .nov2016_rto_offerimg{ display: none; } .nov2016_rto_logo{ margin: 0px; } } @media(max-width:580px){ #popup_rto_x{ top: 15px; right: 15px; } .nov2016_rto_cart_offer_text{ display: block; text-align: center; margin-top: 10px; } } @media(max-width:500px){ #popup_cta{ margin-top: 10px; } } </style>');
jQuery('body').prepend('<div class="ribbon_rto '+campaign+' '+offer+'">'+promotionalOffer.dollarValueHTML+'<img class="nov2016_rto_logo nov2016_bf_logo" src="https://secure.rosettastone.com/lp/cart_rto/nov2016/img/nov2016_black_friday_logo_desktop.png"><img class="nov2016_rto_logo nov2016_cmonday_logo" src="https://secure.rosettastone.com/lp/cart_rto/nov2016/img/nov2016_cyber_monday_logo_desktop.png"><img class="nov2016_rto_logo nov2016_cyberlogo" src="https://secure.rosettastone.com/lp/cart_rto/nov2016/img/nov2016_cyber_week_logo_top.png"><img class="nov2016_rto_offerimg" src="'+promotionalOffer.offerImages[offer]+'" alt="special offer"/><div class="nov2016_rto_cart_offer_text"><span>'+promotionalOffer.offerMessages[offer]+'</span><span>if you order in the next 10 minutes</span></div class="nov2016_rto_cart_offer_text"><div class="nov2016_clock_and_cta_unit">'+promotionalOffer.clockString+'<a id="popup_cta" >CLAIM THIS OFFER</a></div><a id="popup_rto_x" href="#"><svg class="nov2016_close_circle" width="30" height="30" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><circle cx="5" cy="5" r="4.5" style="fill:transparent;"></circle> <line x1="3.5" y1="3.5" x2="6.5" y2="6.5"></line> <line x1="3.5" y1="6.5" x2="6.5" y2="3.5"></line> </svg></a></div>');
}
/* delay to avoid fouc */
promotionalOffer.showRto = function(delay){
setTimeout(function(){
jQuery('.ribbon_rto').slideDown();
promotionalOffer.setSeenCookie();
startClock(Date.now()+10*60*1000);
}, delay);
}
// clock stuff
var timeinterval;
var clock;
function getTimeRemaining(endtime){
var t = endtime - Date.now();
var seconds = Math.floor( (t/1000) % 60 );
var minutes = Math.floor( t/1000/60 );
return { 'total': t, 'minutes': minutes, 'seconds': seconds };
}
function close_popup_rto(){
jQuery('.ribbon_rto').fadeOut('fast');
}
function startClock(endtime) {
clock.style.display = 'inline-block';
var values = ['minutes','seconds'];
var spans = [];
for(var i=0; i<values.length; i++){
spans.push( clock.querySelector('.'+values[i]) );
}
function updateClock() {
var t = getTimeRemaining(endtime);
for(var i=0; i<spans.length; i++){
spans[i].innerHTML = ('0' + t[values[i]]).slice(-2);
}
if(t.total<=0){
clock.style.display = 'none';
clearInterval(timeinterval);
close_popup_rto();
}
}
timeinterval = setInterval(updateClock,1000);
}
// If user has rtoseen cookie, quit.
if( jQuery('[name=gift_option]:checked').length == 0 && promotionalOffer.offer != "off10" && (rs.pixp_name.match(/24/i) && rs.pixp_name.match(/totale/i))){
jQuery('.giftenable').hide()
}
if (document.cookie.match(/rtoseen/)) return;
promotionalOffer.insertHTML(promotionalOffer.campaign, promotionalOffer.offer);
jQuery( document ).ready(function() {
clock = document.getElementById('popup_clock');
/* Don't show tutor offer if egifting is checked*/
if(promotionalOffer.offer == "off10"){
if((rs.pixp_name.match(/24/i) && rs.pixp_name.match(/totale/i)) || (rs.pixp_name.match(/ s5 /i) &&(rs.pixp_name.match(/Download|Box/i) || rs.pixp_name.match(/PTO/i))) )
//if(!jQuery('.couponlabel').html().match(/tutor_2special/i)){
promotionalOffer.showRto(promotionalOffer.delay_in_ms);
//}
}else{
if((rs.pixp_name.match(/24/i) && rs.pixp_name.match(/totale/i)) && jQuery('[name=gift_option]:checked').length == 0 && rs.pixp_name.match(/30|9|15/) == null ){
jQuery('.giftenable').hide()
promotionalOffer.showRto(promotionalOffer.delay_in_ms);
}
}
setTimeout(function(){
/*if(promotionalOffer.offer == "tutoring1"){
jQuery('#coupon_code').val(promotionalOffer.tutorOfferDetails['1'].promo)
}
if(promotionalOffer.offer == "tutoring2"){
jQuery('#coupon_code').val(promotionalOffer.tutorOfferDetails['2'].promo)
}*/
if(promotionalOffer.offer == "off10"){
if(rs.pixp_name.match(/24/i) && rs.pixp_name.match(/totale/i) && !rs.pixp_name.match(/pto/i))
jQuery('#coupon_code').val(promotionalOffer.DollarOfferDetails.promoCodeforAEIPrice['24M'])
if(rs.pixp_name.match(/Download/i) || rs.pixp_name.match(/PTO/i) ){
if(rs.pixp_name.match(/S5/i))
jQuery('#coupon_code').val(promotionalOffer.DollarOfferDetails.promoCodeforAEIPrice['S5'])
//if(rs.pixp_name.match(/S3/i))
// jQuery('#coupon_code').val(promotionalOffer.DollarOfferDetails.promoCodeforAEIPrice['S3'])
}
}
jQuery('#popup_rto_x').click(function(){
jQuery('.ribbon_rto').fadeOut('fast')})
jQuery('#popup_cta').click(function(){
jQuery('#discountsubmit').click()})
}, 300);
});
})();