$(document).ready(function () {
//			if( $.cookie("c") == "1" ){
//				doClose(1);
//			}
});

var swapped = false;

function my_do ()
{
	if( swapped ){
		doOpen();
	} else {
		doClose();
	}
}

function doOpen ()
{
	$("#home").animate({ height: "849px" }, { queue: false, duration: 500 });
			
	var k = 0;

	$("#l1").animate({ top: "100px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l2").animate({ top: "150px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l3").animate({ top: "200px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l4").animate({ top: "250px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l5").animate({ top: "300px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l6").animate({ top: "350px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l7").animate({ top: "400px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l8").animate({ top: "450px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l9").animate({ top: "500px", fontSize: "16px"}, { queue: true, duration: 500 });
	$("#l10").animate({ top: "550px", fontSize: "16px"}, { queue: true, duration: 500, complete:
		function ()
		{
			$("#home a.n").css("position", "absolute");
			$("#min").text("«");
			swapped = false;
			$.cookie("c", 0, { expires : 365 });
		}
	});
}

function doClose (withTimeout)
{
	if( !withTimeout ){
		withTimeout = 500;
	}
	
	$("#home").animate({ height: "152px" }, { queue: false, duration: withTimeout });

	var done = false;
	
	$("#home a.n").animate(
		{
			top: "100px",
			fontSize: "11px"
		}, { queue: true, duration: withTimeout, complete: function (obj) {
			if( !done ){
				$("#home a.n").css("position", "relative");
				$("#min").text("»");
				swapped = true;
				$.cookie("c", 1, { expires : 365 });
			}
			
			done = true;
		} }
	);
}