var AjaxUrlFixer=Class.create({DefaultOptions:{observeBackButton:true,defaultHash:''},initialize:function(func){this.timeout=false;this.call=Object.extend({fixer:func});this.options=Object.extend(this.DefaultOptions,arguments[1]||{});this.checkWhetherChanged();if(this.options.observeBackButton==true){this.interval=setInterval(this.checkWhetherChanged.bind(this),500)}},getStoredHash:function(){return this.hash},storeHash:function(hash){this.hash=hash},setHash:function(hash){if(hash!=""){this.storeHash(hash);window.location.hash="#"+hash}},getHash:function(){var hash=window.location.hash;var separator_position=hash.lastIndexOf("#");if(separator_position!=-1)hash=hash.substr(separator_position+1);return hash},checkWhetherChanged:function(){if(this.getHash()==''){if(this.getStoredHash()!=this.options.defaultHash){this.storeHash(this.options.defaultHash);this.call.fixer(this.options.defaultHash)}}else if(this.getHash()!=this.getStoredHash()){this.storeHash(this.getHash());this.call.fixer(this.getStoredHash())}}});var AjaxCache=Class.create({initialize:function(){this.debug=false;this.cache=new Hash()},debugEnabled:function(bool){this.debug=bool},debugMessage:function(msg){alert(msg)},set:function(key,value){if(this.debug)this.debugMessage('set key: '+key+', value: '+value);this.cache.set(key,value)},isset:function(key){if(this.cache.keys().indexOf(key)>=0)return true;else return false},get:function(key){if(this.isset(key))return this.cache.get(key);else return false},remove:function(key){if(this.isset(key))this.cache.remove(key)}});