
function diff(url1, url2){
	window.open("diff.html#" + url1 + "#" + url2, "Diff");
}

function changeColor(elem, which){
	if (which) color="yellow"; else color="white";
	elem.bgColor = color
}

function changeCells(names, box, toattr, fromattr, val){
	for (var j in names){
		matches = document.getElementsByName(names[j])
		checked = document.getElementsByName(box)[0].checked
		for (i=0; i<matches.length; i++) {
			tmp = matches[i].getAttribute(fromattr);
			if (checked) eval("matches[i]." + toattr + " = val" + ";");
			else eval("matches[i]." + toattr + " = tmp;")
		}
	}
}

function colorMatches() {
	changeCells(["diff", "outerdiff"], "colorbox", "bgColor", "realcolor", "#e5e5e5");
}

function showHex(){
	changeCells(["same", "diff"], "hexbox", "innerHTML", "hex", "<kbd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>")
}

function showHighlights(){
	changeCells(["outersame"], "highbox", "bgColor", "realcolor", "red")
}

