function showSelection(S, L, C, R) { var on = C+'On'; var off = C+'Off'; var theLink = R+"_"+L; var theSelection = R+"_"+S; var currentLink = this[R+"_L"]; var currentSelection = this[R+"_S"]; if (currentLink != theLink || currentLink == null) { document.getElementById(theLink).className=on; if (currentLink != null) { document.getElementById(currentLink).className=off; } this[R+"_L"] = theLink; } if (currentSelection != theSelection || currentSelection == null) { document.getElementById(theSelection).className="displayOn"; if (currentSelection != null) { document.getElementById(currentSelection).className="displayOff"; } this[R+"_S"] = theSelection; } }