﻿// JavaScript Document



$(document).ready(function () {
    $(function () {

        $(".hoverswap-gif").hover(
			function () {
			    $(this).attr("src", $(this).attr("src").replace(/.gif/, "-over.gif"));
			},
			function () {
			    $(this).attr("src", $(this).attr("src").replace(/-over.gif/, ".gif"));
			}
		);
    });
    $(function () {

        $("img.hoverswap").hover(
		function () {
		    $(this).attr("src", $(this).attr("src").replace(/.jpg/, "-over.jpg"));
		},
		function () {
		    $(this).attr("src", $(this).attr("src").replace(/-over.jpg/, ".jpg"));
		}
	);
    });
    $(function () {
        $("div.hoverswap").hover(
		function () {
		    var thumbOver = $(this).find("img").attr("src").replace(/.jpg/, "-over.jpg"); //Get image url and assign it to 'thumbOver'
		    $(this).css({ 'background': 'url(' + thumbOver + ') no-repeat top' });
		    $(this).find("img").stop().animate({ opacity: 0 }, 300);

		},
		function () {
		    $(this).find("img").stop().animate({ opacity: 1 }, 300);
		}
	);
    });
});
