/*******************************************************************************
Author: sascha.scholz@actra.ch
Update: 06.12.2010
*******************************************************************************/

$(document).ready(function() {
	$('a.delete').click(function() {
    return confirm("Wirklich löschen? - Bitte mit OK bestätigen.");
  });
  $('.herstellen').click(function() {
    return confirm("Möchten Sie den Eintrag wirklich wieder herstellen?\nBitte mit OK bestätigen.");
  });
  $('.cancel').click(function() {
    return confirm("Möchten Sie wirklich abbrechen?\nBitte mit OK bestätigen.");
  });
   $('.external').click(function() {
    open(this.href);
		return false;
  });
});

$(document).ready(function() {
$('.form-select input.submit').hide();
$('#cat').change(function() {
    $(this).closest("form").submit();
});
});


$(document).ready(function() {
$('<input type="checkbox" class="discover-all" />').appendTo('.checkall');
 $('.discover-all').click(function() {
    var $checkboxes = $(this).parents('table').find(':checkbox');
    if (this.checked) {
      $checkboxes.attr('checked', true);
    } else {
      $checkboxes.attr('checked', '');
    }
  })
  $('#mypicsform button').attr('disabled', 'disabled').addClass('disabled');
  $('#mypicsform input:checkbox').click(function() {
    var buttonsChecked = $('td input:checkbox:checked');
    if (buttonsChecked.length) {
      $('#mypicsform button').removeAttr('disabled').removeClass('disabled').show();
      } else {
      $('#mypicsform button').attr('disabled', 'disabled').addClass('disabled');
      }
  });
});



$(document).ready(function() {
  $('.file-item').mouseenter(function(e) {
    x = e.pageX - $(this).offset().left;
    y = e.pageY - $(this).offset().top;
    $(this).css('z-index', '100').children('div.tooltip').css({'top' : y + 10, 'left': x + 20, 'display': 'block'});
  }).mousemove(function(e) {
    x = e.pageX - $(this).offset().left;
    y = e.pageY - $(this).offset().top;
    $(this).children('div.tooltip').css({'top': y + 10, 'left': x + 20 });
  }).mouseleave(function() {
    $(this).css('z-index', '1').children('div.tooltip').animate({'opacity': 'hide'}, 'fast');
  });
});








