﻿function css_browser_selector(n) { var a = n.toLowerCase(), i = function(b) { return a.indexOf(b) > -1 }, j = "gecko", l = "webkit", p = "safari", d = "opera", e = "mobile", f = document.documentElement, k = [(!(/opera|webtv/i.test(a)) && /msie\s(\d)/.test(a)) ? ("ie ie" + RegExp.$1) : i("firefox/2") ? j + " ff2" : i("firefox/3.5") ? j + " ff3 ff3_5" : i("firefox/3.6") ? j + " ff3 ff3_6" : i("firefox/3") ? j + " ff3" : i("gecko/") ? j : i("opera") ? d + (/version\/(\d+)/.test(a) ? " " + d + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(a) ? " " + d + RegExp.$2 : "")) : i("konqueror") ? "konqueror" : i("blackberry") ? e + " blackberry" : i("android") ? e + " android" : i("chrome") ? l + " chrome" : i("iron") ? l + " iron" : i("applewebkit/") ? l + " " + p + (/version\/(\d+)/.test(a) ? " " + p + RegExp.$1 : "") : i("mozilla/") ? j : "", i("j2me") ? e + " j2me" : i("iphone") ? e + " iphone" : i("ipod") ? e + " ipod" : i("ipad") ? e + " ipad" : i("mac") ? "mac" : i("darwin") ? "mac" : i("webtv") ? "webtv" : i("win") ? "win" + (i("windows nt 6.0") ? " vista" : "") : i("freebsd") ? "freebsd" : (i("x11") || i("linux")) ? "linux" : "", "js"]; c = k.join(" "); f.className += " " + c; return c } css_browser_selector(navigator.userAgent); function WaterMark(txt, evt, watermark) { if (txt.value.length == 0 && evt.type == "blur") { txt.value = watermark; } if (txt.value == watermark && evt.type == "focus") { txt.value = ""; } }
$().ready(function() { $("input.search_input").bind("keypress", function(a) { if (window.event) { if (window.event.keyCode != 13) { return true } } else { if (a.keyCode != 13) { return true } } a.preventDefault(); window.onbeforeunload = null; window.location = $("a.searchSubmit").attr("href"); return false }); $("div.orderStatusForm input.orderNumberTextBox").bind("keypress", function(a) { if (window.event) { if (window.event.keyCode != 13) { return true } } else { if (a.keyCode != 13) { return true } } a.preventDefault(); $("input.zipCodeTextBox").show(); $("input.zipCodeTextBox").focus() }); $("div.orderStatusForm input.zipCodeTextBox").bind("keypress", function(a) { if (window.event) { if (window.event.keyCode != 13) { return true } } else { if (a.keyCode != 13) { return true } } a.preventDefault(); window.onbeforeunload = null; window.location = $("div.orderStatusForm a.getOrderButton").attr("href"); return false }) }); $(document).ready(function() { (function(b) { b.fn.around = function(d, c) { c = c || b(document); var f = c.find(d), g = f.length; var e = {}; this.each(function() { var i = b(this); for (var h = 0; h < g; ++h) { if (f[h] === i[0]) { e.AfterElm = f[h + 1]; e.BeforeElm = f[h - 1] } } }); return e } })(jQuery); $(".autoTab").keyup(function(f) { var b = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105], g = $(this).attr("maxlength"), d = $(this).around("input"); for (var c = 0; c < b.length; ++c) { if (f.keyCode == b[c]) { if ($(this).val().length === g) { d.AfterElm.focus() } } } }); var a = { "{dfd85562-9061-4227-aa64-c7f3c8bd4489}": { cardType: "Visa", card: 16, cvv: 3 }, "{64c11942-f5f3-426d-86ac-61151a5f49b0}": { cardType: "Discover", card: 16, cvv: 3 }, "{73e5b533-f705-497d-9759-5e5e76f36c80}": { cardType: "MasterCard", card: 16, cvv: 3 }, "{a03407bb-bb1d-4c12-ae72-f11517a1dca1}": { cardType: "Amex", card: 15, cvv: 4} }; $(".SelectCard").change(function() { var c = $(this).val(), b = a.length; if (a[c]) { $(".CCNumber").attr("maxlength", a[c].card); $(".CVV").attr("maxlength", a[c].cvv) } }); $(".CVV").focus(function() { var b = $(".SelectCard").val(); if (a[b]) { $(this).attr("maxlength", a[b].cvv) } }); $(".CCNumber").focus(function() { var b = $(".SelectCard").val(); if (a[b]) { $(this).attr("maxlength", a[b].card) } }); $(".stateDropdown").each(function() { $(this).change(function() { InvalidStates = InvalidStates || ""; var f = $(this), b = InvalidStates.split(","); var e = false; for (var d in b) { if (f.val() === b[d]) { var c = '<ul id="Errors"><li>We\'re sorry, TROJAN&reg; VIBRATIONS cannot legally ship products to ' + InvalidStates + ". Please use another shipping address.</li></ul>"; $(".error-box").html(c); $("#Errors").focus(); e = true } } if (!e) { $(".error-box").html("") } }) }); $(".billingStateDropdown").each(function() { $(this).change(function() { var c = $(".ShippingAddressIgnoreCheckbox input"); if (c.is(":checked") === true) { InvalidStates = InvalidStates || ""; var g = $(this), b = InvalidStates.split(","); var f = false; for (var e in b) { if (g.val() === b[e]) { var d = '<ul id="Errors"><li>We\'re sorry, TROJAN&reg; VIBRATIONS cannot legally ship products to ' + InvalidStates + ". Please use another shipping address.</li></ul>"; $(".error-box").html(d); $("#Errors").focus(); f = true } } if (!f) { $(".error-box").html("") } } }) }); $(".ShippingAddressIgnoreCheckbox input").each(function() { $(this).change(function() { var f = $(this); if (f.is(":checked") === true) { InvalidStates = InvalidStates || ""; var b = InvalidStates.split(","); var e = false; for (var d in b) { if ($(".billingStateDropdown").val() === b[d]) { var c = '<ul id="Errors"><li>We\'re sorry, TROJAN&reg; VIBRATIONS cannot legally ship products to ' + InvalidStates + ". Please use another shipping address.</li></ul>"; $(".error-box").html(c); $("#Errors").focus(); e = true } } if (!e) { $(".error-box").html("") } } else { $(".error-box").html("") } }) }) }); if (document.location.pathname.toLowerCase().indexOf("cart") != -1) { $(function() { var a = $("input#email"); $(a).unbind("keypress"); $(a).bind("keypress", function(b) { if (window.event) { if (window.event.keyCode != 13) { return true } } else { if (b.keyCode != 13) { return true } } b.preventDefault(); $("input#cartPasswordPrompt").hide(); $("input#cartPassword").show(); $("input#cartPassword").focus(); return false }); var a = $("input#cartPassword"); $(a).unbind("keypress"); $(a).bind("keypress", function(b) { if (window.event) { if (window.event.keyCode != 13) { return true } } else { if (b.keyCode != 13) { return true } } b.preventDefault(); $("table#Checkout a.buttonNew").trigger("click"); return false }); $(a).blur(function() { if ($("input#cartPassword").val() == "") { $("input#cartPassword").hide(); $("input#cartPasswordPrompt").show() } }); $("input#cartPasswordPrompt").focus(function() { $("input#cartPasswordPrompt").hide(); $("input#cartPassword").show(); $("input#cartPassword").focus() }); $("input#cartPassword").hide() }) } $(function() { for (var d = 1; d < 6; d++) { $("#expanded" + d).add("#ex" + d + d).click(function() { for (var e = 1; e < 6; e++) { $("#ex" + e).hide(); $("#col" + e).show() } $(this).parent().hide(); $(this).parent().next().show() }); $("#collapsed" + d).add("#col" + d + d).click(function() { for (var e = 1; e < 6; e++) { $("#ex" + e).hide(); $("#col" + e).show() } $(this).parent().prev().show(); $(this).parent().hide() }) } for (var d = 6; d < 11; d++) { $("#expanded" + d).add("#ex" + d + d).click(function() { for (var e = 6; e < 11; e++) { $("#ex" + e).hide(); $("#col" + e).show() } $(this).parent().hide(); $(this).parent().next().show() }); $("#collapsed" + d).add("#col" + d + d).click(function() { for (var e = 6; e < 11; e++) { $("#ex" + e).hide(); $("#col" + e).show() } $(this).parent().prev().show(); $(this).parent().hide() }) } for (var i = 1; i < 12; i++) { $("#expandedAccordian" + i).add('#ex' + i + i).click(function() { for (var i = 1; i < 12; i++) { $("#ex" + i).hide(); $("#col" + i).show(); } $(this).parent().hide(); $(this).parent().next().show(); }); $("#collapsedAccordian" + i).add("#col" + i + i).click(function() { for (var i = 1; i < 12; i++) { $("#ex" + i).hide(); $("#col" + i).show(); } $(this).parent().prev().show(); $(this).parent().hide(); }); } $("#signUp").hide(); $("a.email_vibration_nation_button2").click(function() { $("#signUpTip").hide(); $("#signUp").show() }); $("div.signUpTip input").each(function(e) { var g = this.value; $(this).focusin(function() { if (this.value == g) { this.value = "" } }) }); $("a.experts_orgasmic_tips_button").click(function() { $("#signUp").hide(); $("#signUpTip").show() }); $("#products").hover(function() { $("#navSecond").show() }, function() { $("#navSecond").hide() }); $("#trustTrojan").hover(function() { $("#navSecond2").show() }, function() { $("#navSecond2").hide() }); $("#vibeGuide").hover(function() { $("#navSecond3").show() }, function() { $("#navSecond3").hide() }); $("#sensualScience").hover(function() { $("#navSecond4").show() }, function() { $("#navSecond4").hide() }); $(".cartEmpty").hover(function() { $("#navSecond5").show() }, function() { $("#navSecond5").hide() }); $("#search").click(function() { $(this).val("") }); $("#search").blur(function() { if ($(this).val() == "") { $(this).val("search") } }); $(".moreVibrationPic dt").click(function() { $(this).parent("dl").css({ width: "250px", left: "-200px", "background-color": "#5c3669", padding: "5px 10px", border: "1px solid #9d89aa" }); $(this).siblings("dd").removeClass("hide"); $(this).parent("dl").parent("li").siblings("li").children("dl").css({ left: "0px", background: "none", padding: "0", border: "none", width: "auto" }); $(this).parent("dl").parent("li").siblings("li.vibrationPic").children("dl").children("dd").addClass("hide") }); $(".date").click(function() { if ($(this).attr("value") == "MM/DD/YYYY") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "MM/DD/YYYY") } }); $("#firstName").click(function() { if ($(this).attr("value") == "First Name") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "First Name") } }); $("#lastName").click(function() { if ($(this).attr("value") == "Last Name") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "Last Name") } }); $("#email").click(function() { if ($(this).attr("value") == "Enter E-mail") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "Enter E-mail") } }); $("#password").click(function() { if ($(this).attr("value") == "Password") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "Password") } }); $(".YYYY").click(function() { if ($(this).attr("value") == "YYYY") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "YYYY") } }); $(".DD").click(function() { if ($(this).attr("value") == "DD") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "DD") } }); $(".MM").click(function() { if ($(this).attr("value") == "MM") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "MM") } }); $(".prepopulateFirstName").click(function() { if ($(this).attr("value") == "Jenifer") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "Jenifer") } }); $(".prepopulateLastName").click(function() { if ($(this).attr("value") == "Zweben") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "Zweben") } }); $(".prepopulateEmail").click(function() { if ($(this).attr("value") == "jenz@gmail.com") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "jenz@gmail.com") } }); $(".prepopulateAdd1").click(function() { if ($(this).attr("value") == "990 Victoria Ave.") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "990 Victoria Ave.") } }); $(".prepopulateCity").click(function() { if ($(this).attr("value") == "Venice") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "Venice") } }); $(".prepopulateZidCode").click(function() { if ($(this).attr("value") == "90291") { $(this).attr("value", "") } }).blur(function() { if ($(this).attr("value") == "") { $(this).attr("value", "90291") } }); $(".list5 a").click(function() { $(this).siblings("p").slideDown(); $(this).children("span").addClass("arrowActive"); $(this).parent("li").siblings("li").children("p").slideUp(); $(this).parent("li").siblings("li").children("a").children("span").removeClass("arrowActive").addClass("arrow") }); $(".testimonialPic a").click(function() { switch ($(this).attr("class")) { case "heroProductPic1": $(".heroProductImage1").css("display", "block"); $(".heroProductImage2").css("display", "none"); $(".heroProductImage3").css("display", "none"); $(".heroProductImage4").css("display", "none"); $(".heroProductImage5").css("display", "none"); break; case "heroProductPic2": $(".heroProductImage1").css("display", "none"); $(".heroProductImage2").css("display", "block"); $(".heroProductImage3").css("display", "none"); $(".heroProductImage4").css("display", "none"); $(".heroProductImage5").css("display", "none"); break; case "heroProductPic3": $(".heroProductImage1").css("display", "none"); $(".heroProductImage2").css("display", "none"); $(".heroProductImage3").css("display", "block"); $(".heroProductImage4").css("display", "none"); $(".heroProductImage5").css("display", "none"); break; case "heroProductPic4": $(".heroProductImage1").css("display", "none"); $(".heroProductImage2").css("display", "none"); $(".heroProductImage3").css("display", "none"); $(".heroProductImage4").css("display", "block"); $(".heroProductImage5").css("display", "none"); break; case "heroProductPic5": $(".heroProductImage1").css("display", "none"); $(".heroProductImage2").css("display", "none"); $(".heroProductImage3").css("display", "none"); $(".heroProductImage4").css("display", "none"); $(".heroProductImage5").css("display", "block"); break } }); if ($("select").length > 0) { $(".selectShort select,.selectLong select").each(function() { $(this).sSelect() }) } $(".selectShort .newList li,.selectLong .newList li").hover(function() { $(this).css("color", "#000") }, function() { $(this).css("color", "#78587d") }); $(".table2 tr").each(function() { $(this).children("td:first").css("text-align", "right").css("width", "140px"); $(this).children("td:eq(2)").css("text-align", "right"); $(this).children("td.longTd").css("width", "250px") }); $(".table1 tr").each(function() { $(this).children("th:last").css("border-right", "none").css("width", "71px"); $(this).children("td:last").css("border-right", "none") }); $(".table1 tr:even").each(function() { $(this).children("td").addClass("even") }); $(".table3 tr").each(function() { $(this).children("th:first").css("width", "50%"); $(this).children("th:eq(1)").css("width", "50%") }); var a = $("#footer ul").width(); $("#footer ul").css({ "margin-left": -a / 2 + "px" }); var b = {}; var c = navigator.userAgent.toLowerCase(); if ($.browser.msie && $.browser.version == 7) { $(".search, .sign").appendTo(".header:eq(0)") } if (c.match(/chrome\/([\d.]+)/) != null && c.match(/chrome\/([\d.]+)/)[1].split(".")[0] > 2) { $(".goSearch").css("top", "-1px"); $(".sidebar .heading").css("margin-bottom", "12px"); $(".heading3").css("margin-bottom", "2px") } if (c.match(/firefox\/([\d.]+)/) != null && c.match(/firefox\/([\d.]+)/)[1].split(".")[0] > 2) { $(".moreVibrationPic dt a").click(function() { $(this).parent("dt").parent("dl").css("left", "-200px").css("background-color", "#5c3669").css("padding", "5px").css("border", "1px solid #9d89aa"); $(this).parent("dt").siblings("dd").removeClass("hide"); $(this).parent("dt").parent("dl").parent("li").siblings("li").children("dl").css("left", "0px").css("background-color", "none").css("padding", "0").css("border", "none"); $(this).parent("dt").parent("dl").parent("li").siblings("li").children("dl").children("dd").addClass("hide") }) } if (c.match(/version\/([\d.]+).*safari/) != null && c.match(/version\/([\d.]+).*safari/)[1].split(".")[0] > 3) { $(".goSearch").css("top", "-1px") } try { if ($("body").find("input[type='checkbox']").length > 0) { $("input[type='checkbox']").checkBox() } } catch (f) { } $(".experts_expert_button_more").click(function() { $(this).parent().hide().siblings().show() }); $(".experts_expert_button_close").click(function() { $(this).parent().hide().siblings().show() }); $("textarea.giftMessage").keyup(function() { var e = 250 - $(this).val().length; if (e > 0) { $("#giftMessageCharactersLeft").html(e + " characters are left.") } else { $("#giftMessageCharactersLeft").html("The character max has been reached.") } }); if ($("#staticContentBgCapIndicator").length > 0) { $("#bg_cap").css("display", "block") } $("#shippingAddressTb").css("display", $("input[id$='ShippingAddressIgnore']").attr("checked") ? "none" : "table"); $("#shippingAddressTbOptions").css("display", $("input[id$='ShippingAddressIgnore']").attr("checked") ? "none" : "block"); $(".bugTd").css("width", "auto") }); function trackImp(a, b, c) { s.linkTrackVars = "events,products"; s.linkTrackEvents = a; s.events = a; s.products = ";" + b + ":" + c; s.tl(true, "o", "Impressions") } function bannerClk(a, b, c) { s.linkTrackVars = "events,eVar2,products"; s.linkTrackEvents = "event10"; s.events = a; s.products = ";" + b + ":" + c; s.eVar2 = b + ":" + c; s.tl(true, "o", "Banner Clicks") } function upsellClk(a, b, c) { s.linkTrackVars = "events,eVar11,products"; s.linkTrackEvents = "event10"; s.events = a; s.products = ";" + b + ":" + c; s.eVar11 = b + ":" + c; s.tl(true, "o", "Upsell Clicks") } var productIdToAnalyticsMapping = new Object(); productIdToAnalyticsMapping["22600-64910"] = "http://view.atdmt.com/jaction/63dtvh_2GoUltraThinProductPage_4"; productIdToAnalyticsMapping["22600-97250"] = "http://view.atdmt.com/jaction/63dtvh_ExtendedPleasureClimaxControlProductPag_4"; productIdToAnalyticsMapping["22600-96010"] = "http://view.atdmt.com/jaction/63dtvh_FireandIceProductPage_4"; productIdToAnalyticsMapping["22600-97325"] = "http://view.atdmt.com/jaction/63dtvh_HerPleasureEcstasyProductPage_4"; productIdToAnalyticsMapping["22600-97500"] = "http://view.atdmt.com/jaction/63dtvh_HerPleasureSensationsLubricatedProductP_4"; productIdToAnalyticsMapping["22600-97450"] = "http://view.atdmt.com/jaction/63dtvh_HerPleasureSpermicidalLubricatedProduct_4"; productIdToAnalyticsMapping["22600-64310"] = "http://view.atdmt.com/jaction/63dtvh_MagnumEcstasyProductPage_4"; productIdToAnalyticsMapping["22600-64910"] = "http://view.atdmt.com/jaction/63dtvh_MagnumFireIceProductPage_4"; productIdToAnalyticsMapping["22600-64212"] = "http://view.atdmt.com/jaction/63dtvh_MagnumLubricatedProductPage_4"; productIdToAnalyticsMapping["22600-64612"] = "http://view.atdmt.com/jaction/63dtvh_MagnumThinProductPage_4"; productIdToAnalyticsMapping["22600-90660"] = "http://view.atdmt.com/jaction/63dtvh_MiniProductPage_4"; productIdToAnalyticsMapping["22600-90657"] = "http://view.atdmt.com/jaction/63dtvh_MultispeedRingProductPage_4"; productIdToAnalyticsMapping["22600-95300"] = "http://view.atdmt.com/jaction/63dtvh_PleasurePackProductPage_4"; productIdToAnalyticsMapping["22600-90661"] = "http://view.atdmt.com/jaction/63dtvh_PulseProductPage_4"; productIdToAnalyticsMapping["22600-92670"] = "http://view.atdmt.com/jaction/63dtvh_ThintensityProductPage_4"; productIdToAnalyticsMapping["22600-90646"] = "http://view.atdmt.com/jaction/63dtvh_TouchProductPage_4"; productIdToAnalyticsMapping["22600-90662"] = "http://view.atdmt.com/jaction/63dtvh_TriPhoriaProductPage_4"; productIdToAnalyticsMapping["22600-94730"] = "http://view.atdmt.com/jaction/63dtvh_UltraRibbedEcstasyProductPage_4"; productIdToAnalyticsMapping["22600-92640"] = "http://view.atdmt.com/jaction/63dtvh_UltraThinProductPage_4"; productIdToAnalyticsMapping["22600-90643"] = "http://view.atdmt.com/jaction/63dtvh_VibratingRingDuoProductPage_4"; productIdToAnalyticsMapping["22600-90640"] = "http://view.atdmt.com/jaction/63dtvh_VibratingRingIntimateProductPage_4";
var swfobject = function() { var D = "undefined", r = "object", S = "Shockwave Flash", W = "ShockwaveFlash.ShockwaveFlash", q = "application/x-shockwave-flash", R = "SWFObjectExprInst", x = "onreadystatechange", O = window, j = document, t = navigator, T = false, U = [h], o = [], N = [], I = [], l, Q, E, B, J = false, a = false, n, G, m = true, M = function() { var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D, ah = t.userAgent.toLowerCase(), Y = t.platform.toLowerCase(), ae = Y ? /win/.test(Y) : /win/.test(ah), ac = Y ? /mac/.test(Y) : /mac/.test(ah), af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, X = ! +"\v1", ag = [0, 0, 0], ab = null; if (typeof t.plugins != D && typeof t.plugins[S] == r) { ab = t.plugins[S].description; if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) { T = true; X = false; ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10); ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10); ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0 } } else { if (typeof O.ActiveXObject != D) { try { var ad = new ActiveXObject(W); if (ad) { ab = ad.GetVariable("$version"); if (ab) { X = true; ab = ab.split(" ")[1].split(","); ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } } catch (Z) { } } } return { w3: aa, pv: ag, wk: af, ie: X, win: ae, mac: ac} } (), k = function() { if (!M.w3) { return } if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) { f() } if (!J) { if (typeof j.addEventListener != D) { j.addEventListener("DOMContentLoaded", f, false) } if (M.ie && M.win) { j.attachEvent(x, function() { if (j.readyState == "complete") { j.detachEvent(x, arguments.callee); f() } }); if (O == top) { (function() { if (J) { return } try { j.documentElement.doScroll("left") } catch (X) { setTimeout(arguments.callee, 0); return } f() })() } } if (M.wk) { (function() { if (J) { return } if (!/loaded|complete/.test(j.readyState)) { setTimeout(arguments.callee, 0); return } f() })() } s(f) } } (); function f() { if (J) { return } try { var Z = j.getElementsByTagName("body")[0].appendChild(C("span")); Z.parentNode.removeChild(Z) } catch (aa) { return } J = true; var X = U.length; for (var Y = 0; Y < X; Y++) { U[Y]() } } function K(X) { if (J) { X() } else { U[U.length] = X } } function s(Y) { if (typeof O.addEventListener != D) { O.addEventListener("load", Y, false) } else { if (typeof j.addEventListener != D) { j.addEventListener("load", Y, false) } else { if (typeof O.attachEvent != D) { i(O, "onload", Y) } else { if (typeof O.onload == "function") { var X = O.onload; O.onload = function() { X(); Y() } } else { O.onload = Y } } } } } function h() { if (T) { V() } else { H() } } function V() { var X = j.getElementsByTagName("body")[0]; var aa = C(r); aa.setAttribute("type", q); var Z = X.appendChild(aa); if (Z) { var Y = 0; (function() { if (typeof Z.GetVariable != D) { var ab = Z.GetVariable("$version"); if (ab) { ab = ab.split(" ")[1].split(","); M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } else { if (Y < 10) { Y++; setTimeout(arguments.callee, 10); return } } X.removeChild(aa); Z = null; H() })() } else { H() } } function H() { var ag = o.length; if (ag > 0) { for (var af = 0; af < ag; af++) { var Y = o[af].id; var ab = o[af].callbackFn; var aa = { success: false, id: Y }; if (M.pv[0] > 0) { var ae = c(Y); if (ae) { if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) { w(Y, true); if (ab) { aa.success = true; aa.ref = z(Y); ab(aa) } } else { if (o[af].expressInstall && A()) { var ai = {}; ai.data = o[af].expressInstall; ai.width = ae.getAttribute("width") || "0"; ai.height = ae.getAttribute("height") || "0"; if (ae.getAttribute("class")) { ai.styleclass = ae.getAttribute("class") } if (ae.getAttribute("align")) { ai.align = ae.getAttribute("align") } var ah = {}; var X = ae.getElementsByTagName("param"); var ac = X.length; for (var ad = 0; ad < ac; ad++) { if (X[ad].getAttribute("name").toLowerCase() != "movie") { ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value") } } P(ai, ah, Y, ab) } else { p(ae); if (ab) { ab(aa) } } } } } else { w(Y, true); if (ab) { var Z = z(Y); if (Z && typeof Z.SetVariable != D) { aa.success = true; aa.ref = Z } ab(aa) } } } } } function z(aa) { var X = null; var Y = c(aa); if (Y && Y.nodeName == "OBJECT") { if (typeof Y.SetVariable != D) { X = Y } else { var Z = Y.getElementsByTagName(r)[0]; if (Z) { X = Z } } } return X } function A() { return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312) } function P(aa, ab, X, Z) { a = true; E = Z || null; B = { success: false, id: X }; var ae = c(X); if (ae) { if (ae.nodeName == "OBJECT") { l = g(ae); Q = null } else { l = ae; Q = X } aa.id = R; if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) { aa.width = "310" } if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) { aa.height = "137" } j.title = j.title.slice(0, 47) + " - Flash Player Installation"; var ad = M.ie && M.win ? "ActiveX" : "PlugIn", ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title; if (typeof ab.flashvars != D) { ab.flashvars += "&" + ac } else { ab.flashvars = ac } if (M.ie && M.win && ae.readyState != 4) { var Y = C("div"); X += "SWFObjectNew"; Y.setAttribute("id", X); ae.parentNode.insertBefore(Y, ae); ae.style.display = "none"; (function() { if (ae.readyState == 4) { ae.parentNode.removeChild(ae) } else { setTimeout(arguments.callee, 10) } })() } u(aa, ab, X) } } function p(Y) { if (M.ie && M.win && Y.readyState != 4) { var X = C("div"); Y.parentNode.insertBefore(X, Y); X.parentNode.replaceChild(g(Y), X); Y.style.display = "none"; (function() { if (Y.readyState == 4) { Y.parentNode.removeChild(Y) } else { setTimeout(arguments.callee, 10) } })() } else { Y.parentNode.replaceChild(g(Y), Y) } } function g(ab) { var aa = C("div"); if (M.win && M.ie) { aa.innerHTML = ab.innerHTML } else { var Y = ab.getElementsByTagName(r)[0]; if (Y) { var ad = Y.childNodes; if (ad) { var X = ad.length; for (var Z = 0; Z < X; Z++) { if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) { aa.appendChild(ad[Z].cloneNode(true)) } } } } } return aa } function u(ai, ag, Y) { var X, aa = c(Y); if (M.wk && M.wk < 312) { return X } if (aa) { if (typeof ai.id == D) { ai.id = Y } if (M.ie && M.win) { var ah = ""; for (var ae in ai) { if (ai[ae] != Object.prototype[ae]) { if (ae.toLowerCase() == "data") { ag.movie = ai[ae] } else { if (ae.toLowerCase() == "styleclass") { ah += ' class="' + ai[ae] + '"' } else { if (ae.toLowerCase() != "classid") { ah += " " + ae + '="' + ai[ae] + '"' } } } } } var af = ""; for (var ad in ag) { if (ag[ad] != Object.prototype[ad]) { af += '<param name="' + ad + '" value="' + ag[ad] + '" />' } } aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>"; N[N.length] = ai.id; X = c(ai.id) } else { var Z = C(r); Z.setAttribute("type", q); for (var ac in ai) { if (ai[ac] != Object.prototype[ac]) { if (ac.toLowerCase() == "styleclass") { Z.setAttribute("class", ai[ac]) } else { if (ac.toLowerCase() != "classid") { Z.setAttribute(ac, ai[ac]) } } } } for (var ab in ag) { if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") { e(Z, ab, ag[ab]) } } aa.parentNode.replaceChild(Z, aa); X = Z } } return X } function e(Z, X, Y) { var aa = C("param"); aa.setAttribute("name", X); aa.setAttribute("value", Y); Z.appendChild(aa) } function y(Y) { var X = c(Y); if (X && X.nodeName == "OBJECT") { if (M.ie && M.win) { X.style.display = "none"; (function() { if (X.readyState == 4) { b(Y) } else { setTimeout(arguments.callee, 10) } })() } else { X.parentNode.removeChild(X) } } } function b(Z) { var Y = c(Z); if (Y) { for (var X in Y) { if (typeof Y[X] == "function") { Y[X] = null } } Y.parentNode.removeChild(Y) } } function c(Z) { var X = null; try { X = j.getElementById(Z) } catch (Y) { } return X } function C(X) { return j.createElement(X) } function i(Z, X, Y) { Z.attachEvent(X, Y); I[I.length] = [Z, X, Y] } function F(Z) { var Y = M.pv, X = Z.split("."); X[0] = parseInt(X[0], 10); X[1] = parseInt(X[1], 10) || 0; X[2] = parseInt(X[2], 10) || 0; return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false } function v(ac, Y, ad, ab) { if (M.ie && M.mac) { return } var aa = j.getElementsByTagName("head")[0]; if (!aa) { return } var X = (ad && typeof ad == "string") ? ad : "screen"; if (ab) { n = null; G = null } if (!n || G != X) { var Z = C("style"); Z.setAttribute("type", "text/css"); Z.setAttribute("media", X); n = aa.appendChild(Z); if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) { n = j.styleSheets[j.styleSheets.length - 1] } G = X } if (M.ie && M.win) { if (n && typeof n.addRule == r) { n.addRule(ac, Y) } } else { if (n && typeof j.createTextNode != D) { n.appendChild(j.createTextNode(ac + " {" + Y + "}")) } } } function w(Z, X) { if (!m) { return } var Y = X ? "visible" : "hidden"; if (J && c(Z)) { c(Z).style.visibility = Y } else { v("#" + Z, "visibility:" + Y) } } function L(Y) { var Z = /[\\\"<>\.;]/; var X = Z.exec(Y) != null; return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y } var d = function() { if (M.ie && M.win) { window.attachEvent("onunload", function() { var ac = I.length; for (var ab = 0; ab < ac; ab++) { I[ab][0].detachEvent(I[ab][1], I[ab][2]) } var Z = N.length; for (var aa = 0; aa < Z; aa++) { y(N[aa]) } for (var Y in M) { M[Y] = null } M = null; for (var X in swfobject) { swfobject[X] = null } swfobject = null }) } } (); return { registerObject: function(ab, X, aa, Z) { if (M.w3 && ab && X) { var Y = {}; Y.id = ab; Y.swfVersion = X; Y.expressInstall = aa; Y.callbackFn = Z; o[o.length] = Y; w(ab, false) } else { if (Z) { Z({ success: false, id: ab }) } } }, getObjectById: function(X) { if (M.w3) { return z(X) } }, embedSWF: function(ab, ah, ae, ag, Y, aa, Z, ad, af, ac) { var X = { success: false, id: ah }; if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) { w(ah, false); K(function() { ae += ""; ag += ""; var aj = {}; if (af && typeof af === r) { for (var al in af) { aj[al] = af[al] } } aj.data = ab; aj.width = ae; aj.height = ag; var am = {}; if (ad && typeof ad === r) { for (var ak in ad) { am[ak] = ad[ak] } } if (Z && typeof Z === r) { for (var ai in Z) { if (typeof am.flashvars != D) { am.flashvars += "&" + ai + "=" + Z[ai] } else { am.flashvars = ai + "=" + Z[ai] } } } if (F(Y)) { var an = u(aj, am, ah); if (aj.id == ah) { w(ah, true) } X.success = true; X.ref = an } else { if (aa && A()) { aj.data = aa; P(aj, am, ah, ac); return } else { w(ah, true) } } if (ac) { ac(X) } }) } else { if (ac) { ac(X) } } }, switchOffAutoHideShow: function() { m = false }, ua: M, getFlashPlayerVersion: function() { return { major: M.pv[0], minor: M.pv[1], release: M.pv[2]} }, hasFlashPlayerVersion: F, createSWF: function(Z, Y, X) { if (M.w3) { return u(Z, Y, X) } else { return undefined } }, showExpressInstall: function(Z, aa, X, Y) { if (M.w3 && A()) { P(Z, aa, X, Y) } }, removeSWF: function(X) { if (M.w3) { y(X) } }, createCSS: function(aa, Z, Y, X) { if (M.w3) { v(aa, Z, Y, X) } }, addDomLoadEvent: K, addLoadEvent: s, getQueryParamValue: function(aa) { var Z = j.location.search || j.location.hash; if (Z) { if (/\?/.test(Z)) { Z = Z.split("?")[1] } if (aa == null) { return L(Z) } var Y = Z.split("&"); for (var X = 0; X < Y.length; X++) { if (Y[X].substring(0, Y[X].indexOf("=")) == aa) { return L(Y[X].substring((Y[X].indexOf("=") + 1))) } } } return "" }, expressInstallCallback: function() { if (a) { var X = c(R); if (X && l) { X.parentNode.replaceChild(l, X); if (Q) { w(Q, true); if (M.ie && M.win) { l.style.display = "block" } } if (E) { E(B) } } a = false } } } } ();
/*Thickbox 3 - By Cody Lindley (http://www.codylindley.com)* Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php*/
var tb_pathToImage = "/images/loadingAnimation.gif";
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('$(o).2S(9(){1u(\'a.18, 3n.18, 3i.18\');1w=1p 1t();1w.L=2H});9 1u(b){$(b).s(9(){6 t=X.Q||X.1v||M;6 a=X.u||X.23;6 g=X.1N||P;19(t,a,g);X.2E();H P})}9 19(d,f,g){3m{3(2t o.v.J.2i==="2g"){$("v","11").r({A:"28%",z:"28%"});$("11").r("22","2Z");3(o.1Y("1F")===M){$("v").q("<U 5=\'1F\'></U><4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}n{3(o.1Y("B")===M){$("v").q("<4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}3(1K()){$("#B").1J("2B")}n{$("#B").1J("2z")}3(d===M){d=""}$("v").q("<4 5=\'K\'><1I L=\'"+1w.L+"\' /></4>");$(\'#K\').2y();6 h;3(f.O("?")!==-1){h=f.3l(0,f.O("?"))}n{h=f}6 i=/\\.2s$|\\.2q$|\\.2m$|\\.2l$|\\.2k$/;6 j=h.1C().2h(i);3(j==\'.2s\'||j==\'.2q\'||j==\'.2m\'||j==\'.2l\'||j==\'.2k\'){1D="";1G="";14="";1z="";1x="";R="";1n="";1r=P;3(g){E=$("a[@1N="+g+"]").36();25(D=0;((D<E.1c)&&(R===""));D++){6 k=E[D].u.1C().2h(i);3(!(E[D].u==f)){3(1r){1z=E[D].Q;1x=E[D].u;R="<1e 5=\'1X\'>&1d;&1d;<a u=\'#\'>2T &2R;</a></1e>"}n{1D=E[D].Q;1G=E[D].u;14="<1e 5=\'1U\'>&1d;&1d;<a u=\'#\'>&2O; 2N</a></1e>"}}n{1r=1b;1n="1t "+(D+1)+" 2L "+(E.1c)}}}S=1p 1t();S.1g=9(){S.1g=M;6 a=2x();6 x=a[0]-1M;6 y=a[1]-1M;6 b=S.z;6 c=S.A;3(b>x){c=c*(x/b);b=x;3(c>y){b=b*(y/c);c=y}}n 3(c>y){b=b*(y/c);c=y;3(b>x){c=c*(x/b);b=x}}13=b+30;1a=c+2G;$("#8").q("<a u=\'\' 5=\'1L\' Q=\'1o\'><1I 5=\'2F\' L=\'"+f+"\' z=\'"+b+"\' A=\'"+c+"\' 23=\'"+d+"\'/></a>"+"<4 5=\'2D\'>"+d+"<4 5=\'2C\'>"+1n+14+R+"</4></4><4 5=\'2A\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4>");$("#Z").s(G);3(!(14==="")){9 12(){3($(o).N("s",12)){$(o).N("s",12)}$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1D,1G,g);H P}$("#1U").s(12)}3(!(R==="")){9 1i(){$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1z,1x,g);H P}$("#1X").s(1i)}o.1h=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}n 3(I==3k){3(!(R=="")){o.1h="";1i()}}n 3(I==3j){3(!(14=="")){o.1h="";12()}}};16();$("#K").C();$("#1L").s(G);$("#8").r({Y:"T"})};S.L=f}n{6 l=f.2r(/^[^\\?]+\\??/,\'\');6 m=2p(l);13=(m[\'z\']*1)+30||3h;1a=(m[\'A\']*1)+3g||3f;W=13-30;V=1a-3e;3(f.O(\'2j\')!=-1){1E=f.1B(\'3d\');$("#15").C();3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4></4><U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\' > </U>")}n{$("#B").N();$("#8").q("<U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\'> </U>")}}n{3($("#8").r("Y")!="T"){3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\'>1l</a> 1k 1j 1s</4></4><4 5=\'F\' J=\'z:"+W+"p;A:"+V+"p\'></4>")}n{$("#B").N();$("#8").q("<4 5=\'F\' 3c=\'3b\' J=\'z:"+W+"p;A:"+V+"p;\'></4>")}}n{$("#F")[0].J.z=W+"p";$("#F")[0].J.A=V+"p";$("#F")[0].3a=0;$("#1H").11(d)}}$("#Z").s(G);3(f.O(\'37\')!=-1){$("#F").q($(\'#\'+m[\'26\']).1T());$("#8").24(9(){$(\'#\'+m[\'26\']).q($("#F").1T())});16();$("#K").C();$("#8").r({Y:"T"})}n 3(f.O(\'2j\')!=-1){16();3($.1q.35){$("#K").C();$("#8").r({Y:"T"})}}n{$("#F").34(f+="&1y="+(1p 33().32()),9(){16();$("#K").C();1u("#F a.18");$("#8").r({Y:"T"})})}}3(!m[\'1A\']){o.21=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}}}}31(e){}}9 1m(){$("#K").C();$("#8").r({Y:"T"})}9 G(){$("#2Y").N("s");$("#Z").N("s");$("#8").2X("2W",9(){$(\'#8,#B,#1F\').2V("24").N().C()});$("#K").C();3(2t o.v.J.2i=="2g"){$("v","11").r({A:"1Z",z:"1Z"});$("11").r("22","")}o.1h="";o.21="";H P}9 16(){$("#8").r({2U:\'-\'+20((13/2),10)+\'p\',z:13+\'p\'});3(!(1V.1q.2Q&&1V.1q.2P<7)){$("#8").r({38:\'-\'+20((1a/2),10)+\'p\'})}}9 2p(a){6 b={};3(!a){H b}6 c=a.1B(/[;&]/);25(6 i=0;i<c.1c;i++){6 d=c[i].1B(\'=\');3(!d||d.1c!=2){39}6 e=2a(d[0]);6 f=2a(d[1]);f=f.2r(/\\+/g,\' \');b[e]=f}H b}9 2x(){6 a=o.2M;6 w=1S.2o||1R.2o||(a&&a.1Q)||o.v.1Q;6 h=1S.1P||1R.1P||(a&&a.2n)||o.v.2n;1O=[w,h];H 1O}9 1K(){6 a=2K.2J.1C();3(a.O(\'2I\')!=-1&&a.O(\'3o\')!=-1){H 1b}}', 62, 211, '|||if|div|id|var||TB_window|function||||||||||||||else|document|px|append|css|click||href|body||||width|height|TB_overlay|remove|TB_Counter|TB_TempArray|TB_ajaxContent|tb_remove|return|keycode|style|TB_load|src|null|unbind|indexOf|false|title|TB_NextHTML|imgPreloader|block|iframe|ajaxContentH|ajaxContentW|this|display|TB_closeWindowButton||html|goPrev|TB_WIDTH|TB_PrevHTML|TB_iframeContent|tb_position||thickbox|tb_show|TB_HEIGHT|true|length|nbsp|span|Math|onload|onkeydown|goNext|Esc|or|close|tb_showIframe|TB_imageCount|Close|new|browser|TB_FoundURL|Key|Image|tb_init|name|imgLoader|TB_NextURL|random|TB_NextCaption|modal|split|toLowerCase|TB_PrevCaption|urlNoQuery|TB_HideSelect|TB_PrevURL|TB_ajaxWindowTitle|img|addClass|tb_detectMacXFF|TB_ImageOff|150|rel|arrayPageSize|innerHeight|clientWidth|self|window|children|TB_prev|jQuery|frameborder|TB_next|getElementById|auto|parseInt|onkeyup|overflow|alt|unload|for|inlineId||100||unescape|1000|round|hspace|TB_closeAjaxWindow|TB_title|undefined|match|maxHeight|TB_iframe|bmp|gif|png|clientHeight|innerWidth|tb_parseQuery|jpeg|replace|jpg|typeof|which|keyCode|event|tb_getPageSize|show|TB_overlayBG|TB_closeWindow|TB_overlayMacFFBGHack|TB_secondLine|TB_caption|blur|TB_Image|60|tb_pathToImage|mac|userAgent|navigator|of|documentElement|Prev|lt|version|msie|gt|ready|Next|marginLeft|trigger|fast|fadeOut|TB_imageOff|hidden||catch|getTime|Date|load|safari|get|TB_inline|marginTop|continue|scrollTop|TB_modal|class|TB_|45|440|40|630|input|188|190|substr|try|area|firefox'.split('|'), 0, {}))

//track the removal of upsells
function removeUpsellClk(a, b, c) {
    s.linkTrackVars = "events,eVar11,products";
    s.linkTrackEvents = "scRemove";
    s.events = a;
    s.products = ";" + b + ":" + c;
    s.eVar11 = b + ":" + c;
    s.tl(true, "o", "Upsell Clicks");
}

//add maxlength to textareas
$(document).ready(function() {
    $('textarea[maxlength]').keyup(function() {
        var max = parseInt($(this).attr('maxlength'));
        if ($(this).val().length > max) {
            $(this).val($(this).val().substr(0, $(this).attr('maxlength')));
        }

        //$(this).parent().find('.charsRemaining').html('You have ' + (max - $(this).val().length) + ' characters remaining');
    });
});

//Replace add onclick event so that clicks are tracked in TrackableHTML
MakeTrackableLink = function(itemId, redirectUrl, cacheName, pageGroup) {
    var linkUrl = redirectUrl + '?ciid=' + itemId + '&cachename=' + cacheName + '&PageGroupId=' + pageGroup + '&url=';

    $('.' + itemId + ' .AdLink').each(
		function() {
		    $(this).attr('href', linkUrl + escape($(this).attr('href')));
		}
	);
}

//Ajax Functions
var RequestTimeout = 30000;
var RequestActive = false; //keep user from making multiple requests before seeing feedback

AddToCart = function(catalog, productId, quantity) {
    if (RequestActive) {
        return false;
    }

    var args = {};
    args.catalog = catalog;
    args.id = productId;
    args.quantity = quantity;

    $.ajax({
        url: '/_layouts/TV_CommerceServer/AddToCart.ashx',
        type: 'GET',
        data: args,
        cache: false,
        dataType: 'json',
        timeout: RequestTimeout,
        success: OnCartUpdated,
        error: TimeOutError
    });
    RequestActive = true;
    return true;
};

OnCartUpdated = function(resp) {
    RequestActive = false;

    if (resp.success !== true) {
        return false;
    }

    $('#ItemsInCart').html(resp.itemCount);
    $('#ItemAddedProduct').html(resp.productName.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>'));
    loginBox('ItemAddedModal');

    //event for if the user clicks the mask
    $('#fade').click(function() {
        $('#ItemAddedModal').fadeOut();
        $('#fade').remove();
    });

    //track event in omniture
    s.events = resp.omnitureEvent;
    s.products = resp.omnitureProduct;
    var s_code = s.t();
}

CloseItemAddedModal = function() {
    $('#fade, #ItemAddedModal').fadeOut();
    $('#fade').remove();
};

ShareEmail = function() {
    if (RequestActive) {
        return false;
    }

    if ($('.email-share-sender-name').val() === 'required') {
        $('.share-email-message').html("Please enter your name.");
        $('.share-email-message').removeClass('hidden success_email');
        return false;
    }

    if (!ValidateEmail($('.email-share-recipient-email').val())) {
        $('.share-email-message').html("Please enter a valid email.");
        $('.share-email-message').removeClass('hidden success_email');
        return false;
    }

    var args = {};
    args.sender = escape($('.email-share-sender-name').val());
    args.recipient = escape($('.email-share-recipient-email').val());
    args.message = escape($('.email-share-message').val());

    $.ajax({
        url: '/_layouts/TV_CommerceServer/ShareEmail.ashx',
        type: 'GET',
        data: args,
        cache: false,
        dataType: 'json',
        timeout: RequestTimeout,
        success: ShareEmailSent,
        error: TimeOutError
    });
    RequestActive = true;
    return true;
};

ShareEmailSent = function(resp) {
    RequestActive = false;

    if (resp.friendlyMessage !== 'undefined') {
        $('.share-email-message').html(resp.friendlyMessage);
        $('.share-email-message').removeClass('hidden');
    }

    if (resp.success) {
        $('.share-email-message').addClass('success_email');
    }
    else {
        $('.share-email-message').removeClass('success_email');
        return false;
    }

    // webkit browsers do not respect .blur()
    //    $('.share-email-form :input').each(function(index) {
    //        $(this).val('');
    //        $(this).blur();
    //    });
    $('.email-share-sender-name').val(resp.requiredMessage);
    $('.email-share-recipient-email').val(resp.requiredMessage);
    $('.email-share-message').val(resp.optionalMessage);
};

//returns true if the email is valid, false otherwise
ValidateEmail = function(email) {
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    return reg.test(email);
};

TimeOutError = function(resp) {
    RequestActive = false;
};
