function initSelect() { var theSelect = document.getElementById("quicklinks"); theSelect.changed = false; theSelect.onfocus = selectFocussed; theSelect.onchange = selectChanged; theSelect.onkeydown = selectKeyed; theSelect.onclick = selectClicked; return true; } function goTo(page) { if(page != "") location.href=page; } function isIE() { return navigator.appVersion.indexOf("MSIE")!=-1; } function selectChanged(theElement) { var theSelect; if (theElement && theElement.value) { theSelect = theElement; } else { theSelect = this; } if (!theSelect.changed) { if (isIE()) return false; if (this.value == this.initValue) return false; } goTo(theSelect.value); //alert("The select has been changed to " + theSelect.value); return true; } function selectClicked() { this.changed = true; } function selectFocussed() { this.initValue = this.value; return true; } function selectKeyed(e) { var theEvent; var keyCodeTab = "9"; var keyCodeEnter = "13"; var keyCodeEsc = "27"; if (e) { theEvent = e; } else { theEvent = event; } if ((theEvent.keyCode == keyCodeEnter || theEvent.keyCode == keyCodeTab) && this.value != this.initValue) { this.changed = true; selectChanged(this); } else if (theEvent.keyCode == keyCodeEsc) { this.value = this.initValue; } else { this.changed = false; } return true; } function initSearch() { var searchString = document.getElementById("searchString"); searchString.onfocus = searchFocussed; searchString.onblur = searchBlurred return true; } function searchFocussed() { if(this.value == "Find it Fast") this.value = ""; return true; } function searchBlurred() { if(this.value == "") this.value = "Find it Fast"; return true; } function init() { initSelect(); initSearch(); return true; } window.onload = init;