var hovClass = "hover";
var normalImg = ".";
var hoverImg = "_on.";

$.fn.swapImage = function (src0, src1) {
    var dir = this.attr("src").split("/");
    dir.push(dir.pop().replace(src0, src1));
    this.attr("src", dir.join("/"))
}

$(document).ready(function () {
    $("img").hover(function () {
        if ($(this).hasClass(hovClass) && !$(this).attr("src").match("_selected")) {
            $(this).swapImage(normalImg, hoverImg);
        }
    }, function () {
        if ($(this).hasClass(hovClass) && !$(this).attr("src").match("_selected")) {
            $(this).swapImage(hoverImg, normalImg);
        }
    })



$(function() {
	var num = 1;
	$(".mm-contents").hide();
	$('#mm-works').hover(
		function(){
			$(".mm-contents").show();
			$('.mm-contents').stop().animate({'opacity':'1'},360);
		},
		function(){
			$('.mm-contents').stop().animate({'opacity':'0'},360,function(){$(this).hide();});
		}
	); 
/*
	$(".mm-contents a img").hover(
		function(){
			$(this).stop().animate({'opacity':'0'},240);
		},
		function(){
			$(this).stop().animate({'opacity':'1'},240);
		}
	); 
*/
});



})

