(function(a){if(typeof console==="undefined")console=typeof window.console!=="undefined"?window.console:{};console.log=console.log||function(){};console.debug=console.debug||console.log;console.warn=console.warn||console.log;console.error=console.error||function(){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);alert(b.join("\n"))};console.trace=console.trace||console.log;console.group=console.group||console.log;console.groupEnd=console.groupEnd||console.log;console.profile=console.profile||
console.log;console.profileEnd=console.profileEnd||console.log;a.HistoryClass=function(){this.construct()};a.extend(a.HistoryClass.prototype,{hash:"",$window:null,$iframe:null,handlers:{generic:[],specific:{}},format:function(b){return b.replace(/^.+?#/g,"")},getState:function(){return a.History.format(a.History.hash)},setState:function(b){b=b||a.History.getHash();return a.History.hash=a.History.format(b)},getHash:function(){return a.History.format(window.location.hash||
location.hash)},setHash:function(b){b=a.History.format(b);b=b.replace(/^\/?|\/?(\?)|\/?$/g,"$1");if(typeof window.location.hash!=="undefined")window.location.hash=b;else location.hash=b},go:function(b){if(a.browser.msie&&parseInt(a.browser.version,10)<8){a.History.$iframe.contentWindow.document.open();a.History.$iframe.contentWindow.document.close();a.History.$iframe.contentWindow.document.location.hash=b}b=b||"#";a.History.getHash()!==b&&a.History.setHash(b);a.History.$window.trigger("hashchange")},
hashchange:function(){var b=a.History.getHash(),c=a.History.getState();if(!a.History.$iframe&&c===b||a.History.$iframe&&a.History.hash===a.History.$iframe.contentWindow.document.location.hash)return false;if(c===b)return false;a.History.setState(b);a.History.trigger();return true},bind:function(b,c){if(c){if(typeof a.History.handlers.specific[b]==="undefined")a.History.handlers.specific[b]=[];a.History.handlers.specific[b].push(c)}else{c=b;a.History.handlers.generic.push(c)}return true},trigger:function(b){if(typeof b===
"undefined")b=a.History.getState();var c,e,f,d;if(typeof a.History.handlers.specific[b]!=="undefined"){d=a.History.handlers.specific[b];c=0;for(e=d.length;c<e;++c){f=d[c];f(b)}}d=a.History.handlers.generic;c=0;for(e=d.length;c<e;++c){f=d[c];f(b)}return true},construct:function(){a(document).ready(function(){a.History.domReady()});return true},domReadied:false,domReady:function(){if(!a.History.domRedied){a.History.domRedied=true;a.History.$window=a(window);a.History.$window.bind("hashchange",this.hashchange);
setTimeout(a.History.hashchangeLoader,200);return true}},hashchangeLoader:function(){if(a.browser.msie&&parseInt(a.browser.version,10)>=8)(b=a.History.getHash())&&a.History.$window.trigger("hashchange");else{if(a.browser.msie){a.History.$iframe=a('<iframe id="jquery-history-iframe" style="display: none;"></$iframe>').prependTo(document.body)[0];a.History.$iframe.contentWindow.document.open();a.History.$iframe.contentWindow.document.close();var b=a.History.getHash();if(b)a.History.$iframe.contentWindow.document.location.hash=
b;b=function(){var c=a.History.format(a.History.$iframe.contentWindow.document.location.hash);a.History.getState()!==c&&a.History.setHash(a.History.$iframe.contentWindow.document.location.hash);c=a.History.getHash();a.History.getState()!==c&&a.History.go(c)}}else b=function(){var c=a.History.getHash();a.History.getState()!==c&&a.History.go(c)};setInterval(b,200)}return true}});if(typeof a.History==="undefined")a.History=new a.HistoryClass})(jQuery);
