$(document).ready(function(){ $('.BAM_tabsContainer').each(function(count){ $tabContainer = $(this); $tabContainer.tabs({ cache: false, spinner: "" }); if (!$tabContainer.hasClass('nocycle')) { $tabContainer .tabs('rotate', 15000) ; } if ($tabContainer.hasClass('main')) { $tabContainer .find('ul.ui-tabs-nav').appendTo('#BAM_middleContainer').wrap('
').wrap('
') ; } $('#BAM_tabsLoading').remove(); $tabContainer.show(); if ($tabContainer.hasClass('autoSize')) { $("iframe", $tabContainer).bind('load',function() { $(this).show().css('visibility','visible'); autoSizeFrame(this); }); $tabContainer.bind("tabsselect", function(event, ui){ $("iframe:not(.noAutoSize)", ui.panel).each(function(){ $(this).show().css('visibility','visible'); autoSizeFrame(this); }); $("iframe.noAutoSize[latentsrc]", ui.panel).each(function(){ $(this).attr('src',$(this).attr('latentsrc')).removeAttr('latentsrc'); }); }); } }); function autoSizeFrame(frame) { if (!$(frame).hasClass('noAutoSize')) { var frameDoc = frame.contentDocument ? frame.contentDocument : frame.contentWindow.document; $(frame).height($('body', frameDoc).height() + 35); } } $('.BAM_rightTabContainer').each(function(){ $this = $(this); $.ajax({ type: "GET", url: $('a', this).attr('href'), success: function(html) { $this.html(html).show(); } }); }); }); var $tabsContainer; var tabLinkArray = new Array(); $(function() { $tabsContainer = top.$('.BAM_tabsContainer.main:first'); // For forward and back $.address.change(function(event){ $tabsContainer.tabs( "select" , window.location.hash ) }); // when the tab is selected update the url with the hash $tabsContainer.bind("tabsselect", function(event, ui) { window.location.hash = ui.tab.hash; }); }); function tabGo(href) { var selectedTabIndex = $tabsContainer.tabs('option','selected'); var $selectedTabObject = $('.ui-tabs-nav a:eq(' + selectedTabIndex + ')'); var selectedTabUrl = $.data($selectedTabObject[0], 'load.tabs'); if (typeof(tabLinkArray[selectedTabIndex])=="undefined") tabLinkArray[selectedTabIndex] = new Array(); tabLinkArray[selectedTabIndex].push(selectedTabUrl); $tabsContainer.tabs('url',selectedTabIndex,href).tabs('load',selectedTabIndex); return false; } function tabBack() { var selectedTabIndex = $tabsContainer.tabs('option','selected'); if (tabLinkArray[selectedTabIndex].length > 0) { var href = tabLinkArray[selectedTabIndex].pop(); $tabsContainer.tabs('url',selectedTabIndex,href).tabs('load',selectedTabIndex); } return false; }