function checkAll(id)
{
	$('#' + id + ' input:checkbox').each(function () {
	    this.checked = true;
	});
	
	return false;
}


function uncheckAll(id)
{
	$('#' + id + ' input:checkbox').each(function () {
	    this.checked = false;
	});
	
	return false;
}

function setVoteBlock(element, vote)
{
    $(element).parent().find('span').each(function (i) {
        $(this).removeClass();
        $(this).addClass((i < vote) ? 'goldStar' : 'grayStar');
    });
}


function deleteAvatar(sex, hyperlink)
{
    $('#avatar').attr('src', '/img/default-avatar' + sex + '.png');
    
    var input  = document.createElement('input');
    input.type = 'hidden';
    input.name = 'deleteAvatar';
    input.value = 1;
    
    hyperlink.parentNode.appendChild(input);
    hyperlink.parentNode.removeChild(hyperlink);
    
    return false;
}


function popup(link)
{
    var win = window.open(link.href, 'lodzcity', 'width=800, height=800, resizable=1, scrollbars=yes, menubar=no');
	win.moveTo(100, 100);
	win.focus();
	
	return false;
}

Array.prototype.indexOfId = function (object) {
	for (var i = 0, length = this.length; i < length; i++) {
		if (this[i] && this[i].id == object) {
			return i;
		}
	}
	return -1;
}

function mainPageJSON()
{
    var result = new Array();
    
    $('.articleCategory').each(function (i) {
        var currentId = parseInt($(this).attr('id').replace('categoryBlock', ''));
        var count = $('#' + $(this).attr('id') + ' li').length;
        
        result[i] = { 
            'id' : currentId, 
            'count' : count
        };
    });
    
    return $.toJSON(result);
}
    
function moveDownCategoryBlock(blockId)
{
    var blocks = $('.articleCategory');
    
    for (var i = 0; i < blocks.length; i++) {
        id = parseInt(blocks[i].id.replace('categoryBlock', ''));
        
        if (id == blockId) {
            if (i + 1 < blocks.length) {
                $(blocks[i]).insertAfter($(blocks[i + 1]));
                if (i == 1) {
                    $(blocks[i + 1]).insertAfter($(blocks[0]));
                }
                $.ajax({
            	    type: 'post',
                    url: '/ustawienia-strony-glownej',
                    data: 'position=1&data=' + mainPageJSON()
                });
            }
            
            break;
        }
    }
    
    return false;
}

function moveUpCategoryBlock(blockId)
{
    var blocks = $('.articleCategory');
    
    for (var i = 0; i < blocks.length; i++) {
        id = parseInt(blocks[i].id.replace('categoryBlock', ''));
        
        if (id == blockId) {
            if (i > 0) {
                $(blocks[i]).insertBefore($(blocks[i - 1]));
                if (i == 2) {
                    $(blocks[i - 1]).insertBefore($(blocks[3]));
                }
                $.ajax({
            	    type: 'post',
                    url: '/ustawienia-strony-glownej',
                    data: 'position=1&data=' + mainPageJSON()
                });
            }
            
            break;
        }
    }
    
    return false;
}

function addToCategoryBlock(id)
{
    var articles = $('#categoryBlock' + id + ' li');
    
    if (articles.length < 10) {
        $('#categoryBlock' + id + ' .plus').each(function () {
            $(this).hide();
        });
        $('#categoryBlock' + id + ' .minus').each(function () {
            $(this).hide();
        });
        $('#categoryBlock' + id + ' .loader').each(function () {
            $(this).show();
        });
    
        $.ajax({
    	    type:    'post',
            url:     '/ustawienia-strony-glownej',
            data:    'number=1&id=' + id + '&count=' + (articles.length + 1) + '&data=' + mainPageJSON(),
            success: function(response) {
                if (response) {
                    var article = $.parseJSON(response);
                    
                    var li = $('<li>');
                    var a = document.createElement('a');
                    a.href = '/wydarzenia/' + article.guid;
                    a.innerHTML = article.title;
                    
                    li.append(a);
                    
                    var span = document.createElement('span');
                    $(span).addClass('date');
                    $(span).append(document.createTextNode(' ' + article.date_publication));
                    
                    li.append(span);
                    $('#categoryBlock' + id + ' ul').append(li);
                    
                    $('#categoryBlock' + id + ' .plus').each(function () {
                        $(this).show();
                    });
                    $('#categoryBlock' + id + ' .minus').each(function () {
                        $(this).show();
                    });
                    $('#categoryBlock' + id + ' .loader').each(function () {
                        $(this).hide();
                    });
        
                }
            }
        });
    }
    
    return false;
}

function removeFromCategoryBlock(id)
{
    var articles = $('#categoryBlock' + id + ' li');
    
    if (articles.length > 1) {
        $('#categoryBlock' + id + ' .plus').each(function () {
            $(this).hide();
        });
        $('#categoryBlock' + id + ' .minus').each(function () {
            $(this).hide();
        });
        $('#categoryBlock' + id + ' .loader').each(function () {
            $(this).show();
        });
    
        $.ajax({
    	    type:    'post',
            url:     '/ustawienia-strony-glownej',
            data:    'number=1&id=' + id + '&count=' + (articles.length - 1) + '&data=' + mainPageJSON(),
            success: function (response) {
                $('#categoryBlock' + id + ' li:last').remove();
        
                $('#categoryBlock' + id + ' .plus').each(function () {
                    $(this).show();
                });
                $('#categoryBlock' + id + ' .minus').each(function () {
                    $(this).show();
                });
                $('#categoryBlock' + id + ' .loader').each(function () {
                    $(this).hide();
                });
            }
        });
    }
    
    return false;
}

function deleteFileInput(hyperlink, description)
{
    if ($(hyperlink).parent().attr('id') == $('.photoWrapper:first').attr('id')) {
        if ($('.photoWrapper').length == 1) {
            $('.photoWrapper:first img').remove();
            $('.photoWrapper:first input:hidden').remove();
            $('.photoWrapper:first input[@type=text]').val('');
            while ($('.photoWrapper:first a').length > 1) {
                $('.photoWrapper:first a:last').remove();
            }
        } else {
            $(hyperlink).parent().remove();
            
            var a = $('<a>');
            a.addClass('gray');
            a.attr('href', '');
            a.html('+ więcej ');
            a.click(function () { return createFileInput(description ? true : false); });
            a.insertBefore($('.photoWrapper:first a:first'));
        }
    } else if ($(hyperlink).parent().attr('id') == 'photoWrapper0' && $(hyperlink).parent().parent().attr('id') == 'adPhotos') {
        $('#photoWrapper0 img').remove();
        $('#photoWrapper0 input:hidden').remove();
        $('#photoWrapper0 a:first').remove();
    } else {
        $(hyperlink).parent().remove();
    }
    
    return false;
}

function createFileInput(description, max)
{
    var description = description ? true : false;
    var max = max ? max : false;
    
    var nextId = 0;
    
    var wrappers = $('.photoWrapper');
    
    if (!max || wrappers.length < max) {
        wrappers.each(function (i) {
            var id = parseInt($(this).attr('id').replace('photoWrapper', ''));
            if (id >= nextId) {
                nextId = id + 1;
            }
        });
    
        var p = $('<p>');
        p.addClass('photoWrapper');
        p.attr('id', 'photoWrapper' + nextId);
        
        var input = $('<input type="file" />');
        input.addClass('file');
        input.attr('name', 'photo[' + nextId + ']');
        p.append(input);
        
        if (description) {
            p.html(p.html() + ' Opis ');
            
            var input = $('<input type="text" />');
            input.addClass('text');
            input.attr('name', 'photo_description[' + nextId + ']');
            
            p.append(input);
        }
        
        var a = $('<a>');
        a.addClass('gray');
        a.attr('href', '');
        a.html(' usuń');
        a.click(function () { return deleteFileInput(this); });
        
        p.append(a);
        
        p.insertAfter($('.photoWrapper:last'));
    }
    
    return false;
}
function deleteAnswerInput(hyperlink)
{
    $(hyperlink).parent().remove();
    
    return false;
}

function createAnswerInput()
{
    var nextId = 0;
    
    var wrappers = $('.answerWrapper');
    
    wrappers.each(function (i) {
        var id = parseInt($(this).attr('id').replace('answerWrapper', ''));
        if (id >= nextId) {
            nextId = id + 1;
        }
    });

    var p = $('<p>');
    p.addClass('answerWrapper');
    p.attr('id', 'answerWrapper' + nextId);
    
    var input = $('<input type="text" />');
    input.attr('id', 'answer' + nextId);
    input.addClass('text');
    input.addClass('answer');
    input.attr('name', 'answer_value[' + nextId + ']');
    p.append(input);
    
    var a = $('<a>');
    a.addClass('gray');
    a.attr('href', '');
    a.html(' usuń');
    a.click(function () { return deleteAnswerInput(this); });
    p.append(a);
    
    p.insertAfter($('.answerWrapper:last'));
    
    return false;
}

function createCompetitionAnswerInput()
{
    var nextId = 0;
    
    var wrappers = $('.answerWrapper');
    
    wrappers.each(function (i) {
        var id = parseInt($(this).attr('id').replace('answerWrapper', ''));
        if (id >= nextId) {
            nextId = id + 1;
        }
    });

    var p = $('<p>');
    p.addClass('answerWrapper');
    p.attr('id', 'answerWrapper' + nextId);
    
    try {
        var input = $('<input type="text" name="answer_value[' + nextId + ']" />');
    } catch (e) {
        var input = $('<input type="text" />');
        input.attr('name', 'answer_value[' + nextId + ']');
    }

    input.attr('id', 'answer' + nextId);
    input.addClass('text');
    input.addClass('answer');
    p.append(input);
    
    p.html(p.html() + ' ');
    
    try {
        input = $('<input type="radio" name="correct" />');
    } catch (e) {
        input = $('<input type="radio" />');
        input.attr('name', 'correct');
    }
    
    input.attr('value', nextId);
    p.append(input);
    
    p.html(p.html() + ' odpowiedź prawidłowa ');
    
    var a = $('<a>');
    a.addClass('gray');
    a.attr('href', '');
    a.html(' usuń');
    a.click(function () { return deleteAnswerInput(this); });
    p.append(a);
    
    p.insertAfter($('.answerWrapper:last'));
    
    return false;
}

function deleteEmailInput(hyperlink)
{
    $(hyperlink).parent().remove();
    
    return false;
}

function createEmailInput()
{
    var nextId = 0;
    
    var wrappers = $('.emailWrapper');
    
    wrappers.each(function (i) {
        var id = parseInt($(this).attr('id').replace('emailWrapper', ''));
        if (id >= nextId) {
            nextId = id + 1;
        }
    });

    var p = $('<p>');
    p.addClass('emailWrapper');
    p.attr('id', 'emailWrapper' + nextId);
    
    try {
        var input = $('<input type="text" name="email_value[' + nextId + ']" />');
    } catch (e) {
        var input = $('<input type="text" />');
        input.attr('name', 'email_value[' + nextId + ']');
    }
    
    input.attr('id', 'email' + nextId);
    input.addClass('text');
    input.addClass('email');
    p.append(input);
    
    var a = $('<a>');
    a.addClass('gray');
    a.attr('href', '');
    a.html(' usuń');
    a.click(function () { return deleteEmailInput(this); });
    p.append(a);
    
    p.insertAfter($('.emailWrapper:last'));
    
    return false;
}

function getCompaniesSubcategories(catId)
{
    $('#companyCategory').attr('disabled', 'disabled');
    $('#companySubcategory').attr('disabled', 'disabled');
    $('#company_id').attr('disabled', 'disabled');

    $.ajax({
	    type: 'post',
        url: '/cms/event/getcompanysubcategories',
        data: 'ajax=1&id=' + catId,
        success: function(response) {
            var data   = $(eval('(' + response + ')'));
		    var select = $('#companySubcategory').get(0);
		    
		    select.options.length = 0;
		    
		    data.each (function (i) {
		        select.options[i] = new Option(data[i].gname, data[i].gid);
		    });
		    
		    getCompanies($('#companySubcategory').val());
        }
    });
}


function getCompanies(subId)
{
    $('#companyCategory').attr('disabled', 'disabled');
    $('#companySubcategory').attr('disabled', 'disabled');
    $('#company_id').attr('disabled', 'disabled');
    
    $.ajax({
	    type: 'post',
        url: '/cms/event/getcompanies',
        data: 'ajax=1&id=' + subId,
        success: function(response) {
            var data   = $(eval('(' + response + ')'));
		    var select = $('#company_id').get(0);
		    
		    select.options.length = 0;
		    
		    data.each (function (i) {
		        select.options[i] = new Option(data[i].fname, data[i].fid);
		    });
		    
		    $('#companyCategory').removeAttr('disabled');
            $('#companySubcategory').removeAttr('disabled');
            $('#company_id').removeAttr('disabled');
        }
    });
}


function changeGalleryField()
{
    if ($('#galleryName').css('display') == 'none') {
        $('#gallery_id').hide();
        $('#galleryName').show();
        $('#galleryHyperlink').html('lista');
    } else {
        $('#galleryName').hide();
        $('#gallery_id').show();
        $('#galleryHyperlink').html('nowa');
    }
    
    return false;
}

function changeCategoryField()
{
    if ($('#categoryName').css('display') == 'none') {
        $('#category_id').hide();
        $('#categoryName').show();
        $('#categoryHyperlink').html('lista');
    } else {
        $('#categoryName').hide();
        $('#category_id').show();
        $('#categoryHyperlink').html('nowa');
    }
    
    return false;
}

function togglePromotedStart()
{
    $('#promotedStartWrapper').css('display', $('input[name=promoted]:checked').val() ? 'block' : 'none');
}

function  toggleCompetitionsType()
{
    $('#competitionAnswer').css('display', $('input[name=type]:checked').val() ? 'block' : 'none');
}

function  toggleCompetitionsPeriodically()
{
    $('#competitionWeeks').css('display', $('input[name=periodically]:checked').val() ? 'block' : 'none');
}

function toggleUploadWay(id)
{   
    if ($('input[name="way[' + id + ']"]:checked').val() == 1) {
        $('#hyperlink' + id).show();
        $('#file' + id).hide();
    } else {
        $('#hyperlink' + id).hide();
        $('#file' + id).show();
    }
}

function toggleCompanyType()
{   
    if ($('input[name="companyType"]:checked').val() == 1) {
        $('#companyIdWrapper').show();
        $('#companyNameWrapper').hide();
    } else {
        $('#companyIdWrapper').hide();
        $('#companyNameWrapper').show();
    }
}

function toggleAdvertType()
{   
    if ($('input[name="type"]:checked').val() == 'code') {
        $('#codeWrapper').show();
        $('#fileWrapper').hide();
    } else {
        $('#codeWrapper').hide();
        $('#fileWrapper').show();
    }
}

function addGalleryPhoto()
{
    var nextId = 0;
    $('.photoWrapper').each(function (i) {
        var id = parseInt($(this).attr('id').replace('photoWrapper', ''));
        if (id >= nextId) {
            nextId = id + 1;
        }
    });
    
    var div = $('<div>');
    div.addClass('photoWrapper');
    div.attr('id', 'photoWrapper' + nextId);
    
    var p = $('<p>');
    p.addClass('options');
    var a = $(document.createElement('a'));
    a.addClass('gray');
    a.attr('href', '');
    a.html('usuń');
    a.click(function() {
       return deleteGalleryPhoto(this); 
    });
    p.append(a);
    div.append(p);
    
    p = $('<p>');
    var label = $(document.createElement('label'));
    label.addClass('required');
    label.attr('for', 'title' + nextId);
    label.html('Tytuł');
    p.append(label);
    var input = $(document.createElement('input'));
    input.addClass('text');
    input.addClass('full');
    input.attr('type', 'text');
    input.attr('id', 'title' + nextId);
    input.attr('name', 'title[' +  nextId + ']');
    input.attr('maxlength', '128');
    p.append(input);
    div.append(p);
    
    p = $('<p>');
    var span = $('<span>');
    span.addClass('description');
    span.html('krótki opis, max. 255 znaków - <strong>pozostało: <span id="descriptionCounter' + nextId + '">255</span></strong>');
    p.append(span);
    label = $(document.createElement('label'));
    label.addClass('required');
    label.attr('for', 'description' + nextId);
    label.html('Opis');
    p.append(label);
    var textarea = $(document.createElement('textarea'));
    textarea.addClass('full');
    textarea.attr('id', 'description' + nextId);
    textarea.attr('name', 'description[' +  nextId + ']');
    textarea.attr('rows', '5');
    textarea.attr('cols', '65');
    textarea.keyup(function() { 
        if (this.value.length > 255) { this.value = this.value.substr(0,255) }; 
        $('#descriptionCounter' + nextId).html(255 - this.value.length);
    });
    p.append(textarea);
    div.append(p);
    
    p = $('<p>');
    var span = $('<span>');
    span.addClass('description');
    span.html('słowa kluczowe oddzielone przecinkami');
    p.append(span);
    label = $(document.createElement('label'));
    label.addClass('required');
    label.attr('for', 'tags' + nextId);
    label.html('Tagi');
    p.append(label);
    input = $(document.createElement('input'));
    input.addClass('text');
    input.addClass('full');
    input.attr('type', 'text');
    input.attr('id', 'tags' + nextId);
    input.attr('name', 'tags[' +  nextId + ']');
    p.append(input);
    div.append(p);
    
    p = $('<p>');
    label = $(document.createElement('label'));
    label.addClass('required');
    label.html('Zdjęcie');
    p.append(label);
    if ($.browser.msie) {
        input = document.createElement('<input type="radio" name="way[' +  nextId + ']" value="0" checked="checked" onclick="toggleUploadWay(' + nextId + ')" />');
    } else {
        input = $('<input type="radio" checked="checked" onclick="toggleUploadWay(' + nextId + ')" >');
        input.attr('name', 'way[' +  nextId + ']');
        input.attr('value', 0);
    }
    p.append(input);
    p.html(p.html() + ' Wgraj z dysku ');
    if ($.browser.msie) {
        input = document.createElement('<input type="radio" name="way[' +  nextId + ']" value="1" onclick="toggleUploadWay(' + nextId + ')" />');
    } else {
        input = $('<input type="radio" onclick="toggleUploadWay(' + nextId + ')" >');
        input.attr('name', 'way[' +  nextId + ']');
        input.attr('value', 1);
    }
    p.append(input);
    p.html(p.html() + ' Wstaw link');
    div.append(p);
    
    p = $('<p>');
    input = $(document.createElement('input'));
    input.addClass('file');
    input.attr('type', 'file');
    input.attr('id', 'file' + nextId);
    input.attr('name', 'file[' +  nextId + ']');
    p.append(input);
    input = $(document.createElement('input'));
    input.addClass('text');
    input.addClass('full');
    input.attr('type', 'text');
    input.attr('id', 'hyperlink' + nextId);
    input.attr('name', 'hyperlink[' +  nextId + ']');
    input.css('display', 'none');
    p.append(input);
    div.append(p);
    
    p = $('<p>');
    var span = $('<span>');
    span.addClass('description');
    span.html('miasto, ulica nr, państwo');
    p.append(span);
    label = $(document.createElement('label'));
    label.attr('for', 'localization' + nextId);
    label.html('Lokalizacja');
    p.append(label);
    input = $(document.createElement('input'));
    input.addClass('text');
    input.addClass('full');
    input.attr('type', 'text');
    input.attr('id', 'localization' + nextId);
    input.attr('name', 'localization[' +  nextId + ']');
    input.attr('maxlength', '255');
    p.append(input);
    div.append(p);
       
    div.insertAfter('.photoWrapper:last');
    
    return false;
}

function deleteGalleryPhoto(link)
{
    $(link).parent().parent().remove();
    
    return false;
}

function toggleSubcategories(id)
{   
    if ($('#subcategories' + id).css('display') == 'block') {
        $('#subcategories' + id).hide();
    } else {
        $('#subcategories' + id).show();
    }
    
    return false;
}


function toggleCompanyPlan()
{
    var value = $('#fplan').val();
    $('#silverPlanForm').css('display', value == 'Brown' ? 'none' : 'block'); 
    $('#goldPlanForm').css('display', value == 'Brown' || value == 'Silver' ? 'none' : 'block');
}

function mainCallback(carousel) {
      
  jQuery('.jcarousel-next-horizontal').bind('click', function() {
    carousel.next();
    updateNavigation(carousel);
    return false;
});

jQuery('.jcarousel-prev-horizontal').bind('click', function() {
    carousel.prev();
    updateNavigation(carousel);
    return false;
});

carousel.first = 1;
updateNavigation(carousel);


};

function updateNavigation(carousel) {
  
    var next = '';
    if (carousel.first == $('#mainEvents li h2 a').length) {
        next = $('#mainEvents li h2 a:first').html();
    } else {
        $('#mainEvents li h2 a').each(function (i) {
            if (carousel.first == i) {
                next = $(this).html();
            }
        });
    }
    
    $($('.jcarousel-next-horizontal').get(0)).html(next);
    
    var prev = '';
    if (carousel.first == 1) {
        prev = $('#mainEvents li h2 a:last').html();
    } else {
        $('#mainEvents li h2 a').each(function (i) {
            if (carousel.first - 2 == i) {
                prev = $(this).html();
            }
        });
    }
    
    $($('.jcarousel-prev-horizontal').get(0)).html(prev);
}

function mainArticlesCallback(carousel) {
  jQuery('#mainArticles .control a').bind('click', function() {
      carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
      setNextMainArticle(carousel);
      return false;
  });
  
  carousel.first = 1;
  setNextMainArticle(carousel);
};

function setNextMainArticle(carousel) {
  var anext = '';     
  if (carousel.first == $('#mainArticles h2 a').length) {
      $('#mainArticles h2 a').each(function (i) {
         if (carousel.first - 2 == i) {
             anext = '<span class="red">Poprzedni:</span> <span style="color: #9a9a9a;">' + $(this).html() + '</span>';
         }
      });
  } else {
      $('#mainArticles h2 a').each(function (i) {
         if (carousel.first == i) {
             anext = '<span class="red">Następny:</span> <span style="color: #9a9a9a;">' + $(this).html() + '</span>';
         }
      });
  }
  
  $('#mainArticles .control a').each(function (i) {
     if (carousel.first - 1 == i) {
         $(this).addClass('current');
     } else {
         $(this).removeClass('current');
     }
  });
  
  $('#art').html(anext);      
}

function passstrenght(password){
//deklaracja zmiennych
var passpoints = 0;
var special1=false;
var special2=false;
var nums=/[0-9]/;
var chars=/[a-zA-z]/;
var nums1=false;
var nums2=false;
var chars1=false;
var chars2=false;
var shorty=false;
var same=false;
var special=new Array('!', '@', '#', '$', '%', '^', '&','*', '(', ')', '_', '<', '>', '|', '?');
//sprawdzenie czy hasło ma minimalną długość
if(password.length<5){
shorty=true;
}
//sprawdzenie czy hasło jest dłuższe niż 5 znaków
if(password.length>=5 && !shorty){
passpoints+=1;
}
//sprawdzenie czy hasło jest dłuższe niż 8 znaków
if(password.length>=8 && !shorty){
passpoints+=1;
}
//sprawdzenie czy hasło zawiera conajmniej 2 znaki specjalne
for(var i=0; i<password.length && !special2 && !shorty; i++){
for(var j=0; j<special.length; j++){
if(password.charAt(i)==special[j]){
if(special2==false){
passpoints+=1;
if(special1==false){
special1=true;
}
else{
special2=true;
}
}
}
}
}
//sprawdzenie czy w haśle występują conajmniej 2 cyfry i 2 litery
for(var i=0; i<password.length && !shorty; i++){
if(!nums2){
czy=nums.test(password.charAt(i));
if(czy && !nums1){
nums1=true;
}
if(czy && !nums2){
nums2=true;
}
}
if(!chars2){
czy=chars.test(password.charAt(i));
if(czy && !chars1){
chars1=true;
}
if(czy && !chars2){
chars2=true;
}
}
}
if(nums2 && chars2){
passpoints+=1;
}
//sprawdzenie czy w haśle wystąpują trzy lub więcej takie same znaki obok siebie
for(var i=2; i<password.length && !shorty && !same; i++){
if(password.charAt(i-2) == password.charAt(i-1) && password.charAt(i-2) == password.charAt(i) && password.charAt(i-1) == password.charAt(i)){
same=true;
passpoints-=1;
}
}
//wyznaczenie siły hasła z ilości passpoints-ów
if(shorty){
return 'Siła hasła: Twoje hasło jest za krótkie!';
}
switch(passpoints){
case 0:
return 'Siła hasła: Banalne do odgadnięcia';
break;
case 1:
return 'Siła hasła: Bardzo słabe';
break;
case 2:
return 'Siła hasła: Słabe';
break;
case 3:
return 'Siła hasła: Średnie';
break;
case 4:
return 'Siła hasła: Silne';
break;
case 5:
return 'Siła hasła: Bardzo silne';
break;
}
}

$(function() { $('a[@rel*=lightboxImg]').lightbox()});