/* * swapImg.js * * Copyright (c) 2008 ALLIED ARCHITECTS ALL RIGHTS RESERVED. * licensed under the MIT license. * * How to Use * You can use mouseover effect easily  * by preparing two images and set attribute class="hover" with img. * eg) image.jpg -- image_on.jpg * * $Date: 2008-07-15 12:00:00 +0900 (Tuesday, 15 July 2008) $ */function swapImg() {  $(".hover").each(function() {    var normal = this.src;    var dot = this.src.lastIndexOf('.');    var hover = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);    $(this).hover(      function() { this.src = hover; },      function() { this.src = normal; });  });}$(document).ready(swapImg);