$(document).ready(function(){
	var $x=0;
	var inte;

	/*Preload images BY NETKYNGS*/
							   
	if($.browser.msie)
	{
		inte=setInterval(beginani,8000);
		return;
	}
	else
	{
	$('<img />')
		.attr('src', '/images/LogoSlices/1.png')
		.load(function(){
				
			$('.x').append( $(this) );
		   $('<img />')
				.attr('src', '/images/LogoSlices/2.png')
				.load(function(){
					$('.x').append( $(this) );
				   $('<img />')
					.attr('src', '/images/LogoSlices/3.png')
					.load(function(){
						$('.x').append( $(this) );
							$('<img />')
							.attr('src', '/images/LogoSlices/4.png')
							.load(function(){
								$('.x').append( $(this) );
											   $('<img />')
									.attr('src', '/images/LogoSlices/5.png')
									.load(function(){
										$('.x').append( $(this) );
									   $('<img />')
										.attr('src', '/images/LogoSlices/6.png')
										.load(function(){
											$('.x').append( $(this) );
										   $('<img />')
												.attr('src', '/images/LogoSlices/7.png')
												.load(function(){
													$('.x').append( $(this) );
												   $('<img />')
														.attr('src', '/images/LogoSlices/8.png')
														.load(function(){
															$('.x').append( $(this) );
														   $('<img />')
																.attr('src', '/images/LogoSlices/9.png')
																.load(function(){
																	$('.x').append( $(this) );
																   $('<img />')
																		.attr('src', '/images/LogoSlices/10.png')
																		.load(function(){
																			$('.x').append( $(this) );
																		   $('<img />')
																					.attr('src', '/images/LogoSlices/11.png')
																					.load(function(){
																						$('.x').append( $(this) );
																					   $('<img />')
																						.attr('src', '/images/LogoSlices/12.png')
																						.load(function(){
																							$('.x').append( $(this) );
																						   $('<img />')
																									.attr('src', '/images/LogoSlices/13.png')
																									.load(function(){
																										$('.x').append( $(this) );
																									   $('<img />')
																										.attr('src', '/images/LogoSlices/14.png')
																										.load(function(){
																											$('.x').append( $(this) );
																										   $('<img />')
																													.attr('src', '/images/LogoSlices/15.png')
																													.load(function(){
																														$('.x').append( $(this) );
																														inte=setInterval(beginani,500);
																														$('<img />')
																															.attr('src', "/images/bwslices/1baby.jpg")
																															.load(function(){
																																$('.x').append( $(this) );
																																   
																															   $('<img />')
																																	.attr('src', "/images/bwslices/1man.jpg")
																																	.load(function(){
																																				
																																		$('.x').append( $(this) );
																																		 $('<img />')
																																		.attr('src', "/images/bwslices/1running.jpg")
																																		.load(function(){
																																			$('.x').append( $(this) );
																																			$('<img />')
																																			.attr('src', "/images/bwslices/1boy.jpg")
																																			.load(function(){
																																				$('.x').append( $(this) );
																																				$('<img />')
																																				.attr('src',  "/images/bwslices/2canoe.jpg")
																																				.load(function(){
																																					$('.x').append( $(this) );
																																				   $('<img />')
																																					.attr('src',  "/images/bwslices/2flower.jpg")
																																					.load(function(){
																																						$('.x').append( $(this) );
																																						$('<img />')
																																							.attr('src',  "/images/bwslices/2man.jpg")
																																							.load(function(){
																																								$('.x').append( $(this) );
																																							   $('<img />')
																																								.attr('src',  "/images/bwslices/2womanstick.jpg")
																																								.load(function(){
																																									$('.x').append( $(this) );
																																									$('<img />')
																																									.attr('src',  "/images/bwslices/centerleaves.jpg")
																																									.load(function(){
																																										$('.x').append( $(this) );
																																										   $('<img />')
																																										.attr('src',   "/images/bwslices/centerleaves.jpg")
																																										.load(function(){
																																											$('.x').append( $(this) );
																																											$('<img />')
																																												.attr('src',    "/images/bwslices/centerfield.jpg")
																																												.load(function(){
																																													$('.x').append( $(this) );
																																													$('<img />')
																																														.attr('src',   "/images/bwslices/centerbaby.jpg")
																																														.load(function(){
																																															$('.x').append( $(this) );
																																															$('<img />')
																																																.attr('src',    "/images/bwslices/centerstickbalancer.jpg")
																																																.load(function(){
																																																	$('.x').append( $(this) );
																																																	   $('<img />')
																																																	.attr('src',     "/images/bwslices/centerbutterfly.jpg")
																																																	.load(function(){
																																																		$('.x').append( $(this) );
																																																	   $('<img />')
																																																		.attr('src',     "/images/bwslices/4flower.jpg")
																																																		.load(function(){
																																																			$('.x').append( $(this) );
																																																					  $('<img />')
																																																				.attr('src',     "/images/bwslices/4baby.jpg")
																																																				.load(function(){
																																																					$('.x').append( $(this) );
																																																					$('<img />')
																																																					.attr('src', "/images/bwslices/4window.jpg")
																																																					.load(function(){
																																																						$('.x').append( $(this) );
																																																					   $('<img />')
																																																					.attr('src', "/images/bwslices/4butterfly.jpg")
																																																					.load(function(){
																																																						$('.x').append( $(this) );
																																																					   $('<img />')
																																																					.attr('src', "/images/bwslices/5hand.jpg")
																																																					.load(function(){
																																																						$('.x').append( $(this) );
																																																					   $('<img />')
																																																					.attr('src', "/images/bwslices/5stickbalancer.jpg")
																																																					.load(function(){
																																																						$('.x').append( $(this) );
																																																					   $('<img />')
																																																					.attr('src', "/images/bwslices/5field.jpg")
																																																					.load(function(){
																																																						$('.x').append( $(this) );
																																																					   $('<img />')
																																																					.attr('src', "/images/bwslices/5baby.jpg")
																																																					.load(function(){
																																																						$('.x').append( $(this) );
																																																					   $('<img />')
																																																					.attr('src', "/images/bwslices/5boy.jpg")
																																																					.load(function(){
																																																						$('.x').append( $(this) );
																																																					   
																																																					});
																																																					});
																																																					});
																																																					});
																																																					});
																																																					});
																																																					});
																																																				});
																																																		});
																																																	});
																																																});
																																														});
																																												});
																																										});
																																									});
																																								});
																																							});
																																					});
																																				});
																																			});
																																		});
																																	});
																															});
																													});
																										});
																									});
																						});
																					});
																		});
																});
														});
												});
										});
									});
							});
					});
				});
		});

	}

	/* Logo Animation */
	function changelogo()
	{	
		$x++;
		$(".logoani").css("background-image",'url(/images/LogoSlices/'+$x+'.png)');
		if($x==15)
		{
		clearInterval(inte);
		$(".headerimages").fadeIn(1000);
		imageani();
		}

	}


	function beginani()
	{
		clearInterval(inte);
		$(".loader").fadeOut(500, function() {inte = setInterval(changelogo,100);});
	}

	function imageani()
	{
		/* 1st Image animations with Timing */
		$("#11").delay(9800).fadeIn(1400).delay(10700).fadeOut(1500);
		$("#12").delay(21900).fadeIn(1500).delay(8100).fadeOut(1600);
		$("#13").delay(31500).fadeIn(1600).delay(13400).fadeOut(1300);

		/* 2nd Image animations with Timing */
		$("#21").delay(7300).fadeIn(1134).delay(12466).fadeOut(1800);
		$("#22").delay(20900).fadeIn(1800).delay(11700).fadeOut(1400);
		$("#23").delay(34400).fadeIn(1400).delay(3900).fadeOut(1700);

		/* Center Image animations with Timing */
		$("#31").delay(4100).fadeIn(2300).delay(11700).fadeOut(1300);
		$("#32").delay(18100).fadeIn(1300).delay(8700).fadeOut(1700);
		$("#33").delay(28100).fadeIn(1700).delay(5800).fadeOut(1600);
		$("#34").delay(35600).fadeIn(1600).delay(7200).fadeOut(1300);
		$("#35").delay(44400).fadeIn(1300).delay(5300).fadeOut(1300, function() {imageani()});

		/* 4th Image animations with Timing */
		$("#41").delay(9166).fadeIn(1433).delay(12881).fadeOut(1200);
		$("#42").delay(23300).fadeIn(1200).delay(7600).fadeOut(1800);
		$("#43").delay(32100).fadeIn(1800).delay(3600).fadeOut(1400);
		$("#44").delay(37500).fadeIn(1400).delay(11500).fadeOut(1200);

		/* 5th Image animations with Timing */
		$("#51").delay(13000).fadeIn(4200).delay(8100).fadeOut(1900);
		$("#52").delay(24300).fadeIn(1900).delay(6900).fadeOut(1500);
		$("#53").delay(33100).fadeIn(1500).delay(3800).fadeOut(1500);
		$("#54").delay(38400).fadeIn(1500).delay(7300).fadeOut(1500);

	}

 });


