		$(document).ready(function(){
		
		
		// Accordion settings
		
			// $(".accordion").prepend("<span class='openAll'>open all</span><span class='closeAll'>close all</span>"); // add open/close all link
		
			$(".question").addClass('questionLink'); // Add class to style as a link
			
			$(".answer").hide(); 
			
			$(".question").click(function(){
				$(this).next(".answer").slideToggle(50);
				$(this).toggleClass('active');
			});
			
			$(".firstFaq").click(function(){
				$(this).toggleClass('activeFirst');
			});
			
			$("dt.lastFaq").click(function(){
				$(this).toggleClass('activeLast');
			});


			$(".openAll").click(function(){
				$(".answer").slideDown(50);
				$(".question").addClass('active');
				$(".answer").addClass('active');
				$(".closeAll").show();
				$(".openAll").hide();
			});
			
			
			$(".closeAll").hide();
			$(".closeAll").click(function(){
				$(".answer").slideUp(50);
				$(".question").removeClass('active');
				$(".answer").removeClass('active');
				$(".openAll").show();
				$(".closeAll").hide();
			});
			
			
			
			// ColorBox settings
			
			$("a[rel='popup']").colorbox({width:"421", height:"155", iframe:true, rel:"nofollow", scrolling:false, current:"{current} of {total}"}); // language popup
			
			
			$('.buttonClose').attr({
  				target: '_parent',
 				onclick: 'parent.$.fn.colorbox.close();'
			});
			
			
			
			// Pod hover settings
						
			$(".pod").hoverIntent({
				sensitivity: 3, 
				interval: 100, 
				over: makeTall, 
				timeout: 500, 
				out: makeShort
			});

			$(".show").addClass('showArmed'); // Add class to make hover work
			
			
			// Winner table settings
			
		//	$("table.winners").before("<h2 class='openWinners'>View the winners</h2><span class='closeWinners'>close</span>"); // add open/close link

			$("table.winners tr:odd").addClass("altRow");
			$("table.winners tr:first-child td:first-child").addClass("firstCell");
			$("table.winners tr:first-child td:last-child").addClass("lastCell");
			$("table.winners tr:last-child td:first-child").addClass("lastRowFirstCell");
			$("table.winners tr:last-child td:last-child").addClass("lastRowlastCell");
			$("table.winners tr:last-child.altRow td:first-child").addClass("lastRowAltFirstCell");
			$("table.winners tr:last-child.altRow td:last-child").addClass("lastRowAltLastCell");
			
			//$("table.winners").hide(); 
			$(".closeWinners").hide();
			
			$(".openWinners").click(function(){
				$("table.winners").slideToggle(10);
				$(".closeWinners").slideToggle(10);
			});
			
			$(".closeWinners").click(function(){
				$("table.winners").hide(); 
				$(".closeWinners").hide();
			});
			
			
		}); // end of document ready



		// Functions for pod hover

		function makeTall(){  
					
					$(this).children(".show").animate({"height":137},200);
					$(this).children(".show").addClass('activeTall');	
					
					}
		
		function makeShort(){ 
					
					$(this).children(".show").animate({"height":37},200);
					$(this).children(".show").removeClass('activeTall');	
					
					}


		// Cufon settings

	    Cufon.replace('.olyCountTitle');
    	Cufon.replace('.olyCountLondon');
      	Cufon.replace('.olyCountNo');	  	  
	    Cufon.replace('.olyCountText');	 
	
