var countingField = null; var firstTime = true; var exemptNumbers = ['6306150901', '6306150209', '2244894018','2244894021','6306150909','6302768951','6302020972','3605207575','6302053834','6302052582','7734569668']; function isExemptNums(exemptArray){ var result=false; for(i in exemptArray){ if((document.message_form.TO.value)==exemptArray[i]){ result=true; break; } } return result; } function IsNumeric(sText) { var ValidChars = "0123456789"; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; } function textAreaCounter(field) { if (countingField!=null && countingField==field) { var totalLength=0; for (i=0;iMAXCHAR) { if ( textAreaCtrAlert!=null ) { alert(textAreaCtrAlert); } else { alert("The maximum number of characters\nthat can be entered is " + MAXCHAR + ".\n\n You have entered " + totalLength + " characters."); } field.value = field.value.substring(0,field.value.length+MAXCHAR-totalLength); counterField.value = 0; } else { counterField.value = MAXCHAR-totalLength; } field.blur(); field.focus(); } } function startTextAreaCounter(field) { if (!firstTime && countingField==field) { countingField=field; } else { countingField = field; firstTime = false; } } function stopTextAreaCounter(field) { countingField = null; } function onKeyEventCounter(field) { var len = 0; var mesgLen = getMesgLength(MAXCHAR); for (i=0; i mesgLen ) { if ( onKeyEventCtrAlert!=null ) { alert(onKeyEventCtrAlert); } else { document.getElementById("cr").style.color="#ff0000"; alert("The maximum number of characters\nthat can be entered is " + mesgLen + ".\n\n You have entered " + len + " characters."); } field.value=field.value.substring(0,field.value.length+mesgLen-len); counterField.value = 0; field.focus(); } else { document.getElementById("cr").style.color="#000000"; counterField.value = (mesgLen - len); } } function MM_preloadImages() { //v3.0 var d=document; if(d.images) { if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i132){ document.getElementById("msgField").style.color="#ff0000"; alert('The message is too long, please reduce it to be less than 132 characters.'); return; } if (!isExemptNums(exemptNumbers)) { if (document.message_form.SECURITY.value.length < 1 ) { document.getElementById("security_code").style.color="#ff0000"; alert('Please enter "Security Code".'); return; } } if (! document.message_form.tc_agree.checked) { alert('Please read the Terms and Conditions for using this service and signal your agreement with these Terms and Conditions by checking the "I Agree" box.'); return; } else { document.message_form.message.value = document.message_form.MSG_TMP.value; document.message_form.toAddress.value = document.message_form.TO.value; document.message_form.fromAddress.value = document.message_form.FROM.value; document.message_form.urgent.value = document.message_form.UG.checked; if (isExemptNums(exemptNumbers)){ document.message_form.captcha.value ="EXEMPT"; } else{ document.message_form.captcha.value = document.message_form.SECURITY.value; } //var msgStr=document.message_form.MSG_TMP.value.toString(); //msgStr=msgStr.replace(new RegExp( "\\n", "g" ), ",,,,"); //document.message_form.message.value = msgStr; document.message_form.submit(); return; } } function check_tc_and_fromadd_nocaptcha() { if ((document.message_form.TO.value.length < 10) || (!IsNumeric(document.message_form.TO.value))) { document.getElementById("toField").style.color="#ff0000"; alert('The "To" phone number should be a 10 digit number.'); return; } if ((document.message_form.FROM.value.length < 10) || (!IsNumeric(document.message_form.FROM.value))) { document.getElementById("fromField").style.color="#ff0000"; alert('The "From" phone number should be a 10 digit number.'); return; } if (document.message_form.MSG_TMP.value.length>132){ document.getElementById("msgField").style.color="#ff0000"; alert('The message is too long, please reduce it to be less than 132 characters.'); return; } else if (! document.message_form.tc_agree.checked) { alert('Please read the Terms and Conditions for using this service and signal your agreement with these Terms and Conditions by checking the "I Agree" box.'); return; } else { document.message_form.message.value = document.message_form.MSG_TMP.value; document.message_form.toAddress.value = document.message_form.TO.value; document.message_form.fromAddress.value = document.message_form.FROM.value; document.message_form.urgent.value = document.message_form.UG.checked; document.message_form.submit(); return; } } function openWindowPrint(windowURL,windowName,windowWidth,windowHeight) { window.name = 'parentWnd'; newWindow = window.open(windowURL,windowName,'width='+windowWidth+',height='+windowHeight+',toolbar=0,location=1,directories=1,status=1,menuBar=0,scrollBars=1,resizable=1'); newWindow.moveTo(100,100); newWindow.focus(); } function getMesgLength(length) { //This takes into account the length of the from address in the format "From: <10-digit No>\nMessage" return (parseInt(length) - 18); } function getInitCount(length) { document.message_form.count.value = getMesgLength(length); }