/* * This holds javascript functions for automatic switching of the contents of * a page due to the change of the selected option in a select box. The new * address for the page is given in the value attribute of the option * element. * */ /* * The parameters are as follows: * select: select element calling the function * target: the name of the frame whose address should be changed * targetparent: the name of the parent frame of the frame whose address * should be changed (may be null) */ function switchpageframe(select, target, targetparent) { var index; if(target != "") { for(index=0; index < select.options.length; index++) { if(select.options[index].selected) { if(select.options[index].value != "") { var element = top.frames[target]; if(element == null && targetparent != "") { element = top.frames[targetparent].frames[target]; } if(element != null) { element.location = select.options[index].value; } break; } } } } } /* * The parameters are as follows: * select: select element calling the function */ function switchpage(select) { var index; for(index=0; index < select.options.length; index++) { if(select.options[index].selected) { if(select.options[index].value != "") { document.location = select.options[index].value; break; } } } }