﻿$(document).ready(function(){

    $('a.on_hover').hover(function() {
        var w = parseInt($(this).find('img').css('width'));
        var h = parseInt($(this).find('img').css('height'));
        var a_w = parseInt($(this).css('width'));
        var a_h = parseInt($(this).css('height'));
        var marg_left = ((w-a_w)/2*(-1))+'px';
        var marg_top = ((h-a_h)/2*(-1))+'px';
        $(this).find('img').css({'margin-left' : marg_left});
        $(this).find('img').css({'margin-top' : marg_top});
        $(this).find('img').fadeIn('slow');
    }, function() {
            $(this).find('img').fadeOut('slow');
        }
    );
});

