/** 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; i 0){ var date = new Date(); date.setTime(date.getTime() + parseInt(days) * 24 * 60 * 60 * 1000); expiration = '; expires=' + date.toGMTString(); } document.cookie = name + '=' + value + expiration + '; path=/'; }, readCookie: function(name){ if(!document.cookie){ return ''; } var searchName = name + '='; var data = document.cookie.split(';'); for(var i = 0; i < data.length; i++){ while(data[i].charAt(0) == ' '){ data[i] = data[i].substring(1, data[i].length); } if(data[i].indexOf(searchName) == 0){ return data[i].substring(searchName.length, data[i].length); } } return ''; }, writeNoticeCode: function(){ var title = ''; var notice = ''; var selectBrowser = ''; var remindMeLater = ''; var neverRemindMeAgain = ''; var browsersList = null; var code = '
Close'; if(noticeLang == 'custom' && noticeLangCustom != null){ title = noticeLangCustom.title; notice = noticeLangCustom.notice; selectBrowser = noticeLangCustom.selectBrowser; remindMeLater = noticeLangCustom.remindMeLater; neverRemindMeAgain = noticeLangCustom.neverRemindMeAgain; } else { var noticeTextObj = null; eval('noticeTextObj = this.noticeText.' + noticeLang + ';'); if(!noticeTextObj){ noticeTextObj = this.noticeText.professional; } title = noticeTextObj.title; notice = noticeTextObj.notice; selectBrowser = noticeTextObj.selectBrowser; remindMeLater = noticeTextObj.remindMeLater; neverRemindMeAgain = noticeTextObj.neverRemindAgain; } notice = notice.replace("\n", '

'); notice = notice.replace("{browser_name}", (this.browser + " " + this.version)); code += '

' + title + '

' + notice + '

' + selectBrowser + '

'; if(supportedBrowsers.length > 0){ browsersList = supportedBrowsers; } else { browsersList = this.supportedBrowsers; } code += ''; if(displayPoweredBy){ code += '
Powered by DevSlide Labs
'; } code += ''; code += '
'; window.document.body.innerHTML += code; }, detectBrowser: function(){ this.browser = ''; this.version = 0; if(/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ this.browser = 'Opera'; } else if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ this.browser = 'MSIE'; } else if(/Navigator[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ this.browser = 'Netscape'; } else if(/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ this.browser = 'Chrome'; } else if(/Safari[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ this.browser = 'Safari'; // /Version[\/\s](\d+\.\d+)/.test(navigator.userAgent); /Version[\/\s](\d+)/.test(navigator.userAgent); this.version = new Number(RegExp.$1); } else if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ this.browser = 'Firefox'; } if(this.browser == ''){ this.browser = 'Unknown'; } else if(this.version == 0) { this.version = parseFloat(new Number(RegExp.$1)); } }, // Detect operation system detectOS: function(){ for(var i = 0; i < this.operatingSystems.length; i++){ if(this.operatingSystems[i].searchString.indexOf(this.operatingSystems[i].subStr) != -1){ this.os = this.operatingSystems[i].name; return; } } this.os = "Unknown"; }, // Variables noticeHeight: 0, browser: '', os: '', version: '', supportedBrowsers: [ { 'cssClass': 'firefox', 'name': 'Mozilla Firefox', 'downloadUrl': 'http://www.getfirefox.com/' }, { 'cssClass': 'chrome', 'name': 'Google Chrome', 'downloadUrl': 'http://www.google.com/chrome/' }, { 'cssClass': 'msie', 'name': 'Internet Explorer', 'downloadUrl': 'http://www.getie.com/' }, { 'cssClass': 'opera', 'name': 'Opera', 'downloadUrl': 'http://www.opera.com/' }, { 'cssClass': 'safari', 'name': 'Apple Safari', 'downloadUrl': 'http://www.apple.com/safari/' } ], operatingSystems: [ { 'searchString': navigator.platform, 'name': 'Windows', 'subStr': 'Win' }, { 'searchString': navigator.platform, 'name': 'Mac', 'subStr': 'Mac' }, { 'searchString': navigator.platform, 'name': 'Linux', 'subStr': 'Linux' }, { 'searchString': navigator.userAgent, 'name': 'iPhone', 'subStr': 'iPhone/iPod' } ], defaultNotSupportedBrowsers: [{'os': 'Any', 'browser': 'MSIE', 'version': 6}], noticeText: { 'professional': { "title": "Outdated Browser Detected", "notice": "Our website has detected that you are using an outdated browser. Using your current browser will prevent you from accessing features on our website. An upgrade is not required, but is strongly recommend to improve your browsing experience on our website.", "selectBrowser": "Use the links below to download a new browser or upgrade your existing browser.", "remindMeLater": "Remind me later", "neverRemindAgain": "No, don't remind me again" }, 'informal': { "title": "Whoaaa!", "notice": "It appears you're using an outdated browser which prevents access to some of the features on our website. While it's not required, you really should upgrade or install a new browser!", "selectBrowser": "Visit the official sites for popular browsers below:", "remindMeLater": "Not now, but maybe later", "neverRemindAgain": "No, don't remind me again" }, 'technical': { "title": "Old Browser Alert! DEFCON 5", "notice": "Come on! If you are hitting our site, then you must at least be partially tech savvy. So, why the older browser? We're not asking you to brush off your old Fibonacci Heap and share it with the class. Just upgrade!\nI know, I know. You don't like to be told what to do. But, we're only asking you to upgrade so you can access all the latest, greatest features on our site. It's quick and easy. But, if you still want to skip it, that's cool. We will still welcome you — and your creepy old browser. :P", "selectBrowser": "Visit the official sites for popular browsers below:", "remindMeLater": "Remind me later", "neverRemindAgain": "No, don't remind me. I like my Commodore 64!" }, 'goofy': { "title": "Are You Serious?", "notice": "Are you really using {browser_name} as your browser?\nYou're surfing the web on a dinosaur (a dangerous one too — like a Tyrannosaurus or Pterodactyl or something scary like that). Get with it and upgrade now! If you do, we promise you will enjoy our site a whole lot more. :)", "selectBrowser": "Visit the official sites for popular browsers below:", "remindMeLater": "Maybe Later", "neverRemindAgain": "No, don't remind me again" }, 'mean': { "title": "Umm, Your Browser Sucks!", "notice": "Get a new one here.", "selectBrowser": "Official sites for popular browsers:", "remindMeLater": "Remind me later, a'hole", "neverRemindAgain": "F' off! My browser rocks!" } } }; BrowserDetect.init(); var isNetscape=false; var isIE=false; var isIE6=false; var isIE7=false; var isSafari=false; var isSafari2=false; var isSafari3=false; var isFirefox=false; var isChrome=false; if(BrowserDetect.browser.indexOf("Explorer")>=0 || BrowserDetect.browser=="MSIE"){ isIE=true; if (window.XMLHttpRequest) { // IE 7, mozilla, safari, opera 9 isIE7=true; } else { // IE6, older browsers isIE6=true; } }else if(BrowserDetect.browser=="Firefox"){ isFirefox=true; }else if(BrowserDetect.browser=="Safari"){ isSafari=true; }else if(BrowserDetect.browser=="Chrome"){ isChrome=true; } var isSafari3 = false; if( window.devicePixelRatio && window.getMatchedCSSRules && !window.Opera){ isSafari3 = !!window.getMatchedCSSRules(document.documentElement,''); } var OSName="Unknown OS"; var firefoxVersion=""; //number var isWindows=false; var isMac=false; var isUNIX=false; var isLinux=false; var isFirefox1=false; var isFirefox2=false; var isFirefox3=false; if (navigator.appVersion.indexOf("Win")!=-1) { OSName="Windows"; isWindows=true; } if (navigator.appVersion.indexOf("Mac")!=-1) { OSName="MacOS"; isMac=true; } 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 && firefoxVersion<4)isFirefox3=true; //alert("You're using OS "+OSName+" with browser FF 3.x or above") else if (firefoxVersion>=2 && firefoxVersion<3)isFirefox2=true; // alert("You're using "+OSName+" with browser FF 2.x") else if (firefoxVersion>=1 && firefoxVersion<2)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 = ""; //alert(strng); if ((strng.length < 6)||(strng.length >10)) { error = "Password must be 6-10 characters;
Letters and numbers only."; // alert(error); } //illegalChars= [A-Za-z\d\s\(\)\[\]\,\.\\\/\#\*\`\'\"\:\;\_\+\~] var regx= new RegExp(/[A-Za-z\d]$/); if (!regx.test(strng)) { if(error=="")error ="Password must be 6-10 characters;
Letters and numbers only."; } var illegalChars= /[\<\>\(\)\{\}\=]+/ //detect strange character // illegalChars=/ [^A-Za-z]/ if (strng.match(illegalChars)) { // error = "The password contains illegal characters.\n"; } return error; } function checkConfirmPassword (strng,passwordStr) { var error = ""; if ((strng.length < 6)||(strng.length >10)) { error = "Password must be 6-10 characters;
Letters and numbers only."; // alert(error); } //illegalChars= [A-Za-z\d\s\(\)\[\]\,\.\\\/\#\*\`\'\"\:\;\_\+\~] var regx= new RegExp(/[A-Za-z\d]$/); if (!regx.test(strng)) { if(error=="")error ="Password must be 6-10 characters;
Letters and numbers only."; } var illegalChars= /[\<\>\(\)\{\}\=]+/ //detect strange character // illegalChars=/ [^A-Za-z]/ if (strng.match(illegalChars)) { // error = "The password contains illegal characters.\n"; } if(strng!=passwordStr){ if(error=="")error ="Password must be 6-10 characters;
Letters and numbers only."; } 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; } function checkDescription(strng){ var error = ""; if (strng == "") { error = "You didn't enter a description.\n"; } //detect space at the beginning /*illegalChars= /^ / if (strng.match(illegalChars)) { error = "The username contains illegal characters.\n"; } */ illegalChars= /[\<\>\{\}\=\|\+\=\~\@\^\%\*\$\\\[\]\\"]+/; //detect strange character if (strng.match(illegalChars)) { error = "The username 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 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; } 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; } // 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 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=document.getElementById(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=document.getElementById(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