// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(function() {

	$('a.lightbox').lightBox({
	 imageBtnClose: '/images/lightbox-btn-close.gif'
	}); // Select all links with lightbox class

});

// used in gallery photo delete
function remove_field(element, item) {
	element.parent().remove();
}

// initialise plugins
jQuery(function(){
	jQuery('ul.sf-menu').superfish();

	$('[placeholder]').focus(function() {
    var input = $(this);
    if (input.val() == input.attr('placeholder')) {
      input.val('');
      input.removeClass('placeholder');
    }
  }).blur(function() {
    var input = $(this);
    if (input.val() == '') {
      input.addClass('placeholder');
      input.val(input.attr('placeholder'));
    }
  }).blur().parents('form').submit(function() {
    $(this).find('[placeholder]').each(function() {
      var input = $(this);
      if (input.val() == input.attr('placeholder')) {
        input.val('');
      }
    })
  });

});