//begin add functions to execute
addFunction('toggleLoginBox', "'topBarLoginBox'");
addFunction('submitAfterChangeSelectCatalogue', "null");
addFunction('submitAfterChangeSelectTypes', "null");
addFunction('removeElements', "null");
addFunction('openNewWindow', "null");
addFunction('legendShowHide', "null");
addFunction('confirmDelete', "null");
addFunction('confirmClear', "null");
//addFunction('submitAfterClick', "null");
//end add function to execute

/*Usuwa wszystkie elementy ktore maja klase o nazwie remove-element*/
/*za pomoca css-a sa one ukrywane zeby nie pokazywac ich uzytkownikom bez js-a*/
function removeElements() {
  $("*.remove-element").remove();
  return false;
}
/*przeladuj formularz po wyborze selec-ta katalogu*/
function submitAfterChangeSelectCatalogue() {
  $('select.catalogue').change( function () {
    $("form.submit").submit();
  });
}
function submitAfterChangeSelectTypes() {
  $('#types').change( function () {
    $("form.submit").submit();
  });
}
//function submitAfterClick() {
//  $(".click-submit").click( function () {
//    $("form.submit").submit();
//  });
//}
function hiddenLoginForm() {
  $('#topBarLoginBox').hide();
}
function toggleLoginBox(id) {
  $("#topBarSignupLoginLink").click(function () {
      $("#"+id).toggle();
      return false;
  });
}
function openNewWindow() {
  $('a.new-window').click( function () {
    var url = this.href;
    var title = this.title;
    window.open(url, title, '');
    return false;
  });
}
function legendShowHide() {
  $("#legend ul").css({display:"none"});
  $('.show-hide-legend').click( function () {
    if ($("#legend ul").is(":hidden")) {
      $("#legend ul").show("slow");
    } else {
      $("#legend ul").slideUp();
    }
    return false;
  });
}
/**
 * Potwierdzenie usunięcia
 *
 */
function confirmDelete() {
  $('.confirm-delete').click( function () {
    return confirm("Potwierdź usuwanie");
  });
}
/**
 * Potwierdzenie cyszczenia
 *
 */
function confirmClear() {
  $('.confirm-clear').click( function () {
    return confirm("Potwierdź czyszczenie");
  });
}