function historyRemoteInit(){(function(A){A.ajaxHistory=new function(){var K="historyReset";var C=location.hash;var J=null;var H;this.update=function(){};var G=function(){A(".remote-output").empty();};A(document).bind(K,G);if(A.browser.msie){var I,D=false;A(function(){I=A('<iframe style="display: none;"></iframe>').appendTo(document.body).get(0);var M=I.contentWindow.document;M.open();M.close();if(C&&C!="#"){M.location.hash=C.replace("#","");}});this.update=function(N){C=N;var M=I.contentWindow.document;M.open();M.close();M.location.hash=N.replace("#","");};H=function(){var N=I.contentWindow.document;var M=N.location.hash;if(M!=C){C=M;if(M&&M!="#"){A('a[href$="'+M+'"]').click();location.hash=M;}else{if(D){location.hash="";A(document).trigger(K);}}}D=true;};}else{if(A.browser.mozilla||A.browser.opera){this.update=function(M){C=M;};H=function(){if(location.hash){if(C!=location.hash){C=location.hash;A('a[href$="'+C+'"]').click();}}else{if(C){C="";A(document).trigger(K);}}};}else{if(A.browser.safari){var L,B,F;A(function(){L=[];L.length=history.length;B=[];});var E=false,D=false;F=function(M){L.push(M);B.length=0;E=false;};this.update=function(M){C=M;F(C);};H=function(){var M=history.length-L.length;if(M){E=false;if(M<0){for(var N=0;N<Math.abs(M);N++){B.unshift(L.pop());}}else{for(var N=0;N<M;N++){L.push(B.shift());}}var O=L[L.length-1];A('a[href$="'+O+'"]').click();C=location.hash;}else{if(L[L.length-1]==undefined&&!E){if(document.URL.indexOf("#")>=0){A('a[href$="#'+document.URL.split("#")[1]+'"]').click();}else{if(D){A(document).trigger(K);}}E=true;}}D=true;};}}}this.initialize=function(M){if(typeof M=="function"){A(document).unbind(K,G).bind(K,M);}if(location.hash&&typeof F=="undefined"){A('a.remote[href$="'+location.hash+'"]').click();}if(H&&J==null){J=setInterval(H,200);}};};A.fn.remote=function(B,C){C=A.extend({hashPrefix:"remote-"},C||{});var D=A(B).size()&&A(B)||A("<div></div>").appendTo("body");D.addClass("remote-output");return this.each(function(F){var E=this.href;var G="#"+C.hashPrefix+(F+1);this.href=G;A(this).click(function(I){var H=I.clientX;D.load(E,function(){if(H){A.ajaxHistory.update(G);}});});});};A.fn.history=function(){return this.click(function(C){var B=C.clientX;if(B){A.ajaxHistory.update(this.hash);}});};})(jQuery);}