(function($){$.simpletabs=function(){};$.fn.simpletabs=function(params){var opts=$.extend({hideTags:false,activeTab:1,activeClass:"active",mouseover:false,noresize:false,navParent:false,framesParent:false,activeAnchors:true,linksToInsideAnchors:[],setActiveElt:function($tab){return $tab;}},params);opts.linksToInsideAnchors=$(opts.linksToInsideAnchors);opts.activeTab--;var currentTab=false;this.each(function(){var container=$(this);var nav_container=opts.navParent||container.find("> :first-child");var frames_container=opts.framesParent||container.find("> :nth-child(2)");var nav_links=nav_container.find("a[href^=#]");var frames=frames_container.children();if(nav_links.length!=frames.length){return false;}
if(!(opts.noresize)){$(window).load(function(){var maxHeight=0;frames.each(function(){var curHeight=$(this).height();if(curHeight>maxHeight){maxHeight=curHeight;}});frames.height(maxHeight);});}
nav_links.click(function(e){e.preventDefault();});nav_links.each(function(){var $nav_link=$(this);this._linkedFrame=frames.filter($nav_link.attr("href"));this._linkedFrame.get(0)._linkedTab=this;if(opts.activeAnchors){$("a[href="+$nav_link.attr("href")+"]").not(this).click(function(e){e.preventDefault();var scrollTop=nav_container.offset().top;$(document).scrollTop(scrollTop);$nav_link.click();});}});nav_links.click(function(){if(currentTab){opts.setActiveElt(currentTab).removeClass(opts.activeClass);currentTab.get(0)._linkedFrame.hide();}else{frames.filter(":visible").hide();}
this._linkedFrame.show();opts.setActiveElt($(this)).addClass(opts.activeClass);currentTab=$(this);});if(opts.mouseover){nav_links.hover(function(){$(this).click();},function(){});}
if(opts.hideTags){frames.find(opts.hideTags).hide();}
opts.linksToInsideAnchors.each(function(){var $link=$(this);frames.each(function(){var $frame=$(this);if($frame.find($link.attr("href")).length>0){$link.click(function(){$($frame.get(0)._linkedTab).click();});}});});if(!!window.location.hash&&frames.is(window.location.hash)){nav_links.filter("[href="+window.location.hash+"]").click();}
else if(!!window.location.hash&&opts.linksToInsideAnchors.is('[href='+window.location.hash+']')){opts.linksToInsideAnchors.filter('[href='+window.location.hash+']').click();}
else{nav_links.filter(":eq("+opts.activeTab+")").click();}});return this;};})(jQuery);