$(document).ready(function() {

  // any image with a 'toggle' class will toggle when you mouse over it
  // (unless it has the 'on' class, in which case it should stay on)
  $("img.toggle:not(.on)").hover(function() {
      var src = $(this).attr('src');
      src = src.replace(/_(on|off)\./, '_on.');
      $(this).attr('src', src);

    }, function() {
      var src = $(this).attr('src');
      src = src.replace(/_(on|off)\./, '_off.');
      $(this).attr('src', src);

    });

  // anything with an 'on' class should be toggled to 'on'
  $("img.on").each(function() {
      var src = $(this).attr('src');
      src = src.replace(/_(on|off)\./, '_selected.');
      $(this).attr('src', src);
    });  
    
    
    $("#results tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
    $("#results tr:even").addClass("alt");     
     
     
     $('.delete').click(function(){
	  var answer = confirm('Delete user');
	  return answer // answer is a boolean
	}); 
	
	
	$(".paging li:first").css("padding-top", "3px");

	$("#success_container").fadeTo(900, 0.3, function () {
		$(this).css("background-color","#FEF9DC");
		$(this).fadeTo("fast",1);
	});
	$("#error_container").fadeTo(900, 0.3, function () {
		$(this).css("background-color","#FEF9DC");
		$(this).fadeTo("fast",1);
      });

	
});

function deletechecked()
{
    var answer = confirm("Are you sure you want to delete this entry?")
    if (answer){
        document.messages.submit();
    }
    
    return false;  
} 




