$(window).bind('load', function() {
    
	var preload = new Array();
    
	$(".img-switch").each(function() {
        s = $(this).attr("src").replace(/\.(png|jpg)$/i, "_on.$1");
        preload.push(s)
    });
	
    var img = document.createElement('img');
    $(img).bind('load', function() {
        if(preload[0]) {
            this.src = preload.shift();
        }
    }).trigger('load');
});

$(document).ready(function() {

    $(".img-switch").hover(function() {
        s = $(this).attr("src").replace(/\.(png|jpg)$/i, "_on.$1");
        $(this).attr("src", s);
    }, function() {
        s = $(this).attr("src").replace(/_on\.(png|jpg)$/i, ".$1");
        $(this).attr("src", s);
    });
	
	
	
});

