// This function is used to check if a certain text is numeric or not function IsNumeric(sText) { var ValidChars = "0123456789."; var IsNumber=true; var Char; for (i = 0; i127) { alert("Your email address contains invalid characters."); return false; } } for (i=0; i127) { alert("Your email domain name contains invalid characters."); return false; } } if (user.match(userPat)==null) { alert("Your email address does not seem to be valid - check your spelling, including wrong use of commas, or a full point . at the end of the address!!"); return false; } var IPArray=domain.match(ipDomainPat); if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("Destination IP address is invalid!"); return false; } } return true; } var atomPat=new RegExp("^" + atom + "$"); var domArr=domain.split("."); var len=domArr.length; for (i=0;i=0 && List1.options[0].value != "-1") { // Add the selected item of List1 in List2 Element = new Option(List1.options[List1.options.selectedIndex].text,List1.options[List1.options.selectedIndex].value, false, true); if (List2.options[0].value != "-1") { List2.add(Element,List1.options[List1.options.selectedIndex].value); //List2.add(Element,List1.length); } else { List2.remove(0); List2.add(Element,0); } // Remove the selected item of List1 List1.remove(List1.options.selectedIndex); Element = new Option("----------------------------------------------","-1"); if (List1.options.length == 0) { List1.add(Element,0); } } } function SwapLists(List1,List2) { if (List1.options.length>0 && List1.options[0].value != "-1") { // Add items of List1 in List2 List2.remove(0); for(i=0;i -1) { parts[d++] = whole.substring(p, q); parts.length = d; p = q + 1; q = whole.indexOf(link, p); } parts[d++] = whole.substring(p); parts.length = d; return(parts); } //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-* function myJoin(parts, link) { if (parts.join) { return(parts.join(link)); } var whole = ""; var thisLink = ""; for(var d = 0; d < parts.length;d++) { if (parts[d] != "") { whole = whole + thisLink + parts[d]; thisLink = link; } } return(whole); } /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* * Search Control *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ function SearchForMaterials() { with (document.form) { if (Trim(txtSearch.value)=="") { return false; } action = "../Home/search_results.php"; submit(); } } /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* * Newsletter Control *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ // This function is used to subscribe a certain email address function SubscribeMe() { with (document.form) { var email = txtEmail.value; if (email != "") { if (!isValidMail(email)) { txtEmail.focus(); } else { useraction.value = "subscribe"; action = "../Newsletter/subscribtion.php"; submit(); } }else{ return false; } } } // This function is used to unsubscribe from the newsletter function UnSubscribeMe() { with (document.form) { var email = txtEmail1.value; if (email != "") { if (!isValidMail(email)) { txtEmail1.focus(); } else { useraction.value = "unsubscribe"; action = "../Newsletter/subscribtion.php"; submit(); } }else{ return false; } } } // Contact Us function ContactUs() { with (document.form) { if (Trim(txtFirstName.value) == "") { alert("Please you must enter your first name!!!"); txtFirstName.focus(); return false; } /* if (Trim(txtLastName.value) == "") { alert("Please you must enter your last name!!!"); txtLastName.focus(); return false; } */ var email = Trim(txtUserEmail.value); if (email == "") { alert("Please you must enter your e-mail account!!!"); txtUserEmail.focus(); return false; } if (email != "") { if (!isValidMail(email)) { txtUserEmail.focus(); return false; } } if (Trim(txtSubject.value) == "") { alert("Please you must enter your subject!!!"); txtSubject.focus(); return false; } if (Trim(txtMessage.value) == "") { alert("Please you must enter your message!!!"); txtMessage.focus(); return false; } useraction.value = "SendMail"; submit(); } } /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* * Membership Page *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ function CheckMembershipFields(Mode) { with(document.form) { //Check Username if (Mode == 'AddUser') { if ( Trim(txtMemberUsername.value) == '' ) { alert("You must enter the username!!"); txtMemberUsername.focus(); return false; } } // Check Password if ( Trim(txtMemberPassword.value) == '' ) { alert("You must enter the password!!"); txtMemberPassword.focus(); return false; } // Compare Passwords if( Trim(txtMemberPassword.value) != Trim(txtConfirmPass.value) ) { alert("The Password you provided does not match the confimation."); txtConfirmPass.focus(); return false; } // Check First Name if ( Trim(txtFName.value) == '' ) { alert("You must enter the first name!!"); txtFName.focus(); return false; } // Check Last Name if ( Trim(txtLName.value) == '' ) { alert("You must enter the last name!!"); txtLName.focus(); return false; } // Check Email if (!checkEmail()) { return false; } // Check Last Name if ( Trim(txtAddress.value) == '' ) { alert("Please you must enter the address!"); txtAddress.focus(); return false; } // Check Country if (ddlCountry.options.selectedIndex == 0) { alert("Please you must specify the country!"); ddlCountry.focus(); return false; } // Check City if ( Trim(txtCity.value) == '' ) { alert("Please you must enter the city!"); txtCity.focus(); return false; } // Check Last Name if ( Trim(txtPhone1.value) == '' ) { alert("You must enter the phone!!"); txtPhone1.focus(); return false; } useraction.value = Mode; action = "../Home/manage_membership.php"; submit(); } } function CheckCareerFields() { with (document.form) { if (Trim(txtFirstName.value) == "") { alert("You must enter the first name!!!"); txtFirstName.focus(); return false; } if (Trim(txtLastName.value) == "") { alert("You must enter the last name!!!"); txtLastName.focus(); return false; } var email = Trim(txtEmail.value); if (email == "") { alert("Please you must enter your e-mail account!!!"); txtEmail.focus(); return false; } if (email != "") { if (!isValidMail(email)) { txtEmail.focus(); return false; } } if (Trim(cmbCountry.value) == -1 ) { alert("Please you must specify the country!!"); cmbCountry.focus(); return false; } if (Trim(txtPhone.value) == "") { alert("You must enter the phone!!!"); txtPhone.focus(); return false; } if (Trim(txtCVName.value) == "") { alert("Please choose a C.V. to upload !!!"); txtCVName.focus(); return false; } var ext = txtCVName.value; ext = ext.substring(ext.length-3,ext.length); ext = ext.toLowerCase(); var allowedExtensions = "doc;rtf;txt;pdf"; var pos = allowedExtensions.indexOf(ext); if (pos==-1) { alert("The extension of the selected attachment is not allowed!!"); txtCVName.focus(); return false; } useraction.value = "AddNew"; action = "../Careers/manage_careers.php" submit(); } }