(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(){var c=[];for(var b=0;b<arguments.length;b++){c.push(arguments[b])}alert(c.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,"").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(){var b=window.location.hash||location.hash;return a.History.format(b)},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(c){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=c}c=c||"#";var b=a.History.getHash();if(b!==c){a.History.setHash(c)}a.History.$window.trigger("hashchange")},hashchange:function(b){var c=a.History.getHash();var d=a.History.getState();if((!a.History.$iframe&&d===c)||(a.History.$iframe&&a.History.hash===a.History.$iframe.contentWindow.document.location.hash)){return false}if(d===c){return false}a.History.setState(c);a.History.trigger();return true},bind:function(c,b){if(b){if(typeof a.History.handlers.specific[c]==="undefined"){a.History.handlers.specific[c]=[]}a.History.handlers.specific[c].push(b)}else{b=c;a.History.handlers.generic.push(b)}return true},trigger:function(c){if(typeof c==="undefined"){c=a.History.getState()}var d,e,b,f;if(typeof a.History.handlers.specific[c]!=="undefined"){f=a.History.handlers.specific[c];for(d=0,e=f.length;d<e;++d){b=f[d];b(c)}}f=a.History.handlers.generic;for(d=0,e=f.length;d<e;++d){b=f[d];b(c)}return true},construct:function(b){a(document).ready(function(){a.History.domReady()});return true},domReadied:false,domReady:function(){if(a.History.domRedied){return}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)>=8)){var c;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}c=function(){var d=a.History.format(a.History.$iframe.contentWindow.document.location.hash);if(a.History.getState()!==d){a.History.setHash(a.History.$iframe.contentWindow.document.location.hash)}var e=a.History.getHash();if(a.History.getState()!==e){a.History.go(e)}}}else{c=function(){var d=a.History.getHash();if(a.History.getState()!==d){a.History.go(d)}}}setInterval(c,200)}else{var b=a.History.getHash();if(b){a.History.$window.trigger("hashchange")}}return true}});if(typeof a.History==="undefined"){a.History=new a.HistoryClass()}})(jQuery);
