// -------------------------------------------------------------------------- // This function controls the mouseover and mouseout action for buttons // All buttons must be named with name=, and name=endof // Usage: onmouseover="chgButton()" onmouseout="chgButton()" // Author: Dan Snellgrove // -------------------------------------------------------------------------- function chgButton() { var btn1, bt2, cls1, cls2, endof, id btn1 = event.srcElement; // Identify btn2 endof = btn1.name.indexOf("endof") == -1; id = (endof) ? "endof" + btn1.name : btn1.name.substring(5); btn2 = document.getElementById(id) cls1 = btn1.attributes['class']; cls2 = btn2.attributes['class']; // Update btn classes if (cls1.value.indexOf("over") == -1) { cls1.value += "_over"; cls2.value += "_over"; } else { cls1.value = cls1.value.replace("_over", ""); cls2.value = cls2.value.replace("_over", ""); } } // -------------------------------------------------------------------------- // This function should no longer be necessary function chgSubButton() { var btn = event.srcElement; var state = (event.type == "mouseover") ? "_over" : ""; if ((btn.name).indexOf("endof") == -1) { // Mouseover for subbutton btn.attributes['class'].value = 'subbutton' + state; var endofbutton = document.getElementById('endof'+btn.name); endofbutton.attributes['class'].value = 'endofbutton' + state; } else { // Mouseover for endof button btn.attributes['class'].value= 'endofbutton' + state; var button = document.getElementById(''+btn.name.substring(5)+''); button.attributes['class'].value = 'subbutton' + state; } } // -----------------------------------------------------------------------------------