/* search */ (function ($) { $(function () { //on DOM ready $('a[href^="#"]').click(function(e){ var anchor = $(this).attr("href").substr("1"); if (anchor.length && $("a[name='"+anchor+"']").length){ e.preventDefault(); $('html, body').animate({ scrollTop: $("a[name='"+anchor+"']").offset().top}, 500, "easeInOutQuad"); } }); $('#search a').click( function(e) { e.preventDefault(); if ($(this).hasClass('open')) { $(this).removeClass('open'); $(this).css( {'background-position': '0 0' } ); $(this).find('span').css( {'background-position': '0 0' } ); $('.searchContainer').hide(); $('div.africa').find('li.inactive') .addClass('active') .removeClass('inactive'); } else { $(this).addClass('open'); $(".bc-header").css("margin-bottom","0px"); $(this).css( {'background-position': '0 0' } ); $(this).find('span').css( {'background-position': '0 -28px' } ); $('.searchContainer').show(); $('div.africa').find('li.active') .addClass('inactive') .removeClass('active'); } } ); $('ol > li').wrapInner(' '); var $elem = $('.bc-container'); var subnav_t; var isAuthor = $('div.nav.africa').hasClass("author"); if (isAuthor) { $('div.nav.africa').find('li').hover(function() { var $this = $(this); clearTimeout(subnav_t); var delay = $('div.subnav:visible').length > 0 ? 0 : 300; subnav_t = setTimeout(function(){ $(this).parents(".africa").addClass("closed"); $('div.nav.africa').find('div.subnav').css("z-index", 13).stop(true).fadeOut(1); $this.parents(".africa").removeClass("closed"); $this.addClass("active-temp").children("a").css("opacity", 1); if ($this.attr("id")=="search") { $(".bc-header").css("margin-bottom","0px"); $('div.africa').addClass("closed"); } else $(".bc-header").css("margin-bottom","600px"); // $("nav.africa > ul > li:not(.active-temp) > a").animate({"opacity": 0.5}); $("div.nav.africa > ul > li:not(.active-temp) > a").animate( { color:'#7fbfdb'} ); if ( ! $this.find('div.subnav').length) return; $('div[role="bc-main"], div.bc-footer').stop(true).animate( { opacity: 0.3 }, 0 ); $this.find('div.subnav') .stop(true) .css({"opacity": 0, "z-index": 12}) .show().animate( {opacity:1}, delay == 0 ? 0 : 1 ); $search = $('#search').find('a'); $search.removeClass('open'); $search.css( {'background-position': '0 0' } ); $search.find('span').css( {'background-position': '0 0' } ); $('.searchContainer').hide(); $('div.africa').find('li.inactive') .addClass('active') .removeClass('inactive'); }, delay); }, function() { clearTimeout(subnav_t); //$(this).parents(".africa").addClass("closed"); $(".active-temp").removeClass("active-temp"); // $("div.nav.africa > ul > li > a").animate({"opacity": 1}); $("div.nav.africa > ul > li:not(.active-temp) > a").animate( { color:'#007EB6'} ); if ( ! $(this).find('div.subnav').length) return; //$(this).find('div.subnav').css("z-index", 13).stop(true).fadeOut(1); $('div[role="bc-main"], div.bc-footer').stop(true).animate( { opacity: 1 } ); }); }else { $('div.nav.africa').find('li').hover(function() { var $this = $(this); clearTimeout(subnav_t); var delay = $('div.subnav:visible').length > 0 ? 0 : 300; subnav_t = setTimeout(function(){ $this.parents(".africa").removeClass("closed"); $this.addClass("active-temp").children("a").css("opacity", 1); // $("nav.africa > ul > li:not(.active-temp) > a").animate({"opacity": 0.5}); $("div.nav.africa > ul > li:not(.active-temp) > a").animate( { color:'#7fbfdb'} ); if ( ! $this.find('div.subnav').length) return; $('div[role="bc-main"], div.bc-footer').stop(true).animate( { opacity: 0.3 }, 0 ); $this.find('div.subnav') .stop(true) .css({"opacity": 0, "z-index": 12}) .show().animate( {opacity:1}, delay == 0 ? 0 : 1 ); $search = $('#search').find('a'); $search.removeClass('open'); $search.css( {'background-position': '0 0' } ); $search.find('span').css( {'background-position': '0 0' } ); $('.searchContainer').hide(); $('div.africa').find('li.inactive') .addClass('active') .removeClass('inactive'); }, delay); }, function() { clearTimeout(subnav_t); $(this).parents(".africa").addClass("closed"); $(".active-temp").removeClass("active-temp"); $(".bc-header").css("margin-bottom","0px"); // $("div.nav.africa > ul > li > a").animate({"opacity": 1}); $("div.nav.africa > ul > li:not(.active-temp) > a").animate( { color:'#007EB6'} ); if ( ! $(this).find('div.subnav').length) return; $('div[role="bc-main"], div.bc-footer').stop(true).animate( { opacity: 1 } ); $(this).find('div.subnav').css("z-index", 13).stop(true).fadeOut(1); }); } }); }(jQuery)); /* search */ /* ajax call for top navigaion */ /* jmo Pulled out from here and placr in vap jsp barcaf_topnav_vap.jsp */ /* ajax call for top navigaion */ /* footer accordion * (function($){ $.fn.areablockLinks = function( option ) { option = $.extend( {}, $.fn.areablockLinks.option, option ); return this.each(function() { var $that = $(this); $that.find('.bc-ul-linksdropdown').each(function(){ if($(this).find('.bc-link').length==0)$(this).css("height","75px"); $(this).show().data("height", $(this).height()); if ($(this).parents(".bc-linksdropdown-nav").hasClass("open")){ $(".bc-linksdropdown-nav").data('opened', true); } else { $(this).hide().find('.bc-link').hide(); $(".bc-linksdropdown-nav").data('opened', false); } }); $that.hover(function(e){ var $areas = $(this); if ($areas.data("opened") === true) return; $areas.find('.area .bc-ul-linksdropdown') .stop() .css( { "margin-top": "0", "height": "0" } ) .show() .animate( { "height": "5px" }); },function(e){ var $areas = $(this); if ($areas.data("opened") === true) return; $areas.find('.area .bc-ul-linksdropdown') .stop() .animate( { "height": "0" }, function() { $(this).hide(); } ); }); $that.click(function(e){ var $areas = $(this); if ($areas.data("opened")) { $areas.find('.area .bc-ul-linksdropdown').slideUp( 1000, function() { $(this).find('.bc-link').hide(); $areas.data('opened', false).removeClass("open"); } ); } else { $areas.data('opened', true); $areas.find('.area .bc-ul-linksdropdown').each(function() { $(this) .stop(true) .css("height","0px") .show() .css({"margin-top": '1em'}) .animate( { height: $(this).data("height") }, function(){ $areas.addClass("open"); } ); $(this).find('.bc-link').show(); }); $('html, body').animate({scrollTop: $areas.offset().top}, 800); } }); }); }; // default options $.fn.areablockLinks.option = {}; })(jQuery); $('.bc-linksdropdown-nav').areablockLinks(); /* footer accordion */ /* Main carousel */ var hideaperture=new Array(6); hideaperture[0]="false" hideaperture[1]="false" hideaperture[2]="false" hideaperture[3]="false" hideaperture[4]="false" hideaperture[5]="false" /* portal */ $(".portal-bar").show(); setTimeout(function() { $('.portal .carousel-image-surround').portal({paramplay:10000,paramimage:'/deployedfiles/Assets/Richmedia/barcafgrp/images/loading.gif'}); }, 1000); $('.sub-carousel').find('#slides').show().slides({ preload: true, preloadImage: '/deployedfiles/Assets/Richmedia/barcafgrp/images/loading.gif', play: 10000, pause: 2500, hoverPause: true, animationStart: function(id) { $('#carousel-intro-'+id).fadeOut( function() { tid = id; } ); }, animationComplete: function(id) { var inter = window.setInterval( function(e) { if (tid !== null) { $('#carousel-intro-'+id).fadeIn(); tid = null; window.clearInterval(inter); } }, 100 ); } }); if(hideaperture[0]=="true"){ $(".portal-bar").removeClass("portal-bar").addClass("portal-bar-blank"); } else if(hideaperture[0]=="false"){ $(".portal-bar-blank").removeClass("portal-bar-blank").addClass("portal-bar"); } /* Main carousel */ /* Thumbnail carousel */ $(function() { $('#thumbs .thumb a').each(function(i) { $(this).addClass( 'itm'+i ); $(this).click(function() { $('#images').trigger( 'slideTo', [i, 0, true] ); return false; }); }); $('#thumbs a.itm0').addClass( 'selected' ); $('#images').carouFredSel({ direction: 'left', circular: true, infinite: false, items: 1, auto: true, scroll: { fx: 'directscroll', onBefore: function() { var pos = $(this).triggerHandler( 'currentPosition' ); $('#thumbs a').removeClass( 'selected' ); $('#thumbs a.itm'+pos).addClass( 'selected' ); var page = Math.floor( pos / 3 ); $('#thumbs').trigger( 'slideToPage', page ); } } }); $('#thumbs').carouFredSel({ direction: 'left', circular: true, infinite: false, items: 3, align: false, auto: false, prev: '#prev', next: '#next' }); }); /* Thumbnail carousel */ /* ajax call tab accordion */ /* ajax call tab accordion */