
	hohodesign = {
		checkFormContact: function ()
		{
			$(".InpFieldLast span").remove();

			e = 0;

			imie = $("#imie").val();
			email = $("#email").val();
			wiadomosc = document.contact.wiadomosc.value;

			var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;

			if (imie == '' || imie == 'imię i nazwisko') e = 1;

			if ((email == '') || (emailRegEx.test(email) == false)) e = 1;

			if (wiadomosc.length<1) e = 1;

			if (e)
			{
				$(".InpFieldLast").append('<span class="error">Wystąpił błąd. Popraw formularz i spróbuj ponownie !</span>');
				return false;
			}
			else
			{
				return true;
			}
		},
		checkFormOffer: function ()
		{
			e = 0;

			imie = $("#imie").val();
			email = $("#email").val();
			telefon = $("#telefon").val();

			var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;

			if (imie == '' || imie == 'Imię nazwisko')
			{
				$("#imie").addClass("InpTextError");
				e = 1;
			}
			else
			{
				$("#imie").removeClass("InpTextError");
			}

			if (email == '' || email == 'E-mail' || emailRegEx.test(email) == false)
			{
				$("#email").addClass("InpTextError");
				e = 1;
			}
			else
			{
				$("#email").removeClass("InpTextError");
			}

			if (telefon == '' || telefon == 'Telefon')
			{
				$("#telefon").addClass("InpTextError");
				e = 1;
			}
			else
			{
				$("#telefon").removeClass("InpTextError");
			}

			if (e)
			{
				return false;
			}
			else
			{
				return true;
			}
		}
	}

	popup = {
		close: function ()
		{
			$("#Overlay, #OverlayField").fadeOut("slow", function () {

				$("#Overlay").remove();
				$("#OverlayField").remove();

				$("body").removeClass("Overflow");
			});

			return false;
		},
		show: function (o)
		{
			$("body").append(''
					+'<div id="Overlay"></div>'
					+'<div id="OverlayField">'
					+'	<div id="PopUp">'
					+'		<a href="#Close" id="PopUpClose" onClick="return popup.close();"></a>'
					+'		<a href="'+o.link+'" target="_blank" id="PopUpButton"></a>'
					+'		<div id="PopUpWindow">'
					+'			<div id="PopUpField"><img src="'+o.image+'" alt="" /></div>'
					+'		</div>'
					+'		<div id="PopUpTitle">'+o.title+'</div>'
					+'	</div>'
					+'</div>').addClass("Overflow").children("#OverlayField").addClass("ShowOverflow-y");

			$("#Overlay, #OverlayField").fadeIn("slow");

			return false;
		}
	}

$(document).ready(function () {

	var MenuSpeed = 300;

	$(".MenuLink").not(".MenuLinkActive").hover(function () {
		$(this).children(".Mask").stop().animate({ top: '0px' }, MenuSpeed);
		$(this).children(".Name").addClass("Highlight");
	},
	function () {
		$(this).children(".Mask").stop().animate({ top: '65px' }, MenuSpeed);
		$(this).children(".Name").removeClass("Highlight");
	});


	if ($("select"))
	{
		$("select").SelectList({
			Prefix: 'Category'
		});
	}

	$("input[name='category']").change(function () {

		Active = $(this).val();

		$("#ProjectsField").animate({ top: -Active*412+'px' }, "slow");
	});

	$(".Scroll").jScrollPane();

	$(".ProjectsItem").hover(function () {

		$active = $(".ProjectsItem").index(this);
		$position = $(this).offset();

		$thisHTML = $(this).children(".ProjectsItemCloud").html();

		show = setTimeout(function () {

		$("#ProjectsItemCloud").html($thisHTML).css({
			top: ($position.top+109)+'px',
			left: ($position.left+17)+'px',
			display: 'block'
		});
		}, 250);
	},
	function () {

		clearTimeout(show);

		$("#ProjectsItemCloud").css({
			display: 'none'
		});
	});

	$("#ProjectsItemCloud").hover(function () {

		$(".ProjectsItem:eq("+$active+")").addClass("ProjectsItemHover");

		$(this).css({
			display: 'block'
		});
	},
	function () {

		$(".ProjectsItem:eq("+$active+")").removeClass("ProjectsItemHover");

		$(this).css({
			display: 'none'
		});
	});

	$(".LogosItem").hover(function () {

		$(this).css({ overflow: 'visible' });
	},
	function () {

		$(this).css({ overflow: 'hidden' });
	});

});
