$(document).ready(function(){

	var checked = false;
	
	$(".roll_onglet").mouseover(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);
            checked = false;
        } else {
        	checked = true;
        }
	});
	
	$(".roll_onglet").mouseout(function () {
		if(checked == false) {
	        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);
	        }
		}
	});
	
	$(".roll_menu").mouseover(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);
            checked = false;
        } else {
        	checked = true;
        }
	});
	
	$(".roll_menu").mouseout(function () {
		if(checked == false) {
	        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);
	        }
		}
	});
	
});

