var CONTACTEMAIL = "members@dlitools.com"; var regForm = ""; var loginForm = ""; var control = ""; var authenticated = ""; var strErr = ""; //invalid email address list var mailList = new Array(); mailList[0] = "yahoo.com"; mailList[1] = "yahoo.ca"; mailList[2] = "yahoo.fr"; mailList[3] = "yahoo.it"; mailList[4] = "yahoo.in"; mailList[5] = "yahoo.de"; mailList[6] = "yahoo.co.uk"; mailList[7] = "yahoo.mx"; mailList[8] = "free.fr"; mailList[9] = "gmail.com"; mailList[10] = "canada.com"; mailList[11] = "webmail.com"; mailList[12] = "rediffmail.com"; mailList[13] = "usa.net"; mailList[14] = "lycos.com"; mailList[15] = "web.de"; mailList[16] = "mail.ru"; mailList[17] = "yahoo.ru"; mailList[18] = "msn.com"; mailList[19] = "hotmail.com"; var fieldList = { FirstName: "First Name", LastName: "Last Name", JobTitle: "Responsibility", Phone: "Phone", Email: "E-mail", Company: "Company", Address: "Address", City: "City", Province: "Province/State", Country: "Country", PostalZip: "Postal/Zip", Website: "Website", HowKnow: "How did you hear about us?" }; function doWebOnLoad() { //init variables regForm = document.Registration; loginForm = document.LoginForm; control = regForm.Control.value.split(", "); authenticated = false; if (regForm.Authenticated.value == "true"){authenticated = true} //if user is not authenticated if (!authenticated) { //show error information for registration strErr_R = ""; if ((document.cookie.indexOf('Error_R=')>=0) || (document.cookie.indexOf(' Error_R=')>=0)) { var thisCookie = document.cookie.split(";"); for (i=0; i",",","?","/"]; var charEmail = formObj.Email.value //check "@" and "." first if ( (charEmail.indexOf(char1) > -1) & (charEmail.indexOf(char2) > -1) ) { //check invalid email address for ( var i = 0; i < mailList.length; i++) { if (charEmail.indexOf(mailList[i]) > -1) { formObj.Email.focus(); strErr = strErr + "\t\t - E-mail: We require a valid business email to register with us. If you have received this in error, please contact " + CONTACTEMAIL + " for more assistance. \n"; return false; } } //check invalid characters for ( var i = 0; i < charList.length; i++) { if (charEmail.indexOf(charList[i]) > -1) { formObj.Email.focus(); strErr = strErr + "\t\t - E-mail: Invalid characters entered in the email address. Letters, numbers, hyphen, period, and underscore are permitted. Please contact " + CONTACTEMAIL + " if you required assistance. \n"; return false; //Not business email, pop up special error message } } } else { strErr = strErr + "\t\t - E-mail \n"; return false; } } function checkField(fieldName, formObj, vType) { switch(vType) { case 1: if (formObj[fieldName].value == "") { strErr = strErr + "\t\t - " + fieldList[fieldName] + "\n"; formObj[fieldName].style.backgroundColor = "#F9E1D1"; } else { formObj[fieldName].style.backgroundColor = "#FFFFFF"; } break; case 2: if (formObj[fieldName].options[formObj[fieldName].selectedIndex].text == "-Select-") { strErr = strErr + "\t\t - " + fieldList[fieldName] + "\n"; formObj[fieldName].style.backgroundColor = "#F9E1D1"; } else { formObj[fieldName].style.backgroundColor = "#FFFFFF"; } break; } } function othersChk(formObj) { if ((control[0]=="1") & (control[1]=="1")) {checkField("FirstName", formObj,1)} if ((control[2]=="1") & (control[3]=="1")) {checkField("LastName", formObj,1)} if ((control[4]=="1") & (control[5]=="1")) {checkField("JobTitle", formObj,2)} if ((control[6]=="1") & (control[7]=="1")) {checkField("Phone", formObj,1)} if ((control[8]=="1") & (control[9]=="1")) {checkField("Company", formObj,1)} if ((control[10]=="1") & (control[11]=="1")) {checkField("Address", formObj,1)} if ((control[12]=="1") & (control[13]=="1")) {checkField("City", formObj,1)} if ((control[14]=="1") & (control[15]=="1")) {checkField("Province", formObj,2)} if ((control[16]=="1") & (control[17]=="1")) {checkField("Country", formObj,2)} if ((control[18]=="1") & (control[19]=="1")) {checkField("PostalZip", formObj,1)} if ((control[20]=="1") & (control[21]=="1")) {checkField("Website", formObj,1)} if ((control[22]=="1") & (control[23]=="1")) {checkField("HowKnow", formObj,2)} if ((control[24]=="1") & (control[25]=="1")) { var isChk = 0; for (i=0; i -1) { strErr = strErr + "\t\t - Password: Spaces are not allowed.\n"; return false; } else { return true; } } function doLogin_new() { strErr = ""; //check the validation of email address if ( emailChk_Login(regForm) == false ) { regForm.LoginEmail.style.backgroundColor = "#F9E1D1"; } else { regForm.LoginEmail.style.backgroundColor = "#FFFFFF"; } if ( validatePwd_Login(regForm) == false) { //check the validation of password and confirm password regForm.LoginPassword.style.backgroundColor = "#F9E1D1"; } else { regForm.LoginPassword.style.backgroundColor = "#FFFFFF"; } if (strErr != "") { //handle errors strErr = "You provided an invalid username or password. Please sign in again:\n\n" + strErr; document.all.Error_L.innerText = "\n" + strErr + "\n"; return false; } else { if (loginForm.ReasonType.value == "0") { document.cookie = "PrePage_URL=; path=/"; loginForm.RedirectTo.value = document.URL; } else { if (document.cookie.indexOf("PrePage_URL=http")<0) { var referer = regForm.Refer.value; document.cookie = "PrePage_URL=" + referer.substr(1, referer.indexof("&")) + "; path=/" ; loginForm.RedirectTo.value = regForm.Refer.value; } else { strLogin_URL = ""; var thisCookie = document.cookie.split(";"); for (i=0; i -1) & (charEmail.indexOf(char2) > -1) ) { form.LoginEmail.focus(); strErr = strErr + "\t\t - E-mail \n"; return false; } } function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i