﻿$(document).ready(function() {

    $('input.ForceNumericOnly').ForceNumericOnly();
    
    $('.hoverArrow').hover(
        function() {
            $(this).attr('src', function() {
                return this.src.replace(/\.([a-z]{3})$/, '_over.$1');
            });
        },
        function() {
            $(this).attr('src', function() {
                return this.src.replace('_over.', '.');
            });
        }
    );

    $('a.dealerName').hover(
        function() {
            $(this).find("img:first").attr('src', function() {
                return this.src.replace(/\.([a-z]{3})$/, '_over.$1');
            });
        },
        function() {
            $(this).find("img:first").attr('src', function() {
                return this.src.replace('_over.', '.');
            });
        }
    );

    $('img.hoverable, input:image.hoverable').hover(
            function() {
                $(this).attr('src', this.src.replace('_out.', '_over.'));
            },
            function() {
                $(this).attr('src', this.src.replace('_over.', '_out.'));
            }
        );

    $('a.hoverLink').hover(
            function() {
                $(this).find("img:first").attr('src', function() {
                    return this.src.replace(/\.([a-z]{3})$/, '_over.$1');
                });
            },
            function() {
                $(this).find("img:first").attr('src', function() {
                    return this.src.replace('_over.', '.');
                });
            }
        );

});
