function swap_over(image){
	image.src = "images/folder_red.gif";
}
function swap_out(image){
	image.src = "images/folder_grey.gif";
}

function init(){
	var anchors = document.getElementsByTagName('a');
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		var relAttribute = String(anchor.getAttribute('rel'));
		var image = anchor.childNodes[0];
		if (relAttribute.toLowerCase().match('folder')){
			image.onmouseover = function () { swap_over(this); }
			image.onmouseout = function () { swap_out(this); }
		}
	}
}

window.onload = init;