function searchSite(domain, type) { if (type == "cosmetics" || type == "giftbaskets") { type = 't=' + type & '&'; } else { type = ''; } var q = $("#q").val(); var q2 = $("#q").val(); if (q != 'Search by Keyword' && q != '') { q = q.replace(/ /g, "_"); q = q.replace(/"/g, ''); q = escape(q); window.location.href = domain + "/search/" + q + "/?" + type + "q=" + q2; } }
function showPopBox(pop, id) { $(id).toggle(); $(pop).toggleClass("menu-open"); }
function hidePopBox(pop, id) { $(pop).removeClass("menu-open"); $(id).hide(); }
function preparePopBox(a, b, c) { $(a).click(function(e) { e.preventDefault(); showPopBox(a, c); }); $(c).mouseup(function() { return false }); $(document).mouseup(function(e) { if ($(e.target).parent(b).length == 0) { hidePopBox(a, c); } }); }
$(document).ready(function() { preparePopBox(".popboxbutton", "a.popboxbutton", "fieldset#curr_menu"); preparePopBox(".popboxbutton2", "a.popboxbutton2", "fieldset#del_menu"); }); $(".CountryLine>a").live("click", function() { var text = $(this).attr("text"); if (text != "") { try { trackEvent('HeaderClick', 'DeliveryCountry', text, 0); } catch (e) { } } }); $("#dnn_HeaderItems_lCur a").live("click", function() { var text = $(this).closest("a").attr("text"); if (text != "") { try { trackEvent('HeaderClick', 'DisplayCurrency', text, 0); } catch (e) { } } }); $(".menuLink").live("click", function() {
    var text = $(this).attr("text"); var sub = ""; try { sub = ($(this).parent().parent().parent().children(":first").attr("text")); } catch (e) { }
    if (sub != "" || text != "") { try { trackEvent('MenuClick', sub, text, 0); } catch (e) { } } 
}); $(".todayA").live("click", function() {
    var text = $(this).attr("href"); var promocode = ""; try { promocode = text.substring(10 + text.indexOf("PromoCode"), 999); } catch (e) { }
    if (promocode != "") { try { trackEvent('MenuClick', 'Todays Specials', promocode, 0); } catch (e) { } } 
});
