	$(document).ready(function(){


	
	var blurIt = false;
	var moveIt = true;
		$(".image3").fadeTo(0,0);
			$(".image2").fadeTo(0,0);
		$(".image3").css("visibility" , "visible");


			var timeOut = false;
		
			//	blurImage(".image1", 200);
				$.doTimeout(300, function(){
	//	blurImage(".image3", 200);
		
		}) ;
		
		function blurImage(image, speed) { 
			if (timeOut == false || timeOut != image) {
				timeOut = true;
			
			

					if (blurIt == true) {
						$(image).stop(true, true).fadeTo(0,1, function() {
						//	alert('image'+image);
							$(image).stop(true, true).fadeTo(speed,0);
							timeOut = false;
						
						});
					}
					

				

					}
				
			} 
			
		
			function animateLine(line, direction, position) {
				
				if (direction == 'In') {
					//	$(line).stop(true, true).fadeTo('slow',1);
			if (moveIt) {
				$(line).stop(true, false).animate({
			   left: position
			  }, 1000, 'easeOutBounce', function() {
			   //alert($(this).next().id;
			  });
			}
			
			
			} else {
				if (moveIt) {
					$(line).stop(true, false).animate({
				   left: $(document).width()/2-($('#red_line1').width()*0.5)
				  }, 1000, 'easeOutBounce', function() {
				   //  alert('hello');
					//$(line).fadeTo(100,0.5);
				  });
				}
			
			}
			
			};
			
			
				
		//	blurImage(".image3", 200);

		
		$(".index_back").stop(true, true).fadeTo(0,0);
//$('#red_line1').stop(true, true).fadeTo(0,0);
		$('.commercial_link').mouseenter(function() {
			postion = $(document).width()*0.75;	
			blurImage(".image3", 600);
		animateLine('#red_line1', 'In', postion) ;
		$(this).find(".index_back").stop(true, false).fadeTo(500,1);
		 }).mouseleave(function() { 
			// alert('hello');
			animateLine('#red_line1', 'Out', postion);
	$(this).find(".index_back").stop(true, false).fadeTo(500,0);
		});
		
		$('.weddings_link').mouseenter(function() {	
				postion = $(document).width()*0.25;	
			$(this).find(".index_back").stop(true, false).fadeTo(500,1);
			blurImage(".image2", 600);
		animateLine('#red_line1', 'In', postion);
	
		 }).mouseleave(function() { 
				$(this).find(".index_back").stop(true, false).fadeTo(500,0);
			animateLine('#red_line1', 'Out', postion);
	
		});
		

	});
