function assignRollOver(selector, toReplace, replaceText) {
	$(selector).hover(function(){
		var $childImg = findImgChild($(this));
		if($childImg != undefined) {
			var imgSrc = $childImg.attr("src");
			$childImg.attr("src", imgSrc.replace(toReplace, replaceText));
		}
	},function(){
		var $childImg = findImgChild($(this));
		if($childImg != undefined) {
			var imgSrc = $childImg.attr("src");
			$childImg.attr("src", imgSrc.replace(replaceText, toReplace));
		}
	});
}

function findImgChild(elm) {
	var result;
	$.each(elm, function(){
		if($(this).children().length <= 0) 
		return true;
		
		$(this).children().each(function(){
			if(this.tagName == "IMG") {
				result = $(this);
				return false;
			} else {
				result = findImgChild($(this));
			}
		});
	});
	return result;
}
