window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(b){var a=this;var h=navigator.userAgent.toLowerCase();var g=navigator.platform.toLowerCase();var f=navigator.vendor||"";if(f==="KDE"){this.isKonqueror=true;this.isSupported=false;
}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true;}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true;}else{if(f.indexOf("Apple Computer, Inc.")>-1){this.isGecko=true;this.isSupported=(g.indexOf("mac")>-1);}else{if(h.indexOf("gecko")!=-1){this.isGecko=true;
this.isSupported=true;}}}}}window.historyStorage.setup(b);if(this.isSafari){this.createSafari();}else{if(this.isOpera){this.createOpera();}}var e=this.getCurrentLocation();this.currentLocation=e;if(this.isIE){this.createIE(e);}var d=function(){a.firstLoad=null;};this.addEventListener(window,"unload",d);
if(this.isIE){this.ignoreLocationChange=true;}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.ignoreLocationChange=false;this.fireOnNewListener=true;}}var c=function(){a.checkLocation();
};setInterval(c,100);},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.fireOnNewListener=true;this.firstLoad=false;}}},addListener:function(a){this.listener=a;
if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false;}},addEventListener:function(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false);}else{if(c.attachEvent){c.attachEvent("on"+b,function(){a(window.event);});}}},add:function(b,a){if(this.isSafari){b=this.removeHash(b);
historyStorage.put(b,a);this.currentLocation=b;window.location.hash=b;this.putSafariState(b);}else{var d=this;var c=function(){if(d.currentWaitTime>0){d.currentWaitTime=d.currentWaitTime-d.waitTime;}b=d.removeHash(b);if(document.getElementById(b)&&d.debugMode){var e="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: "+b;
throw new Error(e);}historyStorage.put(b,a);d.ignoreLocationChange=true;d.ieAtomicLocationChange=true;d.currentLocation=b;window.location.hash=b;if(d.isIE){d.iframe.src="/js/raptor/lib/ext/rsh/blank.html?"+b;}d.ieAtomicLocationChange=false;};window.setTimeout(c,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime;
}},isFirstLoad:function(){return this.firstLoad;},getVersion:function(){return"0.6";},getCurrentLocation:function(){var a=(this.isSafari?this.getSafariState():this.getCurrentHash());return a;},getCurrentHash:function(){var b=window.location.href;var a=b.indexOf("#");return(a>=0?b.substr(a+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(d){this.waitTime=400;
var c=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var b="rshHistoryFrame";var a='<iframe frameborder="0" id="'+b+'" style="'+c+'" src="/js/raptor/lib/ext/rsh/blank.html?'+d+'"></iframe>';document.write(a);this.iframe=document.getElementById(b);
},createOpera:function(){this.waitTime=400;var a='<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />';document.write(a);},createSafari:function(){var f="rshSafariForm";var e="rshSafariStack";var d="rshSafariLength";var c=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;
var b=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var a='<form id="'+f+'" style="'+c+'">'+'<input type="text" style="'+b+'" id="'+e+'" value="[]"/>'+'<input type="text" style="'+b+'" id="'+d+'" value=""/>'+"</form>";document.write(a);
this.safariStack=document.getElementById(e);this.safariLength=document.getElementById(d);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint;}else{this.safariHistoryStartPoint=this.safariLength.value;}},getSafariStack:function(){var a=this.safariStack.value;
return historyStorage.fromJSON(a);},getSafariState:function(){var a=this.getSafariStack();var b=a[history.length-this.safariHistoryStartPoint-1];return b;},putSafariState:function(b){var a=this.getSafariStack();a[history.length-this.safariHistoryStartPoint]=b;this.safariStack.value=historyStorage.toJSON(a);
},fireHistoryEvent:function(b){var a=historyStorage.get(b);this.listener.call(null,b,a);},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return;}if(!this.isIE&&this.ieAtomicLocationChange){return;}var a=this.getCurrentLocation();if(a==this.currentLocation){return;
}this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=a){this.iframe.src="/js/raptor/lib/ext/rsh/blank.html?"+a;}else{if(this.isIE){return;}}this.currentLocation=a;this.ieAtomicLocationChange=false;this.fireHistoryEvent(a);},getIframeHash:function(){var b=this.iframe.contentWindow.document;
var a=String(b.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(b){var a;if(b===null||b===undefined){a=null;}else{if(b===""){a="";}else{if(b.length==1&&b.charAt(0)=="#"){a="";}else{if(b.length>1&&b.charAt(0)=="#"){a=b.substring(1);
}else{a=b;}}}}return a;},iframeLoaded:function(b){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return;}var a=String(b.search);if(a.length==1&&a.charAt(0)=="?"){a="";}else{if(a.length>=2&&a.charAt(0)=="?"){a=a.substring(1);}}window.location.hash=a;this.fireHistoryEvent(a);}};window.historyStorage={setup:function(f){if(typeof f!=="undefined"){if(f.debugMode){this.debugMode=f.debugMode;
}if(f.toJSON){this.toJSON=f.toJSON;}if(f.fromJSON){this.fromJSON=f.fromJSON;}}var d="rshStorageForm";var e="rshStorageField";var c=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var b=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);
var a='<form id="'+d+'" style="'+c+'">'+'<textarea id="'+e+'" style="'+b+'"></textarea>'+"</form>";document.write(a);this.storageField=document.getElementById(e);if(typeof window.opera!=="undefined"){this.storageField.focus();}},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){b=null;}return b;},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");},isValidKey:function(a){return(typeof a==="string");},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(a){var b=this.isValidKey(a);
if(!b&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+a+".");}},loadHashTable:function(){if(!this.hashLoaded){var a=this.storageField.value;if(a!==""&&a!==null){this.storageHash=this.fromJSON(a);this.hashLoaded=true;}}},saveHashTable:function(){this.loadHashTable();
var a=this.toJSON(this.storageHash);this.storageField.value=a;},toJSON:function(a){return a.toJSONString();},fromJSON:function(a){return a.parseJSON();}};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(m){throw {name:"JSONError",message:m,at:d-1,text:l};}function g(){a=l.charAt(d);
d+=1;return a;}function i(){while(a!=""&&a<=" "){g();}}function j(){var m,n="",p,o;if(a=='"'){outer:while(g()){if(a=='"'){g();return n;}else{if(a=="\\"){switch(g()){case"b":n+="\b";break;case"f":n+="\f";break;case"n":n+="\n";break;case"r":n+="\r";break;case"t":n+="\t";break;case"u":o=0;for(m=0;m<4;m+=1){p=parseInt(g(),16);
if(!isFinite(p)){break outer;}o=o*16+p;}n+=String.fromCharCode(o);break;default:n+=a;}}else{n+=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 n="",m;if(a=="-"){n="-";g();}while(a>="0"&&a<="9"){n+=a;g();}if(a=="."){n+=".";while(g()&&a>="0"&&a<="9"){n+=a;
}}if(a=="e"||a=="E"){n+="e";g();if(a=="-"||a=="+"){n+=a;g();}while(a>="0"&&a<="9"){n+=a;g();}}m=+n;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();}};