﻿$(document).ready(function () {

    //rollover effect on links 
    $("a.simplehover img, img.simplehover").mouseover(function () {
        $(this).attr("src", $(this).attr("src").replace("-off.", "-on."));
    }).mouseout(function () {
        $(this).attr("src", $(this).attr("src").replace("-on.", "-off."));
    });


    //.fadehover - Rollover effect on links and images with FADE
    $("a.fadehover img, img.fadehover").mouseover(function () {
        $(this).stop(true, true).fadeTo(0, 0.5, function () {
            $(this).attr("src", $(this).attr("src").replace("-off.", "-on.")).fadeTo(500, 1);
        });
    }).mouseout(function () {
        $(this).stop(true, true).fadeTo(50, 0.5, function () {
            $(this).attr("src", $(this).attr("src").replace("-on.", "-off.")).fadeTo(50, 1);
        });
    });

    $(".bigPreview").hide();

    $(".bigbtn-lnk").hover(
        function () {

            $(".backgroundbanner").hide();

            $(this).children().css('background-image', 'none');
            $(this).children().css('background-color', '#002d62');

            $(this).children().stop().animate({ 'color': '#ffe6b2' }, 1000);
            $(this).find(".titlebigbtn").stop().animate({ 'color': 'white' }, 1000);

            $(".bigPreview[ImageNo='" + $(this).attr("ImageNo") + "']").fadeIn(300);

        }, function () {

            $(this).children().css('background', 'url(/imgs/bg-bigbtn.jpg) top repeat-x');
            $(this).children().stop().animate({ 'color': '#404040' }, 1500);
            $(this).find(".titlebigbtn").stop().animate({ 'color': '#002d62' }, 1500);

            $(".bigPreview").fadeOut(100);

        });

    //re-enable main image
    $(".bigbtn-lnk").mouseleave(function () { $(".backgroundbanner").fadeIn(300); });


});



