function initPage(){for(var a=document.getElementsByTagName("input"),b=0;b<a.length;b++)if(a[b].type=="text"&&(a[b].name=="email"||a[b].name=="query")){var c=getAncestor(a[b],"form");if(c)c.onsubmit=handleSubmit;a[b].onfocus=function(){if(this.value=="Email Address"||this.value=="Keywords or Item #s")this.value=""};a[b].onblur=function(){if(this.value==""&&this.name=="email")this.value="Email Address";if(this.value==""&&this.name=="query")this.value="Keywords or Item #s"}}} function handleSubmit(){var a=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,b=this.elements.email;if(b)if(b.value==""){alert("Email address is empty!");return false}else return b.value.match(a)||(alert("You have entered incorrect email address!"),false);return true}function getAncestor(a,b){for(a=a;a.parentNode&&(!a.tagName||a.tagName.toUpperCase()!=b.toUpperCase());)a=a.parentNode;return a} if(window.addEventListener)window.addEventListener("load",initPage,false);else window.attachEvent&&window.attachEvent("onload",initPage);