function msg(n_msg,x){ var msg="The following fields were found to be blank or incorrect.\nKindly check and correct it before submitting the form \n" msg=msg+"------------------------------------------------------------------\n\n" msg=msg+n_msg if(x==1){alert(msg); return false;} } // pop up - Media Ads pop up function popwin(x, y) {window.open(x, y,'status=no,toolbar=0,scrollbars=1,resizable=1,menubar=0,width=510,height=580,left=150,top=50');} // ends // pop up function popwin(x, y) {window.open(x, y,'status=no,toolbar=0,scrollbars=1,resizable=1,menubar=0,width=660,height=527,left=150,top=50');} // ends // pop up - Master Plan function popwinloc(x, y) {window.open(x, y,'status=no,toolbar=0,scrollbars=1,resizable=1,menubar=0,width=800,height=700,left=150,top=50');} // ends // pop up - Location Map function popwinloc1(x, y) {window.open(x, y,'status=no,toolbar=0,scrollbars=1,resizable=1,menubar=0,width=800,height=700,left=150,top=50');} // ends //Verify TEXTAREA field - general function VerifyMsg(f_ld,c_nt,cnt_fld) { var len = f_ld.value.length var cl if ((len == 1) && (f_ld.value.substring(0, 1) == " ")) { f_ld.value = "" len = 0 } if (len > (c_nt-10)) { f_ld.value = f_ld.value.substring(0, c_nt) cl = 0 } else { cl = c_nt - len } eval(cnt_fld).value = cl } //Delete news release check function delCheck() { var conf = confirm("This record will be permanently deleted from the database.\nAre you sure?") if(!conf) return false; else return true; } //for email addresses var regexp = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; //illegal characters in fields var illegalCharStr = '~!@#$%^*()<>{}[]=?/\\\":;'; var illegalCharStrWeb = '~!@#$%^*()<>{}[]=?";'; // Removes all characters which appear in string bag from string s. function stripCharsInBag (s, bag) { var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++) { // Check that current character isn't whitespace. var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } //check for illegal characters function checkIlleg(va) { var stripped = stripCharsInBag (va, illegalCharStr); if(va != '' && stripped.length < va.length) { return false; } return true; } //check illegal characters for url function checkIllegweb(va) { var stripped = stripCharsInBag (va, illegalCharStrWeb); if(va != '' && stripped.length < va.length) { return false; } return true; } function radio_button_checker() { // set var radio_choice to false var radio_choice = false; // Loop from zero to the one minus the number of radio button selections for (counter = 0; counter < form1.source.length; counter++) { // If a radio button has been selected it will return true // (If not it will return false) if (form1.source[counter].checked) radio_choice = true; } if (!radio_choice) { // If there were no selections made display an alert box return (false); } return (true); } //Career Form Validation function valReg(){ var x=0; var err_msg="" if (!document.form1.First_Name.value) { err_msg=err_msg+"First Name\n"; x=1; } if (!document.form1.Last_Name.value) { err_msg=err_msg+"Last Name\n"; x=1; } if (!document.form1.DOB.value) { err_msg=err_msg+"Date of Birth\n"; x=1; } if(document.form1.Gender.selectedIndex==0) { err_msg=err_msg+"Gender\n"; x=1; } if (!document.form1.Email_Addr.value) { err_msg=err_msg+"Email\n"; x=1; } else { email = document.form1.Email_Addr.value; if(email.search(regexp) == -1){ err_msg=err_msg+"Email - Invalid Characters\n"; x=1; } } if (!document.form1.Tel_No.value) { err_msg=err_msg+"Telephone Number\n"; x=1; } if(document.form1.course.selectedIndex==0) { err_msg=err_msg+"Course Interested in\n"; x=1; } if(document.form1.source.selectedIndex==0) { // if (!radio_button_checker()) { err_msg=err_msg+"Where did you find out about us?\n"; x=1; } return msg(err_msg,x) }