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

$(document).ready(function() {
  
  // $('img.nav').hover(function() {
  //     var old_image = $(this).attr("src");
  //     var hovered_image_check = old_image.lastIndexOf("hover");
  //     
  //     // if (hovered_image_check >= 0) {
  //       var index = old_image.lastIndexOf("/");
  //       var filename = old_image.substr(index);
  //       var filename_without_extension = filename.split(".")[0];
  //       alert(filename_without_extension);
  //       var new_path = "/images/ui/nav" + filename_without_extension + "_hover.jpg";
  // 
  //      $(this).attr("src", new_path);
  //     // };
  //  }, function() {
  //    var old_image = $(this).attr("src");
  //    $(this).attr("src", old_image);
  // });
  // 
  
  $('img.nav').hover(
   function()
   {
    this.src = this.src.replace("_off","_on");
   },
   function()
   {
    this.src = this.src.replace("_on","_off");
   }
  );



});
