$(document).ready(function(){

	var checked = false;
	
	$(".icone_materiel_mini >a").mouseover(function () {
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_mini_off/);
        if (matches) {
            imgsrcON = imgsrc.replace(/_mini_off.png$/gi, "_mini_on.png");
            $(this).children("img").attr("src", imgsrcON);
            checked = false;
        } else {
        	checked = true;
        }
	});
	
	$(".icone_materiel_mini >a").mouseout(function () {
		if(checked == false) {
	        imgsrc = $(this).children("img").attr("src");
	        matches = imgsrc.match(/_mini_on/);
	        if (matches) {
	            imgsrcON = imgsrc.replace(/_mini_on.png$/gi, "_mini_off.png");
	            $(this).children("img").attr("src", imgsrcON);
	        }
		}
	});
	
	$(".icone_materiel >a").mouseover(function () {
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_on/);
        if (matches) {
            imgsrcON = imgsrc.replace(/_on.png$/gi, "_off.png");
            $(this).children("img").attr("src", imgsrcON);
        }
	});
	
	$(".icone_materiel >a").mouseout(function () {
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_off/);
        if (matches) {
            imgsrcON = imgsrc.replace(/_off.png$/gi, "_on.png");
            $(this).children("img").attr("src", imgsrcON);
        }
	});
	
	$(".sf-menu >li[id^='roll'] >a").mouseover(function () {
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_0/);
        if (matches) {
            imgsrcON = imgsrc.replace(/_0.png$/gi, "_1.png");
            $(this).children("img").attr("src", imgsrcON);
        }
	});
	
	$(".sf-menu >li[id^='roll'] >a").mouseout(function () {
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_1/);
        if (matches) {
            imgsrcON = imgsrc.replace(/_1.png$/gi, "_0.png");
            $(this).children("img").attr("src", imgsrcON);
        }
	});
	
});


