$(document).ready(function() { 
		function p1(){

			$("#lp1").animate({

				height: "398px",

				width: "303px",

			}, 5000);

		}



		function p2(){

			$("#lp1").animate({

				height: "0px",

				width: "0px",

			}, 5000);



			$("#lp2").animate({

				height: "421px",

				width: "353px",

			}, 5000);

		}

		function p3(){

			$("#lp2").animate({

				height: "0px",

				width: "0px",

			}, 5000);

			$("#lp3").animate({

				height: "134px",

				width: "319px",

			}, 5000);

		}

		function p4(){

			$("#lp3").animate({

				height: "0px",

				width: "0px",

			}, 5000);
			$("#lp").css("display","none");
			var windowHeight = $(window).height();
			var controls = $('#controls').height();
			var topMargin = Math.floor((windowHeight - controls) / 2)-25 ;
			//alert("w "+		windowHeight + " c " + controls + " tm " + topMargin );	
			if(controls < windowHeight) {
				
				$('#controls').css('margin-top', topMargin+"px" );
			}


		}





		var lpage = $("#lp");



		lpage.queue( "test", function(next){ p1(); next(); } );

		lpage.delay(5000, "test");

		lpage.queue( "test", function(next){ p2(); next(); } );

		lpage.delay(5000, "test");

		lpage.queue( "test", function(next){ p3(); next(); } );

		lpage.delay(5000, "test");
		lpage.queue( "test", function(next){ p4(); next(); } );

		lpage.delay(1000, "test");
		
		
		lpage.queue( "test", function(next){ window.location = "http://bestonpage.ca/attend" ; next(); } );


		lpage.dequeue("test");



});
