function defaultFormInput(oid, txt) { var el = document.getElementById(oid); if (el != null) { if (el.nodeName == "INPUT") el.setAttribute("value", txt); else if (el.nodeName == "TEXTAREA") el.value = txt; el.onfocus = function() { if (el.value == txt) el.value = ""; } el.onblur = function() { if (el.value == "") el.value = txt; } }else { //alert("gone"); } } var IsWindowInit = false; function initWindow() { setTimeout("execInit()", 0); } function execInit() { if (IsWindowInit) return; defaultFormInput("contactform_name", 'Name'); defaultFormInput("contactform_email", 'Email'); defaultFormInput("contactform_message", 'Message'); IsWindowInit = true; } var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = initWindow(); } else { window.onload = function() { if (oldonload) { oldonload(); } initWindow(); } }