// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
jQuery(document).ready(function() {
  // sets up the hover image for activity feed items  
  //jQuery(".imgHoverMarker").tooltip({
  //showURL: false,
  //bodyHandler: function() {
  //var i = jQuery(this).children()[0]
  //var imgsrc = jQuery(i).attr('src');
  //return jQuery('<img src="'+imgsrc+'" />');
  //}
  //});

  jQuery('input,textarea').focus( function() {
  jQuery(this).css('border-color', '#006699');
  });
  jQuery('input,textarea').blur( function() {
  jQuery(this).css('border-color','#ccc');
  });

  // facebox popups
  //jQuery('a[rel*=facebox]').facebox();

});

function check_for_attachment(asset_id){
	var asset_attachment = $('#attachment_asset_' + asset_id)
	if (asset_attachment.length != 0){
		$('#add_asset_' + asset_id).hide();
    $('#remove_asset_' + asset_id).show();
	}
}

function remove_attachment(attachment_id){
	$('#attachment_asset_' + attachment_id).remove();
	$('#add_asset_' + attachment_id).show();
	$('#remove_asset_' + attachment_id).hide();
}