window.onload = startup; function startup() { addHighlights(); } /******* HIGHLIGHT INPUT FIELDS *******************************/ lastFocused = ''; function addHighlights() { var inputs = document.getElementsByTagName("input"); var textareas = document.getElementsByTagName("textarea"); var selects = document.getElementsByTagName("select"); var numInputs = inputs.length; var numTextAreas = textareas.length; var numSelects = selects.length; for ( i=0; i < numInputs; i++ ) { var currentInput = inputs[i]; currentInput.onfocus = onFocus; currentInput.onblur = onBlur; currentInput.onmouseover = onOver; currentInput.onmouseout = onOut; } for ( i=0; i < numTextAreas; i++ ) { var currentTextArea = textareas[i]; currentTextArea.onfocus = onFocus; currentTextArea.onblur = onBlur; currentTextArea.onmouseover = onOver; currentTextArea.onmouseout = onOut; } for ( i=0; i < numSelects; i++ ) { var currentSelect = selects[i]; currentSelect.onfocus = onFocus; currentSelect.onblur = onBlur; currentSelect.onmouseover = onOver; currentSelect.onmouseout = onOut; } } function onFocus() { lastFocused = this; this.style.background = '#FFFFFF'; this.style.border = '1px solid #65764B;'; this.style.color = '#65764B;'; } function onBlur() { this.style.background = '#ECECEC'; this.style.border = 'solid 1px #B0B0B0'; this.style.color = '#000000'; } function onOver() { if (this != lastFocused) { this.style.background = '#F8F8F8'; if (this.type == 'submit') this.style.cursor = 'pointer'; if (this.type == 'button') this.style.cursor = 'pointer'; } } function onOut() { if (this != lastFocused) { this.style.background = '#ECECEC'; this.style.border = 'solid 1px #B0B0B0'; this.style.color = '#000000'; } } // Insert links to specified elements/textboxes function insertLink(elementId) { var link = prompt("Please enter the link in the form of http://www.website.com/link.html", ""); while (link != null && link.substr(0,7).toLowerCase() != 'http://') { alert('Link must start with http:// using format: http://www.website.com/link.html'); var link = prompt("Please enter the link in the form of http://www.website.com/link.html", ""); } if (link != null) var title = prompt("Please enter what the link should read (i.e. Click Here!): ",""); if (link != null && title != null) { var textbox = document.getElementById(elementId); textbox.value += ' ' + title + ' '; } }