$(function($) {
    $(document).ready(function(){
    	
    	var list = 'body.home div#wrapper div#main div#container div#content a.imgswap';

    	$(list).mouseover(function () {
        	swapImg($('img', $(this)), true);  
        });
        $(list).mouseout(function () {
        	swapImg($('img', $(this)), false);  
        });
        
        var swapImg = function(imgobj, on)
        {
        	if (on)
        	{
        		$(imgobj).attr('src', $(imgobj).attr('src').replace(/-bw\./gi, '.'));
        	}
        	else
        	{
        		$(imgobj).attr('src', $(imgobj).attr('src').replace(/\.([^.]+)$/gi, '-bw.$1'));
        	}
        }
 
    });
});
