﻿// Copyright (c) 2010 PageBean, Inc.  (http://www.pagebean.com)
// All rights reserved.

function SwapImage(newMainImage, newLargeImage) { var thisImage = document.getElementById("primaryImage"); thisImage.src = newMainImage; var parentHref = document.getElementById("zoom1"); if (parentHref != null) { parentHref.zm = newLargeImage.replace("350x350", "1000x1000").replace("600x600", "1000x1000"); $('.cloud-zoom, .cloud-zoom-gallery').CloudZoom() } } function SwapImageSearch(imageToSwap, swapToImage) { var thisImage = document.getElementById(imageToSwap); thisImage.src = swapToImage } $(document).ready(function() { onEmailProductResize(true); $(".button9OFF,.button11OFF").live('click', function() { alert('Please choose a valid option (color/size/qty) before clicking Add To Cart.') }); $(".emailProduct img").click(function() { $.ajax({ url: "/ajax/emailProduct.aspx", data: { pID: $(this).attr("id") }, cache: false, success: function(data) { $(".emailProductWrapper").html(""); $(".emailProductWrapper").html(data); onEmailProductResize(false) } }); $("#emailProductOverlay").fadeTo(500, 0.45); $("#emailProductDialog").delay(200).fadeIn(300) }); $("#emailProductClose").live("click", function() { $("#emailProductOverlay").fadeOut(500); $("#emailProductDialog").fadeOut(200) }); $(window).resize(function() { onEmailProductResize(true) }); $(window).scroll(function() { onEmailProductResize(true) }); $("#lnkSendEmail").live("click", function() { if ($(this).hasClass("button9")) { var errorMessage = "ERROR(S):<br>"; if ($("#txt_emailTo").val() == "") { errorMessage += "You must enter at least one e-mail address for the recipient(s).<br>" } if ($("#txt_emailFrom").val() == "") { errorMessage += "You must enter an e-mail address for the sender." } if (errorMessage != "ERROR(S):<br>") { $("#lbl_errorMessage2").html(errorMessage); $("#panel_errorMessage2").css('visibility', 'visible') } else { $("#panel_errorMessage2").css('visibility', 'hidden'); $("#panel_errorMessage2").css('display', 'none'); $.ajax({ url: "/ajax/sendEmail.aspx", cache: false, data: { pID: $("#h_pID").val(), productLink: $("#h_productLink").val(), mailTo: $("#txt_emailTo").val(), mailFrom: $("#txt_emailFrom").val(), note: $("#txt_note").val(), sendCopy: $("#chk_sendCopy")[0].checked }, success: function() { $("#panel_errorMessage2").css('visibility', 'hidden'); $("#emailProductOverlay").fadeOut(500); $("#emailProductDialog").fadeOut(200); $("html, body").animate({ scrollTop: 0 }, 1000) }, failure: function(msg) { $("#lbl_errorMessage2").html(msg); $("#panel_errorMessage2").css('visibility', 'visible'); $("#panel_errorMessage2").css('display', 'inline') }, error: function(msg) { var exceptionMessage = msg.responseText.substring(msg.responseText.indexOf("Exception: ")); exceptionMessage = exceptionMessage.substring(10, exceptionMessage.indexOf("<br>")); $("#lbl_errorMessage2").html("ERROR(S):<br>" + exceptionMessage); $("#panel_errorMessage2").css('display', 'inline'); $("#panel_errorMessage2").css('visibility', 'visible') } }) } } }) }); function onEmailProductResize(stop) { if ($(window).height() > $("body").height()) { $("#emailProductOverlay").css("height", $(window).height() + "px") } else { $("#emailProductOverlay").css("height", $("body").height() + "px") } $("#emailProductOverlay").css("left", $(window).scrollLeft() + "px"); if (stop) { $("#emailProductDialog").stop(true, true) } if ($("#emailProductDialog").height() < $(window).height()) { $("#emailProductDialog").animate({ top: ($(window).height() / 2) - ($("#emailProductDialog").height() / 2) + $(window).scrollTop() + "px" }, 250) } else { $("#emailProductDialog").css("top", "0px") } if ($("#emailProductDialog").width() < $(window).width()) { $("#emailProductDialog").animate({ left: ($(window).width() / 2) - ($("#emailProductDialog").width() / 2) + $(window).scrollLeft() + "px" }, 250) } else { $("#emailProductDialog").css("left", "0px") } } $(document).ready(function() { onCallCenterHoursResize(true); $(".simplePopup a").click(function(event) { event.preventDefault(); $.ajax({ url: $(this).attr("content"), data: {}, cache: false, success: function(data) { $(".simplePopupWrapper").html(""); $(".simplePopupWrapper").html(data); onCallCenterHoursResize(false) } }); $("#simplePopupOverlay").fadeTo(500, 0.45); $("#simplePopupDialog").delay(200).fadeIn(300) }); $("#simplePopupClose").live("click", function() { $("#simplePopupOverlay").fadeOut(500); $("#simplePopupDialog").fadeOut(200) }); $(window).resize(function() { onCallCenterHoursResize(true) }); $(window).scroll(function() { onCallCenterHoursResize(true) }); $("#lnkSendEmail").live("click", function() { if ($(this).hasClass("button9")) { var errorMessage = "ERROR(S):<br>"; if ($("#txt_emailTo").val() == "") { errorMessage += "You must enter at least one e-mail address for the recipient(s).<br>" } if ($("#txt_emailFrom").val() == "") { errorMessage += "You must enter an e-mail address for the sender." } if (errorMessage != "ERROR(s):<br>") { $("#lbl_errorMessage2").html(errorMessage); $("#panel_errorMessage2").css('visibility', 'visible') } else { $.ajax({ url: "/ajax/sendEmail.aspx", cache: false, data: { edpNo: $("#h_edpno").val(), mailTo: $("#txt_emailTo").val(), mailFrom: $("#txt_emailFrom").val(), note: $("#txt_note").val(), sendCopy: $("#chk_sendCopy")[0].checked }, success: function() { $("#simplePopupOverlay").fadeOut(500); $("#simplePopupDialog").fadeOut(200); $("html, body").animate({ scrollTop: 0 }, 1000) }, failure: function() { $("#txt_emailTo").val() = "FAIL" } }) } } }); $("#simplePopupOverlay").click(function() { $("#simplePopupOverlay").fadeOut(500); $("#simplePopupDialog").fadeOut(200) }) }); function onCallCenterHoursResize(stop) { if ($(window).height() > $("body").height()) { $("#simplePopupOverlay").css("height", $(window).height() + "px") } else { $("#simplePopupOverlay").css("height", $("body").height() + "px") } $("#simplePopupOverlay").css("left", $(window).scrollLeft() + "px"); if (stop) { $("#simplePopupDialog").stop(true, true) } if ($("#simplePopupDialog").height() < $(window).height()) { $("#simplePopupDialog").animate({ top: ($(window).height() / 2) - ($("#simplePopupDialog").height() / 2) + $(window).scrollTop() + "px" }, 250) } else { $("#simplePopupDialog").css("top", "0px") } if ($("#simplePopupDialog").width() < $(window).width()) { $("#simplePopupDialog").animate({ left: ($(window).width() / 2) - ($("#simplePopupDialog").width() / 2) + $(window).scrollLeft() + "px" }, 250) } else { $("#simplePopupDialog").css("left", "0px") } } function ToggleContent(contentid, sw) { if (document.getElementById(contentid)) { var style = document.getElementById(contentid).style; if (sw == 1) { style.display = "block" } if (sw == 0) { style.display = "none" } } } function makeRequest(url) { var avail_amount; var http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml') } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); http_request.overrideMimeType('text/xml') } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); http_request.overrideMimeType('text/xml') } catch (e) { } } } if (!http_request) { return false } else { http_request.onreadystatechange = function() { processResponse(http_request) }; http_request.open('GET', url, true); http_request.send(null); return true } } function getNodeValue(xml, node) { var value; value = xml.getElementsByTagName(node)[0].firstChild.nodeValue; return value } function processResponse(http_request) { if (http_request.readyState == 4) { if (http_request.status == 200) { return displayData(http_request) } else { return false } } } function displayData(http_request) { var xml = null; var flag, call_type, lstrMessage, lstrItemNo; if (flag == "Y") { lstrItemNo = getNodeValue(xml, "itemNo") } else { } } function validateGC() { if (!makeRequest("/tShirt.aspx.asp")) { document.getElementById("message").innerHTML = "No AJAX for you! We'll fall back on legacy functionality" } } function whichkey(e) { if (document.all) e = event; var key = (e.charCode) ? e.charCode : ((e.keyCode) ? e.keyCode : ((e.which) ? e.which : 0)); return key } if (typeof deconcept == "undefined") { var deconcept = new Object() } if (typeof deconcept.util == "undefined") { deconcept.util = new Object() } if (typeof deconcept.SWFObjectUtil == "undefined") { deconcept.SWFObjectUtil = new Object() } deconcept.SWFObject = function(_1, id, w, h, _5, c, _7, _8, _9, _a) { if (!document.getElementById) { return } this.DETECT_KEY = _a ? _a : "detectflash"; this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); this.params = new Object(); this.variables = new Object(); this.attributes = new Array(); if (_1) { this.setAttribute("swf", _1) } if (id) { this.setAttribute("id", id) } if (w) { this.setAttribute("width", w) } if (h) { this.setAttribute("height", h) } if (_5) { this.setAttribute("version", new deconcept.PlayerVersion(_5.toString().split("."))) } this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(); if (!window.opera && document.all && this.installedVer.major > 7) { deconcept.SWFObject.doPrepUnload = true } if (c) { this.addParam("bgcolor", c) } var q = _7 ? _7 : "high"; this.addParam("quality", q); this.setAttribute("useExpressInstall", false); this.setAttribute("doExpressInstall", false); var _c = (_8) ? _8 : window.location; this.setAttribute("xiRedirectUrl", _c); this.setAttribute("redirectUrl", ""); if (_9) { this.setAttribute("redirectUrl", _9) } }; deconcept.SWFObject.prototype = { useExpressInstall: function(_d) { this.xiSWFPath = !_d ? "expressinstall.swf" : _d; this.setAttribute("useExpressInstall", true) }, setAttribute: function(_e, _f) { this.attributes[_e] = _f }, getAttribute: function(_10) { return this.attributes[_10] }, addParam: function(_11, _12) { this.params[_11] = _12 }, getParams: function() { return this.params }, addVariable: function(_13, _14) { this.variables[_13] = _14 }, getVariable: function(_15) { return this.variables[_15] }, getVariables: function() { return this.variables }, getVariablePairs: function() { var _16 = new Array(); var key; var _18 = this.getVariables(); for (key in _18) { _16[_16.length] = key + "=" + _18[key] } return _16 }, getSWFHTML: function() { var _19 = ""; if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); this.setAttribute("swf", this.xiSWFPath) } _19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\""; _19 += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" "; var _1a = this.getParams(); for (var key in _1a) { _19 += [key] + "=\"" + _1a[key] + "\" " } var _1c = this.getVariablePairs().join("&"); if (_1c.length > 0) { _19 += "flashvars=\"" + _1c + "\"" } _19 += "/>" } else { if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); this.setAttribute("swf", this.xiSWFPath) } _19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\">"; _19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />"; var _1d = this.getParams(); for (var key in _1d) { _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />" } var _1f = this.getVariablePairs().join("&"); if (_1f.length > 0) { _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />" } _19 += "</object>" } return _19 }, write: function(_20) { if (this.getAttribute("useExpressInstall")) { var _21 = new deconcept.PlayerVersion([6, 0, 65]); if (this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))) { this.setAttribute("doExpressInstall", true); this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl"))); document.title = document.title.slice(0, 47) + " - Flash Player Installation"; this.addVariable("MMdoctitle", document.title) } } if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) { var n = (typeof _20 == "string") ? document.getElementById(_20) : _20; n.innerHTML = this.getSWFHTML(); return true } else { if (this.getAttribute("redirectUrl") != "") { document.location.replace(this.getAttribute("redirectUrl")) } } return false } }; deconcept.SWFObjectUtil.getPlayerVersion = function() { var _23 = new deconcept.PlayerVersion([0, 0, 0]); if (navigator.plugins && navigator.mimeTypes.length) { var x = navigator.plugins["Shockwave Flash"]; if (x && x.description) { _23 = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")) } } else { if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0) { var axo = 1; var _26 = 3; while (axo) { try { _26++; axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + _26); _23 = new deconcept.PlayerVersion([_26, 0, 0]) } catch (e) { axo = null } } } else { try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7") } catch (e) { try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); _23 = new deconcept.PlayerVersion([6, 0, 21]); axo.AllowScriptAccess = "always" } catch (e) { if (_23.major == 6) { return _23 } } try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash") } catch (e) { } } if (axo != null) { _23 = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")) } } } return _23 }; deconcept.PlayerVersion = function(_29) { this.major = _29[0] != null ? parseInt(_29[0]) : 0; this.minor = _29[1] != null ? parseInt(_29[1]) : 0; this.rev = _29[2] != null ? parseInt(_29[2]) : 0 }; deconcept.PlayerVersion.prototype.versionIsValid = function(fv) { if (this.major < fv.major) { return false } if (this.major > fv.major) { return true } if (this.minor < fv.minor) { return false } if (this.minor > fv.minor) { return true } if (this.rev < fv.rev) { return false } return true }; deconcept.util = { getRequestParameter: function(_2b) { var q = document.location.search || document.location.hash; if (_2b == null) { return q } if (q) { var _2d = q.substring(1).split("&"); for (var i = 0; i < _2d.length; i++) { if (_2d[i].substring(0, _2d[i].indexOf("=")) == _2b) { return _2d[i].substring((_2d[i].indexOf("=") + 1)) } } } return "" } }; deconcept.SWFObjectUtil.cleanupSWFs = function() { var _2f = document.getElementsByTagName("OBJECT"); for (var i = _2f.length - 1; i >= 0; i--) { _2f[i].style.display = "none"; for (var x in _2f[i]) { if (typeof _2f[i][x] == "function") { _2f[i][x] = function() { } } } } }; if (deconcept.SWFObject.doPrepUnload) { if (!deconcept.unloadSet) { deconcept.SWFObjectUtil.prepUnload = function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs) }; window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload); deconcept.unloadSet = true } } if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id] } } var getQueryParamValue = deconcept.util.getRequestParameter; var FlashObject = deconcept.SWFObject; var SWFObject = deconcept.SWFObject; $(document).ready(function() { $("#dropDownBrand > li").each(function() { if ((($(this).offset()).left + $(this).children("ul").outerWidth()) > Math.round($("#siteContainer").width() + ($(document).width() - $("#siteContainer").width()) / 2)) { $(this).children("ul").eq(0).css("left", (Math.round($("#siteContainer").width() + ($(document).width() - $("#siteContainer").width()) / 2) - (($(this).offset()).left + $(this).children("ul").outerWidth()))) } }); $("#dropDownBrand > li").mouseenter(function() { $("#dropDownBrand > li > ul").stop(true, true); $("#dropDownBrand > li > ul").slideUp(500); $(this).children("ul").delay(150).slideDown(500) }); $("#dropDownBrand > li").mouseleave(function() { $("#dropDownBrand > li > ul").stop(true, true); $(this).children("ul").delay(300).slideUp(500) }) }); $(document).ready(function() { $("#dropDownNav > li").each(function() { if ((($(this).offset()).left + $(this).children("ul").outerWidth()) > Math.round($("#siteContainer").width() + ($(document).width() - $("#siteContainer").width()) / 2)) { $(this).children("ul").eq(0).css("left", (Math.round($("#siteContainer").width() + ($(document).width() - $("#siteContainer").width()) / 2) - (($(this).offset()).left + $(this).children("ul").outerWidth()))) } }); $("#dropDownNav > li").mouseenter(function() { $("#dropDownNav > li > ul").stop(true, true); $("#dropDownNav > li > ul").slideUp(500); $(this).children("ul").delay(150).slideDown(500) }); $("#dropDownNav > li").mouseleave(function() { $("#dropDownNav > li > ul").stop(true, true); $(this).children("ul").delay(300).slideUp(500) }) }); $(document).ready(function() { $("#overlay").css("height", $("body").height() + "px"); onResize(); $(".close-button").click(function() { $("#overlay, #dialog").addClass("display-none") }); $(".open-button").click(function() { $("#overlay, #dialog").removeClass("display-none") }) }); $(window).resize(function() { onResize() }); $(window).scroll(function() { onResize() }); function onResize() { $("#overlay").css("left", $(window).scrollLeft() + "px"); $("#dialog").css("top", ($(window).height() / 2) - 200 + $(window).scrollTop() + "px"); $("#dialog").css("left", ($(window).width() / 2) - 300 + $(window).scrollLeft() + "px") } function SwapImageGroup(groupNumber) { var imgDiv0 = document.getElementById("imgdiv_0"); var imgDiv1 = document.getElementById("imgdiv_1"); var imgDiv2 = document.getElementById("imgdiv_2"); var imgDiv3 = document.getElementById("imgdiv_3"); var imgDiv4 = document.getElementById("imgdiv_4"); if (imgDiv0 != null && imgDiv0 != "undefined") { if (mainImageArray[groupNumber][0] != null && mainImageArray[groupNumber][0] != "undefined") { imgDiv0.innerHTML = mainImageArray[groupNumber][0] } if (imgDiv0.innerHTML == null || imgDiv0.innerHTML == "undefined") { imgDiv0.innerHTML = "" } } if (imgDiv1 != null && imgDiv1 != "undefined") { if (mainImageArray[groupNumber][1] != null && mainImageArray[groupNumber][1] != "undefined") { imgDiv1.innerHTML = mainImageArray[groupNumber][1] } if (imgDiv1.innerHTML == null || imgDiv1.innerHTML == "undefined") { imgDiv1.innerHTML = "" } } if (imgDiv2 != null && imgDiv2 != "undefined") { if (mainImageArray[groupNumber][2] != null && mainImageArray[groupNumber][2] != "undefined") { imgDiv2.innerHTML = mainImageArray[groupNumber][2] } if (imgDiv2.innerHTML == null || imgDiv2.innerHTML == "undefined") { imgDiv2.innerHTML = "" } } if (imgDiv3 != null && imgDiv3 != "undefined") { if (mainImageArray[groupNumber][3] != null && mainImageArray[groupNumber][3] != "undefined") { imgDiv3.innerHTML = mainImageArray[groupNumber][3] } if (imgDiv3.innerHTML == null || imgDiv3.innerHTML == "undefined") { imgDiv3.innerHTML = "" } } if (imgDiv4 != null && imgDiv4 != "undefined") { if (mainImageArray[groupNumber][4] != null && mainImageArray[groupNumber][4] != "undefined") { imgDiv4.innerHTML = mainImageArray[groupNumber][4] } if (imgDiv4.innerHTML == null || imgDiv4.innerHTML == "undefined") { imgDiv4.innerHTML = "" } } } var mainImageArray = new Array(20); for (i = 0; i < 20; i++) mainImageArray[i] = new Array(2); function cleartabs() { var oDiv = document.getElementById('tabdatacontainer'); if (oDiv.firstChild) { var oChild = oDiv.firstChild; while (oChild) { if (oChild.nodeType == 1) { oChild.className = "tabData_Disabled" } oChild = oChild.nextSibling } } oDiv = document.getElementById('tabnav'); if (oDiv.firstChild) { var oChild = oDiv.firstChild; while (oChild) { if (oChild.nodeType == 1) { if (oChild.id == "BUY IN BULK") { document.getElementById("tab_" + oChild.id).className = "red" } else { document.getElementById("tab_" + oChild.id).className = "" } } oChild = oChild.nextSibling } } } function changetab(tabid) { cleartabs(); document.getElementById("tab_" + tabid).className = "active"; document.getElementById("tabData_" + tabid).className = "tabData_Active" } function cleartabs2() { var oDiv = document.getElementById('tabdatacontainer2'); if (oDiv.firstChild) { var oChild = oDiv.firstChild; while (oChild) { if (oChild.nodeType == 1) { oChild.className = "tabData_Disabled" } oChild = oChild.nextSibling } } oDiv = document.getElementById('tabnav2'); if (oDiv.firstChild) { var oChild = oDiv.firstChild; while (oChild) { if (oChild.nodeType == 1) { document.getElementById("tab_" + oChild.id).className = "" } oChild = oChild.nextSibling } } } function changetab2(tabid) { cleartabs2(); document.getElementById("tab_" + tabid).className = "active"; document.getElementById("tabData_" + tabid).className = "tabData_Active" } function cleartabs3() { var oDiv = document.getElementById('brandingTabDataContainer'); if (oDiv.firstChild) { var oChild = oDiv.firstChild; while (oChild) { if (oChild.nodeType == 1) { oChild.className = "tabData_Disabled" } oChild = oChild.nextSibling } } oDiv = document.getElementById('tabnav3'); if (oDiv.firstChild) { var oChild = oDiv.firstChild; while (oChild) { if (oChild.nodeType == 1) { document.getElementById("tab_" + oChild.id).className = "" } oChild = oChild.nextSibling } } } function changetab3(tabid) { cleartabs3(); document.getElementById("tab_" + tabid).className = "active"; document.getElementById("tabData_" + tabid).className = "tabData_Active" } $(document).ready(function() { $("#filterContainer .header").click(function() { var dropDown = ($(this).next()); if (dropDown.hasClass("expanded")) { dropDown.slideUp("slow"); dropDown.removeClass("expanded"); $(this).children("div").children("img").attr("src", "/theme/main/images/downArrowSearch.jpg") } else { dropDown.slideDown("slow"); dropDown.addClass("expanded"); $(this).children("div").children("img").attr("src", "/theme/main/images/upArrowSearch.jpg") } }) }); $(document).ready(function() { $("#brandingNavigation .header").click(function() { var $brandingSlide = $('.BrandingSlide'); $('.header').each(function() { var dropDown = ($(this).next()); dropDown.slideUp("slow"); dropDown.removeClass("expanded"); $(this).children(".brandingArrow").children("img").attr("src", "/theme/main/images/brandingArrowRight.png") }); var dropDown = ($(this).next()); if (dropDown.hasClass("expanded")) { } else { dropDown.slideDown("slow"); dropDown.addClass("expanded"); $(this).children(".brandingArrow").children("img").attr("src", "/theme/main/images/brandingArrowDown.png") } }) }); function slideDownNav(divId) { $("#" + divId).slideDown("slow"); $("#" + divId + "-LINK").attr("href", "JavaScript:slideUpNav('" + divId + "');"); $("#" + divId + "-LINK").html("<img src='/theme/main/images/upArrowSearch.jpg' />") } function slideUpNav(divId) { $("#" + divId).slideUp("slow"); $("#" + divId + "-LINK").attr("href", "JavaScript:slideDownNav('" + divId + "');"); $("#" + divId + "-LINK").html("<img src='/theme/main/images/downArrowSearch.jpg' />") } $(document).ready(function() { $("#bestSellersSlideRight").click(function() { if (-$("#bestSellersContainer").outerWidth() < ($("#bestSellersContainer").css('left').replace('px', '') - 868 - 1)) $("#bestSellersContainer").animate({ 'left': "-=868px" }); if (-$("#bestSellersContainer").outerWidth() >= ($("#bestSellersContainer").css('left').replace('px', '') - 868 - 868 - 1)) { $("#slideRightArrowBestSellers").attr("src", "/theme/main/images/slideRightArrowOFF.jpg") } else { $("#slideRightArrowBestSellers").attr("src", "/theme/main/images/slideRightArrow.jpg") } if (($("#bestSellersContainer").css('left')) == '0px') { $("#slideLeftArrowBestSellers").attr("src", "/theme/main/images/slideLeftArrow.jpg") } }); $("#bestSellersSlideLeft").click(function() { if (($("#bestSellersContainer").css('left')) != '0px') $("#bestSellersContainer").animate({ 'left': "+=868px" }); if (-$("#bestSellersContainer").outerWidth() >= ($("#bestSellersContainer").css('left').replace('px', '') - 868 - 868 - 1)) { $("#slideRightArrowBestSellers").attr("src", "/theme/main/images/slideRightArrow.jpg") } if (($("#bestSellersContainer").css('left')) == '-868px' || ($("#bestSellersContainer").css('left')) == '0px') { $("#slideLeftArrowBestSellers").attr("src", "/theme/main/images/slideLeftArrowOFF.jpg") } else { $("#slideLeftArrowBestSellers").attr("src", "/theme/main/images/slideLeftArrow.jpg") } }); $("#bestDealsSlideRight").click(function() { if (-$("#bestDealsContainer").outerWidth() < ($("#bestDealsContainer").css('left').replace('px', '') - 868)) $("#bestDealsContainer").animate({ 'left': "-=868px" }); if (-$("#bestDealsContainer").outerWidth() >= ($("#bestDealsContainer").css('left').replace('px', '') - 868 - 868 - 1)) { $("#slideRightArrowBestDeals").attr("src", "/theme/main/images/slideRightArrowOFF.jpg") } else { $("#slideRightArrowBestDeals").attr("src", "/theme/main/images/slideRightArrow.jpg") } if (($("#bestDealsContainer").css('left')) == '0px') { $("#slideLeftArrowBestDeals").attr("src", "/theme/main/images/slideLeftArrow.jpg") } }); $("#bestDealsSlideLeft").click(function() { if (($("#bestDealsContainer").css('left')) != '0px') $("#bestDealsContainer").animate({ 'left': "+=868px" }); if (-$("#bestDealsContainer").outerWidth() >= ($("#bestDealsContainer").css('left').replace('px', '') - 868 - 868 - 1)) { $("#slideRightArrowBestDeals").attr("src", "/theme/main/images/slideRightArrow.jpg") } if (($("#bestDealsContainer").css('left')) == '-868px' || ($("#bestDealsContainer").css('left')) == '0px') { $("#slideLeftArrowBestDeals").attr("src", "/theme/main/images/slideLeftArrowOFF.jpg") } else { $("#slideLeftArrowBestDeals").attr("src", "/theme/main/images/slideLeftArrow.jpg") } }); $("#justArrivedSlideRight").click(function() { if (-$("#justArrivedContainer").outerWidth() < ($("#justArrivedContainer").css('left').replace('px', '') - 868 - 1)) $("#justArrivedContainer").animate({ 'left': "-=868px" }); if (-$("#justArrivedContainer").outerWidth() >= ($("#justArrivedContainer").css('left').replace('px', '') - 868 - 868 - 1)) { $("#slideRightArrowJustArrived").attr("src", "/theme/main/images/slideRightArrowOFF.jpg") } else { $("#slideRightArrowJustArrived").attr("src", "/theme/main/images/slideRightArrow.jpg") } if (($("#justArrivedContainer").css('left')) == '0px') { $("#slideLeftArrowJustArrived").attr("src", "/theme/main/images/slideLeftArrow.jpg") } }); $("#justArrivedSlideLeft").click(function() { if (($("#justArrivedContainer").css('left')) != '0px') $("#justArrivedContainer").animate({ 'left': "+=868px" }); if (-$("#justArrivedContainer").outerWidth() >= ($("#justArrivedContainer").css('left').replace('px', '') - 868 - 868 - 1)) { $("#slideRightArrowJustArrived").attr("src", "/theme/main/images/slideRightArrow.jpg") } if (($("#justArrivedContainer").css('left')) == '-868px' || ($("#justArrivedContainer").css('left')) == '0px') { $("#slideLeftArrowJustArrived").attr("src", "/theme/main/images/slideLeftArrowOFF.jpg") } else { $("#slideLeftArrowJustArrived").attr("src", "/theme/main/images/slideLeftArrow.jpg") } }); $(function() { $('.rolloverArrowLeft').hover(function() { var currentImg = $(this).attr('src'); if (currentImg != "/theme/main/images/slideLeftArrowOFF.jpg") { $(this).attr('src', '/theme/main/images/slideLeftArrowOVER.jpg') } }, function() { var currentImg = $(this).attr('src'); if (currentImg != "/theme/main/images/slideLeftArrowOFF.jpg") { $(this).attr('src', '/theme/main/images/slideLeftArrow.jpg') } }) }); $(function() { $('.rolloverArrowRight').hover(function() { var currentImg = $(this).attr('src'); if (currentImg != "/theme/main/images/slideRightArrowOFF.jpg") { $(this).attr('src', '/theme/main/images/slideRightArrowOVER.jpg') } }, function() { var currentImg = $(this).attr('src'); if (currentImg != "/theme/main/images/slideRightArrowOFF.jpg") { $(this).attr('src', '/theme/main/images/slideRightArrow.jpg') } }) }) }); $(document).ready(function() { onQuickViewResize(true); $(".quickView img").click(function() { if (window.location.pathname == "/cart.aspx") { $.ajax({ url: "/ajax/ajaxProduct.aspx", data: { pID: $(this).attr("id"), promotionTiedToItem: $(this).parent().children("input[name=promotionTiedToItem]").val(), forward: 1 }, cache: false, success: function(data) { $(".quickViewWrapper").html(""); $(".quickViewWrapper").html(data); onQuickViewResize(false) } }) } else { $.ajax({ url: "/ajax/ajaxProduct.aspx", data: { pID: $(this).attr("id"), promotionTiedToItem: $(this).parent().children("input[name=promotionTiedToItem]").val() }, cache: false, success: function(data) { $(".quickViewWrapper").html(""); $(".quickViewWrapper").html(data); onQuickViewResize(false) } }) } $("#quickViewOverlay").fadeTo(500, 0.45); $("#quickViewDialog").delay(200).fadeIn(300) }); $("#qiuckViewClose").live("click", function() { $("#quickViewOverlay").fadeOut(500); $("#quickViewDialog").fadeOut(200) }); $(window).resize(function() { onQuickViewResize(true) }); $(window).scroll(function() { onQuickViewResize(true) }); $("#LinkButton4").live("click", function() { if ($(this).hasClass("button9") || $(this).hasClass("button12")) { $.ajax({ url: "/ajax/addToCart.aspx", cache: false, data: { edpNo: $("#h_edpno").val(), qty: $("#lb_qty").val(), promotionTiedToItem: $("#h_promotionTiedToItem").val(), forward: $("#forwardToCart").val() }, success: function() { if ($("#forwardToCart").val() == "1") { $("#quickViewOverlay").fadeOut(500); $("#quickViewDialog").fadeOut(200); window.location.replace("/cart.aspx") } else { $.ajax({ url: "/ajax/cart.aspx", cache: false, success: function(data) { $("#popupCart").html(""); $("#popupCart").html(data); $("#popupCart .d").animate({ scrollTop: 10000 }, 0); $("#ctl00_lbl_cartItems").html($("#popupCart-itemcount").html()); $("#ctl00_lbl_subTotal").html($("#popupCart-subtotal").html()) } }); $("#quickViewOverlay").fadeOut(500); $("#quickViewDialog").fadeOut(200); $("html, body").animate({ scrollTop: 0 }, 1000); $("#popupCart").show(500) } } }) } }); $(".button11").live("click", function() { if ($(this).hasClass("button11")) { var preFix = $(this).attr("id").replace("LinkButton5", ""); $.ajax({ url: "/ajax/addToCart.aspx", cache: false, data: { edpNo: $("#" + preFix + "h_edpno").val(), qty: $("#" + preFix + "lb_qty").val(), promotionTiedToItem: $("#" + preFix + "h_promotionTiedToItem").val() }, success: function() { $.ajax({ url: "/ajax/cart.aspx", cache: false, success: function(data) { $("#popupCart").html(""); $("#popupCart").html(data); $("#popupCart .d").animate({ scrollTop: 10000 }, 0); $("#ctl00_lbl_cartItems").html($("#popupCart-itemcount").html()); $("#ctl00_lbl_subTotal").html($("#popupCart-subtotal").html()) } }); if ($("#forwardToCart").val() == "1") { window.location.replace("/cart.aspx") } else { $("#quickViewOverlay").fadeOut(500); $("#quickViewDialog").fadeOut(200); $("html, body").animate({ scrollTop: 0 }, 1000); $("#popupCart").show(500) } } }) } }) }); function onQuickViewResize(stop) { if ($(window).height() > $("body").height()) { $("#quickViewOverlay").css("height", $(window).height() + "px") } else { $("#quickViewOverlay").css("height", $("body").height() + "px") } $("#quickViewOverlay").css("left", $(window).scrollLeft() + "px"); if (stop) { $("#quickViewDialog").stop(true, true) } if ($("#quickViewDialog").height() < $(window).height()) { $("#quickViewDialog").animate({ top: ($(window).height() / 2) - ($("#quickViewDialog").height() / 2) + $(window).scrollTop() + "px" }, 250) } else { $("#quickViewDialog").css("top", "0px") } if ($("#quickViewDialog").width() < $(window).width()) { $("#quickViewDialog").animate({ left: ($(window).width() / 2) - ($("#quickViewDialog").width() / 2) + $(window).scrollLeft() + "px" }, 250) } else { $("#quickViewDialog").css("left", "0px") } } var fieldError; $(document).ready(function() { fieldError = { create: function(id, orintaion, field, errorMessage) { var parent; switch (true) { case ($(field).is("input[type='checkbox']")): parent = $(field).parents(".checkBoxABC"); break; case ($(field).is("input[type='text']") || $(field).is("input[type='password']")): parent = $(field).parents(".fieldBox"); break; case ($(field).is("select")): parent = $(field).parents(".fieldBox"); break } if (parent.length > 0) { $(parent).append("<div id=\"" + id + "\" class=\"field-error " + orintaion + "\">" + errorMessage + "</div>"); switch (orintaion) { case "left": $("#" + id).css("left", -($("#" + id).outerWidth() + 2)); break; case "right": $("#" + id).css("left", $(parent).outerWidth() + 2); break; case "top-left": case "top-right": $("#" + id).css("top", -($("#" + id).outerHeight() - 10)); break; case "bottom-left": case "bottom-right": $("#" + id).css("top", ($(parent).outerHeight() - 10)); break } if (($("#" + id).offset()).left < 0) { $("#" + id).css("min-width", ($("#" + id).width() + ($("#" + id).offset()).left) - 2); $("#" + id).css("left", -($("#" + id).outerWidth() + 2)) } } }, remove: function(id) { $("#" + id).remove() }, removeAll: function() { $(".field-error").remove() } } }); var validation = { isValidEmailAddress: function(expression) { return RegExp(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/).test(expression) }, isNumeric: function(expression) { return RegExp(/^[0-9]*$/).test(expression) }, isValidUsZipCode: function(expression) { return RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/).test(expression) }, isValidCanadianPostalCode: function(expression) { return RegExp(/^([ABCEGHJKLMNPRSTVXY][0-9][A-Z] [0-9][A-Z][0-9])*$/).test(expression) }, isValidFirstOrLastName: function(expression) { return RegExp(/^([a-zA-Z\s\.,'-]+)$/).test(expression) }, iIsValidStreetAddress: function(expression) { return RegExp(/^([a-zA-Z0-9\s\.,'-]+)$/).test(expression) }, getCreditCardTypeByNumber: function(cardNumber) { var validator = RegExp(/^4[0-9]{12}(?:[0-9]{3})?$/); if (validator.test(cardNumber)) { return this.cardType.Visa } validator = RegExp(/^5[1-5][0-9]{14}$/); if (validator.test(cardNumber)) { return this.cardType.MasterCard } validator = RegExp(/^3[47][0-9]{13}$/); if (validator.test(cardNumber)) { return this.cardType.AmericanExpress } validator = RegExp(/^6(?:011|5[0-9]{2})[0-9]{12}$/); if (validator.test(cardNumber)) { return this.cardType.Discover } return this.cardType.Unknown }, isValidCreditCard: function(cardNumber, cardType) { switch (cardType) { case this.cardType.Visa: return RegExp(/^4[0-9]{12}(?:[0-9]{3})?$/).test(cardNumber); case this.cardType.MasterCard: return RegExp(/^5[1-5][0-9]{14}$/).test(cardNumber); case this.cardType.AmericanExpress: return RegExp(/^3[47][0-9]{13}$/).test(cardNumber); case this.cardType.Discover: return RegExp(/^6(?:011|5[0-9]{2})[0-9]{12}$/).test(cardNumber); case this.cardType.DinersClub: return RegExp(/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/).test(cardNumber); case this.cardType.JCB: return RegExp(/^(?:2131|1800|35\d{3})\d{11}$/).test(cardNumber); default: return false } }, cardType: { Visa: "VI", MasterCard: "MC", AmericanExpress: "AX", Discover: "DI", Unknown: "none"} };
