// Design & Technology by Reading Room // www.readingroom.com (020) 7173 2800 // Author: Lucy Kavanagh // Date: June 2009 // Client: G4S /* * IMPORTANT: * jQuery.noConflict is ON in jQuery source for sitecore page edit compatability. * Therefor all instances of '$' selectors must be replaced with 'jQuery'. */ jQuery(document).ready(function(){ jQuery(this).delay(200, function(){ // delay needed for Firefox 3.0.x - content not syncing properly on refresh only jQuery(".terms").colorbox(); jQuery(".incoterms").colorbox(); jQuery(".split a").click(function() { jQuery("#gen_small_table").hide(); jQuery("#gen_large_table").hide(); jQuery("#gen_hc_table").hide(); jQuery("#ref_small_table").hide(); jQuery("#ref_large_table").hide(); jQuery("#ref_hc_table").hide(); var show_table = jQuery(this).attr("id"); switch(show_table){ case "gen_small": jQuery("#gen_small_table").show("slow"); break; case "gen_large": jQuery("#gen_large_table").show("slow"); break; case "gen_large": jQuery("#gen_large_table").show("slow"); break; case "gen_hc": jQuery("#gen_hc_table").show("slow"); break; case "ref_small": jQuery("#ref_small_table").show("slow"); break; case "ref_large": jQuery("#ref_large_table").show("slow"); break; case "ref_hc": jQuery("#ref_hc_table").show("slow"); break; }; }); jQuery("a#exportLink").click(function() { jQuery("a#importLink").parent().prev().show(); jQuery("a#importLink").parent().show(); jQuery("a#importLink").parent().next().hide(); jQuery("a#generalLink").parent().prev().show(); jQuery("a#generalLink").parent().show(); jQuery("a#generalLink").parent().next().hide(); jQuery(this).parent().prev().hide(); jQuery(this).parent().hide(); jQuery(this).parent().next().show() }); jQuery("a#importLink").click(function() { jQuery("a#exportLink").parent().prev().show(); jQuery("a#exportLink").parent().show(); jQuery("a#exportLink").parent().next().hide(); jQuery("a#generalLink").parent().prev().show(); jQuery("a#generalLink").parent().show(); jQuery("a#generalLink").parent().next().hide(); jQuery(this).parent().prev().hide(); jQuery(this).parent().hide(); jQuery(this).parent().next().show() }); jQuery("a#generalLink").click(function() { jQuery("a#importLink").parent().prev().show(); jQuery("a#importLink").parent().show(); jQuery("a#importLink").parent().next().hide(); jQuery("a#exportLink").parent().prev().show(); jQuery("a#exportLink").parent().show(); jQuery("a#exportLink").parent().next().hide(); jQuery(this).parent().prev().hide(); jQuery(this).parent().hide(); jQuery(this).parent().next().show() }); // ****** MAIN NAV ****** // // Dropdown is pure css, but needs js fix to appear in IE6, and has fade/tab focus enhancement when JS on jQuery('.mainNav > li > ul').hide(); jQuery('.mainNav > ul > li').hover( function(){jQuery(this).addClass('hover').children('ul').fadeIn();}, function(){jQuery(this).children('ul').hide().parent('li').removeClass('hover');} ); jQuery('.mainNav > ul > li > a').focus( function(){jQuery(this).parents('li').addClass('hover').siblings('ul').fadeIn();} ); jQuery('.mainNav > ul > li > a').blur( function(){jQuery(this).siblings('ul').hide().parent('li').removeClass('hover');} ); // ****** SUB NAV****** // // Slide for sectors and services faux headers (but not if there is only one) if (jQuery('.fauxHeader').length !== 1){ jQuery('.fauxHeader').addClass('navSlide'); jQuery('#subNav dd.active').siblings('.navSlide').removeClass('navSlide').addClass('fauxActive'); jQuery('.navSlide').siblings('dd').hide(); jQuery('.navSlide').click(function(){ if (jQuery(this).siblings('dd').is(':hidden')) { jQuery(this).children('span').addClass('active').parents('.navSlide').siblings('dd').slideDown('slow'); jQuery(this).siblings('.navSlide').children('span').removeClass('active').parents('.navSlide').siblings('dd').slideUp(); } else { jQuery(this).children('span').removeClass('active').parents('.navSlide').siblings('dd').slideUp(); } }); jQuery('.fauxActive').toggle( function(){jQuery(this).children('span').addClass('off').parents('.fauxActive').siblings('dd').slideUp();}, function(){ jQuery(this).children('span').removeClass('off').parents('.fauxActive').siblings('dd').slideDown('slow'); jQuery(this).siblings('.fauxActive').children('span').removeClass('off').parents('.fauxActive').siblings('dd').slideUp(); } ); }; }); // end delay }); // end document ready