function animateBalloonA()
{
	resetBalloon(1);
	$('#balloon-1').animate({top: -400, opacity: 1.0}, 8000, animateBalloonA);
}
function animateBalloonB()
{
	resetBalloon(2);
	$('#balloon-2').animate({top: -400, opacity: 1.0}, 8000, animateBalloonB);
}
function animateBalloonC()
{
	resetBalloon(3);
	$('#balloon-3').animate({top: -400, opacity: 1.0}, 8000, animateBalloonC);
}
function animateBalloonD()
{
	resetBalloon(4);
	$('#balloon-4').animate({top: -400, opacity: 1.0}, 8000, animateBalloonD);
}
function resetBalloon(numb)
{

	_colour = balloonColours[Math.floor(Math.random()*balloonColours.length)];
	_left = Math.floor(Math.random()*120) - (50*numb);
	
	$('#balloon-'+numb).attr('src', 'gfx/'+_colour+'-balloon-2.jpg');
	$('#balloon-'+numb).css({top: 40, left: _left, opacity: 0});
}
function animateStickers()
{
	$('#sticker').delay(5000).animate(stickerStateA, 'fast', function() { $(this).attr('src', stickers[0]); });
	$('#sticker').animate(stickerStateB, 'fast');
	$('#sticker').delay(5000).animate(stickerStateA, 'fast', function() { $(this).attr('src', stickers[1]); });
	$('#sticker').animate(stickerStateB, 'fast', animateStickers);
}
function collagePics()
{
	$('<div id="animation_collage"><img src="pictures/right/Home/01-milford-classic.jpg" alt="" /><img src="pictures/right/Home/02-eifel-liberty.jpg" alt="" /><img src="pictures/right/Home/03-sydney-opera-house.jpg" alt="" /></div>').prependTo($('#animation'));
	$('#animation_collage').css({'opacity': 0});
	$('#animation_collage').animate({'opacity': 1}, 'slow');
	setTimeout(collageEnd, 10000);
}
function collageEnd()
{
	$('#animation_collage').animate({'opacity': 0}, 'slow', function() { $('#animation_collage').remove() });
	setTimeout(collagePics, 10000);
}
if (navigator.appName == 'Microsoft Internet Explorer')
{
	var stickers = ['gfx/book-your-au-pair-now.gif', 'gfx/plan-ahead.gif'];
	$('#sticker').attr('src', stickers[0]);
	var stickerStateA = {width: 1, height: 130};
	var stickerStateB = {width: 130, height: 130};
}
else
{
	var stickers = ['gfx/book-your-au-pair-now.png', 'gfx/plan-ahead.png'];
	var stickerStateA = {width: 1, height: 130, opacity: 0};
	var stickerStateB = {width: 130, height: 130, opacity: 1.0};
}
$('#sticker').delay(1200).fadeIn('fast', animateStickers);
var balloonColours = ['blue', 'gold', 'grey', 'purple', 'green', 'baby', 'red', 'white'];
animateBalloonA();
setTimeout(animateBalloonB, 2000);
setTimeout(animateBalloonC, 4000);
setTimeout(animateBalloonD, 6000);

setTimeout(collagePics, 10000);