(function(b){function a(){this._curHash="";this._callback=function(c){}}b.extend(a.prototype,{init:function(d){this._callback=d;this._curHash=location.hash;if(b.browser.msie){b("body").prepend('<iframe id="jQuery_history" style="display: none;"></iframe>');var c=b("#jQuery_history")[0].contentWindow.document;c.open();c.close();if(this._curHash!=""){c.location.hash=this._curHash}}else{if(b.browser.safari){this._historyBackStack=[];this._historyBackStack.length=history.length;this._historyForwardStack=[];this._isFirst=true;this._dontCheck=false}}this._callback(this._curHash.replace(/^#/,""));setInterval(this._check,100)},add:function(c){this._historyBackStack.push(c);this._historyForwardStack.length=0;this._isFirst=true},_check:function(){if(b.browser.msie){var c=b("#jQuery_history")[0];var f=c.contentDocument||c.contentWindow.document;var h=f.location.hash;if(h!=b.history._curHash){location.hash=h;b.history._curHash=h;b.history._callback(h.replace(/^#/,""))}}else{if(b.browser.safari){if(!b.history._dontCheck){var d=history.length-b.history._historyBackStack.length;if(d){b.history._isFirst=false;if(d<0){for(var e=0;e<Math.abs(d);e++){b.history._historyForwardStack.unshift(b.history._historyBackStack.pop())}}else{for(var e=0;e<d;e++){b.history._historyBackStack.push(b.history._historyForwardStack.shift())}}var g=b.history._historyBackStack[b.history._historyBackStack.length-1];if(g!=undefined){b.history._curHash=location.hash;b.history._callback(g)}}else{if(b.history._historyBackStack[b.history._historyBackStack.length-1]==undefined&&!b.history._isFirst){if(document.URL.indexOf("#")>=0){b.history._callback(document.URL.split("#")[1])}else{b.history._callback("")}b.history._isFirst=true}}}}else{var h=location.hash;if(h!=b.history._curHash){b.history._curHash=h;b.history._callback(h.replace(/^#/,""))}}}},load:function(f){var g;if(b.browser.safari){g=f}else{g="#"+f;location.hash=g}this._curHash=g;if(b.browser.msie){var c=b("#jQuery_history")[0];var e=c.contentWindow.document;e.open();e.close();e.location.hash=g;this._callback(f)}else{if(b.browser.safari){this._dontCheck=true;this.add(f);var d=function(){b.history._dontCheck=false};window.setTimeout(d,200);this._callback(f);location.hash=g}else{this._callback(f)}}}});b(document).ready(function(){b.history=new a()})})(jQuery);var orig_title=document.title;function get_title(a,b){a=a||$(b);var c=a.find("title").text();!c&&a.each(function(){if(this.tagName=="TITLE"){c=this.text}});c=c||$.browser.msie&&orig_title;c=c||$("<title>"+b.replace(new RegExp("^[^]*<title>[\\s]*([^]*)[\\s]*</title>[^]*","mi"),"$1")+"</title>").text();return c}$(function(){$("a:not(.data)").live("click",function(c){if(c.button==0){var b=$(this).attr("href");if(b.substring(0,("http://"+document.location.host+"/").length)=="http://"+document.location.host+"/"){b=b.substring(("http://"+document.location.host+"/").length-1)}if(b.substring(0,1)!="/"||b=="/#"){return}c.preventDefault();this.blur();pageTracker&&pageTracker._trackPageview(b);$.history.load(b.substring(1))}});var a="GET /"+document.location.pathname.substring(1);$.history.init(function(b){if("GET /"+b===a){return}else{a="GET /"+b;$("#contents-wrapper").fadeOut("fast");function c(e){var d=$(e);$("#contents-wrapper").scrollTop(0);$("#contents-wrapper").fadeOut("fast",function(){$("#contents").html(d.find("#contents-wrapper").css("display","none"));document.title=get_title(d,e);$("#contents form").submit(function(g){g.preventDefault();var f=$(this);e={};f.find("input, textarea, select").each(function(){if($(this).is("input[type=checkbox]")&&!this.checked){return}if(e[this.name]){e[this.name].push(this.value)}else{e[this.name]=[this.value]}});a="POST /"+b;$.post(this.action,e,c)});$("#menu li").removeClass("active").find("a").each(function(){var f=$(this).attr("href");if(f.substring(0,("http://"+document.location.host+"/").length)=="http://"+document.location.host+"/"){f=f.substring(("http://"+document.location.host+"/").length-1)}if(("/"+b).substring(0,f.length)==f){$(this).parent().addClass("active")}});if($("#menu li li").hasClass("active")){$("#menu > li").removeClass("active")}if(b==""){$("#contents").addClass("home")}else{$("#contents").removeClass("home")}$("#contents-wrapper").fadeIn("normal")})}$.get("/"+b,c)}})});