$(window).load(function() {
	setInterval('$(".hello").slideUp("slow")', 10000);
	$("body").kkCountDown();
});

function showSetForm(){
	$("#setForm").animate({"height": "toggle"}, { duration: 1000 });
}

function showSetForm1(){
	$("#setForm1").animate({"height": "toggle"}, { duration: 1000 });
}

/**
 * Dynamiczne odliczanie czasu do podanej daty.
 *
 * @example
 * $("body").kkCountDown();
 *
 * @type jQuery
 *
 * @name $.fn.kkCountDown
 * @author Krzysztof Furtak
 * @version 1.0 BETA
 */
jQuery.fn.kkCountDown = function() {
	function d(b) {
		s = "";
		if (b < 10)
			b = "0" + b;
		return b
	}
	function g() {
		for ( var b = 0; b < $("span").length; b++)
			if ($("#count" + b).get()) {
				var c = new Date;
				c = Math.floor(c.getTime() / 1E3);
				var a = $("#count" + b).attr("time") - c;
				if (a <= 0)
					$("#count" + b).html("---");
				else if (a <= 86400) {
					c = d(a % 60);
					a = Math.floor(a / 60);
					var e = d(a % 60);
					a = Math.floor(a / 60);
					var f = d(a % 24);
					a = a = Math.floor(a / 24);
					if (a>1){
						$("#count" + b).html('<span style="color:#cf0000;">' + a + " dni, i " + f + ":" + e + ":" + c + "</span>")
					}
					else if (a==1) {
						$("#count" + b).html('<span style="color:#cf0000;">' + a + " dzień, i " + f + ":" + e + ":" + c + "</span>")
					}
					else {
						$("#count" + b).html('<span style="color:#cf0000;">'+ f + ":" + e + ":" + c + "</span>")
					}
					
				} else {
					c = d(a % 60);
					a = Math.floor(a / 60);
					e = d(a % 60);
					a = Math.floor(a / 60);
					f = d(a % 24);
					a = a = Math.floor(a / 24);
					if (a>1){
						$("#count" + b).html(a + " dni, i " + f + ":" + e + ":" + c)
					}
					else if (a==1) {
						$("#count" + b).html(a + " dzień, i " + f + ":" + e + ":" + c)
					}
					else {
						$("#count" + b).html(f + ":" + e + ":" + c)
					}
				}
			}
		setTimeout(function() {
			g()
		}, 1E3)
	}
	g()
};
