//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License.

MooTools.More={version:"1.2.4.4",build:"6f6057dc645fdb7547689183b2311063bd653ddf"};
$extend(Element.NativeEvents,{hashchange:1});var HashListener=new Class({Implements:[Options,Events],options:{blank_page:"blank.html",start:false},iframe:null,currentHash:"",firstLoad:true,handle:false,useIframe:(Browser.Engine.trident&&(typeof(document.documentMode)=="undefined"||document.documentMode<8)),ignoreLocationChange:false,initialize:function(a){var b=this;this.setOptions(a);if(Browser.Engine.presto&&window.history.navigationMode){window.history.navigationMode="compatible"}if(("onhashchange" in window)&&(typeof(document.documentMode)=="undefined"||document.documentMode>7)){window.addEvent("hashchange",function(){var c=b.getHash();if(c==b.currentHash){return}b.fireEvent("hashChanged",c);b.fireEvent("hash-changed",c)})}else{if(this.useIframe){this.initializeHistoryIframe()}}window.addEvent("unload",function(c){b.firstLoad=null});if(this.options.start){this.start()}},initializeHistoryIframe:function(){var b=this.getHash(),a;this.iframe=new IFrame({src:this.options.blank_page,styles:{position:"absolute",top:0,left:0,width:"1px",height:"1px",visibility:"hidden"}}).inject(document.body);a=(this.iframe.contentDocument)?this.iframe.contentDocument:this.iframe.contentWindow.document;a.open();a.write('<html><body id="state">'+b+"</body></html>");a.close();return},checkHash:function(){var c=this.getHash(),a,b;if(this.ignoreLocationChange){this.ignoreLocationChange=false;return}if(this.useIframe){b=(this.iframe.contentDocument)?this.iframe.contentDocumnet:this.iframe.contentWindow.document;a=b.body.innerHTML;if(a!=c){this.setHash(a);c=a}}if(this.currentLocation==c){return}this.currentLocation=c;this.fireEvent("hashChanged",c);this.fireEvent("hash-changed",c)},setHash:function(a){window.location.hash=this.currentLocation=a;if(("onhashchange" in window)&&(typeof(document.documentMode)=="undefined"||document.documentMode>7)){return}this.fireEvent("hashChanged",a);this.fireEvent("hash-changed",a)},getHash:function(){var a;if(Browser.Engine.gecko){a=/#(.*)$/.exec(window.location.href);return a&&a[1]?a[1]:""}else{if(Browser.Engine.webkit){return decodeURI(window.location.hash.substr(1))}else{return window.location.hash.substr(1)}}},setIframeHash:function(a){var b=(this.iframe.contentDocument)?this.iframe.contentDocumnet:this.iframe.contentWindow.document;b.open();b.write('<html><body id="state">'+a+"</body></html>");b.close()},updateHash:function(a){if($type(document.id(a))){this.debug_msg("Exception: History locations can not have the same value as _any_ IDs that might be in the document, due to a bug in IE; please ask the developer to choose a history location that does not match any HTML IDs in this document. The following ID is already taken and cannot be a location: "+newLocation)}this.ignoreLocationChange=true;if(this.useIframe){this.setIframeHash(a)}else{this.setHash(a)}},start:function(){this.handle=this.checkHash.periodical(100,this)},stop:function(){$clear(this.handle)}});

