function substituteBlankSpace(queryString) { queryString = queryString.replace(/\ /g,"%20"); return queryString; } function popUp(URL, width, height) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height+',left=100,top=100');"); } function closePopup() { window.close(); } function isBlank(formName, fieldName) { var fld = ""; eval("fld = document."+formName+ "." +fieldName+".value"); if(fld == "") { var alrt = "Please Enter "+fieldName; alert(alrt); eval("document."+formName+"."+fieldName+".focus()"); return false; } else { return true; } } function checkIsBlank(formName, fieldName,alertMsg) { var fld = ""; eval("fld = document."+formName+ "." +fieldName+".value"); if(fld == "") { alert(alertMsg); eval("document."+formName+"."+fieldName+".focus()"); return false; } else { return true; } } function isNumber(formName, fieldName) { var t1 = ""; eval("t1 = document."+formName+ "." +fieldName+".value"); if (parseInt(t1) >= 0) { return true; } else { alert("Please enter " + fieldName + " as integer number."); eval("document."+formName+"."+fieldName+".focus()"); return false; } } function trim(strInput) { return strInput.replace(/^\s+/g, '').replace(/\s+$/g, ''); } function isPhoneNumber(formName,phoneNumber,ph1,ph2,ph3) { str1 = eval("document."+ formName +"."+ph1+".value"); str2 = eval("document."+ formName +"."+ph2+".value"); str3 = eval("document."+ formName +"."+ph3+".value"); if (str1 == "") { alert("Please enter area code in phone number."); eval("document."+ formName +"."+ph1+".focus()"); eval("document."+ formName +"."+ph1+".select()"); return false; } if (str2 == "") { alert("Please check the phone number."); eval("document."+ formName +"."+ph2+".focus()"); eval("document."+ formName +"."+ph2+".select()"); return false; } if (str3 == "") { alert("Please check the phone number."); eval("document."+ formName +"."+ph3+".focus()"); eval("document."+ formName +"."+ph3+".select()"); return false; } var str = str1 + str2 + str3; for (var i = 0; i < str.length; i++) { var ch = str.substring(i, i + 1); if (ch < "0" || "9" < ch) { alert('Phone number should be numeric.'); eval("document."+ formName +"."+ph3+".focus()"); eval("document."+ formName +"."+ph3+".select()"); return false; } } if (str.length != 10) { alert("The phone number should have 10 digits."); eval("document."+ formName +"."+ph3+".focus()"); eval("document."+ formName +"."+ph3+".select()"); return false; } eval("document."+ formName +"."+phoneNumber+".value="+str); return true; } function isZip(formName, fieldName, alertMsg) { var t1 = ""; eval("t1 = document."+formName+ "." +fieldName+".value"); t2 = parseInt(t1.length); if ((parseInt(t1) > 0) ) { return true; } else { alert(alertMsg); eval("document."+ formName +"."+fieldName+".focus()"); eval("document."+ formName +"."+fieldName+".select()"); return false; } } function isPasswordOk(formName, fieldName1, fieldName2) { eval("str = document."+formName+ "." +fieldName1+".value"); eval("str1 = document."+formName+ "." +fieldName2+".value"); str = trim(str); str1 = trim(str1); if (str == "") { alert("Enter Your Password."); eval("document."+formName+"."+fieldName1+".value=str"); eval("document."+formName+"."+fieldName1+".select()"); eval("document."+formName+"."+fieldName1+".focus()"); return false; } if(str.length <6) { alert("Your Password Should be at least 6 Characters."); eval("document."+formName+"."+fieldName1+".select()"); eval("document."+formName+"."+fieldName1+".focus()"); return false; } if (str1 == "") { alert("Please Confirm Your Password."); eval("document."+formName+"."+fieldName1+".value=str1"); eval("document."+formName+"."+fieldName2+".select()"); eval("document."+formName+"."+fieldName2+".focus()"); return false; } if (str == str1) { } else { alert("Confirm Your Password Again."); eval("document."+formName+"."+fieldName2+".value=\"\""); eval("document."+formName+"."+fieldName2+".select()"); eval("document."+formName+"."+fieldName2+".focus()"); return false; } return true; } /** * email validation script. */ function isEmailOk(formName, fieldName) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ var email = ""; try { eval("email = document."+formName+"."+fieldName+".value"); } catch(e) {} if (email == "") { alert ('Please enter E-mail address.'); try { eval("document."+formName+"."+fieldName+".focus()"); } catch(e) {} try { eval(" document."+formName+"."+fieldName+".select()"); } catch(e) {} return false; } if (!email.match(re)) { alert("Check E-mail Address!"); try { eval("document."+formName+"."+fieldName+".focus()"); } catch(e) {} try { eval(" document."+formName+"."+fieldName+".select()"); } catch(e) {} return (false); } return(true); } function checkIsEmailOk(formName, fieldName,alertMsg) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ var email = ""; try { eval("email = document."+formName+"."+fieldName+".value"); } catch(e) {} if (email == "") { alert (alertMsg); try { eval("document."+formName+"."+fieldName+".focus()"); } catch(e) {} try { eval(" document."+formName+"."+fieldName+".select()"); } catch(e) {} return false; } if (!email.match(re)) { alert("Please enter a valid e-mail address."); try { eval("document."+formName+"."+fieldName+".focus()"); } catch(e) {} try { eval(" document."+formName+"."+fieldName+".select()"); } catch(e) {} return (false); } return(true); } function autoTab(formName, srcFiled,trgtField) { var ph = ""; eval("ph = document."+formName+"."+srcFiled+".value"); var phLen = ph.length; if(phLen == 3) { eval("document."+formName+"."+trgtField+".focus()"); } } function checkBlankHidden(formName, fieldName,alertMsg) { var fld; var fld1; var fld2; try { eval("fld = document."+formName+ "." +fieldName+".value"); fld = trim(fld); } catch(e) {} try { eval("fld1 = document."+formName+ "." +fieldName+"Chk.value"); fld1 = trim(fld1); } catch(e) {} var url = "getEncCaptcha.php"; var qstr = "fld1="+fld1; try { xmlDoc = getXMLDoc(url,qstr,"POST"); } catch (e) {} try { fld2 = xmlDoc.getElementsByTagName("encCaptcha")[0].firstChild.nodeValue; } catch(e) {} if (fld == "") { alert("Please Enter the Verification Code"); return (false); } else if (fld == fld2) { return (true); } else { alert("Retype the verification code"); document.memberRegForm.codeVerify.value=""; return (false); } } function inputClearedValue(formName,fldName,textValue) { eval("document."+formName+"."+fldName+".value=''"); }