// source --> https://www.elhuertourbano.net/wp-content/plugins/theia-post-slider/js/balupton-history.js/jquery.history.js?ver=1.7.1 
typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()}(window),function(e,t){"use strict";var n=e.document,r=e.setTimeout||r,i=e.clearTimeout||i,s=e.setInterval||s,o=e.History=e.History||{};if(typeof o.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");o.initHtml4=function(){if(typeof o.initHtml4.initialized!="undefined")return!1;o.initHtml4.initialized=!0,o.enabled=!0,o.savedHashes=[],o.isLastHash=function(e){var t=o.getHashByIndex(),n;return n=e===t,n},o.isHashEqual=function(e,t){return e=encodeURIComponent(e).replace(/%25/g,"%"),t=encodeURIComponent(t).replace(/%25/g,"%"),e===t},o.saveHash=function(e){return o.isLastHash(e)?!1:(o.savedHashes.push(e),!0)},o.getHashByIndex=function(e){var t=null;return typeof e=="undefined"?t=o.savedHashes[o.savedHashes.length-1]:e<0?t=o.savedHashes[o.savedHashes.length+e]:t=o.savedHashes[e],t},o.discardedHashes={},o.discardedStates={},o.discardState=function(e,t,n){var r=o.getHashByState(e),i;return i={discardedState:e,backState:n,forwardState:t},o.discardedStates[r]=i,!0},o.discardHash=function(e,t,n){var r={discardedHash:e,backState:n,forwardState:t};return o.discardedHashes[e]=r,!0},o.discardedState=function(e){var t=o.getHashByState(e),n;return n=o.discardedStates[t]||!1,n},o.discardedHash=function(e){var t=o.discardedHashes[e]||!1;return t},o.recycleState=function(e){var t=o.getHashByState(e);return o.discardedState(e)&&delete o.discardedStates[t],!0},o.emulated.hashChange&&(o.hashChangeInit=function(){o.checkerFunction=null;var t="",r,i,u,a,f=Boolean(o.getHash());return o.isInternetExplorer()?(r="historyjs-iframe",i=n.createElement("iframe"),i.setAttribute("id",r),i.setAttribute("src","#"),i.style.display="none",n.body.appendChild(i),i.contentWindow.document.open(),i.contentWindow.document.close(),u="",a=!1,o.checkerFunction=function(){if(a)return!1;a=!0;var n=o.getHash(),r=o.getHash(i.contentWindow.document);return n!==t?(t=n,r!==n&&(u=r=n,i.contentWindow.document.open(),i.contentWindow.document.close(),i.contentWindow.document.location.hash=o.escapeHash(n)),o.Adapter.trigger(e,"hashchange")):r!==u&&(u=r,f&&r===""?o.back():o.setHash(r,!1)),a=!1,!0}):o.checkerFunction=function(){var n=o.getHash()||"";return n!==t&&(t=n,o.Adapter.trigger(e,"hashchange")),!0},o.intervalList.push(s(o.checkerFunction,o.options.hashChangeInterval)),!0},o.Adapter.onDomLoad(o.hashChangeInit)),o.emulated.pushState&&(o.onHashChange=function(t){var n=t&&t.newURL||o.getLocationHref(),r=o.getHashByUrl(n),i=null,s=null,u=null,a;return o.isLastHash(r)?(o.busy(!1),!1):(o.doubleCheckComplete(),o.saveHash(r),r&&o.isTraditionalAnchor(r)?(o.Adapter.trigger(e,"anchorchange"),o.busy(!1),!1):(i=o.extractState(o.getFullUrl(r||o.getLocationHref()),!0),o.isLastSavedState(i)?(o.busy(!1),!1):(s=o.getHashByState(i),a=o.discardedState(i),a?(o.getHashByIndex(-2)===o.getHashByState(a.forwardState)?o.back(!1):o.forward(!1),!1):(o.pushState(i.data,i.title,encodeURI(i.url),!1),!0))))},o.Adapter.bind(e,"hashchange",o.onHashChange),o.pushState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.pushState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getHash(),c=o.expectedStateId==s.id;return o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),u===f?(o.busy(!1),!1):(o.saveState(s),c||o.Adapter.trigger(e,"statechange"),!o.isHashEqual(u,l)&&!o.isHashEqual(u,o.getShortUrl(o.getLocationHref()))&&o.setHash(u,!1),o.busy(!1),!0)},o.replaceState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.replaceState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getStateByIndex(-2);return o.discardState(a,s,l),u===f?(o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),o.saveState(s),o.Adapter.trigger(e,"statechange"),o.busy(!1)):o.pushState(s.data,s.title,s.url,!1),!0}),o.emulated.pushState&&o.getHash()&&!o.emulated.hashChange&&o.Adapter.onDomLoad(function(){o.Adapter.trigger(e,"hashchange")})},typeof o.init!="undefined"&&o.init()}(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=e.sessionStorage||!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window);
// source --> https://www.elhuertourbano.net/wp-content/plugins/theia-post-slider/js/async.min.js?ver=14.09.2014 
(function(){function w(a){var b=!1;return function(){if(b)throw Error("Callback was already called.");b=!0;a.apply(n,arguments)}}var d={},n,x;n=this;null!=n&&(x=n.async);d.noConflict=function(){n.async=x;return d};var B=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===B.call(a)},l=function(a,b){if(a.forEach)return a.forEach(b);for(var c=0;c<a.length;c+=1)b(a[c],c,a)},m=function(a,b){if(a.map)return a.map(b);var c=[];l(a,function(a,f,g){c.push(b(a,f,g))});return c},C=
function(a,b,c){if(a.reduce)return a.reduce(b,c);l(a,function(a,f,g){c=b(c,a,f,g)});return c},s=function(a){if(Object.keys)return Object.keys(a);var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b};"undefined"!==typeof process&&process.nextTick?(d.nextTick=process.nextTick,d.setImmediate="undefined"!==typeof setImmediate?function(a){setImmediate(a)}:d.nextTick):(d.nextTick="function"===typeof setImmediate?function(a){setImmediate(a)}:function(a){setTimeout(a,0)},d.setImmediate=d.nextTick);
d.each=function(a,b,c){function e(b){b?(c(b),c=function(){}):(f+=1,f>=a.length&&c())}c=c||function(){};if(!a.length)return c();var f=0;l(a,function(a){b(a,w(e))})};d.forEach=d.each;d.eachSeries=function(a,b,c){c=c||function(){};if(!a.length)return c();var e=0,f=function(){b(a[e],function(b){b?(c(b),c=function(){}):(e+=1,e>=a.length?c():f())})};f()};d.forEachSeries=d.eachSeries;d.eachLimit=function(a,b,c,e){u(b).apply(null,[a,c,e])};d.forEachLimit=d.eachLimit;var u=function(a){return function(b,c,
e){e=e||function(){};if(!b.length||0>=a)return e();var f=0,g=0,d=0;(function D(){if(f>=b.length)return e();for(;d<a&&g<b.length;)g+=1,d+=1,c(b[g-1],function(a){a?(e(a),e=function(){}):(f+=1,d-=1,f>=b.length?e():D())})})()}},q=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[d.each].concat(b))}},y=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return b.apply(null,[u(a)].concat(c))}},r=function(a){return function(){var b=Array.prototype.slice.call(arguments);
return a.apply(null,[d.eachSeries].concat(b))}},t=function(a,b,c,e){b=m(b,function(a,b){return{index:b,value:a}});if(e){var f=[];a(b,function(a,b){c(a.value,function(c,e){f[a.index]=e;b(c)})},function(a){e(a,f)})}else a(b,function(a,b){c(a.value,function(a){b(a)})})};d.map=q(t);d.mapSeries=r(t);d.mapLimit=function(a,b,c,e){return y(b,t)(a,c,e)};d.reduce=function(a,b,c,e){d.eachSeries(a,function(a,e){c(b,a,function(a,c){b=c;e(a)})},function(a){e(a,b)})};d.inject=d.reduce;d.foldl=d.reduce;d.reduceRight=
function(a,b,c,e){a=m(a,function(a){return a}).reverse();d.reduce(a,b,c,e)};d.foldr=d.reduceRight;var h=function(a,b,c,e){var f=[];b=m(b,function(a,b){return{index:b,value:a}});a(b,function(a,b){c(a.value,function(c){c&&f.push(a);b()})},function(a){e(m(f.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};d.filter=q(h);d.filterSeries=r(h);d.select=d.filter;d.selectSeries=d.filterSeries;h=function(a,b,c,e){var f=[];b=m(b,function(a,b){return{index:b,value:a}});a(b,function(a,
b){c(a.value,function(c){c||f.push(a);b()})},function(a){e(m(f.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};d.reject=q(h);d.rejectSeries=r(h);h=function(a,b,c,e){a(b,function(a,b){c(a,function(c){c?(e(a),e=function(){}):b()})},function(a){e()})};d.detect=q(h);d.detectSeries=r(h);d.some=function(a,b,c){d.each(a,function(a,f){b(a,function(a){a&&(c(!0),c=function(){});f()})},function(a){c(!1)})};d.any=d.some;d.every=function(a,b,c){d.each(a,function(a,f){b(a,function(a){a||
(c(!1),c=function(){});f()})},function(a){c(!0)})};d.all=d.every;d.sortBy=function(a,b,c){d.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){if(a)return c(a);c(null,m(b.sort(function(a,b){var c=a.criteria,f=b.criteria;return c<f?-1:c>f?1:0}),function(a){return a.value}))})};d.auto=function(a,b){b=b||function(){};var c=s(a),e=c.length;if(!e)return b();var f={},g=[],k=function(a){g.unshift(a)},v=function(){e--;l(g.slice(0),function(a){a()})};k(function(){if(!e){var a=
b;b=function(){};a(null,f)}});l(c,function(c){var e=p(a[c])?a[c]:[a[c]],z=function(a){var e=Array.prototype.slice.call(arguments,1);1>=e.length&&(e=e[0]);if(a){var g={};l(s(f),function(a){g[a]=f[a]});g[c]=e;b(a,g);b=function(){}}else f[c]=e,d.setImmediate(v)},h=e.slice(0,Math.abs(e.length-1))||[],m=function(){return C(h,function(a,b){return a&&f.hasOwnProperty(b)},!0)&&!f.hasOwnProperty(c)};if(m())e[e.length-1](z,f);else{var n=function(){if(m()){a:for(var a=n,b=0;b<g.length;b+=1)if(g[b]===a){g.splice(b,
1);break a}e[e.length-1](z,f)}};k(n)}})};d.retry=function(a,b,c){var e=[];"function"===typeof a&&(c=b,b=a,a=5);a=parseInt(a,10)||5;var f=function(f,k){for(var v=function(a,b){return function(c){a(function(a,e){c(!a||b,{err:a,result:e})},k)}};a;)e.push(v(b,!(a-=1)));d.series(e,function(a,b){b=b[b.length-1];(f||c)(b.err,b.result)})};return c?f():f};d.waterfall=function(a,b){b=b||function(){};if(!p(a))return b(Error("First argument to waterfall must be an array of functions"));if(!a.length)return b();
var c=function(a){return function(f){if(f)b.apply(null,arguments),b=function(){};else{var g=Array.prototype.slice.call(arguments,1),k=a.next();k?g.push(c(k)):g.push(b);d.setImmediate(function(){a.apply(null,g)})}}};c(d.iterator(a))()};var A=function(a,b,c){c=c||function(){};if(p(b))a.map(b,function(a,b){a&&a(function(a){var c=Array.prototype.slice.call(arguments,1);1>=c.length&&(c=c[0]);b.call(null,a,c)})},c);else{var e={};a.each(s(b),function(a,c){b[a](function(b){var d=Array.prototype.slice.call(arguments,
1);1>=d.length&&(d=d[0]);e[a]=d;c(b)})},function(a){c(a,e)})}};d.parallel=function(a,b){A({map:d.map,each:d.each},a,b)};d.parallelLimit=function(a,b,c){A({map:y(b,t),each:u(b)},a,c)};d.series=function(a,b){b=b||function(){};if(p(a))d.mapSeries(a,function(a,b){a&&a(function(a){var c=Array.prototype.slice.call(arguments,1);1>=c.length&&(c=c[0]);b.call(null,a,c)})},b);else{var c={};d.eachSeries(s(a),function(b,d){a[b](function(a){var k=Array.prototype.slice.call(arguments,1);1>=k.length&&(k=k[0]);c[b]=
k;d(a)})},function(a){b(a,c)})}};d.iterator=function(a){var b=function(c){var e=function(){a.length&&a[c].apply(null,arguments);return e.next()};e.next=function(){return c<a.length-1?b(c+1):null};return e};return b(0)};d.apply=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b.concat(Array.prototype.slice.call(arguments)))}};h=function(a,b,c,e){var d=[];a(b,function(a,b){c(a,function(a,c){d=d.concat(c||[]);b(a)})},function(a){e(a,d)})};d.concat=q(h);
d.concatSeries=r(h);d.whilst=function(a,b,c){a()?b(function(e){if(e)return c(e);d.whilst(a,b,c)}):c()};d.doWhilst=function(a,b,c){a(function(e){if(e)return c(e);var f=Array.prototype.slice.call(arguments,1);b.apply(null,f)?d.doWhilst(a,b,c):c()})};d.until=function(a,b,c){a()?c():b(function(e){if(e)return c(e);d.until(a,b,c)})};d.doUntil=function(a,b,c){a(function(e){if(e)return c(e);var f=Array.prototype.slice.call(arguments,1);b.apply(null,f)?c():d.doUntil(a,b,c)})};d.queue=function(a,b){function c(a,
b,c,e){a.started||(a.started=!0);p(b)||(b=[b]);if(0==b.length)return d.setImmediate(function(){a.drain&&a.drain()});l(b,function(b){b={data:b,callback:"function"===typeof e?e:null};c?a.tasks.unshift(b):a.tasks.push(b);a.saturated&&a.tasks.length===a.concurrency&&a.saturated();d.setImmediate(a.process)})}void 0===b&&(b=1);var e=0,f={tasks:[],concurrency:b,saturated:null,empty:null,drain:null,started:!1,paused:!1,push:function(a,b){c(f,a,!1,b)},kill:function(){f.drain=null;f.tasks=[]},unshift:function(a,
b){c(f,a,!0,b)},process:function(){if(!f.paused&&e<f.concurrency&&f.tasks.length){var b=f.tasks.shift();f.empty&&0===f.tasks.length&&f.empty();e+=1;var c=w(function(){e-=1;b.callback&&b.callback.apply(b,arguments);f.drain&&0===f.tasks.length+e&&f.drain();f.process()});a(b.data,c)}},length:function(){return f.tasks.length},running:function(){return e},idle:function(){return 0===f.tasks.length+e},pause:function(){!0!==f.paused&&(f.paused=!0)},resume:function(){if(!1!==f.paused){f.paused=!1;for(var a=
1;a<=f.concurrency;a++)d.setImmediate(f.process)}}};return f};d.priorityQueue=function(a,b){function c(a,b){return a.priority-b.priority}function e(a,b,c){for(var d=-1,e=a.length-1;d<e;){var f=d+(e-d+1>>>1);0<=c(b,a[f])?d=f:e=f-1}return d}function f(a,b,f,g){a.started||(a.started=!0);p(b)||(b=[b]);if(0==b.length)return d.setImmediate(function(){a.drain&&a.drain()});l(b,function(b){b={data:b,priority:f,callback:"function"===typeof g?g:null};a.tasks.splice(e(a.tasks,b,c)+1,0,b);a.saturated&&a.tasks.length===
a.concurrency&&a.saturated();d.setImmediate(a.process)})}var g=d.queue(a,b);g.push=function(a,b,c){f(g,a,b,c)};delete g.unshift;return g};d.cargo=function(a,b){var c=!1,e=[],f={tasks:e,payload:b,saturated:null,empty:null,drain:null,drained:!0,push:function(a,c){p(a)||(a=[a]);l(a,function(a){e.push({data:a,callback:"function"===typeof c?c:null});f.drained=!1;f.saturated&&e.length===b&&f.saturated()});d.setImmediate(f.process)},process:function k(){if(!c)if(0===e.length)f.drain&&!f.drained&&f.drain(),
f.drained=!0;else{var d="number"===typeof b?e.splice(0,b):e.splice(0,e.length),h=m(d,function(a){return a.data});f.empty&&f.empty();c=!0;a(h,function(){c=!1;var a=arguments;l(d,function(b){b.callback&&b.callback.apply(null,a)});k()})}},length:function(){return e.length},running:function(){return c}};return f};h=function(a){return function(b){var c=Array.prototype.slice.call(arguments,1);b.apply(null,c.concat([function(b){var c=Array.prototype.slice.call(arguments,1);"undefined"!==typeof console&&
(b?console.error&&console.error(b):console[a]&&l(c,function(b){console[a](b)}))}]))}};d.log=h("log");d.dir=h("dir");d.memoize=function(a,b){var c={},e={};b=b||function(a){return a};var f=function(){var f=Array.prototype.slice.call(arguments),k=f.pop(),h=b.apply(null,f);h in c?d.nextTick(function(){k.apply(null,c[h])}):h in e?e[h].push(k):(e[h]=[k],a.apply(null,f.concat([function(){c[h]=arguments;var a=e[h];delete e[h];for(var b=0,d=a.length;b<d;b++)a[b].apply(null,arguments)}])))};f.memo=c;f.unmemoized=
a;return f};d.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}};d.times=function(a,b,c){for(var e=[],f=0;f<a;f++)e.push(f);return d.map(e,b,c)};d.timesSeries=function(a,b,c){for(var e=[],f=0;f<a;f++)e.push(f);return d.mapSeries(e,b,c)};d.seq=function(){var a=arguments;return function(){var b=this,c=Array.prototype.slice.call(arguments),e=c.pop();d.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,
1);d(a,b)}]))},function(a,c){e.apply(b,[a].concat(c))})}};d.compose=function(){return d.seq.apply(null,Array.prototype.reverse.call(arguments))};h=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};d.applyEach=q(h);d.applyEachSeries=r(h);d.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d;
}a(c)}c()};"undefined"!==typeof module&&module.exports?module.exports=d:"undefined"!==typeof define&&define.amd?define([],function(){return d}):n.async=d})();
// source --> https://www.elhuertourbano.net/wp-content/plugins/theia-post-slider/js/tps.js?ver=1.8.3 
/*
 * Copyright 2012-2015, Theia Post Slider, WeCodePixels, http://wecodepixels.com
 */
var tps = tps || {};
tps.slideshowsOnPage = 0;
tps.createSlideshowDefaults = {
    slideContainer: '',
    nav: [],
    navText: '%{currentSlide} of %{totalSlides}',
    helperText: '',
    defaultSlide: 0,
    transitionEffect: 'none',
    transitionSpeed: 400,
    keyboardShortcuts: false,
    scrollAfterRefresh: true,
    numberOfSlides: 0, // Total number of slides, including the ones not loaded.
    slides: [],
    useSlideSources: false,
    themeType: 'classic',
    prevPost: null,
    nextPost: null,
    prevText: null,
    nextText: null,
    buttonWidth: 0,
    prevText_post: null,
    nextText_post: null,
    buttonWidth_post: 0,
    onShowPost: null,
    postUrl: null,
    postId: null,
    refreshAds: false,
    refreshAdsEveryNSlides: 1,
    adRefreshingMechanism: 'javascript',
    siteUrl: '/'
};
tps.createSlideshow = function (options) {
    var i, j;
    var me = this;
    var $ = jQuery;

    // Merge options with defaults and sanitize values.
    me.options = $.extend(tps.createSlideshowDefaults, options);
    for (i in me.options) {
        // If the default is a number and the option is a string, then convert it to a number if possible.
        if (!isNaN(tps.createSlideshowDefaults[i]) && (typeof me.options[i] == 'string')) {
            var value = parseFloat(me.options[i]);
            if (!isNaN(value)) {
                me.options[i] = value;
            }
        }
    }

    me.slides = [];
    me.slideContainer = $(me.options.slideContainer);
    if (me.slideContainer.length == 0) {
        return null;
    }

    tps.slideshowsOnPage++;
    me.navEl = [];
    for (i = 0; i < me.options.nav.length; i++) {
        var e = $(me.options.nav[i]).get();
        for (j = 0; j < e.length; j++) {
            me.navEl.push({
                container: $(e[j])
            });
        }
    }

    // Initialize variables.
    me.currentPostId = me.options.postId;
    me.isLoading = false;
    me.slidesSinceLastAdRefresh = 0;

    // Remote loading queue.
    me.remoteLoadingQueue = async.queue(function (task, callback) {
        callback();
    }, 1);

    // The current slide.
    me.currentSlide = null;

    // The slide that is currently displayed. This may lag behind "me.currentSlide" because of the animations.
    me.currentlyDisplayedSlide = null;

    // The number of animations that are currently running.
    me.animations = 0;

    // A queue that is executed when no animation is running.
    me.semaphore = 0;
    me.asyncQueue = async.queue(function (task, callback) {
        callback();
    }, 1);

    me.incrementSemaphore = function () {
        me.asyncQueue.pause();
        me.semaphore++;
    };

    me.decrementSemaphore = function () {
        me.semaphore--;
        if (me.semaphore == 0) {
            me.asyncQueue.resume();
        }
    };

    // Initialization function
    me.init = function () {
        var i;

        // Load scroll position, if available.
        me.loadScrollTop();

        // Get slides from me.options.slides
        for (i in me.options.slides) {
            if ('content' in me.options.slides[i]) {
                if (me.options.useSlideSources) {
                    me.options.slides[i].source = me.options.slides[i].content;
                }

                me.options.slides[i].content = $('<div>').html(me.options.slides[i].content);
            }

            me.slides[i] = me.options.slides[i];
        }
        me.options.slides = null;

        // Get slides from HTML. The first slide is considered the default one, while the rest are detached.
        me.slideContainer.children().each(function (index, slide) {
            index = me.options.defaultSlide + index;
            slide = $(slide);
            me.slides[index] = me.slides[index] || {};
            me.slides[index].title = document.title;
            me.slides[index].permalink = document.location.href;
            me.slides[index].content = slide;

            if (index != me.options.defaultSlide) {
                slide.detach();
            }
        });

        // Count the slides.
        me.numberOfSlides = me.options.numberOfSlides;

        // Setup the navigation bars.
        for (i = 0; i < me.navEl.length; i++) {
            var navEl = me.navEl[i];
            navEl.text = navEl.container.find('._text');
            navEl.prev = navEl.container.find('._prev')
                .click(function (me) {
                    return function (event) {
                        me.onNavClick(this, 'prev', event);
                    }
                }(me));
            navEl.next = navEl.container.find('._next')
                .click(function (me) {
                    return function (event) {
                        me.onNavClick(this, 'next', event);
                    }
                }(me));

            navEl.title = navEl.container.find('._title');

            // Get the default slide's title. The title will be the same for all navigation bars, so get it only from the first.
            if (i === 0) {
                me.slides[me.options.defaultSlide].shortCodeTitle = navEl.title.html();
            }

            /*
             Add _active class on mousedown. This is a fix for IE and Opera which don't match :active on container elements.
             Also, return false to prevent double click context menu in Opera.
             */
            navEl.container.find('._prev, ._next')
                .mousedown(function () {
                    $(this).addClass('_active');
                })
                .mouseup(function () {
                    $(this).removeClass('_active');
                });
        }

        // Skip loading the slide if we're not going to display another one anyway.
        if (me.numberOfSlides == 1 || (me.options.refreshAds && me.options.adRefreshingMechanism == 'page' && me.options.refreshAdsEveryNSlides <= 1)) {
            me.currentSlide = 0;
        }
        else {
            // Show the first slide
            me.setSlide(me.options.defaultSlide);

            // Add history handler.
            var history = window.History;
            if (history.enabled) {
                history.Adapter.bind(window, 'statechange', function (me) {
                    return function () {
                        var state = History.getState();
                        if (state.data.currentPostId != undefined) {
                            if (state.data.currentSlide != undefined) {
                                me.setSlide(state.data.currentSlide);
                            }
                            else {
                                me.setSlide(me.options.defaultSlide);
                            }
                        }
                    };
                }(me));
            }
        }

        // Enable keyboard shortcuts
        if (me.options.keyboardShortcuts) {
            $(document).keydown(function (me) {
                return function (e) {
                    // Disable shortcut if there is more than one slideshow on the page.
                    if (tps.slideshowsOnPage > 1) {
                        return true;
                    }

                    // Disable shortcut if the target element is editable (input boxes, textareas, etc.).
                    if (
                        this !== e.target &&
                        (
                        /textarea|select/i.test(e.target.nodeName) ||
                        e.target.type === "text" ||
                        (
                        $(e.target).prop &&
                        $(e.target).prop('contenteditable') == 'true'
                        )
                        )
                    ) {
                        return true;
                    }

                    switch (e.which) {
                        case 37:
                            me.setPrev();
                            return false;

                        case 39:
                            me.setNext();
                            return false;
                    }

                    return true;
                };
            }(me));
        }
    };

    // Load slides remotely
    me.loadSlides = function (slides, callback) {
        me.remoteLoadingQueue.push({name: ''}, function (me, slides, callback) {
            return function (err) {
                // Check if the slides are already loaded.
                var allSlidesAreLoaded = true;
                for (var i in slides) {
                    if (!(slides[i] in me.slides) || !('content' in me.slides[slides[i]])) {
                        allSlidesAreLoaded = false;
                        break;
                    }
                }
                if (allSlidesAreLoaded) {
                    if (callback) {
                        callback();
                    }
                    return;
                }

                // Load the slides and don't load anything else in the meantime.
                me.remoteLoadingQueue.concurrency = 0;
                $.ajax({
                    dataType: 'json',
                    data: {
                        theiaPostSlider: 'get-slides',
                        postId: me.currentPostId,
                        slides: slides
                    },
                    url: me.options.siteUrl,
                    success: function (me) {
                        return function (data) {
                            if (!data) {
                                return;
                            }
                            if (data.postId == me.currentPostId) {
                                // Add each slide.
                                for (var i in data.slides) {
                                    if (!(i in me.slides)) {
                                        me.slides[i] = {};
                                    }

                                    // Add content.
                                    if ('content' in data.slides[i]) {
                                        if (me.options.useSlideSources) {
                                            data.slides[i].source = data.slides[i].content;
                                        }

                                        data.slides[i].content = $('<div>').html(data.slides[i].content);
                                    }

                                    // Overwrite old data with new data.
                                    for (var j in data.slides[i]) {
                                        me.slides[i][j] = data.slides[i][j];
                                    }
                                }
                            }
                        };
                    }(me),
                    complete: function (me, callback) {
                        return function () {
                            if (callback) {
                                callback();
                            }
                            me.remoteLoadingQueue.concurrency = 1;
                            me.remoteLoadingQueue.push({});
                        };
                    }(me, callback)
                });
            };
        }(me, slides, callback));
    };

    // Set the current slide.
    me.setSlide = function (index, isCallback) {
        if (me.isLoading == true && isCallback != true) {
            return;
        }

        // Is the slide already displayed?
        if (me.currentSlide == index) {
            return;
        }

        // Do we need to refresh the ads by refreshing the entire page?
        if (me.needToRefreshPage() && index in me.slides) {
            me.saveScrollTop();
            window.location = me.slides[index].permalink;

            return;
        }

        // Fire events.
        $(document).trigger('theiaPostSlider.willChangeSlide', [index]);

        // Is the slide not yet loaded?
        if (!me.isSlideLoaded(index)) {
            if (!isCallback) {
                me.showLoading();
                me.loadSlides([index], function (me, index) {
                    return function () {
                        me.hideLoading();
                        me.setSlide(index, true);
                    }
                }(me, index));

                return;
            }
            else {
                // The slide could not be loaded via AJAX. Abort.
                return;
            }
        }

        var previousSlide = me.currentSlide;
        me.currentSlide = index;

        if (previousSlide != null) {
            // Scroll the window up, if the beginning of the slide is out-of-view.            
            // Get the lowest offset.top
            var scrollTop = me.slideContainer.offset().top;
            for (var i = 0; i < me.navEl.length; i++) {
                scrollTop = Math.min(scrollTop, me.navEl[i].container.offset().top);
            }

            if ($(window).scrollTop() > scrollTop) {
                $('body,html').animate({scrollTop: scrollTop});
            }
        }

        // Set the title text.
        me.updateTitleText();

        // Change URL, but only if this isn't the first slide set (i.e. the default slide).
        var history = window.History;
        if (history.enabled) {
            var url = me.slides[me.currentSlide].permalink;
            if (url && previousSlide !== null) {
                var f;
                if (url == window.location) {
                    f = history.replaceState;
                }
                else {
                    f = history.pushState;
                }
                f({
                    currentSlide: index,
                    currentPostId: me.currentPostId
                }, me.slides[me.currentSlide].title, url);
            }
        }

        // Show the slide.
        me.asyncQueue.push({name: ''}, me.showSlide);

        // Refresh ads using JavaScript.
        if (previousSlide != null) {
            if (me.options.refreshAds) {
                me.slidesSinceLastAdRefresh++;

                if (me.slidesSinceLastAdRefresh >= me.options.refreshAdsEveryNSlides) {
                    me.slidesSinceLastAdRefresh = 0;

                    if (me.options.adRefreshingMechanism == 'javascript') {
                        var p = null;

                        if (typeof pubService === 'undefined') {
                            if (typeof googletag !== 'undefined') {
                                p = googletag.pubads();
                            }
                        }
                        else {
                            p = pubService;
                        }

                        if (p) {
                            p.refresh();
                        }

                        $(document).trigger('theiaPostSlider.refreshAds');
                    }
                }
            }
        }

        // Set the navigation bars.
        me.updateNavigationBars();

        // Preload, but only if we don't have to refresh the page immediately after.
        if (
            !(
            me.options.refreshAds &&
            me.slidesSinceLastAdRefresh + 1 >= me.options.refreshAdsEveryNSlides &&
            me.options.adRefreshingMechanism == 'page'
            )
        ) {
            var direction;
            if (previousSlide == null) {
                direction = 1;
            }
            else {
                direction = me.currentSlide - previousSlide;
                direction = Math.max(Math.min(direction, 1), -1);
            }

            var slideToPreload = me.currentSlide + direction;
            if (
                slideToPreload >= 0 &&
                slideToPreload < me.numberOfSlides && !me.isSlideLoaded((slideToPreload))
            ) {
                me.loadSlides([slideToPreload]);
            }
        }

        // Set up touch events.
        if (typeof Hammer !== 'undefined') {
            me.previousTouch = 0;
            me.minimumTimeBetweenGestures = 500;
            var hammertime = new Hammer(me.slideContainer[0]);
            hammertime
                .on('swipeleft', function () {
                    var t = (new Date).getTime();
                    if (t - me.minimumTimeBetweenGestures >= me.previousTouch) {
                        me.setNext();
                        me.previousTouch = t;
                    }
                })
                .on('swiperight', function () {
                    var t = (new Date).getTime();
                    if (t - me.minimumTimeBetweenGestures >= me.previousTouch) {
                        me.setPrev();
                        me.previousTouch = t;
                    }
                });
        }
    };

    // Show (display) the current slide using the chosen animation.
    me.showSlide = function () {
        // Don't do anything if the current slide is already shown.
        if (me.currentlyDisplayedSlide == me.currentSlide) {
            return;
        }

        // Track the pageview if this isn't the first slide displayed.
        if (me.currentlyDisplayedSlide != null && me.slides[me.currentSlide]['permalink']) {
            // URL Path
            var path = me.slides[me.currentSlide]['permalink'].split('/');
            if (path.length >= 4) {
                path = '/' + path.slice(3).join('/');

                // Google Analytics (Analytics.js).
                if (typeof ga !== 'undefined') {
                    ga('send', 'pageview', path);
                }
                // Google Analytics (ga.js, deprecated).
                else if (typeof _gaq !== 'undefined' && typeof _gaq.push !== 'undefined') {
                    _gaq.push(['_trackPageview', path]);
                }
                // Google Analytics Traditional.
                else if (typeof pageTracker !== 'undefined' && typeof pageTracker._trackPageview !== 'undefined') {
                    pageTracker._trackPageview(path);
                }

                // Piwik
                if (typeof piwikTracker !== 'undefined' && typeof piwikTracker.trackPageView !== 'undefined') {
                    piwikTracker.trackPageView(path);
                }

                // StatCounter
                if (typeof sc_project !== 'undefined' && typeof sc_security !== 'undefined') {
                    var img = new Image();
                    img.src = '//c.statcounter.com/' + sc_project + '/0/' + sc_security + '/1/';
                }

                // Quantcast
                if (typeof _qacct !== 'undefined') {
                    var img = new Image();
                    img.src = '//pixel.quantserve.com/pixel/' + _qacct + '.gif';
                }
            }
        }

        var previousIndex = me.currentlyDisplayedSlide;
        me.currentlyDisplayedSlide = me.currentSlide;

        me.createSlideContentFromSource(me.slides[me.currentSlide]);

        // Change the slide while applying a certain effect/animation.
        var animationsQueue = tps.transitions[me.options.transitionEffect](me, previousIndex, me.currentlyDisplayedSlide);

        // Execute all "attachAnimation" methods before starting any animation.
        // Otherwise, we might get a race condition when one animation finishes before others are started,
        // thus triggering unwanted events before all animations have ended.
        for (var i = 0; i < animationsQueue.length; i++) {
            me.incrementSemaphore();
        }

        // This will be called after all animations finish, before any other items in the queue.
        if (previousIndex !== null) {
            me.asyncQueue.unshift({name: ''}, function (me, previousIndex) {
                return function () {
                    me.onRemovedSlide(previousIndex);
                }
            }(me, previousIndex));
        }

        // Start all animations.
        for (var i = 0; i < animationsQueue.length; i++) {
            animationsQueue[i]();
        }
    };

    me.createSlideContentFromSource = function (slide) {
        if (!('content' in slide) && ('source' in slide)) {
            slide.content = $('<div>').html(slide.source);

            if (false == me.options.useSlideSources) {
                alert(1);
                delete slide.source;
            }
        }
    };

    me.isSlideLoaded = function (index) {
        if (!(index in me.slides)) {
            return false;
        }

        // Only if this isn't the first slide.
        if (me.currentlyDisplayedSlide !== null && me.options.useSlideSources && !('source' in me.slides[index])) {
            return false;
        }

        if (!(('content' in me.slides[index]) || ('source' in me.slides[index]))) {
            return false;
        }

        return true;
    };

    // Function that is called right after a new slide has been added to the DOM, and right before the animation (if available) has started.
    me.onNewSlide = function () {
        // "BJ Lazy Load" plugin.
        $(".lazy-hidden").not(".data-lazy-ready").one("scrollin.bj_lazy_load", {
            distance: 200
        }, function () {
            var b = $(this),
                d = b.attr("data-lazy-type");
            if (d == "image") {
                b.hide().attr("src", b.attr("data-lazy-src")).removeClass("lazy-hidden").fadeIn()
            } else if (d == "iframe") {
                b.replaceWith(c(b.attr("data-lazy-src")))
            }
        }).addClass("data-lazy-ready");

        // "Lazy Load" plugin.
        var events = $('body').data('events');
        if (events && events['post-load']) {
            for (var i = 0; i < events['post-load'].length; i++) {
                if (events['post-load'][i].handler.name == 'lazy_load_init') {
                    events['post-load'][i].handler();
                }
            }
        }

        // WordPress [audio] and [video] shortcodes.
        if (typeof _wpmejsSettings !== 'undefined') {
            $('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer(_wpmejsSettings);
        }

        // Instagram embeds.
        if (typeof instgrm !== 'undefined' && typeof instgrm.Embeds !== 'undefined' && typeof instgrm.Embeds.process !== 'undefined') {
            instgrm.Embeds.process();
        }

        // Fire events.
        $(document).trigger('theiaPostSlider.changeSlide', [me.currentSlide]);
    };

    // Function that is called right after a slide has been removed from the DOM.
    me.onRemovedSlide = function (slideId) {
        if (me.options.useSlideSources) {
            me.slides[slideId].content.remove();
            delete me.slides[slideId].content;
        }
    };

    // Update the title text.
    me.updateTitleText = function () {
        var shortCodeTitle = me.slides[me.currentSlide].shortCodeTitle;
        if (!shortCodeTitle) {
            shortCodeTitle = '<span class="_helper">' + me.options['helperText'] + '</span>';
        }
        for (i = 0; i < me.navEl.length; i++) {
            me.navEl[i].title.html(shortCodeTitle);
        }
    };

    // Update the navigation bar's text and buttons.
    me.updateNavigationBars = function () {
        for (var i = 0; i < me.navEl.length; i++) {
            var navEl = me.navEl[i];
            var navText;
            if (me.numberOfSlides == 1) {
                navText = '';
            }
            else {
                navText = me.options.navText;
                navText = navText.replace('%{currentSlide}', me.currentSlide + 1);
                navText = navText.replace('%{totalSlides}', me.numberOfSlides);
            }
            navEl.text.html(navText);

            // Update buttons.
            me.updateNavigationBarButton(navEl, false);
            me.updateNavigationBarButton(navEl, true);
        }
    };

    // Update a button from a navigation bar.
    me.updateNavigationBarButton = function (navEl, direction) {
        var width,
            html1 = '',
            html2 = '',
            html3 = '',
            href,
            directionName = direction ? 'next' : 'prev',
            buttonEl = navEl[directionName];

        if (me.options.themeType == 'font') {
            width = 0;
            html2 = me.options[directionName + 'FontIcon'];

            if (direction == false) {
                if (me.options.prevText_post) {
                    if (me.currentSlide == 0) {
                        html3 = me.options.prevText_post;
                    } else {
                        html3 = me.options.prevText;
                    }
                } else {
                    html3 = me.options.prevText;
                }
            } else {
                if (me.options.nextText_post) {
                    if (me.currentSlide == me.numberOfSlides - 1) {
                        html1 = me.options.nextText_post;
                    } else {
                        html1 = me.options.nextText;
                    }
                } else {
                    html1 = me.options.nextText;
                }
            }
        } else {
            width = me.options.buttonWidth;

            if (
                (direction == false && me.options.prevPost && me.currentSlide == 0) ||
                (direction == true && me.options.nextPost && me.currentSlide == me.numberOfSlides - 1)
            ) {
                html2 = me.options[directionName + 'Text_post'];
                href = direction ? me.options.nextPost : me.options.prevPost;
            }
            else {
                html2 = me.options[directionName + 'Text'];
            }
        }

        // Set link.
        if (
            (direction == false && me.options.prevPost && me.currentSlide == 0) ||
            (direction == true && me.options.nextPost && me.currentSlide == me.numberOfSlides - 1)
        ) {
            buttonEl.addClass('_another_post');
            href = direction ? me.options.nextPost : me.options.prevPost;
        } else {
            buttonEl.removeClass('_another_post');
            if (me.needToRefreshPage()) {
                var slide = me.slides[me.currentSlide + (direction ? 1 : -1)];
                if (slide) {
                    href = slide.permalink;
                }
            }
            else {
                href = '#';
            }
        }

        buttonEl.find('._1').html(html1);
        buttonEl.find('._2')
            .css('width', width > 0 ? width : '')
            .html(html2);
        buttonEl.find('._3').html(html3);

        // Disable or enable
        if (
            (direction == false && me.options.prevPost == null && me.currentSlide == 0) ||
            (direction == true && me.options.nextPost == null && me.currentSlide == me.numberOfSlides - 1)
        ) {
            buttonEl.addClass('_disabled');
            href = '#';
        }
        else {
            buttonEl.removeClass('_disabled');
        }

        buttonEl.attr('href', href);
    };

    // Handler for previous and next buttons.
    me.onNavClick = function (that, direction, event) {
        var $that = $(that);

        // Jump to another page.
        // Some 3rd party plugins misbehave and turn the '#' into '', namely https://github.com/medialize/URI.js with "Blackout Image Gallery".
        if ($that.attr('href') != '#' && $that.attr('href') != '') {
            me.showLoading();
            me.saveScrollTop();
            return;
        }

        if (direction == 'prev') {
            me.setPrev();
        } else {
            me.setNext();
        }

        $that.focus();
        event.preventDefault();
    };

    me.isHtml5StorageAvailable = function () {
        try {
            return 'localStorage' in window && window['localStorage'] !== null;
        } catch (e) {
            return false;
        }
    };

    me.saveScrollTop = function () {
        if (!me.options.scrollAfterRefresh) {
            return;
        }

        if (!me.isHtml5StorageAvailable) {
            return;
        }
        
        localStorage.setItem('scrollTop', JSON.stringify({
            postId: me.postId,
            scrollTop: $(window).scrollTop()
        }));
    };

    me.loadScrollTop = function () {
        if (!me.options.scrollAfterRefresh) {
            return;
        }

        if (!me.isHtml5StorageAvailable) {
            return;
        }

        var data = JSON.parse(localStorage.getItem('scrollTop'));
        if (data && data.postId == me.postId) {
            var scrollTop = Math.min(data.scrollTop, me.slideContainer.offset().top);
            $(window).scrollTop(scrollTop);
        }

        localStorage.removeItem('scrollTop');
    };

    // Go to the previous slide.
    me.setPrev = function () {
        if (me.currentSlide == 0) {
            if (me.options.prevPost) {
                me.showPost(me.options.prevPost);
            }
        }
        else {
            me.setSlide(me.currentSlide - 1);
        }
    };

    // Go to the next slide.
    me.setNext = function () {
        if (me.currentSlide == me.numberOfSlides - 1) {
            if (me.options.nextPost) {
                me.showPost(me.options.nextPost);
            }
        }
        else {
            me.setSlide(me.currentSlide + 1);
        }
    };

    // Go to another post. This method will be called when navigating using the keyboard shortcuts.
    me.showPost = function (postUrl) {
        document.location = postUrl;
    };

    // Set the transition properties (used in Live Preview).
    me.setTransition = function (options) {
        var defaults = {
            'effect': me.options.transitionEffect,
            'speed': me.options.transitionSpeed
        };
        options = $.extend(defaults, options);
        me.options.transitionEffect = options.effect;
        me.options.transitionSpeed = options.speed;
    };

    // Set the navigation bar's text template (used in Live Preview).
    me.setNavText = function (text) {
        me.options.navText = text;
        me.updateNavigationBars();
    };

    // Set the title for all slides (used in Live Preview).
    me.setTitleText = function (text) {
        for (i = 0; i < me.slides.length; i++) {
            me.slides[i].shortCodeTitle = '';
        }
        me.options.helperText = text;
        me.updateTitleText();
    };

    me.showLoading = function () {
        me.isLoading = true;
        for (i = 0; i < me.navEl.length; i++) {
            me.navEl[i].container
                .append($('<div class="_loading"></div>'))
                .find('._buttons > a').addClass('_disabled');
        }
    };

    me.hideLoading = function () {
        me.isLoading = false;
        for (i = 0; i < me.navEl.length; i++) {
            me.navEl[i].container.find('._loading').remove();
        }
        me.updateNavigationBars();
    };

    me.needToRefreshPage = function () {
        return (
        me.currentSlide !== null &&
        me.options.refreshAds &&
        me.slidesSinceLastAdRefresh + 1 >= me.options.refreshAdsEveryNSlides &&
        me.options.adRefreshingMechanism == 'page'
        );
    };

    // Initialize the slider.
    me.init();

    return me;
};
// source --> https://www.elhuertourbano.net/wp-content/plugins/theia-post-slider/js/tps-transition-slide.js?ver=1.8.3 
/*
 * Copyright 2012-2015, Theia Post Slider, WeCodePixels, http://wecodepixels.com
 */
var tps = tps || {};
tps.transitions = tps.transitions || {};
tps.transitions.slide = function (me, previousIndex, newIndex) {
    var $ = jQuery;

    // Init
    var width = me.slideContainer.innerWidth();
    var diff = newIndex - previousIndex;
    var direction = diff > 0 ? 1 : -1;

    // Start all animations at once, at the end of this function. Otherwise we can get rare race conditions.
    var animationsQueue = [];

    // Remove previous slide.
    var previousSlide = previousIndex !== null ? $(me.slides[previousIndex].content) : null;
    if (previousSlide) {
        me.slideContainer.css('height', previousSlide.innerHeight());
        animationsQueue.push(function () {
            previousSlide
                .css('width', width)
                .css('position', 'absolute')
                .css('left', 0)
                .animate({
                    left: -direction * width
                }, me.options.transitionSpeed, function (me, previousIndex) {
                    return function () {
                        $(this)
                            .detach()
                            .css('position', '')
                            .css('left', '');
                        me.decrementSemaphore();
                    }
                }(me, previousIndex));
        });
    }

    var slide = me.slides[newIndex].content;

    if (previousSlide == null) {
        // Don't animate the first shown slide.
        me.slideContainer.append(slide);
    }
    else {
        slide.css('width', width);
        slide.css('visibility', 'hidden');
        me.slideContainer.append(slide);

        // Call event handlers.
        me.onNewSlide();

        // Animate the height.
        animationsQueue.push(function () {
            me.slideContainer.animate({
                'height': slide.innerHeight()
            }, me.options.transitionSpeed, function (me) {
                return function () {
                    $(this)
                        .css('position', '');
                    me.decrementSemaphore();
                }
            }(me));
        });

        // Animate the new slide.
        animationsQueue.push(function () {
            slide
                .css('left', direction * width)
                .css('position', 'absolute')
                .css('visibility', 'visible')
                .animate({
                    left: '0'
                }, me.options.transitionSpeed, function (me) {
                    return function () {
                        $(this)
                            .css('position', '')
                            .css('width', '');
                        me.slideContainer.css('height', '');
                        me.decrementSemaphore();
                    }
                }(me));
        });
    }

    return animationsQueue;
};