jQuery.noConflict();

(function($){

$.extend({

	AnimateInit: function(){
		// Ontwerp
		$("#ontwerp").find('a').append("<div><img /></div>");
		$("#ontwerp").find('img').attr("id","imgOntwerp")
							.css("display","none")
							.css("margin-left","0px")
							.attr("src","images/menu.png");
		$("#ontwerp").find('div:first').attr("id","spanOntwerp")
							.css("height","84px")
							.css("width","85px")
							.css("overflow","hidden");
		
		// Reclame
		$("#reclame").find('a').append("<div><img /></div>");
		$("#reclame").find('img').attr("id","imgOntwerp")
							.css("display","none")
							.css("margin-left","-85px")
							.attr("src","images/menu.png");
		$("#reclame").find('div:first').attr("id","spanOntwerp")
							.css("height","84px")
							.css("width","85px")
							.css("overflow","hidden");
							
		// Media
		$("#media").find('a').append("<div><img /></div>");
		$("#media").find('img').attr("id","imgOntwerp")
							.css("display","none")
							.css("margin-left","-170px")
							.attr("src","images/menu.png");
		$("#media").find('div:first').attr("id","spanOntwerp")
							.css("height","84px")
							.css("width","86px")
							.css("overflow","hidden");
		
		$.AnimateLeft();
	},
	
	AnimateLeft: function(){
		$(document).oneTime(500, function(){
			$("#ontwerp").oneTime(500, function(){
				$(this).find('img').animate({
					opacity: 'toggle'
				},1000,function(){
					$(this).animate({
						opacity: 'toggle'
					},1000)
				});
			});
			
			$("#reclame").oneTime(1000, function(){		
				$(this).find('img').animate({
					opacity: 'toggle'
				},1000,function(){
					$(this).animate({
						opacity: 'toggle'
					},1000)
				});
			});
			
			$("#media").oneTime(1500, function(){								
				$(this).find('img').animate({
					opacity: 'toggle'
				},1000,function(){
					$(this).animate({
						opacity: 'toggle'
					},1000, function(){
						$.AnimateRight();
					});
				});
			});
		});
	},
	
	AnimateRight: function(){
		$(document).oneTime(500, function(){
			$("#ontwerp").oneTime(1500, function(){
				$(this).find('img').animate({
					opacity: 'toggle'
				},700,function(){
					$(this).animate({
						opacity: 'toggle'
					},1000)
				});
			});
			
			$("#reclame").oneTime(1000, function(){		
				$(this).find('img').animate({
					opacity: 'toggle'
				},700,function(){
					$(this).animate({
						opacity: 'toggle'
					},1000)
				});
			});
			
			$("#media").oneTime(500, function(){								
				$(this).find('img').animate({
					opacity: 'toggle'
				},700,function(){
					$(this).animate({
						opacity: 'toggle'
					},1000, function(){
						$.AnimateLeft();
					});
				});
			});
		});
	}
	
});

$(document).ready(function(){
	
	$.AnimateInit();
	
});

})(jQuery);