1//--------------------------------------------------------------------------------------------------------------- 2//ONLOAD - Event: 3if (window.onload){ 4 var funWindowLoad = window.onload; 5 window.onload = new Function("funWindowLoad(); Window_OnLoad();"); 6} 7else 8 window.onload = Window_OnLoad; 9 10//--------------------------------------------------------------------------------------------------------------- 11function Window_OnLoad(){ 12 13 //Check to see if the _form has been set yet, it could have been set in uof.js: 14 if (_form == null) _form = document.frmMain; 15 16} 17//--------------------------------------------------------------------------------------------------------------- 18function SendEmail(){ 19 20 //Make sure required fields are filled in: 21 if (Trim(_form.txtFirstName.value) == ""){ 22 alert("Please enter your first name."); 23 _form.txtFirstName.focus(); 24 return; 25 } 26 27 if (Trim(_form.txtFirstName.value).length < 2 ){ 28 alert("Please enter a valid first name."); 29 _form.txtFirstName.focus(); 30 return; 31 } 32 33 if (Trim(_form.txtLastName.value) == ""){ 34 alert("Please enter your last name."); 35 _form.txtLastName.focus(); 36 return; 37 } 38 39 if (Trim(_form.txtLastName.value).length < 2 ){ 40 alert("Please enter a valid last name."); 41 _form.txtFirstName.focus(); 42 return; 43 } 44 45 if (Trim(_form.txtEmailFrom.value) == ""){ 46 alert("Please enter your email address."); 47 _form.txtEmailFrom.focus(); 48 return; 49 } 50 if (!IsEmail(Trim(_form.txtEmailFrom.value))){ 51 alert("Please enter a valid email address."); 52 _form.txtEmailFrom.focus(); 53 return; 54 } 55 if (Trim(_form.txtVerifyEmail.value) == ""){ 56 alert("Please verify your email address."); 57 _form.txtVerifyEmail.focus(); 58 return; 59 } 60 if (Trim(_form.txtEmailFrom.value) != Trim(_form.txtVerifyEmail.value)){ 61 alert("The second entry of your email address must match your first entry."); 62 _form.txtVerifyEmail.focus(); 63 return; 64 } 65 66 if (Trim(_form.txtComments.value) == ""){ 67 alert("Please enter your question/comment."); 68 _form.txtComments.focus(); 69 return; 70 } 71 72 if (Trim(_form.txtComments.value).length < 2 ){ 73 alert("Please enter your question/comment."); 74 _form.txtFirstName.focus(); 75 return; 76 } 77 78 //Search for spam words and stop email if any are found: 79var wordsToSearch = /search engine|white hat|google ranking|increase traffic|online leads|SEO|Internet Marketing|time is your greatest enemy/; 80 var matchWords = _form.txtComments.value.toLowerCase().search(wordsToSearch); 81 82 if(matchWords != -1){ 83 alert("Your email was successfully sent."); 84 document.location.href = "default.aspx"; 85 return; 86 } 87 88 //Disable the button: 89 _form.cmdSendEmail.disabled = true; 90 91 //Call the callback method: 92 resultArray = cbSendEmail( 93 escape(document.getElementById("tblContactForm").getAttribute("source")), 94 escape((_form.txtAgentEmail == null?"":_form.txtAgentEmail.value)), 95 escape(_form.txtFirstName.value), 96 escape(_form.txtLastName.value), 97 escape(_form.txtEmailFrom.value), 98 escape(document.getElementById("divSubject").innerHTML), 99 escape(_form.txtComments.value) 100 ).split("<cb_col>"); 101 102 //Evaluate result: 103 if (resultArray[0] == "0"){ 104 105 alert("Your email was successfully sent."); 106 document.location.href = "counter.aspx"; 107 108 } 109 else { 110 111 //Show the error: 112 alert(resultArray[1]); 113 114 } 115 116 //Enable the button: 117 _form.cmdSendEmail.disabled = false; 118 119} 120//---------------------------------------------------------------------------------------------------------------
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.