$(document).ready(function(){
/* EXAMPLE SYNTAX
	 $("a").click(function(){
	   alert("Example");
	 });
	$('#gallery a').lightBox(); // Lightbox script. 
*/

	$("#legalofferform").validate({
	   rules: {
	     // simple rule, converted to {required:true}
	     name: "required",
	     company: "required",
	     phone: "required",
	     // compound rule
	     email: {
	       required: true,
	       email: true
	     }
	   }
	});
	$("#regForm").validate({
	   rules: {
	     // simple rule, converted to {required:true}
	     LastName: "required",
	     FirstName: "required",
	     Title: "required",
		 Company: "required",
		 Address: "required",
		 City: "required",
		 StateProvince: "required",
		 ZipCode: "required",
	     // compound rule
	     EmailAddress: {
	       required: true,
	       email: true
	     }
	   }
	});
	 $("#normalTextSize").click(function(){
		$("body").removeClass("big")
		$.cookie('big', 'false'); // set cookie
		return false;
	});
	 $("#bigTextSize").click(function(){
		$("body").addClass("big")
		$.cookie('big', 'true'); // set cookie
		return false;
	});
	if ($.cookie('big') == 'true') {
		$("body").addClass("big")
	}
	function animate (argument) {
		$("#image1").fadeIn(1000,function(){
			$("#image2").fadeIn(1000,function(){
				$("#image3").fadeIn(1000,function(){
					setTimeout(function() {
						$("#image1").fadeOut(1000);
						$("#image2").fadeOut(1000);
						$("#image3").fadeOut(1000,function(){
							$("#image4").fadeIn(1000,function(){
								$("#image5").fadeIn(1000,function(){
									$("#image6").fadeIn(1000,function(){
										setTimeout(function() {
											$("#image4").fadeOut(1000);
											$("#image5").fadeOut(1000);
											$("#image6").fadeOut(1000,function(){
												$("#image7").fadeIn(1000,function(){
													$("#image8").fadeIn(1000,function(){
														$("#image9").fadeIn(1000,function(){
															setTimeout(function() {
																$("#image7").fadeOut(1000);
																$("#image8").fadeOut(1000);
																$("#image9").fadeOut(1000,function(){
																	setTimeout(function(){
																		$("#image10").fadeIn(1000,function(){
																			$("#image11").fadeIn(1000,function(){
																				$("#image12").fadeIn(1000,function(){
																					setTimeout(function() {
																						$("#image10").fadeOut(1000);
																						$("#image11").fadeOut(1000);
																						$("#image12").fadeOut(1000,function(){
																							$("#image13").fadeIn(1000,function(){
																								$("#image13b").fadeIn(1000,function(){
																									$("#image14").fadeIn(1000,function(){
																										setTimeout(function() {
																											$("#image13").fadeOut(1000);
																											$("#image13b").fadeOut(1000);
																											$("#image14").fadeOut(1000,function(){
																												animate();
																											});				
																										}, 2000);
																									});	
																								});
																							});
																						});				
																					}, 2000);
																				});
																			});
																		});	
																	});
																});				
															}, 2000);
														});
													});
												});
											});				
										}, 2000);
									});
								});
							});
						});				
					}, 2000);
				});
			});
		});
	}
	animate();
});