/*************************************/ // Function: To chcek the value and change the style of it function initSearchValue() { var formObj = document.getElementById('search_form'); var searchField = formObj.search; if(document.getElementById('search_value')) { searchField.value = document.getElementById('search_value').innerHTML; searchField.className = "input normalText"; } } // Function: To check the value and (re)set the class name etc. (will be called onclick and onblur) function checkSearchValue() { var formObj = document.getElementById('search_form'); var searchField = formObj.search; if(searchField.className == "input inactiveText") { searchField.value = ""; searchField.className = "input normalText"; } else if(searchField.value.length == 0) { searchField.className = "input inactiveText"; formObj.reset(); } } // Add function to onload event window.onload = initSearchValue;