if(!Object.prototype.toJSONString)Array.prototype.toJSONString=function(a){var c=[],b,e=this.length,d;for(b=0;b<e;b+=1)switch(d=this[b],typeof d){case "object":d?"function"===typeof d.toJSONString&&c.push(d.toJSONString(a)):c.push("null");break;case "string":case "number":case "boolean":c.push(d.toJSONString())}return"["+c.join(",")+"]"},Boolean.prototype.toJSONString=function(){return""+this},Date.prototype.toJSONString=function(){function a(a){return 10>a?"0"+a:a}return'"'+this.getUTCFullYear()+
"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+'Z"'},Number.prototype.toJSONString=function(){return isFinite(this)?""+this:"null"},Object.prototype.toJSONString=function(a){var c=[],b,e,d;if(a)for(e=0;e<a.length;e+=1){if(b=a[e],"string"===typeof b)switch(d=this[b],typeof d){case "object":d?"function"===typeof d.toJSONString&&c.push(b.toJSONString()+":"+d.toJSONString(a)):c.push(b.toJSONString()+":null");break;
case "string":case "number":case "boolean":c.push(b.toJSONString()+":"+d.toJSONString())}}else for(b in this)if("string"===typeof b&&Object.prototype.hasOwnProperty.apply(this,[b]))switch(d=this[b],typeof d){case "object":d?"function"===typeof d.toJSONString&&c.push(b.toJSONString()+":"+d.toJSONString()):c.push(b.toJSONString()+":null");break;case "string":case "number":case "boolean":c.push(b.toJSONString()+":"+d.toJSONString())}return"{"+c.join(",")+"}"},function(a){var c={"\u0008":"\\b","\t":"\\t",
"\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};a.parseJSON=function(a){function c(d,f){var g;if(f&&"object"===typeof f)for(g in f)Object.prototype.hasOwnProperty.apply(f,[g])&&(f[g]=c(g,f[g]));return a(d,f)}var d;if(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"")))return d=eval("("+this+")"),"function"===typeof a?c("",d):d;throw new SyntaxError("parseJSON");};a.toJSONString=function(){return/["\\\x00-\x1f]/.test(this)?'"'+this.replace(/[\x00-\x1f\\"]/g,
function(a){var e=c[a];if(e)return e;e=a.charCodeAt();return"\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)})+'"':'"'+this+'"'}}(String.prototype);window.dhtmlHistory={isIE:!1,isOpera:!1,isSafari:!1,isKonquerer:!1,isGecko:!1,isSupported:!1,create:function(a){var c=this,b=navigator.userAgent.toLowerCase(),e=navigator.platform.toLowerCase(),d=navigator.vendor||"";if("KDE"===d)this.isKonqueror=!0,this.isSupported=!1;else if("undefined"!==typeof window.opera)this.isSupported=this.isOpera=!0;else if("undefined"!==typeof document.all)this.isSupported=this.isIE=!0;else if(-1<d.indexOf("Apple Computer, Inc."))this.isSafari=!0,this.isSupported=-1<e.indexOf("mac");
else if(-1!=b.indexOf("gecko"))this.isSupported=this.isGecko=!0;window.historyStorage.setup(a);this.isSafari?this.createSafari():this.isOpera&&this.createOpera();this.currentLocation=a=this.getCurrentLocation();this.isIE&&this.createIE(a);this.addEventListener(window,"unload",function(){c.firstLoad=null});this.isIE?this.ignoreLocationChange=!0:historyStorage.hasKey(this.PAGELOADEDSTRING)?(this.ignoreLocationChange=!1,this.fireOnNewListener=!0):(this.firstLoad=this.ignoreLocationChange=!0,historyStorage.put(this.PAGELOADEDSTRING,
!0));setInterval(function(){c.checkLocation()},100)},initialize:function(){if(this.isIE)historyStorage.hasKey(this.PAGELOADEDSTRING)?(this.fireOnNewListener=!0,this.firstLoad=!1):(this.fireOnNewListener=!1,this.firstLoad=!0,historyStorage.put(this.PAGELOADEDSTRING,!0))},addListener:function(a){this.listener=a;if(this.fireOnNewListener)this.fireHistoryEvent(this.currentLocation),this.fireOnNewListener=!1},addEventListener:function(a,c,b){a.addEventListener?a.addEventListener(c,b,!1):a.attachEvent&&
a.attachEvent("on"+c,function(){b(window.event)})},add:function(a,c){if(this.isSafari)a=this.removeHash(a),historyStorage.put(a,c),this.currentLocation=a,window.location.hash=a,this.putSafariState(a);else{var b=this;window.setTimeout(function(){0<b.currentWaitTime&&(b.currentWaitTime-=b.waitTime);a=b.removeHash(a);if(document.getElementById(a)&&b.debugMode)throw Error("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: "+
a);historyStorage.put(a,c);b.ignoreLocationChange=!0;b.ieAtomicLocationChange=!0;b.currentLocation=a;window.location.hash=a;if(b.isIE)b.iframe.src="blank.html?"+a;b.ieAtomicLocationChange=!1},this.currentWaitTime);this.currentWaitTime+=this.waitTime}},isFirstLoad:function(){return this.firstLoad},getVersion:function(){return"0.6"},getCurrentLocation:function(){return this.isSafari?this.getSafariState():this.getCurrentHash()},getCurrentHash:function(){var a=window.location.href,c=a.indexOf("#");return 0<=
c?a.substr(c+1):""},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(a){this.waitTime=400;document.write('<iframe frameborder="0" id="rshHistoryFrame" style="'+(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles)+
'" src="blank.html?'+a+'"></iframe>');this.iframe=document.getElementById("rshHistoryFrame")},createOpera:function(){this.waitTime=400;document.write('<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />')},createSafari:function(){var a=historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles;document.write('<form id="rshSafariForm" style="'+(historyStorage.debugMode?
historyStorage.showStyles:historyStorage.hideStyles)+'"><input type="text" style="'+a+'" id="rshSafariStack" value="[]"/><input type="text" style="'+a+'" id="rshSafariLength" value=""/></form>');this.safariStack=document.getElementById("rshSafariStack");this.safariLength=document.getElementById("rshSafariLength");historyStorage.hasKey(this.PAGELOADEDSTRING)?this.safariHistoryStartPoint=this.safariLength.value:(this.safariHistoryStartPoint=history.length,this.safariLength.value=this.safariHistoryStartPoint)},
getSafariStack:function(){return historyStorage.fromJSON(this.safariStack.value)},getSafariState:function(){return this.getSafariStack()[history.length-this.safariHistoryStartPoint-1]},putSafariState:function(a){var c=this.getSafariStack();c[history.length-this.safariHistoryStartPoint]=a;this.safariStack.value=historyStorage.toJSON(c)},fireHistoryEvent:function(a){var c=historyStorage.get(a);this.listener.call(null,a,c)},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange)this.ignoreLocationChange=
!1;else if(this.isIE||!this.ieAtomicLocationChange){var a=this.getCurrentLocation();if(a!=this.currentLocation){this.ieAtomicLocationChange=!0;if(this.isIE&&this.getIframeHash()!=a)this.iframe.src="blank.html?"+a;else if(this.isIE)return;this.currentLocation=a;this.ieAtomicLocationChange=!1;this.fireHistoryEvent(a)}}},getIframeHash:function(){var a=""+this.iframe.contentWindow.document.location.search;1==a.length&&"?"==a.charAt(0)?a="":2<=a.length&&"?"==a.charAt(0)&&(a=a.substring(1));return a},removeHash:function(a){return null===
a||void 0===a?null:""===a?"":1==a.length&&"#"==a.charAt(0)?"":1<a.length&&"#"==a.charAt(0)?a.substring(1):a},iframeLoaded:function(a){this.ignoreLocationChange?this.ignoreLocationChange=!1:(a=""+a.search,1==a.length&&"?"==a.charAt(0)?a="":2<=a.length&&"?"==a.charAt(0)&&(a=a.substring(1)),window.location.hash=a,this.fireHistoryEvent(a))}};
window.historyStorage={setup:function(a){if("undefined"!==typeof a){if(a.debugMode)this.debugMode=a.debugMode;if(a.toJSON)this.toJSON=a.toJSON;if(a.fromJSON)this.fromJSON=a.fromJSON}document.write('<form id="rshStorageForm" style="'+(this.debugMode?historyStorage.showStyles:historyStorage.hideStyles)+'"><textarea id="rshStorageField" style="'+(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles)+'"></textarea></form>');this.storageField=document.getElementById("rshStorageField");
"undefined"!==typeof window.opera&&this.storageField.focus()},put:function(a,c){this.assertValidKey(a);this.hasKey(a)&&this.remove(a);this.storageHash[a]=c;this.saveHashTable()},get:function(a){this.assertValidKey(a);this.loadHashTable();a=this.storageHash[a];void 0===a&&(a=null);return a},remove:function(a){this.assertValidKey(a);this.loadHashTable();delete this.storageHash[a];this.saveHashTable()},reset:function(){this.storageField.value="";this.storageHash={}},hasKey:function(a){this.assertValidKey(a);
this.loadHashTable();return"undefined"!==typeof this.storageHash[a]},isValidKey:function(a){return"string"===typeof a},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:!1,storageHash:{},hashLoaded:!1,storageField:null,assertValidKey:function(a){if(!this.isValidKey(a)&&this.debugMode)throw Error("Please provide a valid key for window.historyStorage. Invalid key = "+a+".");},loadHashTable:function(){if(!this.hashLoaded){var a=
this.storageField.value;if(""!==a&&null!==a)this.storageHash=this.fromJSON(a),this.hashLoaded=!0}},saveHashTable:function(){this.loadHashTable();this.storageField.value=this.toJSON(this.storageHash)},toJSON:function(a){return a.toJSONString()},fromJSON:function(a){return a.parseJSON()}};

