function validate_float(a){if(isNaN(parseFloat(a))){return false}else{return true}}function validate_integer(a){if(isNaN(parseInt(a))){return false}else{return true}}function validate_zip(e){var a=new String(e);if(a.match(/^[0-9]{5}(-[0-9]{4})?$/)){return true}else{return false}}function validate_date(e){dmask="mm/dd/yyyy";num_elements=3;monthf=0;dayf=1;yearf=2;var f=/[^0-9\/]/g;var g=String(e);r1=f.test(g);if(r1){return(9)}if(e==""){return(0)}b=new String(e);if(b.length>10){return(7)}c=b.split(/[\/\-\.]/);if(c.length!=num_elements){return(1)}for(i=0;i<num_elements;i++){if(isNaN(parseInt(c[i]))){return(2)}}d=new Array(num_elements);for(i=0;i<num_elements;i++){d[i]=new Number(c[i])}if(yearf!=-1){if(((d[yearf]%4==0)&&(d[yearf]%100!=0))||(d[yearf]%400==0)){ly=1}else{ly=0}}else{ly=0}if(monthf!=-1){if(d[monthf]<1||d[monthf]>12){return(3)}}if(dayf!=-1){if(d[dayf]<1||d[dayf]>31){return(4)}}if(yearf!=-1){if(d[yearf]<1900||d[yearf]>2100){return(5)}}if((d[monthf]==2&&((ly==1&&d[dayf]>29)||(ly==0&&d[dayf]>28)))||((d[monthf]==4||d[monthf]==6||d[monthf]==9||d[monthf]==11)&&d[dayf]>30)){return(6)}return(0)}function validate_time(h){var f=String(h);var e=f.match(/^\s*([0-9]{1,2}):([0-9]{2})( ?am| ?pm)?\s*$/i);if(e==null){return false}else{var g=parseInt(e[1].replace(/^0+/,""));var l=parseInt(e[2].replace(/^0+/,""));var j=e[3];if(isNaN(l)){l=0}if(isNaN(g)){g=0}if(l>=0&&l<=59){if(typeof j=="undefined"){if(g>=0&&g<=23){return true}}else{var k=j.replace(/\s+/g,"");if(k.toLowerCase()=="am"&&g>=1&&g<=12){return true}else{if(k.toLowerCase()=="pm"&&g>=1&&g<=12){return true}}}}return false}}function deny(){window.status="";alert("The function you're attempting to access has been disabled.");return false}function obscure_status(){window.status="";return true}function email_validate(a){t=new String(a);if(t.match(/^\s*[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9_\.]+\.[a-zA-Z]{2,}\s*$/)){return true}else{return false}}function validate_email(e){invalid_email=0;if(e==""){return(0)}s=String(e);cclist=s.split(",");if(cclist.length==1){if(cclist[0].indexOf("@")==-1||cclist[0].indexOf(".")==-1){return(1)}else{if(cclist[0].indexOf(" ")!=-1){return(4)}else{regex=/@/g;t=s.match(regex);if(t.length>1){return(2)}else{return(0)}}}}else{for(i=0;i<cclist.length;i++){if(cclist[i].indexOf("@")==-1||cclist[i].indexOf(".")==-1){invalid_email=1}}if(invalid_email==1){return(3)}else{return(0)}}}function RandRange(f,e){return(Math.floor(Math.random()*(e-f))+f)}function required(l,k){popup=0;if(k==""){k="One of the form fields is required"}if(l.type=="text"||l.type=="textarea"||l.type=="password"){if(l.value==""){popup=1}}else{if(l.type=="checkbox"||l.type=="radio"){var h=0;if(typeof l.length=="undefined"){if(l.checked==true){h=1}}else{for(var a=0;a<l.length;a++){if(l[a].checked==true){h=1}}}if(h==0){popup=1}}else{if(l.type=="select-one"){if(l.selectedIndex==-1||l.options[l.selectedIndex].value==""){popup=1}}else{if(l.type=="select-multiple"){h=0;for(a=0;a<l.length;a++){if(l.options[a].value!=""&&l.options[a].selected==true){h=1}}if(h==0){popup=1}}else{if(typeof l=="object"&&typeof l.length=="number"){tmp=0;for(a=0;a<l.length;a++){if(l[a].checked==true){tmp=1;break}}if(tmp==0){popup=1}}}}}}if(popup==1){alert(k);try{l.focus()}catch(j){try{l[0].focus()}catch(g){}}return 0}else{return 1}}function validate_phone(a){str=new String(a);if(str==""||str.match(/\s/)){return 0}else{if(str.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/)){return 0}else{if(str.match(/\([0-9]{3}\)\s?[0-9]{3}-[0-9]{4}/)){return 0}else{return 1}}}}function validate_number(a){str=new String(a);str=str.replace("$","");str=str.replace(".","");str=str.replace(",","");if(str==""||str.match(/\s/)){return 0}else{if(str.match(/\D/)){return 1}else{return 0}}}function validate_currency(a){str=new String(a);if(str.match(/^\s*$/)){return true}if(!str.match(/^\s*\$?((([0-9]{1,3})(,[0-9]{3})*)|([0-9]+))(\.[0-9]{2})?\s*$/)){return false}else{return true}}function formatCurrency(e){e=e.toString().replace(/\$|\,/g,"");dblValue=parseFloat(e);blnSign=(dblValue==(dblValue=Math.abs(dblValue)));dblValue=Math.floor(dblValue*100+0.50000000001);intCents=dblValue%100;strCents=intCents.toString();dblValue=Math.floor(dblValue/100).toString();if(intCents<10){strCents="0"+strCents}for(var a=0;a<Math.floor((dblValue.length-(1+a))/3);a++){dblValue=dblValue.substring(0,dblValue.length-(4*a+3))+","+dblValue.substring(dblValue.length-(4*a+3))}return(((blnSign)?"":"-")+"$"+dblValue+"."+strCents)}function replaceMSChars(a){if(a==""){return a}else{a=a.replace(/%u2013/g,"-");a=a.replace(/%u2018/g,"'");a=a.replace(/%u2019/g,"'");a=a.replace(/%u201C/g,'"');a=a.replace(/%u201D/g,'"');a=a.replace(/%u2022/g,"*");a=a.replace(/%u2014/g,"--");return a}};