$(document).ready(
	function()
	{
		$("#searchForm").submit(
			function() {
				var s = $("input[name=searchword]").val();
				
				//alert(s.length);
				str2 = s.replace(/^\s+|\s+$/g, ''); 
				count = (str2.length);
				
				if (count < 3) {
					alert('Wprowad¼ szukany zwrot, przynajmniej 3 znaki');
					return false;
				}
				return true;	
		});
				
		
		$(".close").click(
			function () {
				$(this).parent().fadeTo(400, 0, function () {
					$(this).slideUp(400);
				});
				return false;
			}
		);
		
		$("#filter").click(
			function () {
				if ( $("#filter").text() == "Ukryj" ) {
					$("#hideFilter").slideUp();
					$("#filter").text("Opcje wy¶wietlania");
				}
				else {
					$("#hideFilter").slideDown();
					$("#filter").text("Ukryj");
				}
			}
		);
		
		$("#filter2").click(
				function () {
					if ( $("#filter2").text() == "Ukryj" ) {
						$("#hideFilterAdmin").slideUp();
						$("#filter2").text("Centrum administracyjne");
					}
					else {
						$("#hideFilterAdmin").slideDown();
						$("#filter2").text("Ukryj");
					}
				}
			);
		
		$(".thumb").click(
				function () {
					//alert('click');
					//$(".thumb").addClass("o");
					$(".thumb").removeClass("o"); 
					$(this).addClass('o');

				}
			);
		
		

	});

/***
$(document).ready(
		function(){
			
			$(".cboxpdf").colorbox({width:"90%", height:"100%", iframe:true});
			$(".example5").colorbox();
			$(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});
			$(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"});
			$(".example8a").colorbox({iframe:true, innerWidth:1000, innerHeight:550});
			$(".example7").colorbox({width:"100%", height:"100%", iframe:true});
			$(".example9").colorbox({
				onOpen:function(){ alert('onOpen: colorbox is about to open'); },
				onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
				onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
				onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
				onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
			});
			//Example of preserving a JavaScript event for inline calls.
			$("#click").click(function(){ 
				$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
		}
	);***/
