$(document).ready(function(){
	// Your code here
	$('.lista-lightbox a').lightBox();
	
	$(".got-acc").each( function(i) {
		var el = $(this);
		var input = el.parent().find('input[@type="text"]');
		
        $('#gallery a').lightBox();


		
		if( input.val() == "" ) {
			input.attr("disabled", "disabled");
			input.addClass( "blocked" );
			el.removeAttr('checked' );
		} else {
			el.attr( 'checked', 'checked' );
		}
		
		el.change( function(j) {
			if( el.attr('checked' ) ) {
				input.removeAttr( "disabled" );
				input.removeClass( "blocked" );
				el.attr('checked', 'checked' );
			} else {
				input.attr("disabled", "disabled");
				input.val( "" );
				input.addClass( "blocked" );
				el.removeAttr('checked' );
			}
		});
		
		//alert( i );
	});
	
	$('textarea#description').markItUp(mySettings);



	$('textarea#description').keyup( function() {
		var text = $('textarea#description').val(); 
		var textlength = text.length;
		var ile = 1000-textlength;
		if( ile == 1 ) {
			$('#description-limit').html( ', pozostał Ci jeden znak. :)' );
		} else if( ile > 1 ) {
			$('#description-limit').html( ', pozostały Ci '+ile+' znaki.' );
		} else if ( ile <= 0 ) {
			$('#description-limit').html( ', przekroczyłeś limit o '+(-1*ile)+' znaki, wpis zostanie skrócony do 500.' );
		}

	});

});

