function DisplayFilterSearchBoxValue(){$(".npacc-filter-search").each(function(){WebStorageFilter(null,$(this).attr("id"),!1)})}function SlideUpDown(n,t){$("#"+n).is(":visible")?($("#"+n).slideUp("slow"),$("#"+t).attr("class","arrow rotate")):($("#"+n).slideDown("slow"),$("#"+t).attr("class","arrow"))}function AjaxCall(n,t,i){$("#npacc-ajax-loading").show();$.ajax({url:n,type:"POST",cache:!1,async:!0,beforeSend:function(){return localCache.exist(n)?(oldDataReplaceWithNew(localCache.get(n)),!1):!0},complete:function(){$.getScript(location.protocol+"//"+location.host+"/Plugins/SevenSpikes.Nop.Plugins.QuickView/Scripts/QuickView.min.js",function(){});$(document).keyup(function(n){n.keyCode==27&&$(".k-overlay").css("display","none")});$(".k-window-actions").click(function(){var n=$(".quickViewWindow").data("kendoWindow");void 0!=n&&""!=n.content()&&n.close();setTimeout(function(){$(".k-overlay").remove()},10)});$.getScript(location.protocol+"//"+location.host+"/Plugins/SevenSpikes.Nop.Plugins.AjaxCart/Scripts/AjaxCart.min.js",function(){});$.getScript(location.protocol+"//"+location.host+"/Plugins/SevenSpikes.Nop.Plugins.SalesCampaigns/Scripts/SaleCampaigns.min.js",function(){});$.getScript(location.protocol+"//"+location.host+"/Plugins/SevenSpikes.Nop.Plugins.ProductRibbons/Scripts/ProductRibbons.min.js",function(){})},success:function(r){localCache.timeout=t!=undefined?t:6e5;localCache.set(n,r,oldDataReplaceWithNew);typeof i=="function"&&i.call(this,n)}})}function ribbon(){!function(n,t){function f(){var o=".product-ribbon",n=sevenSpikes.getAttrValFromDom(i,"data-productPagePicturesParentContainerSelector"),s=[],r={},f=sevenSpikes.getAttrValFromDom(i,"data-productId"),e;return f&&f>0&&n&&(e=t(n).find(o),e&&0!==e.length||(r.productId=f,r.productElement=t(n))),t(u).each(function(){var i=t(this).find(o),n,r;i&&0!==i.length||(n=t(this).attr("data-productid"),n&&n>0&&(r={productId:n,productElement:t(this)},s.push(r)))}),{productPage:r,categoryPageProducts:s}}function e(n,t){var i,u;if(t&&t.productPage&&t.productPage.productId&&r(n,t.productPage,!0),t&&t.categoryPageProducts&&t.categoryPageProducts.length>0)for(i=0;i<t.categoryPageProducts.length;i++)u=t.categoryPageProducts[i],r(n,u)}function r(n,r,u){var f="",e,o,h;if(r.productElement){if(u){if(f=sevenSpikes.getAttrValFromDom(i,"data-productPageBugPictureContainerSelector"),!f)return}else if(f=sevenSpikes.getAttrValFromDom(i,"data-productBoxPictureContainerSelector"),!f)return;e=r.productElement.find(f);e&&r.productId&&r.productId>0&&(h=r.productId,o=u?t(n).filter("div[data-productId='"+h+"']"):t(n).filter("a[data-productId='"+h+"']"),o&&o.length>0&&(t(e).wrap('<div class="'+s+'"><\/div>'),t(e).after(o)))}}function o(){return sevenSpikes.getAttrValFromDom("#product-ribbon-info","data-retrieveproductribbonsurl")}var s="ribbon-wrapper",i="#product-ribbon-info",u=sevenSpikes.getAttrValFromDom(i,"data-productBoxSelector");u&&(n.showRibbons=function(){var i=0,u=[],n=f(),r,s,h,c;if(n&&n.productPage&&n.productPage.productId&&(i=n.productPage.productId),n&&n.categoryPageProducts&&n.categoryPageProducts.length>0)for(r=0;r<n.categoryPageProducts.length;r++)s=n.categoryPageProducts[r],s.hasOwnProperty("productId")&&u.push(s.productId);(i||0!==u.length)&&(t.isNumeric(i)||(i=0),h={productPageId:i,categoryPageIds:u},c=o(),t.ajax({type:"POST",data:t.toJSON(h),contentType:"application/json; charset=utf-8",url:c}).done(function(i){i&&(e(i,n),t.event.trigger({type:"nopProductRibbonsLoadingCompleteEvent"}))}))},n.showRibbons())}(window.nopProductRibbons=window.nopProductRibbons||{},jQuery);$(document).on("nopAjaxFiltersFiltrationCompleteEvent",nopProductRibbons.showRibbons)}function oldDataReplaceWithNew(n){$("#npacc-catalog").replaceWith(n);$("#npacc-ajax-loading").hide();$(".pager").find("li").text()==""&&$("#product-grid").length>0&&$("#product-grid").jscroll.destroy();var t=$("input:checked").length;t>0&&$("#npacc-clearAll").attr("style","display:block;");DisplayFilterSearchBoxValue();$("img.lazy").show().lazyload({effect:"fadeIn"});typeof keepPriceRangeAfterRefresh!="undefined"&&keepPriceRangeAfterRefresh();$(window).trigger("scroll");ScrollToTop()}function prepareSpecificationFilterTags(n){var t="",i;$("ul#tagsList").html(t);n&&(i=n.split("?")[1],i=i.split("&"),i.forEach(function(n){var i=n.replace(new RegExp("%3a","g"),":").replace(new RegExp("%2c","g"),",").replace(new RegExp("%7c","g"),"|").replace(new RegExp("%3A","g"),":").replace(new RegExp("%2C","g"),",").replace(new RegExp("%7C","g"),"|").replace(new RegExp("%21","g"),"!"),f=i.indexOf("specs=")>=0,u,r;f?(i=i.replace("specs=",""),u=i.split("||"),u.forEach(function(n){var r,i,u,f;n&&(r=n,i="",n=replaceAllString(n,"+"," ").replace("pa_","").replace("f_","").replace("%3A",":").split(":"),n[1].indexOf("!!")>0&&(n[1]=new String(n[1]),u=n[1].indexOf("!!"),f=n[1].substring(0,u),n.splice(1,0,f)),t+='<li><input type="hidden" value="'+r+'" class="filterPair" /><span class="tag" title="Remove This Filter"><span>'+decodeURIComponent(n[0])+"<\/span> : ",n[1].indexOf("%23")>=0?(i=n[1].split("%23"),t+='<span class="sSpecification">'+decodeURIComponent(i[0])+'<\/span><span class="remove">x<\/span><\/span><\/li>'):t+='<span class="sSpecification">'+decodeURIComponent(n[1])+'<\/span><span class="remove">x<\/span><\/span><\/li>')})):i.indexOf("stock=exclude_out_of_stock_products")>=0?(r="Exclude Out Of Stock",t+='<li><span class="tag" title="Remove This Filter"><span>Availability<\/span> : ',t+='<span class="sStock">'+r+'<\/span><span class="remove">x<\/span><\/span><\/li>'):i.indexOf("stock=include_out_of_stock_products")>=0?(r="Include Out Of Stock",t+='<li><span class="tag" title="Remove This Filter"><span>Availability<\/span> : ',t+='<span class="sStock">'+r+'<\/span><span class="remove">x<\/span><\/span><\/li>'):i.indexOf("price=")>=0?(i=i.replace("price=",""),r=i,t+='<li><span class="tag" title="Remove This Filter"><span>Price<\/span> : ',t+='<span class="sPrice">'+r+'<\/span><span class="remove">x<\/span><\/span><\/li>'):i.indexOf("rating=")>=0?(i=i.replace("rating=",""),r=i,t+='<li><span class="tag" title="Remove This Filter"><span>Rating<\/span> : ',t+='<span class="sRating">'+r+'<\/span><span class="remove">x<\/span><\/span><\/li>'):i.indexOf("term=")>=0&&(i=i.replace("term=",""),r=i,t+='<li><span class="tag" title="Remove This Filter"><span>Search<\/span> : ',t+='<span class="sSearch">'+r+'<\/span><span class="remove">x<\/span><\/span><\/li>')}),$("ul#tagsList").append(t))}function replaceAllString(n,t,i){return n.replace(new RegExp(escapeRegExp(t),"g"),i)}function escapeRegExp(n){return n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function ClearWebStorageFilter(){typeof Storage!="undefined"&&sessionStorage.clear()}function WebStorageFilter(n,t,i){var r="sessionStorageId-"+t;i?typeof Storage!="undefined"&&(sessionStorage[r]!=="undefined"&&sessionStorage[r]!==""?sessionStorage[r]=n:(sessionStorage[r]="",sessionStorage[r]=n)):typeof Storage!="undefined"&&sessionStorage[r]!=="undefined"&&sessionStorage[r]!==""&&($("#"+t).val(sessionStorage[r]),SearchFilter(sessionStorage[r],t))}function SearchFilter(n,t){$("#"+t+"-item li").each(function(){var t=$(this).find("span").attr("original"),i=new RegExp(n,"i");i.test(t)?($(this).show(),$oldcontent=$(this).find("span").attr("original"),$(this).find("span").html($oldcontent.replace(i.exec(t),'<em class="matched">'+i.exec(t)+"<\/em>"))):$(this).hide()})}function removeParameter(n,t){var u=n.split("?"),r;if(u.length>=2){var f=u.shift(),e=u.join("?"),o=encodeURIComponent(t)+"=",i=e.split(/[&;]/g);for(r=i.length;r-->0;)i[r].lastIndexOf(o,0)!==-1&&i.splice(r,1);n=f+"?"+i.join("&")}return n}function UpdateQueryString(n,t,i){var r,f,u;return i||(i=window.location.href),r=new RegExp("([?|&])"+n+"=.*?(&|#|$)(.*)","gi"),r.test(i)?typeof t!="undefined"&&t!==null?i.replace(r,"$1"+n+"="+t+"$2$3"):i.replace(r,"$1$3").replace(/(&|\?)$/,""):typeof t!="undefined"&&t!==null?(f=i.indexOf("?")!==-1?"&":"?",u=i.split("#"),i=u[0]+f+n+"="+t,u[1]&&(i+="#"+u[1]),i):i}function npAccFiltersPushStateUrl(n){return manualStateChange=!1,History.pushState({loadUrl:n,rand:Math.random()},document.title,n),!1}function npAccFiltersPushStateUrl(n){return manualStateChange=!1,History.pushState({loadUrl:n,rand:Math.random()},document.title,n),!1}$(document).on("keyup",".npacc-filter-search",function(){SearchFilter($(this).val(),$(this).attr("id"));WebStorageFilter($(this).val(),$(this).attr("id"),!0)});$(document).ready(function(){ClearWebStorageFilter();$("img.lazy").show().lazyload({effect:"fadeIn"});$(".k-window-actions").click(function(){var n=$(".quickViewWindow").data("kendoWindow");void 0!=n&&""!=n.content()&&n.close();setTimeout(function(){$(".k-overlay").remove()},10)})});$("#npacc-clearAll").click(function(){ClearWebStorageFilter()});var localCache={timeout:6e5,data:{},remove:function(n){delete localCache.data[n]},exist:function(n){return!!localCache.data[n]&&(new Date).getTime()-localCache.data[n]._<localCache.timeout},get:function(n){return console.log("Getting in cache url-"+n),localCache.data[n].data},set:function(n,t,i){localCache.remove(n);localCache.data[n]={_:(new Date).getTime(),data:t};$.isFunction(i)&&i(t)}};$(function(){History.Adapter.bind(window,"statechange",function(){var n=History.getState(),t=n.data.loadUrl=="undefined"?n.data.loadUrl:n.url;return typeof manualStateChange!="undefined"&&manualStateChange==!0?AjaxCall(t):typeof n.data.loadUrl=="undefined"&&AjaxCall(t),manualStateChange=!0,!1})}),function(n,t){"use strict";var i=n.History=n.History||{},r=n.jQuery;if(typeof i.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");i.Adapter={bind:function(n,t,i){r(n).bind(t,i)},trigger:function(n,t,i){r(n).trigger(t,i)},extractEventData:function(n,i,r){return i&&i.originalEvent&&i.originalEvent[n]||r&&r[n]||t},onDomLoad:function(n){r(n)}};typeof i.init!="undefined"&&i.init()}(window),function(n,t){"use strict";var e=n.console||t,r=n.document,o=n.navigator,f=!1,h=n.setTimeout,c=n.clearTimeout,l=n.setInterval,a=n.clearInterval,u=n.JSON,v=n.alert,i=n.History=n.History||{},s=n.history;try{f=n.sessionStorage;f.setItem("TEST","1");f.removeItem("TEST")}catch(y){f=!1}if(u.stringify=u.stringify||u.encode,u.parse=u.parse||u.decode,typeof i.init!="undefined")throw new Error("History.js Core has already been loaded...");i.init=function(){return typeof i.Adapter=="undefined"?!1:(typeof i.initCore!="undefined"&&i.initCore(),typeof i.initHtml4!="undefined"&&i.initHtml4(),!0)};i.initCore=function(){if(typeof i.initCore.initialized!="undefined")return!1;if(i.initCore.initialized=!0,i.options=i.options||{},i.options.hashChangeInterval=i.options.hashChangeInterval||100,i.options.safariPollInterval=i.options.safariPollInterval||500,i.options.doubleCheckInterval=i.options.doubleCheckInterval||500,i.options.disableSuid=i.options.disableSuid||!1,i.options.storeInterval=i.options.storeInterval||1e3,i.options.busyDelay=i.options.busyDelay||250,i.options.debug=i.options.debug||!1,i.options.initialTitle=i.options.initialTitle||r.title,i.options.html4Mode=i.options.html4Mode||!1,i.options.delayInit=i.options.delayInit||!1,i.intervalList=[],i.clearAllIntervals=function(){var n,t=i.intervalList;if(typeof t!="undefined"&&t!==null){for(n=0;n<t.length;n++)a(t[n]);i.intervalList=null}},i.debug=function(){(i.options.debug||!1)&&i.log.apply(i,arguments)},i.log=function(){var s=typeof e!="undefined"&&typeof e.log!="undefined"&&typeof e.log.apply!="undefined",t=r.getElementById("log"),n,f,h,o,i;for(s?(o=Array.prototype.slice.call(arguments),n=o.shift(),typeof e.debug!="undefined"?e.debug.apply(e,[n,o]):e.log.apply(e,[n,o])):n="\n"+arguments[0]+"\n",f=1,h=arguments.length;f<h;++f){if(i=arguments[f],typeof i=="object"&&typeof u!="undefined")try{i=u.stringify(i)}catch(c){}n+="\n"+i+"\n"}return t?(t.value+=n+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):s||v(n),!0},i.getInternetExplorerMajorVersion=function(){return i.getInternetExplorerMajorVersion.cached=typeof i.getInternetExplorerMajorVersion.cached!="undefined"?i.getInternetExplorerMajorVersion.cached:function(){for(var n=3,t=r.createElement("div"),i=t.getElementsByTagName("i");(t.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->")&&i[0];);return n>4?n:!1}()},i.isInternetExplorer=function(){return i.isInternetExplorer.cached=typeof i.isInternetExplorer.cached!="undefined"?i.isInternetExplorer.cached:Boolean(i.getInternetExplorerMajorVersion())},i.emulated=i.options.html4Mode?{pushState:!0,hashChange:!0}:{pushState:!Boolean(n.history&&n.history.pushState&&n.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(o.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(o.userAgent)),hashChange:Boolean(!("onhashchange"in n||"onhashchange"in r)||i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<8)},i.enabled=!i.emulated.pushState,i.bugs={setHash:Boolean(!i.emulated.pushState&&o.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(o.userAgent)),safariPoll:Boolean(!i.emulated.pushState&&o.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(o.userAgent)),ieDoubleCheck:Boolean(i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<7)},i.isEmptyObject=function(n){for(var t in n)if(n.hasOwnProperty(t))return!1;return!0},i.cloneObject=function(n){var i,t;return n?(i=u.stringify(n),t=u.parse(i)):t={},t},i.getRootUrl=function(){var n=r.location.protocol+"//"+(r.location.hostname||r.location.host);return(r.location.port||!1)&&(n+=":"+r.location.port),n+="/",n},i.getBaseHref=function(){var t=r.getElementsByTagName("base"),i=null,n="";return t.length===1&&(i=t[0],n=i.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},i.getBaseUrl=function(){return i.getBaseHref()||i.getBasePageUrl()||i.getRootUrl()},i.getPageUrl=function(){var t=i.getState(!1,!1),r=(t||{}).url||i.getLocationHref(),n;return n=r.replace(/\/+$/,"").replace(/[^\/]+$/,function(n){return/\./.test(n)?n:n+"/"}),n},i.getBasePageUrl=function(){return i.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(n){return/[^\/]$/.test(n)?"":n}).replace(/\/+$/,"")+"/"},i.getFullUrl=function(n,t){var u=n,r=n.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(n)||(u=r==="/"?i.getRootUrl()+n.replace(/^\/+/,""):r==="#"?i.getPageUrl().replace(/#.*/,"")+n:r==="?"?i.getPageUrl().replace(/[\?#].*/,"")+n:t?i.getBaseUrl()+n.replace(/^(\.\/)+/,""):i.getBasePageUrl()+n.replace(/^(\.\/)+/,"")),u.replace(/\#$/,"")},i.getShortUrl=function(n){var t=n,r=i.getBaseUrl(),u=i.getRootUrl();return i.emulated.pushState&&(t=t.replace(r,"")),t=t.replace(u,"/"),i.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},i.getLocationHref=function(n){return n=n||r,n.URL===n.location.href?n.location.href:n.location.href===decodeURIComponent(n.URL)?n.URL:n.location.hash&&decodeURIComponent(n.location.href.replace(/^[^#]+/,""))===n.location.hash?n.location.href:n.URL.indexOf("#")==-1&&n.location.href.indexOf("#")!=-1?n.location.href:n.URL||n.location.href},i.store={},i.idToState=i.idToState||{},i.stateToId=i.stateToId||{},i.urlToId=i.urlToId||{},i.storedStates=i.storedStates||[],i.savedStates=i.savedStates||[],i.normalizeStore=function(){i.store.idToState=i.store.idToState||{};i.store.urlToId=i.store.urlToId||{};i.store.stateToId=i.store.stateToId||{}},i.getState=function(n,t){typeof n=="undefined"&&(n=!0);typeof t=="undefined"&&(t=!0);var r=i.getLastSavedState();return!r&&t&&(r=i.createStateObject()),n&&(r=i.cloneObject(r),r.url=r.cleanUrl||r.url),r},i.getIdByState=function(n){var t=i.extractId(n.url),r;if(!t)if(r=i.getStateString(n),typeof i.stateToId[r]!="undefined")t=i.stateToId[r];else if(typeof i.store.stateToId[r]!="undefined")t=i.store.stateToId[r];else{for(;;)if(t=(new Date).getTime()+String(Math.random()).replace(/\D/g,""),typeof i.idToState[t]=="undefined"&&typeof i.store.idToState[t]=="undefined")break;i.stateToId[r]=t;i.idToState[t]=n}return t},i.normalizeState=function(n){var t,r;return(n&&typeof n=="object"||(n={}),typeof n.normalized!="undefined")?n:(n.data&&typeof n.data=="object"||(n.data={}),t={},t.normalized=!0,t.title=n.title||"",t.url=i.getFullUrl(n.url?n.url:i.getLocationHref()),t.hash=i.getShortUrl(t.url),t.data=i.cloneObject(n.data),t.id=i.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,r=!i.isEmptyObject(t.data),(t.title||r)&&i.options.disableSuid!==!0&&(t.hash=i.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=i.getFullUrl(t.hash),(i.emulated.pushState||i.bugs.safariPoll)&&i.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t)},i.createStateObject=function(n,t,r){var u={data:n,title:t,url:r};return u=i.normalizeState(u),u},i.getStateById=function(n){n=String(n);return i.idToState[n]||i.store.idToState[n]||t},i.getStateString=function(n){var t,r,f;return t=i.normalizeState(n),r={data:t.data,title:n.title,url:n.url},f=u.stringify(r),f},i.getStateId=function(n){var t,r;return t=i.normalizeState(n),r=t.id,r},i.getHashByState=function(n){var t,r;return t=i.normalizeState(n),r=t.hash,r},i.extractId=function(n){var i,t,u,r;return r=n.indexOf("#")!=-1?n.split("#")[0]:n,t=/(.*)\&_suid=([0-9]+)$/.exec(r),u=t?t[1]||n:n,i=t?String(t[2]||""):"",i||!1},i.isTraditionalAnchor=function(n){return!/[\/\?\.]/.test(n)},i.extractState=function(n,t){var r=null,u,f;return t=t||!1,u=i.extractId(n),u&&(r=i.getStateById(u)),r||(f=i.getFullUrl(n),u=i.getIdByUrl(f)||!1,u&&(r=i.getStateById(u)),!r&&t&&!i.isTraditionalAnchor(n)&&(r=i.createStateObject(null,null,f))),r},i.getIdByUrl=function(n){return i.urlToId[n]||i.store.urlToId[n]||t},i.getLastSavedState=function(){return i.savedStates[i.savedStates.length-1]||t},i.getLastStoredState=function(){return i.storedStates[i.storedStates.length-1]||t},i.hasUrlDuplicate=function(n){var r=!1,t;return t=i.extractState(n.url),r=t&&t.id!==n.id,r},i.storeState=function(n){return i.urlToId[n.url]=n.id,i.storedStates.push(i.cloneObject(n)),n},i.isLastSavedState=function(n){var t=!1,r,u,f;return i.savedStates.length&&(r=n.id,u=i.getLastSavedState(),f=u.id,t=r===f),t},i.saveState=function(n){return i.isLastSavedState(n)?!1:(i.savedStates.push(i.cloneObject(n)),!0)},i.getStateByIndex=function(n){var t=null;return t=typeof n=="undefined"?i.savedStates[i.savedStates.length-1]:n<0?i.savedStates[i.savedStates.length+n]:i.savedStates[n],t},i.getCurrentIndex=function(){var n=null;return n=i.savedStates.length<1?0:i.savedStates.length-1,n},i.getHash=function(n){var r=i.getLocationHref(n),t;return t=i.getHashByUrl(r),t},i.unescapeHash=function(n){var t=i.normalizeHash(n);return t=decodeURIComponent(t),t},i.normalizeHash=function(n){return n.replace(/[^#]*#/,"").replace(/#.*/,"")},i.setHash=function(n,t){var u,f;return t!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.setHash,args:arguments,queue:t}),!1):(i.busy(!0),u=i.extractState(n,!0),u&&!i.emulated.pushState?i.pushState(u.data,u.title,u.url,!1):i.getHash()!==n&&(i.bugs.setHash?(f=i.getPageUrl(),i.pushState(null,null,f+"#"+n,!1)):r.location.hash=n),i)},i.escapeHash=function(t){var r=i.normalizeHash(t);return r=n.encodeURIComponent(r),i.bugs.hashEscape||(r=r.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),r},i.getHashByUrl=function(n){var t=String(n).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=i.unescapeHash(t),t},i.setTitle=function(n){var t=n.title,u;t||(u=i.getStateByIndex(0),u&&u.url===n.url&&(t=u.title||i.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(f){}return r.title=t,i},i.queues=[],i.busy=function(n){if(typeof n!="undefined"?i.busy.flag=n:typeof i.busy.flag=="undefined"&&(i.busy.flag=!1),!i.busy.flag){c(i.busy.timeout);var t=function(){var n,r,u;if(!i.busy.flag)for(n=i.queues.length-1;n>=0;--n)(r=i.queues[n],r.length!==0)&&(u=r.shift(),i.fireQueueItem(u),i.busy.timeout=h(t,i.options.busyDelay))};i.busy.timeout=h(t,i.options.busyDelay)}return i.busy.flag},i.busy.flag=!1,i.fireQueueItem=function(n){return n.callback.apply(n.scope||i,n.args||[])},i.pushQueue=function(n){return i.queues[n.queue||0]=i.queues[n.queue||0]||[],i.queues[n.queue||0].push(n),i},i.queue=function(n,t){return typeof n=="function"&&(n={callback:n}),typeof t!="undefined"&&(n.queue=t),i.busy()?i.pushQueue(n):i.fireQueueItem(n),i},i.clearQueue=function(){return i.busy.flag=!1,i.queues=[],i},i.stateChanged=!1,i.doubleChecker=!1,i.doubleCheckComplete=function(){return i.stateChanged=!0,i.doubleCheckClear(),i},i.doubleCheckClear=function(){return i.doubleChecker&&(c(i.doubleChecker),i.doubleChecker=!1),i},i.doubleCheck=function(n){return i.stateChanged=!1,i.doubleCheckClear(),i.bugs.ieDoubleCheck&&(i.doubleChecker=h(function(){return i.doubleCheckClear(),i.stateChanged||n(),!0},i.options.doubleCheckInterval)),i},i.safariStatePoll=function(){var r=i.extractState(i.getLocationHref()),t;if(!i.isLastSavedState(r))return t=r,t||(t=i.createStateObject()),i.Adapter.trigger(n,"popstate"),i},i.back=function(n){return n!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.back,args:arguments,queue:n}),!1):(i.busy(!0),i.doubleCheck(function(){i.back(!1)}),s.go(-1),!0)},i.forward=function(n){return n!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.forward,args:arguments,queue:n}),!1):(i.busy(!0),i.doubleCheck(function(){i.forward(!1)}),s.go(1),!0)},i.go=function(n,t){var r;if(n>0)for(r=1;r<=n;++r)i.forward(t);else{if(!(n<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(r=-1;r>=n;--r)i.back(t)}return i},i.emulated.pushState){var y=function(){};i.pushState=i.pushState||y;i.replaceState=i.replaceState||y}else i.onPopState=function(t,r){var e=!1,u=!1,o,f;return i.doubleCheckComplete(),o=i.getHash(),o?(f=i.extractState(o||i.getLocationHref(),!0),f?i.replaceState(f.data,f.title,f.url,!1):(i.Adapter.trigger(n,"anchorchange"),i.busy(!1)),i.expectedStateId=!1,!1):(e=i.Adapter.extractEventData("state",t,r)||!1,u=e?i.getStateById(e):i.expectedStateId?i.getStateById(i.expectedStateId):i.extractState(i.getLocationHref()),u||(u=i.createStateObject(null,null,i.getLocationHref())),i.expectedStateId=!1,i.isLastSavedState(u)?(i.busy(!1),!1):(i.storeState(u),i.saveState(u),i.setTitle(u),i.Adapter.trigger(n,"statechange"),i.busy(!1),!0))},i.Adapter.bind(n,"popstate",i.onPopState),i.pushState=function(t,r,u,f){if(i.getHashByUrl(u)&&i.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&i.busy())return i.pushQueue({scope:i,callback:i.pushState,args:arguments,queue:f}),!1;i.busy(!0);var e=i.createStateObject(t,r,u);return i.isLastSavedState(e)?i.busy(!1):(i.storeState(e),i.expectedStateId=e.id,s.pushState(e.id,e.title,e.url),i.Adapter.trigger(n,"popstate")),!0},i.replaceState=function(t,r,u,f){if(i.getHashByUrl(u)&&i.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&i.busy())return i.pushQueue({scope:i,callback:i.replaceState,args:arguments,queue:f}),!1;i.busy(!0);var e=i.createStateObject(t,r,u);return i.isLastSavedState(e)?i.busy(!1):(i.storeState(e),i.expectedStateId=e.id,s.replaceState(e.id,e.title,e.url),i.Adapter.trigger(n,"popstate")),!0};if(f){try{i.store=u.parse(f.getItem("History.store"))||{}}catch(p){i.store={}}i.normalizeStore()}else i.store={},i.normalizeStore();i.Adapter.bind(n,"unload",i.clearAllIntervals);i.saveState(i.storeState(i.extractState(i.getLocationHref(),!0)));f&&(i.onUnload=function(){var n,t,r;try{n=u.parse(f.getItem("History.store"))||{}}catch(o){n={}}n.idToState=n.idToState||{};n.urlToId=n.urlToId||{};n.stateToId=n.stateToId||{};for(t in i.idToState)i.idToState.hasOwnProperty(t)&&(n.idToState[t]=i.idToState[t]);for(t in i.urlToId)i.urlToId.hasOwnProperty(t)&&(n.urlToId[t]=i.urlToId[t]);for(t in i.stateToId)i.stateToId.hasOwnProperty(t)&&(n.stateToId[t]=i.stateToId[t]);i.store=n;i.normalizeStore();r=u.stringify(n);try{f.setItem("History.store",r)}catch(e){if(e.code!==DOMException.QUOTA_EXCEEDED_ERR)throw e;f.length&&(f.removeItem("History.store"),f.setItem("History.store",r))}},i.intervalList.push(l(i.onUnload,i.options.storeInterval)),i.Adapter.bind(n,"beforeunload",i.onUnload),i.Adapter.bind(n,"unload",i.onUnload));i.emulated.pushState||(i.bugs.safariPoll&&i.intervalList.push(l(i.safariStatePoll,i.options.safariPollInterval)),(o.vendor==="Apple Computer, Inc."||(o.appCodeName||"")==="Mozilla")&&(i.Adapter.bind(n,"hashchange",function(){i.Adapter.trigger(n,"popstate")}),i.getHash()&&i.Adapter.onDomLoad(function(){i.Adapter.trigger(n,"hashchange")})))};(!i.options||!i.options.delayInit)&&i.init()}(window)