$(document).ready(function(){ $('a.buttonred,a.buttonyellow').append(''); $('#nav div span').hide(); $('#nav div a:eq(1)').click(function(){$('#nav div span').toggle();}); $('.story-subnav a:eq(0)').addClass('active'); $('#contact .story-subnav a:eq(0)').removeClass('active'); $('.story-subnav a').click(function(){ $('.story-subnav a').removeClass('active'); $(this).addClass('active'); }); //$('#content div').hide().filter(':first').show(); $('#content > div div').jScrollPane(); $('#content > div div').addClass('contentdivs'); $(".story-subnav ul").tabs("#content > div", {effect: 'slide'}); (function($) { var cache = []; // Arguments are image paths relative to the current page. $.preLoadImages = function() { var args_len = arguments.length; for (var i = args_len; i--;) { var cacheImage = document.createElement('img'); cacheImage.src = arguments[i]; cache.push(cacheImage); } } })(jQuery);jQuery.preLoadImages("/images/education_outreach_bg-funding.jpg"); $('.story-subnav li a').click(function(){ $('body#education_outreach').css({'background-image':'url(/images/education_outreach_bg.jpg)'}); $('.fundinglogos').hide(); }); $('.story-subnav li a.funding').click(function(){ $('body#education_outreach').css({'background-image':'url(/images/education_outreach_bg-funding.jpg)'}); $('.fundinglogos').show(); }); /* wallboy Trailer */ $('.story-subnav li a').click(function(){$('.wallboytrailer').hide();}); $('.story-subnav li.wallboytrailer_li a').click(function(){$('.wallboytrailer').show();}); /* wallboy Gallery */ /* Initialise */ var imgCount = $('#wallboygallery li').length; $('#wallboygallery li:eq(0)').addClass('center'); $('#wallboygallery li:eq(1)').addClass('r_thumb'); $('#wallboygallery li:gt(1)').addClass('hidden'); $('#wallboygallery li:last').addClass('l_thumb').removeClass('hidden'); $('#wallboygallery li').click(function(){ if ($(this).hasClass('l_thumb')){moveLeft();$(this).find('a').attr({});} else if ($(this).hasClass('r_thumb')){moveRight();$(this).find('a').attr({});} else if ($(this).hasClass('center')){$(this).find('a').attr({});} // else if($(this).hasClass('center')){enlarge();} }); $('#wallboygallery li.center').hover(function(){$(this).addClass('smamodal')},function(){$(this).removeClass('smamodal')}); $('#wallboygallery li.l_thumb,#wallboygallery li.r_thumb').click(function(){$('#wallboygallery li.center').removeClass('smamodal')}); //$('#wallboygallery li.center a').attr({title:"Click for larger view"}); $('#wallboygallery li').attr({onmousedown:'return false'}); $('#wallboygallery li').bind("contextmenu",function(e){return false;}); }); function moveRight(){ var imgList = $('#wallboygallery li'); var imgCount = imgList.length; var target=$('#wallboygallery li.r_thumb'); var t_index = imgList.index(target); var r_t_index = ((t_index + 1) >= imgCount) ? (t_index + 1) - imgCount : t_index + 1 ; var l_t_index = ((t_index - 1) < 0) ? ((t_index - 1) + imgCount) : t_index - 1 ; // alert('Target index = '+t_index+'\nLeft Thumb: '+l_t_index + '\nRight Thumb: ' + r_t_index + '\nTotal images: '+imgCount); var duration = 500; imgList.eq(r_t_index).addClass('r_thumb').removeClass('hidden'); $('#wallboygallery li.l_thumb').addClass('hidden').removeClass('l_thumb'); imgList.eq(l_t_index).addClass('l_thumb').removeClass('center'); target.addClass('center').removeClass('r_thumb'); } function moveLeft(){ var imgList = $('#wallboygallery li'); var imgCount = imgList.length; var target=$('#wallboygallery li.l_thumb'); var t_index = imgList.index(target); var r_t_index = ((t_index + 1) >= imgCount) ? (t_index + 1) - imgCount : t_index + 1 ; var l_t_index = ((t_index - 1) < 0) ? ((t_index - 1) + imgCount) : t_index - 1 ; // alert('Target index = '+t_index+'\nLeft Thumb: '+l_t_index + '\nRight Thumb: ' + r_t_index + '\nTotal images: '+imgCount); var duration = 500; imgList.eq(l_t_index).addClass('l_thumb').removeClass('hidden'); $('#wallboygallery li.r_thumb').addClass('hidden').removeClass('r_thumb'); imgList.eq(r_t_index).addClass('r_thumb').removeClass('center'); target.addClass('center').removeClass('l_thumb'); }