var jnxtac={};(function(){function n(t,i,r,u){var f=document.createElement("script");f.type="text/javascript";f.src=t[i];r!=!0?i+1<t.length&&n(t,i+1,!1,null):i+1<t.length?typeof f.addEventListener=="function"?f.addEventListener("load",function(){n(t,i+1,r,u)},!1):f.onreadystatechange=function(){f.readyState in{loaded:1,complete:1}&&(f.onreadystatechange=null,n(t,i+1,r,u))}:typeof u=="function"&&(typeof f.addEventListener=="function"?f.addEventListener("load",function(){u()},!1):f.onreadystatechange=function(){f.readyState in{loaded:1,complete:1}&&(f.onreadystatechange=null,u())});document.getElementsByTagName("head")[0].appendChild(f)}var t=window.jnxtac_params||{};jnxtac=$;jnxtac(document).ready(function(){jnxtac(".searchBox").nxt_autocomplete({cid:"b688eccefd941380b97a5a17decd1e3f",api_params:t,charset:"ISO-8859-1"});jnxtac(".searchBox").nxt_autocomplete("option","footer","");jnxtac.ui.nxt_autocomplete.prototype._setPosition=function(){this.ac_main_container.position({my:"left top",at:"left bottom",of:this.element,offset:"0 0",collision:"none"})};jnxtac.ui.nxt_autocomplete.prototype._drawProduct=function(n){var t=n.Image,i=n.Price;return"https:"==document.location.protocol&&n.Image.substr(0,6)!="https:"&&(t="https:"+n.Image),t='<img height="50" width="50" src="'+t+'"/>',t+' <span class="nxt-item-txt">'+this._encapsulateMatches(n.Name)+"<\/span>"}})})(),function(n,t){var i,r;$.ui||(n=n||$,n.cleanData?(i=n.cleanData,n.cleanData=function(t){for(var r=0,u;(u=t[r])!=null;r++)try{n(u).triggerHandler("remove")}catch(f){}i(t)}):(r=n.fn.remove,n.fn.remove=function(t,i){return this.each(function(){return i||(!t||n.filter(t,[this]).length)&&n("*",this).add([this]).each(function(){try{n(this).triggerHandler("remove")}catch(t){}}),r.call(n(this),t,i)})}),n.widget=function(t,i,r){var u=t.split(".")[0],e,f;t=t.split(".")[1];e=u+"-"+t;r||(r=i,i=n.Widget);n.expr[":"][e]=function(i){return!!n.data(i,t)};n[u]=n[u]||{};n[u][t]=function(n,t){arguments.length&&this._createWidget(n,t)};f=new i;f.options=n.extend(!0,{},f.options);n[u][t].prototype=n.extend(!0,f,{namespace:u,widgetName:t,widgetEventPrefix:n[u][t].prototype.widgetEventPrefix||t,widgetBaseClass:e},r);n.widget.bridge(t,n[u][t])},n.widget.bridge=function(i,r){n.fn[i]=function(u){var f=typeof u=="string",e=Array.prototype.slice.call(arguments,1),o=this;return(u=!f&&e.length?n.extend.apply(null,[!0,u].concat(e)):u,f&&u.charAt(0)==="_")?o:(f?this.each(function(){var r=n.data(this,i),f=r&&n.isFunction(r[u])?r[u].apply(r,e):r;if(f!==r&&f!==t)return o=f,!1}):this.each(function(){var t=n.data(this,i);t?t.option(u||{})._init():n.data(this,i,new r(u,this))}),o)}},n.Widget=function(n,t){arguments.length&&this._createWidget(n,t)},n.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(t,i){n.data(i,this.widgetName,this);this.element=n(i);this.options=n.extend(!0,{},this.options,this._getCreateOptions(),t);var r=this;this.element.bind("remove."+this.widgetName,function(){r.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return n.metadata&&n.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(i,r){var u=i;if(arguments.length===0)return n.extend({},this.options);if(typeof i=="string"){if(r===t)return this.options[i];u={};u[i]=r}return this._setOptions(u),this},_setOptions:function(t){var i=this;return n.each(t,function(n,t){i._setOption(n,t)}),this},_setOption:function(n,t){return this.options[n]=t,n==="disabled"&&this.widget()[t?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",t),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(t,i,r){var e=this.options[t],u,f;if(i=n.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),r=r||{},i.originalEvent)for(u=n.event.props.length;u;)f=n.event.props[--u],i[f]=i.originalEvent[f];return this.element.trigger(i,r),!(n.isFunction(e)&&e.call(this.element[0],i,r)===!1||i.isDefaultPrevented())}})}(jnxtac),function(n){var i;n=n||$;i=n.curCSS||n.css;n.ui=n.ui||{};var r=/left|center|right/,u=/top|center|bottom/,t="center",f=n.fn.position,e=n.fn.offset;n.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=n.extend({},e);var s=n(e.of),v=s[0],a=(e.collision||"flip").split(" "),h=e.offset?e.offset.split(" "):[0,0],c,l,o;return v.nodeType===9?(c=s.width(),l=s.height(),o={top:0,left:0}):v.setTimeout?(c=s.width(),l=s.height(),o={top:s.scrollTop(),left:s.scrollLeft()}):v.preventDefault?(e.at="left top",c=l=0,o={top:e.of.pageY,left:e.of.pageX}):(c=s.outerWidth(),l=s.outerHeight(),o=s.offset()),n.each(["my","at"],function(){var n=(e[this]||"").split(" ");n.length===1&&(n=r.test(n[0])?n.concat([t]):u.test(n[0])?[t].concat(n):[t,t]);n[0]=r.test(n[0])?n[0]:t;n[1]=u.test(n[1])?n[1]:t;e[this]=n}),a.length===1&&(a[1]=a[0]),h[0]=parseInt(h[0],10)||0,h.length===1&&(h[1]=h[0]),h[1]=parseInt(h[1],10)||0,e.at[0]==="right"?o.left+=c:e.at[0]===t&&(o.left+=c/2),e.at[1]==="bottom"?o.top+=l:e.at[1]===t&&(o.top+=l/2),o.left+=h[0],o.top+=h[1],this.each(function(){var u=n(this),f=u.outerWidth(),s=u.outerHeight(),v=parseInt(i(this,"marginLeft",!0))||0,y=parseInt(i(this,"marginTop",!0))||0,w=f+v+(parseInt(i(this,"marginRight",!0))||0),b=s+y+(parseInt(i(this,"marginBottom",!0))||0),r=n.extend({},o),p;e.my[0]==="right"?r.left-=f:e.my[0]===t&&(r.left-=f/2);e.my[1]==="bottom"?r.top-=s:e.my[1]===t&&(r.top-=s/2);r.left=Math.round(r.left);r.top=Math.round(r.top);p={left:r.left-v,top:r.top-y};n.each(["left","top"],function(t,i){n.ui.position[a[t]]&&n.ui.position[a[t]][i](r,{targetWidth:c,targetHeight:l,elemWidth:f,elemHeight:s,collisionPosition:p,collisionWidth:w,collisionHeight:b,offset:h,my:e.my,at:e.at})});n.fn.bgiframe&&u.bgiframe();u.offset(n.extend(r,{using:e.using}))})};n.ui.position={fit:{left:function(t,i){var r=n(window),u=i.collisionPosition.left+i.collisionWidth-r.width()-r.scrollLeft();t.left=u>0?t.left-u:Math.max(t.left-i.collisionPosition.left,t.left)},top:function(t,i){var r=n(window),u=i.collisionPosition.top+i.collisionHeight-r.height()-r.scrollTop();t.top=u>0?t.top-u:Math.max(t.top-i.collisionPosition.top,t.top)}},flip:{left:function(i,r){if(r.at[0]!==t){var u=n(window),s=r.collisionPosition.left+r.collisionWidth-u.width()-u.scrollLeft(),f=r.my[0]==="left"?-r.elemWidth:r.my[0]==="right"?r.elemWidth:0,e=r.at[0]==="left"?r.targetWidth:-r.targetWidth,o=-2*r.offset[0];i.left+=r.collisionPosition.left<0?f+e+o:s>0?f+e+o:0}},top:function(i,r){if(r.at[1]!==t){var u=n(window),s=r.collisionPosition.top+r.collisionHeight-u.height()-u.scrollTop(),f=r.my[1]==="top"?-r.elemHeight:r.my[1]==="bottom"?r.elemHeight:0,e=r.at[1]==="top"?r.targetHeight:-r.targetHeight,o=-2*r.offset[1];i.top+=r.collisionPosition.top<0?f+e+o:s>0?f+e+o:0}}}};n.offset.setOffset||(n.offset.setOffset=function(t,r){/static/.test(i(t,"position"))&&(t.style.position="relative");var u=n(t),f=u.offset(),o=parseInt(i(t,"top",!0),10)||0,s=parseInt(i(t,"left",!0),10)||0,e={top:r.top-f.top+o,left:r.left-f.left+s};"using"in r?r.using.call(t,e):u.css(e)},n.fn.offset=function(t){var i=this[0];return!i||!i.ownerDocument?null:t?this.each(function(){n.offset.setOffset(this,t)}):e.call(this)})}(jnxtac),function(n){n=n||$;n.widget("ui.nxt_autocomplete",{options:{cid:"",minLength:1,delay:300,captureSearches:!1,charset:"",api_params:{},footer:'<div style="text-align:center;border-top:1px solid #ddd;"><a target="_blank" href="http://www.nextopia.com"><img border="0" src="//d2brc35ftammet.cloudfront.net/autocomplete/autocomplete-powered-by-nextopiav1.gif"><\/a><\/div>'},_create:function(){var t=this;this.lastSearch="";this.overContainer=!1;this.selectedItem=null;this.element.attr("autocomplete","off").bind("keydown.nxt_autocomplete",function(n){switch(n.which){case 38:n.preventDefault();t._move("up");break;case 40:n.preventDefault();t._move("down");break;case 16:case 17:case 18:break;case 9:case 13:if(t.selectedItem==null)return;n.preventDefault();t._select(n,t.selectedItem);break;case 27:t._close();break;default:clearTimeout(t.searching);t.searching=setTimeout(function(){t._search()},t.options.delay)}}).bind("blur.nxt_autocomplete",function(){t.overContainer==!1&&t._close()});this.ac_main_container=n('<div class="nxt-ac-main"><\/div>').appendTo("body",this.element[0].ownerDocument).css("z-index",this._getZIndex()+1).click(function(n){t._select(n,t.selectedItem);t.element.focus()}).hover(function(){t.overContainer=!0},function(){t.overContainer=!1}).on("mouseenter",".nxt-ac-item",function(){t._highlight(n(this))}).on("mouseleave",".nxt-ac-item",function(){t._highlight(null)});this.options.captureSearches===!0&&this._bindingToCaptureSearches();this._close()},_bindingToCaptureSearches:function(){var t=this;t.element.closest("form").bind("submit.nxt_autocomplete",function(i){var r=this;n(r).unbind("submit.nxt_autocomplete");i.preventDefault();t._logACUsage(-1,"",function(){r.submit()})})},_search:function(){var i=this,r=n.trim(this.element.val()),t;r.length<this.options.minLength||this.element.val()==this.lastSearch?this._close():(this.lastSearch=this.element.val(),t=this.options.api_params,t.q=this.element.val(),t.cid=this.options.cid,t.charset=this.options.charset,n.ajax({url:"//ac.nextopiasoftware.com/return_autocomplete_jsonp_v3.php",dataType:"jsonp",data:t,success:function(n){i._renderAutocomplete(n)}}))},_renderAutocomplete:function(t){var o=this,f,i,u,s,e,r;if(this._close(),n.isEmptyObject(t)==!1){f=0;for(i in t)if(t[i]!==undefined){if(i=="banner")r=n('<div class="nxt-ac-banner"><\/div>').append(t[i][0]);else{u=[];s=t[i].n;switch(i){case"products":e="nxt-ac-"+i+"-container";n.each(t[i].r,function(n,t){u[n]={data:t,content:o._drawProduct(t)}});break;default:e="nxt-ac-section-container nxt-ac-sub-"+i;n.each(t[i].r,function(n,t){u[n]={data:t,content:o._drawSection(i,t)}})}r=n('<div class="'+e+'"><\/div>').append('<div class="nxt-ac-header">'+s+"<\/div>");n.each(u,function(t,u){n('<div class="nxt-ac-item"><\/div>').data("nxt-autocomplete.item",u.data).data("nxt-autocomplete.type",i).data("nxt-autocomplete.item_num",f).append(u.content).appendTo(r);f++})}this.ac_main_container.append(r)}this.ac_main_container.append(this.options.footer).show();this._setPosition()}},_drawProduct:function(n){return"https:"==document.location.protocol&&n.Image.substr(0,6)!="https:"&&(n.Image="https:"+n.Image.substr(5)),'<img height="50" width="50" src="'+n.Image+'"/> <span class="nxt-item-txt">'+this._encapsulateMatches(n.Name)+"<\/span>"},_determineSectionType:function(n,t){return typeof t=="string"?"simple":t.html!=undefined?"html":"normal"},_drawSection:function(n,t){switch(this._determineSectionType(n,t)){case"simple":return this._drawSimpleSection(n,t);case"html":return this._drawHTMLSection(n,t);case"normal":return this._drawNormalSection(n,t)}},_drawSimpleSection:function(n,t){return'<span class="nxt-item-txt">'+this._encapsulateMatches(t)+"<\/span>"},_drawHTMLSection:function(n,t){return t.html},_drawNormalSection:function(n,t){var i="";return t.image!=undefined&&("https:"==document.location.protocol&&t.image.substr(0,6)!="https:"&&(t.image="https:"+t.image.substr(5)),i+='<img src="'+t.image+'"/> '),i+'<span class="nxt-item-txt">'+this._encapsulateMatches(t.matched)+"<\/span>"},_encapsulateMatches:function(n){for(var i=this.element.val().replace(/^\s*/,"").replace(/\s*$/,"").split(" "),r=i.length,t=0;t<r;t++)n=n.replace(new RegExp("(^|\\b)("+i[t].replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")","gi"),String.fromCharCode(9677)+"$1$2"+String.fromCharCode(9678));return n.replace(new RegExp(String.fromCharCode(9677),"g"),"<b>").replace(new RegExp(String.fromCharCode(9678),"g"),"<\/b>")},_move:function(n){var i=null,r=this.ac_main_container.children("div").children(".nxt-ac-item"),t=null;this.selectedItem!=null&&(t=this.selectedItem.data("nxt-autocomplete.item_num"));switch(n){case"up":i=t==null||t==0?r.length-1:t-1;break;case"down":i=t==null||t==r.length-1?0:t+1}this._highlight(r.eq(i))},_highlight:function(n){this.selectedItem!=null&&(this.selectedItem.removeClass("nxt-ac-selected"),this.selectedItem=null);n!=null&&(n.addClass("nxt-ac-selected"),this.selectedItem=n)},_select:function(n,t){var i,r,u;t!=null&&(i=this,t.data("nxt-autocomplete.type")=="products"?this._logACUsage(1,t.data("nxt-autocomplete.item").Sku,function(){i._handleProductSelect(n,t)}):(r=t.data("nxt-autocomplete.type")=="terms"?0:"1"+t.data("nxt-autocomplete.type").toString().substr(1),u=this._determineSectionType(t.data("nxt-autocomplete.type"),t.data("nxt-autocomplete.item"))=="simple"?t.data("nxt-autocomplete.item"):t.data("nxt-autocomplete.item").matched,this._logACUsage(r,u,function(){i._handleSectionSelect(n,t)})))},_handleProductSelect:function(n,t){var i=t.data("nxt-autocomplete.item");i.Url!=undefined&&i.Url!=""?window.location=i.Url:this.element.val(i.Name)},_handleSectionSelect:function(t,i){var u,f,r;if(t.type=="click"&&(u=n(t.target).closest("a",i),u.length>0&&u.attr("href")!=undefined))return!0;f=i.data("nxt-autocomplete.type");r=i.data("nxt-autocomplete.item");this._determineSectionType(f,r)=="simple"?this._submitForm(r):r.url!=undefined?window.location=r.url:this._submitForm(r.matched)},_submitForm:function(n){this.element.val(n).closest("form").unbind("submit.nxt_autocomplete").submit()},_close:function(){this.selectedItem=null;clearTimeout(self.searching);this.ac_main_container.hide();this.ac_main_container.empty()},_logACUsage:function(t,i,r){n.ajax({url:("https:"==document.location.protocol?"https://":"http://")+"analytics.nextopia.net/acl.php?r="+Math.floor(Math.random()*200)+"&v="+escape(this.element.val())+"&w="+escape(i)+"&x="+escape(t)+"&y="+escape(this.options.cid),dataType:"jsonp",timeout:300}).always(function(){n.isFunction(r)&&r()})},_setPosition:function(){this.ac_main_container.position({my:"left top",at:"left bottom",of:this.element,offset:"0 0",collision:"none"})},_getZIndex:function(){var t=parseInt(n(this.element).css("z-index"));return isNaN(t)&&(t=0),t}})}(jnxtac),function(n){n=n||$;var i=n.curCSS||n.css,r=/left|center|right/,u=/top|center|bottom/,t="center",f=n.fn.position,e=n.fn.offset;n.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=n.extend({},e);var s=n(e.of),v=s[0],a=(e.collision||"flip").split(" "),h=e.offset?e.offset.split(" "):[0,0],c,l,o;return v.nodeType===9?(c=s.width(),l=s.height(),o={top:0,left:0}):v.setTimeout?(c=s.width(),l=s.height(),o={top:s.scrollTop(),left:s.scrollLeft()}):v.preventDefault?(e.at="left top",c=l=0,o={top:e.of.pageY,left:e.of.pageX}):(c=s.outerWidth(),l=s.outerHeight(),o=s.offset()),n.each(["my","at"],function(){var n=(e[this]||"").split(" ");n.length===1&&(n=r.test(n[0])?n.concat([t]):u.test(n[0])?[t].concat(n):[t,t]);n[0]=r.test(n[0])?n[0]:t;n[1]=u.test(n[1])?n[1]:t;e[this]=n}),a.length===1&&(a[1]=a[0]),h[0]=parseInt(h[0],10)||0,h.length===1&&(h[1]=h[0]),h[1]=parseInt(h[1],10)||0,e.at[0]==="right"?o.left+=c:e.at[0]===t&&(o.left+=c/2),e.at[1]==="bottom"?o.top+=l:e.at[1]===t&&(o.top+=l/2),o.left+=h[0],o.top+=h[1],this.each(function(){var u=n(this),f=u.outerWidth(),s=u.outerHeight(),v=parseInt(i(this,"marginLeft",!0))||0,y=parseInt(i(this,"marginTop",!0))||0,w=f+v+(parseInt(i(this,"marginRight",!0))||0),b=s+y+(parseInt(i(this,"marginBottom",!0))||0),r=n.extend({},o),p;e.my[0]==="right"?r.left-=f:e.my[0]===t&&(r.left-=f/2);e.my[1]==="bottom"?r.top-=s:e.my[1]===t&&(r.top-=s/2);r.left=Math.round(r.left);r.top=Math.round(r.top);p={left:r.left-v,top:r.top-y};n.each(["left","top"],function(t,i){n.ui.position[a[t]]&&n.ui.position[a[t]][i](r,{targetWidth:c,targetHeight:l,elemWidth:f,elemHeight:s,collisionPosition:p,collisionWidth:w,collisionHeight:b,offset:h,my:e.my,at:e.at})});n.fn.bgiframe&&u.bgiframe();u.offset(n.extend(r,{using:e.using}))})};n.ui.position={fit:{left:function(t,i){var r=n(window),u=i.collisionPosition.left+i.collisionWidth-r.width()-r.scrollLeft();t.left=u>0?t.left-u:Math.max(t.left-i.collisionPosition.left,t.left)},top:function(t,i){var r=n(window),u=i.collisionPosition.top+i.collisionHeight-r.height()-r.scrollTop();t.top=u>0?t.top-u:Math.max(t.top-i.collisionPosition.top,t.top)}},flip:{left:function(i,r){if(r.at[0]!==t){var u=n(window),s=r.collisionPosition.left+r.collisionWidth-u.width()-u.scrollLeft(),f=r.my[0]==="left"?-r.elemWidth:r.my[0]==="right"?r.elemWidth:0,e=r.at[0]==="left"?r.targetWidth:-r.targetWidth,o=-2*r.offset[0];i.left+=r.collisionPosition.left<0?f+e+o:s>0?f+e+o:0}},top:function(i,r){if(r.at[1]!==t){var u=n(window),s=r.collisionPosition.top+r.collisionHeight-u.height()-u.scrollTop(),f=r.my[1]==="top"?-r.elemHeight:r.my[1]==="bottom"?r.elemHeight:0,e=r.at[1]==="top"?r.targetHeight:-r.targetHeight,o=-2*r.offset[1];i.top+=r.collisionPosition.top<0?f+e+o:s>0?f+e+o:0}}}};n.offset.setOffset||(n.offset.setOffset=function(t,r){/static/.test(i(t,"position"))&&(t.style.position="relative");var u=n(t),f=u.offset(),o=parseInt(i(t,"top",!0),10)||0,s=parseInt(i(t,"left",!0),10)||0,e={top:r.top-f.top+o,left:r.left-f.left+s};"using"in r?r.using.call(t,e):u.css(e)},n.fn.offset=function(t){var i=this[0];return!i||!i.ownerDocument?null:t?this.each(function(){n.offset.setOffset(this,t)}):e.call(this)})}(jnxtac),function(n){n=n||$;n.widget("ui.nxt_autocomplete",{options:{cid:"",minLength:1,delay:300,captureSearches:!1,charset:"",api_params:{},footer:'<div style="text-align:center;border-top:1px solid #ddd;"><a target="_blank" href="http://www.nextopia.com"><img border="0" src="//d2brc35ftammet.cloudfront.net/autocomplete/autocomplete-powered-by-nextopiav1.gif"><\/a><\/div>'},_create:function(){var t=this;this.lastSearch="";this.overContainer=!1;this.selectedItem=null;this.element.attr("autocomplete","off").bind("keydown.nxt_autocomplete",function(n){switch(n.which){case 38:n.preventDefault();t._move("up");break;case 40:n.preventDefault();t._move("down");break;case 16:case 17:case 18:break;case 9:case 13:if(t.selectedItem==null)return;n.preventDefault();t._select(n,t.selectedItem);break;case 27:t._close();break;default:clearTimeout(t.searching);t.searching=setTimeout(function(){t._search()},t.options.delay)}}).bind("blur.nxt_autocomplete",function(){t.overContainer==!1&&t._close()});this.ac_main_container=n('<div class="nxt-ac-main"><\/div>').appendTo("body",this.element[0].ownerDocument).css("z-index",this._getZIndex()+1).click(function(n){t._select(n,t.selectedItem);t.element.focus()}).hover(function(){t.overContainer=!0},function(){t.overContainer=!1}).on("mouseenter",".nxt-ac-item",function(){t._highlight(n(this))}).on("mouseleave",".nxt-ac-item",function(){t._highlight(null)});this.options.captureSearches===!0&&this._bindingToCaptureSearches();this._close()},_bindingToCaptureSearches:function(){var t=this;t.element.closest("form").bind("submit.nxt_autocomplete",function(i){var r=this;n(r).unbind("submit.nxt_autocomplete");i.preventDefault();t._logACUsage(-1,"",function(){r.submit()})})},_search:function(){var i=this,r=n.trim(this.element.val()),t;r.length<this.options.minLength||this.element.val()==this.lastSearch?this._close():(this.lastSearch=this.element.val(),t=this.options.api_params,t.q=this.element.val(),t.cid=this.options.cid,t.charset=this.options.charset,n.ajax({url:"//ac.nextopiasoftware.com/return_autocomplete_jsonp_v3.php",dataType:"jsonp",data:t,success:function(n){i._renderAutocomplete(n)}}))},_renderAutocomplete:function(t){var o=this,f,i,u,s,e,r;if(this._close(),n.isEmptyObject(t)==!1){f=0;for(i in t)if(t[i]!==undefined){if(i=="banner")r=n('<div class="nxt-ac-banner"><\/div>').append(t[i][0]);else{u=[];s=t[i].n;switch(i){case"products":e="nxt-ac-"+i+"-container";n.each(t[i].r,function(n,t){u[n]={data:t,content:o._drawProduct(t)}});break;default:e="nxt-ac-section-container nxt-ac-sub-"+i;n.each(t[i].r,function(n,t){u[n]={data:t,content:o._drawSection(i,t)}})}r=n('<div class="'+e+'"><\/div>').append('<div class="nxt-ac-header">'+s+"<\/div>");n.each(u,function(t,u){n('<div class="nxt-ac-item"><\/div>').data("nxt-autocomplete.item",u.data).data("nxt-autocomplete.type",i).data("nxt-autocomplete.item_num",f).append(u.content).appendTo(r);f++})}this.ac_main_container.append(r)}this.ac_main_container.append(this.options.footer).show();this._setPosition()}},_drawProduct:function(n){return"https:"==document.location.protocol&&n.Image.substr(0,6)!="https:"&&(n.Image="https:"+n.Image.substr(5)),'<img height="50" width="50" src="'+n.Image+'"/> <span class="nxt-item-txt">'+this._encapsulateMatches(n.Name)+"<\/span>"},_determineSectionType:function(n,t){return typeof t=="string"?"simple":t.html!=undefined?"html":"normal"},_drawSection:function(n,t){switch(this._determineSectionType(n,t)){case"simple":return this._drawSimpleSection(n,t);case"html":return this._drawHTMLSection(n,t);case"normal":return this._drawNormalSection(n,t)}},_drawSimpleSection:function(n,t){return'<span class="nxt-item-txt">'+this._encapsulateMatches(t)+"<\/span>"},_drawHTMLSection:function(n,t){return t.html},_drawNormalSection:function(n,t){var i="";return t.image!=undefined&&("https:"==document.location.protocol&&t.image.substr(0,6)!="https:"&&(t.image="https:"+t.image.substr(5)),i+='<img src="'+t.image+'"/> '),i+'<span class="nxt-item-txt">'+this._encapsulateMatches(t.matched)+"<\/span>"},_encapsulateMatches:function(n){for(var i=this.element.val().replace(/^\s*/,"").replace(/\s*$/,"").split(" "),r=i.length,t=0;t<r;t++)n=n.replace(new RegExp("(^|\\b)("+i[t].replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")","gi"),String.fromCharCode(9677)+"$1$2"+String.fromCharCode(9678));return n.replace(new RegExp(String.fromCharCode(9677),"g"),"<b>").replace(new RegExp(String.fromCharCode(9678),"g"),"<\/b>")},_move:function(n){var i=null,r=this.ac_main_container.children("div").children(".nxt-ac-item"),t=null;this.selectedItem!=null&&(t=this.selectedItem.data("nxt-autocomplete.item_num"));switch(n){case"up":i=t==null||t==0?r.length-1:t-1;break;case"down":i=t==null||t==r.length-1?0:t+1}this._highlight(r.eq(i))},_highlight:function(n){this.selectedItem!=null&&(this.selectedItem.removeClass("nxt-ac-selected"),this.selectedItem=null);n!=null&&(n.addClass("nxt-ac-selected"),this.selectedItem=n)},_select:function(n,t){var i,r,u;t!=null&&(i=this,t.data("nxt-autocomplete.type")=="products"?this._logACUsage(1,t.data("nxt-autocomplete.item").Sku,function(){i._handleProductSelect(n,t)}):(r=t.data("nxt-autocomplete.type")=="terms"?0:"1"+t.data("nxt-autocomplete.type").toString().substr(1),u=this._determineSectionType(t.data("nxt-autocomplete.type"),t.data("nxt-autocomplete.item"))=="simple"?t.data("nxt-autocomplete.item"):t.data("nxt-autocomplete.item").matched,this._logACUsage(r,u,function(){i._handleSectionSelect(n,t)})))},_handleProductSelect:function(n,t){var i=t.data("nxt-autocomplete.item");i.Url!=undefined&&i.Url!=""?window.location=i.Url:this.element.val(i.Name)},_handleSectionSelect:function(t,i){var u,f,r;if(t.type=="click"&&(u=n(t.target).closest("a",i),u.length>0&&u.attr("href")!=undefined))return!0;f=i.data("nxt-autocomplete.type");r=i.data("nxt-autocomplete.item");this._determineSectionType(f,r)=="simple"?this._submitForm(r):r.url!=undefined?window.location=r.url:this._submitForm(r.matched)},_submitForm:function(n){this.element.val(n).closest("form").unbind("submit.nxt_autocomplete").submit()},_close:function(){this.selectedItem=null;clearTimeout(self.searching);this.ac_main_container.hide();this.ac_main_container.empty()},_logACUsage:function(t,i,r){n.ajax({url:("https:"==document.location.protocol?"https://":"http://")+"analytics.nextopia.net/acl.php?r="+Math.floor(Math.random()*200)+"&v="+escape(this.element.val())+"&w="+escape(i)+"&x="+escape(t)+"&y="+escape(this.options.cid),dataType:"jsonp",timeout:300}).always(function(){n.isFunction(r)&&r()})},_setPosition:function(){this.ac_main_container.position({my:"left top",at:"left bottom",of:this.element,offset:"0 0",collision:"none"})},_getZIndex:function(){var t=parseInt(n(this.element).css("z-index"));return isNaN(t)&&(t=0),t}})}(jnxtac);jnxtac={},function(){function n(t,i,r,u){var f=document.createElement("script");f.type="text/javascript";f.src=t[i];r!=!0?i+1<t.length&&n(t,i+1,!1,null):i+1<t.length?typeof f.addEventListener=="function"?f.addEventListener("load",function(){n(t,i+1,r,u)},!1):f.onreadystatechange=function(){f.readyState in{loaded:1,complete:1}&&(f.onreadystatechange=null,n(t,i+1,r,u))}:typeof u=="function"&&(typeof f.addEventListener=="function"?f.addEventListener("load",function(){u()},!1):f.onreadystatechange=function(){f.readyState in{loaded:1,complete:1}&&(f.onreadystatechange=null,u())});document.getElementsByTagName("head")[0].appendChild(f)}var t=window.jnxtac_params||{};jnxtac=$;jnxtac(document).ready(function(){jnxtac(".searchBox").nxt_autocomplete({cid:"b688eccefd941380b97a5a17decd1e3f",api_params:t,charset:"ISO-8859-1"});jnxtac(".searchBox").nxt_autocomplete("option","footer","");jnxtac.ui.nxt_autocomplete.prototype._setPosition=function(){this.ac_main_container.position({my:"left top",at:"left bottom",of:this.element,offset:"0 0",collision:"none"})};jnxtac.ui.nxt_autocomplete.prototype._drawProduct=function(n){var t=n.Image,i=n.Price;return"https:"==document.location.protocol&&n.Image.substr(0,6)!="https:"&&(t="https:"+n.Image),t='<img height="50" width="50" src="'+t+'"/>',t+' <span class="nxt-item-txt">'+this._encapsulateMatches(n.Name)+"<\/span>"}})}()