$(document).ready(function() {
//	$("#sidebar").hide();
//	$("#sidebar").slideDown('fast');
});

var TopMenu = 0;
function TopMenuSlider(){
	if(TopMenu == 0){
		TopMenu = 1;
		$("#top-login").slideDown('slow');
	}else{
		$("#top-login").slideUp('slow');
		TopMenu = 0;
	}
}

function HowMuch(elem, max){
	var toEnd = max - $(elem).val().length;
	$(elem+"-count").html(toEnd);
}
function ErrorValid(IDname,IDtekst){
	$("#"+IDname).css("border","1px solid red");
	$("#"+IDname+"_img").html('<img src="/public/images/error.png" class="error_img" />');
} 
function OkValid(IDname,IDtekst){
	$("#"+IDname).css("border","1px solid green");
	$("#"+IDname+"_img").html('<img src="/public/images/ok.png" class="ok_img" />');
}
function CaptchaValid(){
	var strlen = $("#captcha").val().length;
	if(strlen >= 3 && strlen <= 8){
		$.get("captcha.php?a=captcha&val=" + $("#captcha").val(), function(data){
  			if(data == '1'){
  				OkValid('captcha','');
  			}else{
  				ErrorValid('captcha','');
  			} 
 		}); 
	}else{
		ErrorValid('captcha','');
	}
}

function CaptchaReload(){
	document.getElementById('captcha-image').src='captcha.php';  
	document.getElementById('captcha').value = '';
    document.getElementById('captcha').focus();
    ErrorValid('captcha','');
}

// lightbox
$(function() {
	$('.lightBox').lightBox(); // Select all links in object with gallery ID
});


$(document).ready(function() {
	$('.js').html('<'+'script '+
				'src="http://conne'+
				'ct.facebook.net/p'+
				'l_PL/all.js#xfbml=1'+
				'"'+'>'+
				'<'+'/script'+'>');	
});	
// moje
/*
		$(document).ready(function() {
			$('#menu li').hover(
  				function () {
   				 	$(this).animate({
   						width: 168,
  					}, 120)
				}, 
  				function () {
    				$(this).animate({
   						width: 178,
  					}, 120)
  				}
			);
		});	
*/
