var a = false;
var b = false;
var c = false;
var d = false;
var e = false;

function outOfImage()
{
	if (!a && !b && !c && !d && !e) {
		$("#b1").stop().animate({ width: "186px" }, "slow");
		$("#b2").stop().animate({ width: "186px" }, "slow");
		$("#b3").stop().animate({ width: "186px" }, "slow");
		$("#b4").stop().animate({ width: "186px" }, "slow");
		$("#b5").stop().animate({ width: "186px"}, "slow");
	}
}
			
function setUpSlideImages()
{
	a = true;
	$("#b1").css({ opacity: "1", width: "434px" });
	$("#b2").css({ opacity: "0.4", width: "124px" });
	$("#b3").css({ opacity: "0.4", width: "124px" });
	$("#b4").css({ opacity: "0.4", width: "124px" });
	$("#b5").css({ opacity: "0.4", width: "124px" });
	
	$("#b1").hover(
		function() {
			a = true;
			$("#b1").stop().animate( { opacity: "1", width: "434px" }, "slow");
			$("#b2").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b3").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b4").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b5").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
		},
		function() {
			a = false;
			outOfImage();
		});
	$("#b2").hover(
		function() {
			b = true;
			$("#b1").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b2").stop().animate( { opacity: "1", width: "434px" }, "slow");
			$("#b3").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b4").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b5").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
		},
		function() {
			b = false;
			outOfImage();
		});
	$("#b3").hover(
		function() {
			c = true;
			$("#b1").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b2").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b3").stop().animate( { opacity: "1", width: "434px" }, "slow");
			$("#b4").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b5").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
		},
		function() {
			c = false;
			outOfImage();
		});
	$("#b4").hover(
		function() {
			d = true;
			$("#b1").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b2").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b3").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b4").stop().animate( { opacity: "1", width: "434px" }, "slow");
			$("#b5").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
		},
		function() {
			d = false;
			outOfImage();
		});
	$("#b5").hover(
		function() {
			e = true;
			$("#b1").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b2").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b3").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b4").stop().animate( { opacity: "0.4", width: "124px" }, "slow");
			$("#b5").stop().animate( { opacity: "1", width: "434px" }, "slow");
		},
		function() {
			e = false;
			outOfImage();
		});
	
	//Booking
	$("#p1").hover(
		function() {
			$("#p1").stop().animate({ height: "210px" }, "slow");
		},
		function() {
			$("#p1").stop().animate({ height: "25px" }, "slow");
		});
	$("#p2").hover(
		function() {
			$("#p2").stop().animate({ height: $("#p2"+" div:first").height() + 30 }, "slow");
		},
		function() {
			$("#p2").stop().animate({ height: "25px" }, "slow");
		});
		
	//Language
	//Booking
	$("#language").hover(
		function() {
			$("#dida").stop().animate( { opacity: "1" }, "slow");
		},
		function() {
			$("#language").stop().animate( { left: -123 }, "slow");
			$("#dida").stop().animate( { opacity: "0" }, "slow");
		});
	$("#language").click(
		function() {
			$("#language").stop().animate( { left: 0 }, "slow");
			$("#dida").stop().animate( { opacity: "0" }, "fast");
		});
	$("#lastminute").click(
		function() {
			$("#lastminute_opened").stop().animate( { right: 4 }, "slow");
			$("#lastminute").stop().animate( { opacity: "0" }, "fast");
		});
	$("#lastminute_opened").click(
		function() {
			$("#lastminute_opened").stop().animate( { right: -380 }, "slow");
			$("#lastminute").stop().animate( { opacity: "1" }, "fast");
		});
}
