
window.dhtmlHistory={initialize:function(){if(this.isInternetExplorer()!=false)if(historyStorage.hasKey("DhtmlHistory_pageLoaded")==false){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put("DhtmlHistory_pageLoaded",true)}else{this.fireOnNewListener=true;this.firstLoad=false}},addListener:function(a){this.listener=a;if(this.fireOnNewListener==true){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false}},add:function(a){var c=this;window.setTimeout(function(){if(c.currentWaitTime>0)c.currentWaitTime-=c.WAIT_TIME;a=c.removeHash(a);var b=document.getElementById(a);if(b!=undefined||b!=null)throw"Exception: History locations can not have the same value as _any_ id's that might be in the document, due to a bug in Internet Explorer; please ask the developer to choose a history location that does not match any HTML id's in this document. The following ID is already taken and can not be a location: "+a;this.ieAtomicLocationChange=c.ignoreLocationChange=true;c.currentLocation=a;window.location.hash=a;if(c.isInternetExplorer())c.iframe.src="blank.html?"+a;this.ieAtomicLocationChange=false},this.currentWaitTime);this.currentWaitTime+=this.WAIT_TIME},isFirstLoad:function(){return this.firstLoad==true?true:false},isInternational:function(){return false},getVersion:function(){return"0.03"},getCurrentLocation:function(){return this.removeHash(window.location.hash)},currentLocation:null,listener:null,iframe:null,ignoreLocationChange:null,WAIT_TIME:200,currentWaitTime:0,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,create:function(){var a=this.getCurrentLocation();this.currentLocation=a;if(this.isInternetExplorer()){document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='DhtmlHistoryFrame' id='DhtmlHistoryFrame' src='blank.html?"+a+"'></iframe>");this.WAIT_TIME=400}var c=this;window.onunload=function(){c.firstLoad=null};if(this.isInternetExplorer()==false)if(historyStorage.hasKey("DhtmlHistory_pageLoaded")==false){this.firstLoad=this.ignoreLocationChange=true;historyStorage.put("DhtmlHistory_pageLoaded",true)}else{this.ignoreLocationChange=false;this.fireOnNewListener=true}else this.ignoreLocationChange=true;if(this.isInternetExplorer())this.iframe=document.getElementById("DhtmlHistoryFrame");c=this;setInterval(function(){c.checkLocation()},100)},fireHistoryEvent:function(a){var c=historyStorage.get(a);this.listener.call(null,a,c)},checkLocation:function(){if(this.isInternetExplorer()==false&&this.ignoreLocationChange==true)this.ignoreLocationChange=false;else if(!(this.isInternetExplorer()==false&&this.ieAtomicLocationChange==true)){var a=this.getCurrentLocation();if(a!=this.currentLocation){this.ieAtomicLocationChange=true;if(this.isInternetExplorer()&&this.getIFrameHash()!=a)this.iframe.src="blank.html?"+a;else if(this.isInternetExplorer())return;this.currentLocation=a;this.ieAtomicLocationChange=false;this.fireHistoryEvent(a)}}},getIFrameHash:function(){var a=document.getElementById("DhtmlHistoryFrame").contentWindow.document;a=new String(a.location.search);if(a.length==1&&a.charAt(0)=="?")a="";else if(a.length>=2&&a.charAt(0)=="?")a=a.substring(1);return a},removeHash:function(a){return a==null||a==undefined?null:a==""?"":a.length==1&&a.charAt(0)=="#"?"":a.length>1&&a.charAt(0)=="#"?a.substring(1):a},iframeLoaded:function(a){if(this.ignoreLocationChange==true)this.ignoreLocationChange=false;else{a=new String(a.search);if(a.length==1&&a.charAt(0)=="?")a="";else if(a.length>=2&&a.charAt(0)=="?")a=a.substring(1);if(this.pageLoadEvent!=true)window.location.hash=a;this.fireHistoryEvent(a)}},isInternetExplorer:function(){var a=navigator.userAgent.toLowerCase();return document.all&&a.indexOf("msie")!=-1?true:false}};window.historyStorage={debugging:false,storageHash:{},hashLoaded:false,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];return a==undefined?null: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 typeof this.storageHash[a]=="undefined"?false:true},isValidKey:function(a){if(typeof a!="string")a=a.toString();return/^[a-zA-Z0-9_ \!\@\#\$\%\^\&\*\(\)\+\=\:\;\,\.\/\?\|\\\~\{\}\[\]]*$/.test(a)},storageField:null,init:function(){var a="position: absolute; top: -1000px; left: -1000px;";if(this.debugging==true)a="width: 30em; height: 30em;";document.write("<form id='historyStorageForm' method='GET' style='"+a+"'><textarea id='historyStorageField' style='"+a+"'left: -1000px;' name='historyStorageField'></textarea></form>");this.storageField=document.getElementById("historyStorageField")},assertValidKey:function(a){if(this.isValidKey(a)==false)throw"Please provide a valid key for window.historyStorage, key= "+a;},loadHashTable:function(){if(this.hashLoaded==false){var a=this.storageField.value;if(a!=""&&a!=null)this.storageHash=eval("("+a+")");this.hashLoaded=true}},saveHashTable:function(){this.loadHashTable();this.storageField.value=JSON.stringify(this.storageHash)}};Array.prototype.______array="______array";var JSON={org:"http://www.JSON.org",copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(a){var c,b,h,f="";switch(typeof a){case"object":if(a)if(a.______array=="______array"){for(b=0;b<a.length;++b){c=this.stringify(a[b]);if(f)f+=",";f+=c}return"["+f+"]"}else if(typeof a.toString!="undefined"){for(b in a){c=a[b];if(typeof c!="undefined"&&typeof c!="function"){c=this.stringify(c);if(f)f+=",";f+=this.stringify(b)+":"+c}}return"{"+f+"}"}return"null";case"number":return isFinite(a)?String(a):"null";case"string":h=a.length;f='"';for(b=0;b<h;b+=1){c=a.charAt(b);if(c>=" "){if(c=="\\"||c=='"')f+="\\";f+=c}else switch(c){case"\u0008":f+="\\b";break;case"\u000c":f+="\\f";break;case"\n":f+="\\n";break;case"\r":f+="\\r";break;case"\t":f+="\\t";break;default:c=c.charCodeAt();f+="\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)}}return f+'"';case"boolean":return String(a);default:return"null"}},parse:function(a){function c(e){throw{name:"JSONError",message:e,at:j-1,text:a};}function b(){d=a.charAt(j);j+=1;return d}function h(){for(;d!=""&&d<=" ";)b()}function f(){var e,g="",k,i;if(d=='"')a:for(;b();)if(d=='"'){b();return g}else if(d=="\\")switch(b()){case"b":g+="\u0008";break;case"f":g+="\u000c";break;case"n":g+="\n";break;case"r":g+="\r";break;case"t":g+="\t";break;case"u":for(e=i=0;e<4;e+=1){k=parseInt(b(),16);if(!isFinite(k))break a;i=i*16+k}g+=String.fromCharCode(i);break;default:g+=d}else g+=d;c("Bad string")}function n(){var e=[];if(d=="["){b();h();if(d=="]"){b();return e}for(;d;){e.push(l());h();if(d=="]"){b();return e}else if(d!=",")break;b();h()}}c("Bad array")}function o(){var e,g={};if(d=="{"){b();h();if(d=="}"){b();return g}for(;d;){e=f();h();if(d!=":")break;b();g[e]=l();h();if(d=="}"){b();return g}else if(d!=",")break;b();h()}}c("Bad object")}function m(){var e="";if(d=="-"){e="-";b()}for(;d>="0"&&d<="9";){e+=d;b()}if(d==".")for(e+=".";b()&&d>="0"&&d<="9";)e+=d;if(d=="e"||d=="E"){e+="e";b();if(d=="-"||d=="+"){e+=d;b()}for(;d>="0"&&d<="9";){e+=d;b()}}e=+e;if(isFinite(e))return e;else c("Bad number")}function p(){switch(d){case"t":if(b()=="r"&&b()=="u"&&b()=="e"){b();return true}break;case"f":if(b()=="a"&&b()=="l"&&b()=="s"&&b()=="e"){b();return false}break;case"n":if(b()=="u"&&b()=="l"&&b()=="l"){b();return null}break}c("Syntax error")}function l(){h();switch(d){case"{":return o();case"[":return n();case'"':return f();case"-":return m();default:return d>="0"&&d<="9"?m():p()}}var j=0,d=" ";return l()}};window.historyStorage.init();window.dhtmlHistory.create();
