function readcookie() { document.contact_us.realname.focus(); if (document.cookie.length>0) { var mcookie=document.cookie.split("="); mvalue=mcookie[1].split("/"); mname=unescape(mvalue[0]); mmail=unescape(mvalue[1]); document.contact_us.realname.value=mname; document.contact_us.email.value=mmail; document.contact_us.feedback_txt.focus() email_change() } } function clearFeedback() { document.contact_us.feedback_txt.value="" } function checkRequired() { var problem="no" var mnofeedback=document.getElementById("nofeedback"); var mnorealname=document.getElementById("norealname"); var mnoemail=document.getElementById("noemail"); var minvalidemail=document.getElementById("invalidemail"); var myesfeedback=document.getElementById("yesfeedback"); if (document.contact_us.feedback_txt.value=="") { if (myesfeedback.style.display=='none') { mnofeedback.style.display='inline'; } problem="yes"; } else { mnofeedback.style.display='none'; } if (document.contact_us.realname.value=="") { mnorealname.style.display='inline'; problem="yes"; } else { mnorealname.style.display='none'; } if (document.contact_us.email.value=="") { mnoemail.style.display='inline'; minvalidemail.style.display='none'; problem="yes"; } else { var mnoemail=document.getElementById("noemail"); var minvalidemail=document.getElementById("invalidemail"); var form = document.contact_us; var the_at = form.email.value.indexOf("@"); var the_dot = form.email.value.lastIndexOf("."); var a_space = form.email.value.indexOf(" "); var a_comma = form.email.value.indexOf(","); if ((the_at == -1) || // if there's no '@' (the_at == 0) || // or it's at position 0 (the_dot == -1) || // or there's no '.' (the_dot <= the_at + 1) || // or the '@' is after '.' (the_dot > form.email.value.length - 3) || // there is less than 2 char after the '.' (a_space !== -1) || // or there's a space (a_comma !== -1)) // or there's a comma { mnoemail.style.display='none'; minvalidemail.style.display='inline'; problem="yes"; } } if (problem=="yes") { return false; } else { mnofeedback.style.display='none'; myesfeedback.style.display='inline'; document.contact_us.feedback.value=document.contact_us.feedback_txt.value; var mdate=new Date("December 31, 2015"); var expiredate=mdate.toGMTString(); var mcookie="name="+escape(document.contact_us.realname.value)+"/"+escape(document.contact_us.email.value)+";expires="+expiredate; document.cookie=mcookie; document.contact_us.feedback_txt.value=""; document.contact_us.spamfltr.value=""; if (document.contact_us.recipient.value=="webmaster") { document.contact_us.user_agent.value=navigator.userAgent; } return true; } } function txtarea_focus() { var mnofeedback=document.getElementById("nofeedback"); var myesfeedback=document.getElementById("yesfeedback"); mnofeedback.style.display='none'; myesfeedback.style.display='none'; document.contact_us.spamfltr.value=""; document.contact_us.button.disabled=false } function realname_focus() { var mnorealname=document.getElementById("norealname"); mnorealname.style.display='none'; } function email_focus() { var mnoemail=document.getElementById("noemail"); var minvalidemail=document.getElementById("invalidemail"); mnoemail.style.display='none'; minvalidemail.style.display='none'; } function email_change() { // check that Email address is in proper format var mnoemail=document.getElementById("noemail"); var minvalidemail=document.getElementById("invalidemail"); var form = document.contact_us; var the_at = form.email.value.indexOf("@"); var the_dot = form.email.value.lastIndexOf("."); var a_space = form.email.value.indexOf(" "); var a_comma = form.email.value.indexOf(","); if ((the_at == -1) || // if there's no '@' (the_at == 0) || // or it's at position 0 (the_dot == -1) || // or there's no '.' (the_dot <= the_at + 1) || // or the '@' is after '.' (the_dot > form.email.value.length - 3) || // there is less than 2 char after the '.' (a_space !== -1) || // or there's a space (a_comma !== -1)) // or there's a comma { mnoemail.style.display='none'; minvalidemail.style.display='inline'; } }