jQuery.fn.initBogoTabs=function(F,H){H=jQuery.extend({activeLabelClass:"bogoTabsActiveLabel",inactiveLabelClass:"bogoTabsInactiveLabel",debugBogoTabs:false},H);var J=this;J.dbgdiv=null;function B(L){if(J.dbgdiv){J.dbgdiv.append("BogoTabs: "+L+"<br/>")}}if(H.debugBogoTabs){this.after("<div id='bogoTabsDebugDiv'>Debugging area</div>");J.dbgdiv=jQuery("#bogoTabsDebugDiv");J.dbgdiv.css("border","1px dashed #000");B("debugging activated.")}function D(){var L=this;L.tabs=[];L.links=[];L.onselect=[];L.currentTab=null}J.holder=new D();function A(N){B("switchTabs("+N+")");var P=null;var L=[];for(var M=0;M<J.holder.tabs.length;++M){var O=J.holder.tabs[M];if(O==N){P=jQuery(O);(J.holder.links[O]).removeClass(H.inactiveLabelClass).addClass(H.activeLabelClass)}else{L[L.length]=jQuery(O);(J.holder.links[O]).removeClass(H.activeLabelClass).addClass(H.inactiveLabelClass)}}if(J.currentTab&&(J.currentTab.attr("id")==P.attr("id"))){B("Skipping switch - tab already selected.");return }jQuery(L).each(function(){this.hide()});if(J.holder.onselect[N]){(J.holder.onselect[N])(P)}P.show();J.currentTab=P}var K=null;for(var I in F){if(!K){K=I}var C=jQuery(I);var E=F[I];if(E["selected"]){K=I}C.hide();this.append(C);var G=jQuery("<span tabid='"+I+"'/>");G.css("cursor","pointer");J.holder.tabs[J.holder.tabs.length]=I;J.holder.links[I]=G;J.holder.onselect[I]=E.onselect;G.html(E["label"]);G.click(function(){B("Calling switch: "+jQuery(this).attr("tabid"));A(jQuery(this).attr("tabid"));return false});this.before(G)}A(K)}
