/** 
 * Ridiculously small sized tab implementation with all the
 * features you'll need. 
 * 
 * Features 
 * 	- API is similar to $.ui.tabs.
 * 	- inline and ajaxed content
 * 	- tab enable / disable 
 * 	- next- prev tab functionality for wizards
 * 	- initial tab loading
 * 	- + more
 *  
 * @TODO:   
 * 	- NOT supported: (+ corresponding workarounds)
 * 
 * Few examples:
 * 	$("ul.tabs").jtabs();
 * 	$("ul.tabs").jtabs("click", 1);
 * 	$("ul.tabs").jtabs("next");
 * 	$("ul.tabs").jtabs(function(tabIndex) { }); 
 * 
 *  
 * If you want this plugin to be released at http://plugins.jquery.com
 * please drop a note to: tero.piirainen@piimaa.fi. 
 * 
 * 
 * @since 01.02.2008
 * @version 25.02.2008
 */
/*eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){$.I.q({8:4(c,d){l 2.o(4(){5(H c=="E"){3 a=$.B(2,"z");3 b=[d];a[c].y(a,b)}p{L $.8(2,c)}})}});$.8=4(c,d){$.B(c,"z",2);3 e=2;2.9={i:2.i};2.9=$.q(2.9,d);2.7=c;3 f=0;3 g=0;$("u",c).o(4(a){3 b=$(2);b.t("a").6(4(){e.6(a,c)});5(b.A(".k"))f=a;5(b.t("a").j("r")==R.P)g=a});5(g>0)e.6(g);p 5(f>0)e.6(f);p e.6(0)};$.q($.8.O,{i:4(a){l N},6:4(a){3 b=$("a:x("+a+")",2.7);5(!2.9.i.y(b.h(),[a]))l;5(b.w()==0||b.h().A(".m"))l;2.n=a;$("a",2.7).o(4(){$($(2).j("r")).K()});3 c=b.j("r").J(1);3 d=$("#"+c);3 e=b.j("v");5(e){d.G(e);b.F("v")}d.M();$("u.k",2.7).s("k");b.h().D("k").s("m")},C:4(a){3 b=2.n+1;3 c=$("a:x("+b+")",2.7);5(c.w()>0){5(a)c.h().s("m");2.6(b)}},Q:4(){2.6(2.n-1)}})})(S);',55,55,'||this|var|function|if|click|root|jtabs|opts||||||||parent|before|attr|current|return|disabled|index|each|else|extend|href|removeClass|find|li|url|size|eq|apply|el|is|data|next|addClass|string|removeAttr|load|typeof|fn|substring|hide|new|fadeIn|true|prototype|hash|prev|location|jQuery'.split('|'),0,{}))*/

(function($)
	{
	$.fn.extend(
		{
		jtabs:function(c,d)
			{
			return this.each(function()
				{
				if(typeof c=="string")
					{
					var a=$.data(this,"el");
					var b=[d];
					a[c].apply(a,b)
				}
				else
					{
					new $.jtabs(this,c)
				}
			}
			)
		}
	}
	);
	$.jtabs=function(c,d)
		{
		$.data(c,"el",this);
		var e=this;
		this.opts=
			{
			before:this.before
		};
		this.opts=$.extend(this.opts,d);
		this.root=c;
		var f=0;
		var g=0;
		$("li",c).each(function(a)
			{
			var b=$(this);
			b.find("a").click(function()
				{
				e.click(a,c);
				
			}
			);
			if(b.is(".current"))f=a;
			if(b.find("a").attr("href")==location.hash)g=a;
		
		}
		);
		if(g>0)e.click(g);
		else if(f>0)e.click(f);
		else e.click(0)
	};
	$.extend($.jtabs.prototype,
		{
		before:function(a)
			{
			return true
		}
		,click:function(a)
			{
			var b=$("a:eq("+a+")",this.root);
			if(!this.opts.before.apply(b.parent(),[a]))return;
			if(b.size()==0||b.parent().is(".disabled"))return;
			this.index=a;
			$("a",this.root).each(function()
				{
				$($(this).attr("href")).hide()
			}
			);
			
			var c=b.attr("href").substring(1);
			
			var d=$("#"+c);
			var e=b.attr("url");
			
			
			if(e)
				{
				d.load(e);
				
				b.removeAttr("url")
			}
			
			d.fadeIn();
			
			$("li.current",this.root).removeClass("current");
			b.parent().addClass("current").removeClass("disabled")
		}
		,next:function(a)
			{
				
			var b=this.index+1;
			var c=$("a:eq("+b+")",this.root);
			if(c.size()>0)
				{
				if(a)c.parent().removeClass("disabled");
				this.click(b)
			}
		}
		,prev:function()
			{
			this.click(this.index-1)
		}
	}
	)
}
)(jQuery);


