$(document).ready(function () { //autocomplete var a = $('#ctl00_ctlHeader1_txtSearch').autocomplete({ serviceUrl: '/autocompletehandler.ashx', minChars: 2, delimiter: /(,|;)\s*/, // regex or character maxHeight: 150, width: 200, zIndex: 9999, deferRequestBy: 50, //miliseconds noCache: false, //default is false, set to true to disable caching onSelect: function(value, data){ location.href='/Products/SearchResults.aspx?type=FULL&Keyword=' + encodeURI(data); } }); }); function fillcartsummary() { $.ajax({ type: "GET", url: "/HTMLScript/CartSummaryCallback.aspx", dataType: 'html', success: function (html) { $(".lnkcarthover").html(html); }, error: function () { $(".lnkcarthover").html('Shopping Cart'); }, complete: function () { } }); } function makeShow2() { $('.QuickCartViewer').html(''); $('.QuickCartViewer').show('fast'); $.ajax({ type: "GET", url: "/HTMLScript/DisplayQuickCartCallback.aspx", dataType: 'html', success: function (html) { $(".QuickCartViewer").html(html); }, error: function () { $(".QuickCartViewer").html('could not show cart'); }, complete: function () { } }); }; function makeHide2() { $('.QuickCartViewer').hide('fast'); // $('.QuickCartViewer').html(''); }; function showcart2() { $(".CartText").hoverIntent({ over: makeShow2, timeout: 200, out: makeHide2, timeout: 500 }); } function filllogininfo() { $.ajax({ type: "GET", url: "/HTMLScript/DisplayLoginCallback.aspx", dataType: 'html', success: function (html) { $(".lnkmyaccountinfo").html(html); }, error: function () { $(".lnkmyaccountinfo").html('Welcome'); }, complete: function () { } }); } function DoInvPopup() { $('a.clsInvDisplay').tooltip({ position: "top center" , effect: 'slide' , relative: 'true' , onShow: function () { var wrap = this.getTip().find("div.invContent"); if (wrap.is(":empty")) { wrap.load(this.getTrigger().attr("href")); } } }); } $(document).ready(function () { filllogininfo(); fillcartsummary(); showcart2(); $('a.fancyboxiframe').each(function () { var dWidth = parseInt($(this).attr('href').match(/width=[0-9]+/i)[0].replace('width=', '')); var dHeight = parseInt($(this).attr('href').match(/height=[0-9]+/i)[0].replace('height=', '')); $(this).fancybox({ 'width': dWidth, 'height': dHeight, 'autoScale': false, 'transitionIn': 'elastic', 'transitionOut': 'elastic', 'type': 'iframe' }); }); DoInvPopup(); });