  if(!Array.indexOf){
	    Array.prototype.indexOf = function(obj){
	        for(var i=0; i<this.length; i++){
	            if(this[i]==obj){
	                return i;
	            }
	        }
	        return -1;
	    }
	}

// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function is_defined(variable) {
  return (typeof(window[variable]) != "undefined");
}

jQuery(function($) {
    $('.target_blank').each(function() {
      $(this).attr('target', '_blank');
    });
    
    $('img[alt]:not(img[title])').each(function() {
      e = $(this)
      e.attr('title', e.attr('alt'));
    });
});

(function($) {
  $('div.without_shadowbox.photo').livequery("mouseover", function() {
    if( $('.nottohide').length == 0)
	    $('.description', $(this)).show();
  });
  $('div.description.without_shadowbox').livequery("mouseenter", function() {
    $(this).addClass('nottohide');
  });
  $('div.description.without_shadowbox').livequery("mouseleave", function() {
    $(this).removeClass('nottohide');
    $(this).hide();
  });
  $('div.without_shadowbox.photo').livequery("mouseleave", function() {
    if( $('.nottohide').length == 0){
      $('.description', $(this)).hide();
    }
  });
})(jQuery);

