/* jQuery Tools @VERSION Tabs- The basics of UI design. NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. http://flowplayer.org/tools/tabs/ Since: November 2008 Date: @DATE jQuery Tools @VERSION History "Back button for AJAX apps" NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. http://flowplayer.org/tools/toolbox/history.html Since: Mar 2010 Date: @DATE */ (function(a){function o(e,d,c){var b=this,h=e.add(this),i=e.find(c.tabs),l=d.jquery?d:e.children(d),k;i.length||(i=e.children());l.length||(l=e.parent().find(d));l.length||(l=a(d));a.extend(this,{click:function(f,g){var m=i.eq(f);if(typeof f=="string"&&f.replace("#","")){m=i.filter("[href*="+f.replace("#","")+"]");f=Math.max(i.index(m),0)}if(c.rotate){var p=i.length-1;if(f<0)return b.click(p,g);if(f>p)return b.click(0,g)}if(!m.length){if(k>=0)return b;f=c.initialIndex;m=i.eq(f)}if(f===k)return b; g=g||a.Event();g.type="onBeforeClick";h.trigger(g,[f]);if(!g.isDefaultPrevented()){n[c.effect].call(b,f,function(){g.type="onClick";h.trigger(g,[f])});k=f;i.removeClass(c.current);m.addClass(c.current);return b}},getConf:function(){return c},getTabs:function(){return i},getPanes:function(){return l},getCurrentPane:function(){return l.eq(k)},getCurrentTab:function(){return i.eq(k)},getIndex:function(){return k},next:function(){return b.click(k+1)},prev:function(){return b.click(k-1)}});a.each("onBeforeClick,onClick".split(","), function(f,g){a.isFunction(c[g])&&a(b).bind(g,c[g]);b[g]=function(m){a(b).bind(g,m);return b}});if(c.history&&a.fn.history){a.tools.history.init(i);c.event="history"}i.each(function(f){a(this).bind(c.event,function(g){b.click(f,g);return g.preventDefault()})});l.find("a[href^=#]").click(function(f){b.click(a(this).attr("href"),f)});if(location.hash)b.click(location.hash);else if(c.initialIndex===0||c.initialIndex>0)b.click(c.initialIndex)}a.tools=a.tools||{version:"@VERSION"};a.tools.tabs={conf:{tabs:"a", current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:false,history:false},addEffect:function(e,d){n[e]=d}};var n={"default":function(e,d){this.getPanes().hide().eq(e).show();d.call()},fade:function(e,d){var c=this.getConf(),b=c.fadeOutSpeed,h=this.getPanes();b?h.fadeOut(b):h.hide();h.eq(e).fadeIn(c.fadeInSpeed,d)},slide:function(e,d){this.getPanes().slideUp(200);this.getPanes().eq(e).slideDown(400,d)},ajax:function(e,d){this.getPanes().eq(0).load(this.getTabs().eq(e).attr("href"), d)}},j;a.tools.tabs.addEffect("horizontal",function(e,d){j||(j=this.getPanes().eq(0).width());this.getCurrentPane().animate({width:0},function(){a(this).hide()});this.getPanes().eq(e).animate({width:j},function(){a(this).show();d.call()})});a.fn.tabs=function(e,d){var c=this.data("tabs");if(c)return c;if(a.isFunction(d))d={onBeforeClick:d};d=a.extend({},a.tools.tabs.conf,d);this.each(function(){c=new o(a(this),e,d);a(this).data("tabs",c)});return d.api?c:this}})(jQuery); (function(a){function o(c){if(c){var b=j.contentWindow.document;b.open().close();b.location.hash=c}}var n,j,e,d;a.tools=a.tools||{version:"@VERSION"};a.tools.history={init:function(c){if(!d){if(a.browser.msie&&a.browser.version<"8"){if(!j){j=a("<iframe/>").attr("src","javascript:false;").hide().get(0);a("body").append(j);setInterval(function(){var b=j.contentWindow.document.location.hash;n!==b&&a.event.trigger("hash",b)},100);o(location.hash||"#")}}else setInterval(function(){var b=location.hash; b!==n&&a.event.trigger("hash",b)},100);e=!e?c:e.add(c);c.click(function(b){var h=a(this).attr("href");j&&o(h);if(h.slice(0,1)!="#"){location.href="#"+h;return b.preventDefault()}});d=true}}};a(window).bind("hash",function(c,b){b?e.filter(function(){var h=a(this).attr("href");return h==b||h==b.replace("#","")}).trigger("history",[b]):e.eq(0).trigger("history",[b]);n=b});a.fn.history=function(c){a.tools.history.init(this);return this.bind("history",c)}})(jQuery);
