/** Contructor(s): Hashtable() Creates a new, empty hashtable Method(s): void clear() Clears this hashtable so that it contains no keys. boolean containsKey(String key) Tests if the specified object is a key in this hashtable. boolean containsValue(Object value) Returns true if this Hashtable maps one or more keys to this value. Object get(String key) Returns the value to which the specified key is mapped in this hashtable. boolean isEmpty() Tests if this hashtable maps no keys to values. Array keys() Returns an array of the keys in this hashtable. void put(String key, Object value) Maps the specified key to the specified value in this hashtable. A NullPointerException is thrown is the key or value is null. Object remove(String key) Removes the key (and its corresponding value) from this hashtable. Returns the value of the key that was removed int size() Returns the number of keys in this hashtable. String toString() Returns a string representation of this Hashtable object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space). Array values() Returns a array view of the values contained in this Hashtable. Array entrySet() Returns a reference to the internal array that stores the data. The Set is backed by the Hashtable, so changes to the Hashtable are reflected in the Set, and vice-versa. */ function Hashtable(){ this.hashtable = new Array(); } /* privileged functions */ Hashtable.prototype.clear = function(){ this.hashtable = new Array(); } Hashtable.prototype.containsKey = function(key){ var exists = false; for (var i in this.hashtable) { if (i == key && this.hashtable[i] != null) { exists = true; break; } } return exists; } Hashtable.prototype.containsValue = function(value){ var contains = false; if (value != null) { for (var i in this.hashtable) { if (this.hashtable[i] == value) { contains = true; break; } } } return contains; } Hashtable.prototype.get = function(key){ return this.hashtable[key]; } Hashtable.prototype.isEmpty = function(){ return (parseInt(this.size()) == 0) ? true : false; } Hashtable.prototype.keys = function(){ var keys = new Array(); for (var i in this.hashtable) { if (this.hashtable[i] != null) keys.push(i); } return keys; } Hashtable.prototype.put = function(key, value){ if (key == null || value == null) { throw "NullPointerException {" + key + "},{" + value + "}"; }else{ this.hashtable[key] = value; } } Hashtable.prototype.remove = function(key){ var rtn = this.hashtable[key]; this.hashtable[key] = null; return rtn; } Hashtable.prototype.size = function(){ var size = 0; for (var i in this.hashtable) { if (this.hashtable[i] != null) size ++; } return size; } Hashtable.prototype.toString = function(){ var result = ""; for (var i in this.hashtable) { if (this.hashtable[i] != null) result += "{" + i + "},{" + this.hashtable[i] + "}\n"; } return result; } Hashtable.prototype.values = function(){ var values = new Array(); for (var i in this.hashtable) { if (this.hashtable[i] != null) values.push(this.hashtable[i]); } return values; } Hashtable.prototype.entrySet = function(){ return this.hashtable; } function CheckEmail(email) { var rejectedDomain=new Array() var index=0; rejectedDomain[index++]="hotmadsadil" rejectedDomain[index++]="rocketmdsaail" rejectedDomain[index++]="yahdssadoo" rejectedDomain[index++]="zdnetmdsasdail" var rejected=false var testresults=true var str=email var filter=/^.+@.+\..{2,3}$/ if (filter.test(str)){ var tempstring = str.split("@") tempstring = tempstring[1].split(".") for (i=0; i0) { OSVersion = navigator.userAgent.substr(OSIndex+9,4); } } if (navigator.appVersion.indexOf("X11")!=-1) { OSName="UNIX"; isUNIX=true; } if (navigator.appVersion.indexOf("Linux")!=-1) { OSName="Linux"; isLinux=true; } if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits); firefoxVersion=new Number(RegExp.$1) // capture x.x portion and store as a number if (firefoxVersion>=3)isFirefox3=true; //alert("You're using OS "+OSName+" with browser FF 3.x or above") else if (firefoxVersion>=2)isFirefox2=true; // alert("You're using "+OSName+" with browser FF 2.x") else if (firefoxVersion>=1)isFirefox1=true; //alert("You're using "+OSName+" with browser FF 1.x") } function getbrowser_details() { var x = navigator; var txt = "CodeName = " + x.appCodeName + "
"; txt += "MinorVersion = " + x.appMinorVersion + "
"; txt += "Name = " + x.appName + "
"; txt += "Version = " + x.appVersion + "
"; txt += "CookieEnabled = " + x.cookieEnabled + "
"; txt += "CPUClass = " + x.cpuClass + "
"; txt += "OnLine = " + x.onLine + "
"; txt += "Platform = " + x.platform + "
"; txt += "UA = " + x.userAgent + "
"; txt += "BrowserLanguage = " + x.browserLanguage + "
"; txt += "SystemLanguage = " + x.systemLanguage + "
"; txt += "UserLanguage = " + x.userLanguage; //alert(x.appVersion); return(txt); } //alert('browser='+BrowserDetect.browser+',version='+BrowserDetect.version+',OS='+BrowserDetect.version); function checkSpec(formname) { // Scans fields looking for illegal characters for (i=0; i < eval('document.' + formname + '.length') ; i++) { if (eval('document.' + formname + '.elements[' + i + '].type') == "text" || eval('document.' + formname + '.elements[' + i + '].type') == "textarea") { stringer = eval('document.' + formname + '.elements[' + i + '].value'); } else { stringer = ""; } if ((stringer.indexOf("<") != -1)||(stringer.indexOf(">") != -1)) { //alert('Sorry, but you have entered illegal characters (< or >) into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } if ((stringer.indexOf("'") != -1)||(stringer.indexOf("\"") != -1)) { //alert('Please do not enter single or double quotes into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } if ((stringer.indexOf("(") != -1)||(stringer.indexOf(")") != -1)) { //alert('Please do not enter parenthesis into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } } // Checks for City/State or Zip Code var zip = eval('document.' + formname + '.zip.value'); var state = eval('document.' + formname + '.state.value'); var city = eval('document.' + formname + '.city.value'); var range = eval('document.' + formname + '.range.value'); if (city != "") { for (i=1;i 1) || ((zip.length==10) && ""+zip.charAt(5)!="-")) { //alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'. Please try again."); return false; } } } if ((city == "")&&(state == "")&&(range == "")&&(zip != "")) { //alert("Please enter a range."); eval('document.' + formname + '.range.focus()'); return false; } if ((city != "")&&(state == "")) { //alert("Please enter a state"); eval('document.' + formname + '.state.focus()'); return false; } //SpecPop(); return true; } function checkEmail (strng) { var error=""; var emailFilter = /^([\w\-]+\.)*([\w\-]+)@([\w\-]+\.)+([a-zA-Z]{2,4})$/; if (!(emailFilter.test(strng))) { error = "Please enter a valid email address.\n"; } return error; } // phone number - strip out delimiters and check for 10 digits function checkPhone (strng,media) { var error = ""; if (strng == "") { error = "You didn't enter a "+media+" number.\n"; } var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters if (isNaN(parseInt(stripped))) { error = "The "+media+" number contains illegal characters."; } if (!(stripped.length == 10)) { error = "The "+media+" number is the wrong length.
Make sure you included an area code.\n"; } return error; } // password - between 6-8 chars, uppercase, lowercase, and numeral function checkPassword (strng) { var error = ""; if (strng == "") { error = "You didn't enter a password.\n"; } var illegalChars = /[\W_]/; // allow only letters and numbers if ((strng.length < 6) || (strng.length > 8)) { error = "must be between 6 and 8 letters.\n"; //alert(error); } else if (illegalChars.test(strng)) { error = "contains illegal characters.\n"; //alert(error); } else if (!((strng.search(/(a-z)+/)) && (strng.search(/(A-Z)+/)) && (strng.search(/(0-9)+/)))) { //error = "The password must contain at least one uppercase letter, one lowercase letter, and one numeral.\n"; } else if (!((strng.search(/(a-z)+/))) ) { //error = "must contain at least one lowercase letter.\n"; //alert(error); } else if (!(strng.search(/(A-Z)+/)) ) { // error = "must contain at least one uppercase letter.\n"; //alert(error); } else if (!(strng.search(/(0-9)+/)) ) { // error = "must contain at least one numeral.\n"; //alert(error); } //alert(error); return error; } function checkConfirmPassword (strng,passwordStr) { var error = ""; if (strng == "") { error = "You didn't enter a confirm password.\n"; //alert(error); } var illegalChars = /[\W_]/; // allow only letters and numbers if ((strng.length < 6) || (strng.length > 8)) { error = "must be between 6 and 8 letters.\n"; // alert(error); } else if (illegalChars.test(strng)) { error = "contains illegal characters.\n"; // alert(error); } else if (strng!=passwordStr) { error = "different from the password.\n"; //alert(error); } /* else if (!((strng.search(/(a-z)+/)) && (strng.search(/(A-Z)+/)) && (strng.search(/(0-9)+/)))) { error = "The password must contain at least one uppercase letter, one lowercase letter, and one numeral.\n"; } */ else if (!((strng.search(/(a-z)+/))) ) { //error = "The confirm password must contain at least one lowercase letter.\n"; //alert(error); } else if (!(strng.search(/(A-Z)+/)) ) { //error = "The confirm password must contain at least one uppercase letter.\n"; //alert(error); } else if (!(strng.search(/(0-9)+/)) ) { //error = "The confirm password must contain at least one numeral.\n"; //alert(error); } return error; } function checkName (strng) { var error = ""; var illegalChars = /^[a-zA-Z\s]+$/; // allow letters, numbers, and underscores if (!illegalChars.test(strng)) { error = "The name contains illegal characters.\n"; } return error; } // username - 4-10 chars, uc, lc, and underscore only. function checkUsername (strng) { var error = ""; if (strng == "") { error = "You didn't enter a username.\n"; } var illegalChars = /\W/; // allow letters, numbers, and underscores if ((strng.length < 4) || (strng.length > 10)) { error = "The username is the wrong length.\n"; } else if (illegalChars.test(strng)) { error = "The username contains illegal characters.\n"; } return error; } function checkRange (strng) { var error = ""; var reRange = new RegExp(/(^\d{1}$)|(^\d{2}$)/); if (!reRange.test(strng)) { error ="Zip Code Is Not Valid"; return error; } return error; } function checkIlllegalCharacter (strng) { var error = ""; illegalChars= /[\d\-\|\+\=\~\_\%\@\#\!\?\&\(\)\<\>\,\$\;\:\\\"\[\]]+/ //detect strange character if (strng.match(illegalChars)) { error = "The username contains illegal characters.\n"; } return error; } function checkField (strng,fieldName) { var error = ""; if (strng == "") { error = "You didn't enter a username.\n"; } var illegalChars = /\A-Za-z\s/; // allow letters, numbers, and underscores //illegalChars = new RegExp([A-Za-z\s\'\-]+); //var illegalChars = new RegExp("[A-Za-z\s\'\-]+"); /*if ((strng.length < 4) || (strng.length > 10)) { error = "The username is the wrong length.\n"; } else*/ if (illegalChars.test(strng)) { error = "The username contains illegal characters.\n"; } //detect number illegalChars= /\d/ if (strng.match(illegalChars)) { error = "The username contains illegal characters.\n"; } //detect space at the beginning illegalChars= /^ / if (strng.match(illegalChars)) { error = "The username contains illegal characters.\n"; } illegalChars= /[\d\-\|\+\=\~\_\%\@\#\!\?\&\(\)\<\>\,\$\;\:\\\"\[\]]+/ //detect strange character // illegalChars=/ [^A-Za-z]/ if (strng.match(illegalChars)) { error = "The username contains illegal characters.\n"; } return error; } function checkZip(strng) { // Check for correct zip code var error = ""; reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/); if (!reZip.test(strng)) { error ="Zip Code Is Not Valid"; return error; } return error; } // non-empty textbox function isEmpty(strng) { var error = ""; if (strng.length == 0) { error = "The mandatory text area has not been filled in.\n" } return error; } // was textbox altered function isDifferent(strng) { var error = ""; if (strng != "Can\'t touch this!") { error = "You altered the inviolate text area.\n"; } return error; } // exactly one radio button is chosen function checkRadio(checkvalue) { var error = ""; if (!(checkvalue)) { error = "Please check a radio button.\n"; } return error; } // valid selector from dropdown list function checkDropdown(choice) { var error = ""; if (choice == 0) { error = "You didn't choose an option from the drop-down list.\n"; } return error; } function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ) { var cookie_string = name + "=" + escape ( value ); if ( exp_y ) { var expires = new Date ( exp_y, exp_m, exp_d ); cookie_string += "; expires=" + expires.toGMTString(); } if ( path ) cookie_string += "; path=" + escape ( path ); if ( domain ) cookie_string += "; domain=" + escape ( domain ); if ( secure ) cookie_string += "; secure"; document.cookie = cookie_string; } function get_cookie ( cookie_name ) { var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' ); if ( results ) return ( unescape ( results[2] ) ); else return null; } function delete_cookie ( cookie_name ) { var cookie_date = new Date ( ); // current date & time cookie_date.setTime ( cookie_date.getTime() - 1 ); document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString(); } function set_default_text(element,default_text){ var elem=$(element); var elem_val=elem.value; if(elem_val=="" || elem_val==" " || elem_val==default_text || elem_val==null){ elem.value=default_text; } } function hide_default_text(element,original_text){ var elem=$(element); var elem_val=elem.value; if(elem_val==original_text){ elem.value=""; } } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&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&&i