window.dhtmlHistory={initialize:function(){if(this.isInternetExplorer()==false){return}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(c,d){var a=this;var b=function(){if(a.currentWaitTime>0){a.currentWaitTime=a.currentWaitTime-a.WAIT_TIME}c=a.removeHash(c);var f=document.getElementById(c);if(f!=undefined||f!=null){var e="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: "+c;throw e}historyStorage.put(c,d);a.ignoreLocationChange=true;this.ieAtomicLocationChange=true;a.currentLocation=c;window.location.hash=c;if(a.isInternetExplorer()){a.iframe.src="blank.html?"+c}this.ieAtomicLocationChange=false};window.setTimeout(b,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.WAIT_TIME},isFirstLoad:function(){if(this.firstLoad==true){return true}else{return false}},isInternational:function(){return false},getVersion:function(){return"0.05"},getCurrentLocation:function(){var a=this.removeHash(window.location.hash);return a},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 b=this;window.onunload=function(){b.firstLoad=null};if(this.isInternetExplorer()==false){if(historyStorage.hasKey("DhtmlHistory_pageLoaded")==false){this.ignoreLocationChange=true;this.firstLoad=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")}var b=this;var c=function(){b.checkLocation()};setInterval(c,100)},fireHistoryEvent:function(a){var b=historyStorage.get(a);this.listener.call(null,a,b)},checkLocation:function(){if(this.isInternetExplorer()==false&&this.ignoreLocationChange==true){this.ignoreLocationChange=false;return}if(this.isInternetExplorer()==false&&this.ieAtomicLocationChange==true){return}var a=this.getCurrentLocation();if(a==this.currentLocation){return}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");var c=a.contentWindow.document;var b=new String(c.location.search);if(b.length==1&&b.charAt(0)=="?"){b=""}else{if(b.length>=2&&b.charAt(0)=="?"){b=b.substring(1)}}return b},removeHash:function(a){if(a==null||a==undefined){return null}else{if(a==""){return""}else{if(a.length==1&&a.charAt(0)=="#"){return""}else{if(a.length>1&&a.charAt(0)=="#"){return a.substring(1)}else{return a}}}}},iframeLoaded:function(a){if(this.ignoreLocationChange==true){this.ignoreLocationChange=false;return}var b=new String(a.search);if(b.length==1&&b.charAt(0)=="?"){b=""}else{if(b.length>=2&&b.charAt(0)=="?"){b=b.substring(1)}}if(this.pageLoadEvent!=true){window.location.hash=b}this.fireHistoryEvent(b)},isInternetExplorer:function(){var a=navigator.userAgent.toLowerCase();if(document.all&&a.indexOf("msie")!=-1){return true}else{return false}}};window.historyStorage={debugging:false,storageHash:new Object(),hashLoaded:false,put:function(a,b){this.assertValidKey(a);if(this.hasKey(a)){this.remove(a)}this.storageHash[a]=b;this.saveHashTable()},get:function(a){this.assertValidKey(a);this.loadHashTable();var b=this.storageHash[a];if(b==undefined){return null}else{return b}},remove:function(a){this.assertValidKey(a);this.loadHashTable();delete this.storageHash[a];this.saveHashTable()},reset:function(){this.storageField.value="";this.storageHash=new Object()},hasKey:function(a){this.assertValidKey(a);this.loadHashTable();if(typeof this.storageHash[a]=="undefined"){return false}else{return true}},isValidKey:function(a){return(typeof a=="string")},storageField:null,init:function(){var b="position: absolute; top: -1000px; left: -1000px;";if(this.debugging==true){b="width: 30em; height: 30em;"}var a="<form id='historyStorageForm' method='GET' style='"+b+"'><textarea id='historyStorageField' style='"+b+"'left: -1000px;' name='historyStorageField'></textarea></form>";document.write(a);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 serializedHashTable=this.storageField.value;if(serializedHashTable!=""&&serializedHashTable!=null){this.storageHash=eval("("+serializedHashTable+")")}this.hashLoaded=true}},saveHashTable:function(){this.loadHashTable();var a=JSON.stringify(this.storageHash);this.storageField.value=a}};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 g,e,b,f="",d;switch(typeof a){case"object":if(a){if(a.______array=="______array"){for(e=0;e<a.length;++e){d=this.stringify(a[e]);if(f){f+=","}f+=d}return"["+f+"]"}else{if(typeof a.toString!="undefined"){for(e in a){d=a[e];if(typeof d!="undefined"&&typeof d!="function"){d=this.stringify(d);if(f){f+=","}f+=this.stringify(e)+":"+d}}return"{"+f+"}"}}}return"null";case"number":return isFinite(a)?String(a):"null";case"string":b=a.length;f='"';for(e=0;e<b;e+=1){g=a.charAt(e);if(g>=" "){if(g=="\\"||g=='"'){f+="\\"}f+=g}else{switch(g){case"\b":f+="\\b";break;case"\f":f+="\\f";break;case"\n":f+="\\n";break;case"\r":f+="\\r";break;case"\t":f+="\\t";break;default:g=g.charCodeAt();f+="\\u00"+Math.floor(g/16).toString(16)+(g%16).toString(16)}}}return f+'"';case"boolean":return String(a);default:return"null"}},parse:function(l){var d=0;var a=" ";function k(n){throw {name:"JSONError",message:n,at:d-1,text:l}}function g(){a=l.charAt(d);d+=1;return a}function i(){while(a!=""&&a<=" "){g()}}function j(){var o,p="",n,m;if(a=='"'){outer:while(g()){if(a=='"'){g();return p}else{if(a=="\\"){switch(g()){case"b":p+="\b";break;case"f":p+="\f";break;case"n":p+="\n";break;case"r":p+="\r";break;case"t":p+="\t";break;case"u":m=0;for(o=0;o<4;o+=1){n=parseInt(g(),16);if(!isFinite(n)){break outer}m=m*16+n}p+=String.fromCharCode(m);break;default:p+=a}}else{p+=a}}}}k("Bad string")}function h(){var m=[];if(a=="["){g();i();if(a=="]"){g();return m}while(a){m.push(c());i();if(a=="]"){g();return m}else{if(a!=","){break}}g();i()}}k("Bad array")}function e(){var m,n={};if(a=="{"){g();i();if(a=="}"){g();return n}while(a){m=j();i();if(a!=":"){break}g();n[m]=c();i();if(a=="}"){g();return n}else{if(a!=","){break}}g();i()}}k("Bad object")}function f(){var o="",m;if(a=="-"){o="-";g()}while(a>="0"&&a<="9"){o+=a;g()}if(a=="."){o+=".";while(g()&&a>="0"&&a<="9"){o+=a}}if(a=="e"||a=="E"){o+="e";g();if(a=="-"||a=="+"){o+=a;g()}while(a>="0"&&a<="9"){o+=a;g()}}m=+o;if(!isFinite(m)){k("Bad number")}else{return m}}function b(){switch(a){case"t":if(g()=="r"&&g()=="u"&&g()=="e"){g();return true}break;case"f":if(g()=="a"&&g()=="l"&&g()=="s"&&g()=="e"){g();return false}break;case"n":if(g()=="u"&&g()=="l"&&g()=="l"){g();return null}break}k("Syntax error")}function c(){i();switch(a){case"{":return e();case"[":return h();case'"':return j();case"-":return f();default:return a>="0"&&a<="9"?f():b()}}return c()}};window.historyStorage.init();window.dhtmlHistory.create();
