﻿(function($) {
    $.extend($, {
        cacheImage: function(src, options) {
            if (typeof src === 'object') {
                $.each(src, function() {
                    $.cacheImage(String(this), options);
                });
            }
            var image = new Image();
            options = options || {};
            $.each(['load', 'error', 'abort'], function() { // Callbacks
                var e = String(this);
                if (typeof options[e] === 'function') { $(image)[e](options[e]); }
            });
            image.src = src;
            return image;
        }
    });
    $.extend($.fn, {
        cacheImage: function(options) {
            return this.each(function() {
                $.cacheImage(this.src, options);
            });
        }
    });
})(jQuery);

$(document).ready(function() {
    $(function() {
        $(".carouselClients").jCarouselLite({
            btnNext: ".next",
            btnPrev: ".prev",
            visible: 5
        });
    });
});
$(document).ready(function() {
    $(function() {
        $(".headers").jCarouselLite({
            btnNext: ".next2",
            btnPrev: ".prev2",
            auto: 10000,
            speed: 200,
            visible: 1
        });
    });
});
$(document).ready(function() {
    $(".fprollover").hover(
        function() {
            var val = $(this).attr("src");
            if (val.indexOf("Rollover") != -1) {
                var iconName = $(this).attr("src");
                var rollover = iconName.replace('Rollover', 'Static');

                $(this).attr({ src: rollover });
            }
            else {
                var iconName = $(this).attr("src");
                var staticc = iconName.replace('Static', 'Rollover');
                $(this).attr({ src: staticc });
            }
        });
});
