var activepanel = null;

$(document).ready(function(){

	// Extra Content
	var extrastitle = $('.Extras h4');
	if(extrastitle.length > 0){
		$('.MainCollumnWrap').append('<div class="ExtraContentButton">' + extrastitle.text() + '</div>');
		extrastitle.remove();
		$('.ExtraContentButton').click(function(){
			$('.Extras').slideToggle();									
		});
		$('.Extras').hide();
	}
	
	// Scrolling Background
	var count = 1;
	$('.SiteBackground img').each(function(){
		$(this).addClass('Balloon' + count);
		count++;
	});
	if($('.Animation').length > 0){
		picturemove();
		balloonmove1();
		balloonmove2();
		balloonmove3();
	}
	
});

function picturemove(){
	$('.SiteBackground').css({'backgroundPosition': '0 0'}).animate({'backgroundPosition': "-2000 0"}, 200000, 'linear', picturemove);
}

function balloonmove1(){
	$('.Balloon1').animate({'left': '-270px', 'top': '-70px'}, 7000)
	.animate({'left': '-370px', 'top': '-35px'}, 7000)
	.animate({'top': '0px'}, 7000, balloonmove1);
}

function balloonmove2(){
	$('.Balloon2').animate({'top': '30px'}, 10000)
	.animate({'left': '-20px', 'top': '60px'}, 10000)
	.animate({'left': '-120px', 'top': '0px'}, 5000, balloonmove2);
}

function balloonmove3(){
	$('.Balloon3').animate({'right': '-380px', 'top': '-400px'}, 30000)
	.animate({'right': '-180px'}, 30000)
	.animate({'top': '-800px'}, 10000, balloonmove3);
}
