var isValid=true;
var focusObj;
Array.prototype.getIndex=function(n){
for(var i=0;i<this.length;i++){
if(this[i]===n){
return i;
}
}
return -1;
};
function ucFirst(s){
var c=s.charAt(0);
if(parseInt(s.length,10)==1){
return c.toUpperCase();
}else{
return c.toUpperCase()+s.slice(1).toLowerCase();
}
}
function now(){
return new Date().getTime();
}
function sleep(_5){
var i=0;
for(var _7=now();(_7+_5)>now();){
i++;
}
}
function toggleCheckbox(_8){
var _9=document.getElementsByName(_8.name);
if(_8.checked){
for(var i=0;i<_9.length;i++){
if(_9[i]!=_8){
_9[i].checked=false;
}
}
}
}
function toggleFreeze(_b,on){
var _d=0;
var _e=0;
var _f=0;
var agt=navigator.userAgent.toLowerCase();
var _11="#f0f0f0";
if(agt.indexOf("safari")!=-1){
_d=1;
}
if(agt.indexOf("msie")!=-1){
_f=1;
}
if(agt.indexOf("mac")!=-1&&agt.indexOf("msie")!=-1){
_e=1;
}
if(_f&&!_e){
_11="#f5f5f5";
}
if(on){
_b.disabled=true;
if(_b.style){
_b.style.backgroundColor=_11;
_b.style.background=_11;
_b.className="inputdisabled";
}
for(i=0;i<_b.length;i++){
_b[i].disabled=true;
}
}else{
_b.disabled=false;
if(_b.style){
_b.style.backgroundColor="";
_b.style.background="";
_b.className="";
}
for(i=0;i<_b.length;i++){
_b[i].disabled=false;
}
}
}
function toggleSelect(_12){
if(_12.disabled){
for(i=0;i<_12.options.length;i++){
_12.options[i].selected=_12.options[i].frozenStatus;
}
return false;
}
}
function Freeze(obj){
toggleFreeze(obj,1);
}
function unFreeze(obj){
toggleFreeze(obj,0);
}
function testCheckedValue(obj,val){
if(!obj){
return false;
}
if(!val||val==""){
return false;
}
var _17;
var len=obj.length;
if(len==undefined){
_17=document.getElementsByName(obj.name);
}else{
_17=obj;
}
len=_17.length;
if(len==undefined){
if(_17.checked&&_17.value==val){
return true;
}
}else{
for(var i=0;i<len;i++){
if(_17[i].checked&&_17[i].value==val){
return true;
}
}
}
if(obj.type){
if(obj.type.toLowerCase().substring(0,6)=="select"){
if(obj.options[obj.selectedIndex].value==val){
return true;
}
}
if(obj.type.toLowerCase().substring(0,6)=="hidden"){
if(obj.value==val){
return true;
}
}
}
return false;
}
function getCheckedValue(_1a){
if(!_1a){
return "";
}
var _1b=_1a.length;
if(_1b==undefined){
if(_1a.checked){
return _1a.value;
}else{
return "";
}
}
for(var i=0;i<_1b;i++){
if(_1a[i].checked){
return _1a[i].value;
}
}
return "";
}
function has_value(el){
var i,_1f,msg,_21="";
var _22=has_value.arguments;
var _23=_22.length;
if(!el){
var _24=has_value.caller;
if(_24==null){
alert("form_checks.js ERROR: bad el argument in has_value call.");
}else{
var _25="";
while(_24!=null){
if(_24.name){
_25+=" called by function "+_24.name;
}
_24=_24.caller;
}
alert("form_checks.js ERROR: bad el argument; has_value"+_25+".");
}
return (false);
}
_1f=0;
if(el.type){
_21=el.type.toLowerCase();
}
if(_21.substring(0,4)=="text"||_21.substring(0,6)=="hidden"||_21.substring(0,8)=="password"){
if(el.value!=""){
_1f=1;
}
}else{
if(el.length>1&&_21.substring(0,6)=="select"){
_1f=el.selectedIndex;
}else{
if(!el.length){
if(el.checked){
_1f=1;
}
}else{
for(i=0;i<el.length;i++){
if(el[i].checked){
_1f=1;
}
}
}
}
}
if(el.options){
if(el.options.length){
if(escape(el.options[0].value)!="%A0"&&escape(el.options[0].value)!=""){
_1f=1;
}
}
}
if(!_1f){
if(_23>1){
msg=_22[1];
if(msg&&msg!=""){
alert(msg);
}
setFocus(el);
isValid=false;
}
return (false);
}else{
return (true);
}
}
function clear_radio_group(obj){
var i;
if(!obj.length){
obj.checked=false;
}else{
for(i=0;i<obj.length;i++){
obj[i].checked=false;
}
}
}
function clear_group(obj){
clear_radio_group(obj);
}
function validate_radio_group(obj,msg){
var _2b=0;
if(!isValid){
return;
}
for(i=0;i<obj.length;i++){
if(obj[i].checked){
_2b++;
}
}
if(!_2b){
isValid=false;
if(msg){
alert(msg);
}
setFocus(obj[0]);
}
}
function validate_form(){
var _2c=isValid;
isValid=true;
if(typeof hideLoading=="function"&&_2c==false){
setTimeout("hideLoading();",400);
}
return (_2c);
}
function validate_time(a){
if(!a.value){
return true;
}
timeStr=a.value;
var _2e=/^(\d{1,2}):(\d{2})(:(\d{2}))?(\s?(AM|am|PM|pm))?$/;
var _2f=timeStr.match(_2e);
if(_2f==null){
alert("Please enter time as hh:mm [am|pm].");
setFocus(a);
isValid=false;
return;
}
hour=_2f[1];
minute=_2f[2];
second=_2f[4];
ampm=_2f[6];
if(second==""){
second=null;
}
if(ampm==""){
ampm=null;
}
if(hour<0||hour>23){
alert("Hour must be between 1 and 12 (or 0 and 23).");
setFocus(a);
isValid=false;
return;
}
if(hour>12&&ampm!=null){
alert("Invalid time: cannot specify AM or PM for 24 h (military) time.");
setFocus(a);
isValid=false;
return;
}
if(minute<0||minute>59){
alert("Minute must be between 0 and 59.");
setFocus(a);
isValid=false;
return;
}
if(second!=null&&(second<0||second>59)){
alert("Second must be between 0 and 59.");
setFocus(a);
isValid=false;
return;
}
return true;
}
function validate_military_time(a){
if(!a.value){
return true;
}
timeStr=a.value.replace(/:/,"");
if(timeStr.length!=4){
alert("Please enter 4 digital numbers for time with format: hhmm");
isValid=false;
return (false);
}
var _31="0123456789";
for(var _32=0;_32<timeStr.length;_32++){
var _33=timeStr.substring(_32,_32+1);
if(_31.indexOf(_33,0)==-1){
alert("All entered need be digital number.");
setFocus(a);
isValid=false;
return (false);
}
}
var _34=timeStr.substring(0,2);
var _35=timeStr.substring(2,4);
if(_34<0||_34>23){
alert("Hour must be between 00 and 23.");
setFocus(a);
isValid=false;
return false;
}
if(_35<0||_35>59){
alert("Minute must be between 00 and 59.");
setFocus(a);
isValid=false;
return false;
}
return true;
}
function validate_date(a){
if(!a.value){
return true;
}
var _37=validate_date.arguments;
var _38=_37.length;
var _39="mm/dd/yyyy";
if(_38>1){
_39=_37[1];
}
switch(_39){
case "mm/dd/yyyy":
_3a=a.value;
var _3b=/^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/;
var _3c=_3a.match(_3b);
if(_3c==null){
alert("Please enter date as mm/dd/yyyy.");
setFocus(a);
isValid=false;
return false;
}
_3d=_3c[1];
day=_3c[3];
_3f=_3c[5];
if(_3d<1||_3d>12){
alert("Month must be between 1 and 12.");
setFocus(a);
isValid=false;
return false;
}
if(day<1||day>31){
alert("Day must be between 1 and 31.");
setFocus(a);
isValid=false;
return false;
}
if(_3f<1900){
alert("You have entered a year prior to 1900.  Please verify that the year you entered is correct.");
return true;
}
if((_3d==4||_3d==6||_3d==9||_3d==11)&&day==31){
alert("Month "+_3d+" doesn`t have 31 days!");
setFocus(a);
isValid=false;
return false;
}
if(_3d==2){
var _40=(_3f%4==0&&(_3f%100!=0||_3f%400==0));
if(day>29||(day==29&&!_40)){
alert("February "+_3f+" doesn`t have "+day+" days!");
setFocus(a);
isValid=false;
return false;
}
}
return true;
break;
case "dd-mmmm-yyyy":
var _3a=a.value;
var _3b=/^(\d{2})(\-)([a-zA-Z]{3})(\-)(\d{4})$/i;
var _3c=_3a.match(_3b);
if(_3c==null){
alert("Please enter date as DD-MON-YYYY.");
setFocus(a);
isValid=false;
return false;
}
var day=_3c[1];
var _41=_3c[3];
var _3f=_3c[5];
var _3d;
switch(_41.toUpperCase()){
case "JAN":
_3d=1;
break;
case "FEB":
_3d=2;
break;
case "MAR":
_3d=3;
break;
case "APR":
_3d=4;
break;
case "MAY":
_3d=5;
break;
case "JUN":
_3d=6;
break;
case "JUL":
_3d=7;
break;
case "AUG":
_3d=8;
break;
case "SEP":
_3d=9;
break;
case "OCT":
_3d=10;
break;
case "NOV":
_3d=11;
break;
case "DEC":
_3d=12;
break;
}
if(_3d<1||_3d>12||isNaN(_3d)){
alert("Month is invalid.");
setFocus(a);
isValid=false;
return false;
}
var _42=new Array(31,31,((_3f%4==0&&_3f%100!=0)||_3f%400==0||isNaN(_3f)?29:28),31,30,31,30,31,31,30,31,30,31);
if(day<1||day>_42[_3d]){
alert("Please enter a day between 01 and "+_42[_3d]+".");
setFocus(a);
isValid=false;
return false;
}
if(_3f<1900){
if(confirm("You have entered a year prior to 1900.  Is this correct?")!=true){
setFocus(a);
isValid=false;
return false;
}
}
return true;
break;
default:
var _43=validate_date.caller;
if(_43==null){
alert("form_checks.js ERROR: unknown date pattern in validate_date call.");
}else{
var _44="";
while(_43!=null){
if(_43.name){
_44+=" called by function "+_43.name;
}
_43=_43.caller;
}
alert("form_checks.js ERROR: unknown date pattern; validate_date"+_44+".");
}
return false;
}
}
function validate_date_silent(a){
if(!a.value){
return true;
}
dateStr=a.value;
var _46=/^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/;
var _47=dateStr.match(_46);
if(_47==null){
return false;
}
month=_47[1];
day=_47[3];
year=_47[5];
if(month<1||month>12){
return false;
}
if(day<1||day>31){
return false;
}
if((month==4||month==6||month==9||month==11)&&day==31){
return false;
}
if(month==2){
var _48=(year%4==0&&(year%100!=0||year%400==0));
if(day>29||(day==29&&!_48)){
return false;
}
}
return true;
}
function validate_military_date(a){
if(!a.value){
return true;
}
var _4a=a.value;
if(_4a.length!=11){
alert("Please enter date with format: dd-MON-yyyy");
return (false);
}
var day=_4a.substring(0,2);
var _4c=_4a.substring(3,6);
var _4d=_4a.substring(7,11);
if(_4c!="Jan"&&_4c!="Feb"&&_4c!="Mar"&&_4c!="Apr"&&_4c!="May"&&_4c!="Jun"&&_4c!="Jul"&&_4c!="Aug"&&_4c!="Sep"&&_4c!="Oct"&&_4c!="Nov"&&_4c!="Dec"){
alert("Month must be entered in 3 letter format: Jan, Feb, Mar, Apr, etc."+_4c);
setFocus(a);
return false;
}
if(day<1||day>31){
alert("Day must be between 01 and 31.");
setFocus(a);
return false;
}
if(_4d<1900){
alert("You have entered a year prior to 1900.  Please verify that the year you entered is correct.");
return true;
}
if((_4c==4||_4c==6||_4c==9||_4c==11)&&day==31){
alert("Month "+_4c+" doesn`t have 31 days!");
setFocus(a);
return false;
}
if(_4c==2){
var _4e=(_4d%4==0&&(_4d%100!=0||_4d%400==0));
if(day>29||(day==29&&!_4e)){
alert("February "+_4d+" doesn`t have "+day+" days!");
setFocus(a);
return false;
}
}
return true;
}
function validate_military_date2(a){
if(!a.value){
return true;
}
var _50=a.value;
if(_50.length!=8){
alert("Please enter 8 digital numbers for date with format: mmddyyyy");
return (false);
}
var _51="0123456789";
for(var _52=0;_52<_50.length;_52++){
var _53=_50.substring(_52,_52+1);
if(_51.indexOf(_53,0)==-1){
alert("All entered need be digital number.");
setFocus(a);
return (false);
}
}
var _54=_50.substring(0,2);
var day=_50.substring(2,4);
var _56=_50.substring(4,8);
if(_54<1||_54>12){
alert("Month must be between 01 and 12.");
setFocus(a);
return false;
}
if(day<1||day>31){
alert("Day must be between 01 and 31.");
setFocus(a);
return false;
}
if(_56<1900){
alert("You have entered a year prior to 1900.  Please verify that the year you entered is correct.");
return true;
}
if((_54==4||_54==6||_54==9||_54==11)&&day==31){
alert("Month "+_54+" doesn`t have 31 days!");
setFocus(a);
return false;
}
if(_54==2){
var _57=(_56%4==0&&(_56%100!=0||_56%400==0));
if(day>29||(day==29&&!_57)){
alert("February "+_56+" doesn`t have "+day+" days!");
setFocus(a);
return false;
}
}
return true;
}
function validate_dollar(a){
var b=a.value;
if(!b){
return (true);
}
b=b.replace(/\$/,"");
b=parseFloat(b);
if(isNaN(b)){
alert("You have entered an invalid number.  Please make the proper corrections to continue.");
setFocus(a);
isValid=false;
return (false);
}
return (true);
}
function validate_number(a){
var b=a.value;
var _5c=validate_number.arguments;
var _5d=_5c.length;
var min,max;
if(isNaN(b)){
alert("You have entered an invalid number.  Please make the proper corrections to continue.");
setFocus(a);
isValid=false;
return (false);
}
if(_5d>0){
min=_5c[1];
if(b<min){
alert("You have entered an invalid number.  Please enter a value greater than "+(min-1)+".");
setFocus(a);
isValid=false;
return (false);
}
}
if(_5d>1){
max=_5c[2];
if(b>max){
alert("You have entered an invalid number.  Please enter a value less than "+(max+1)+".");
setFocus(a);
isValid=false;
return (false);
}
}
return (true);
}
function validate_positive_number(a){
return validate_number(a,1);
}
function validate_positive_or_zero_number(a){
return validate_number(a,0);
}
function validate_099uu(a){
var b=a.value;
if(!((parseInt(b,10)>=0&&parseInt(b,10)<=99)||b.toLowerCase()=="uu")){
alert("You have entered an invalid value.  Please enter a value from 0 to 99 or uu.");
setFocus(a);
isValid=false;
return (false);
}
return (true);
}
function validate_0999uu(a){
var b=a.value;
if(!((parseInt(b,10)>=0&&parseInt(b,10)<=999)||b.toLowerCase()=="uu")){
alert("You have entered an invalid value.  Please enter a value from 0 to 999 or uu.");
setFocus(a);
isValid=false;
return (false);
}
return (true);
}
function normalizeYear(_66){
if(_66==""){
return;
}
yr=parseInt(_66,10);
var _67;
var _68;
if(yr<100){
var _69=new Date();
if(_69.getFullYear()!=null){
_67=parseInt(_69.getFullYear()/100,10)*100;
_68=(_69.getFullYear()+15)-_67;
}else{
_67=parseInt((_69.getYear()+1900)/100,10)*100;
_68=(_69.getYear()+1900+15)-_67;
}
if(yr>_68){
yr+=_67-100;
}else{
yr+=_67;
}
}
return (yr);
}
function expandYear(_6a){
if(_6a.value==""){
return;
}
if(isNaN(_6a.value)){
return;
}
_6a.value=normalizeYear(_6a.value);
}
function setFocus(obj){
focusObj=obj;
objtype="";
if(obj.type){
objtype=obj.type.toLowerCase();
}
if(obj.length>1&&objtype.substring(0,6)!="select"){
focusObj=obj[0];
}
if(focusObj.select&&typeof focusObj.select=="function"){
setTimeout("focusObj.focus();focusObj.select();",1);
}else{
setTimeout("focusObj.focus();",1);
}
}
function check_non_null_fields(_6c,_6d){
var _6e=_6d.getElementsByTagName("input");
var _6f=_6d.getElementsByTagName("select");
var _70=_6d.getElementsByTagName("textarea");
var _71=new Array();
var _72=new Array();
var _73=new Array();
var _74;
var _75;
var msg;
var i,j;
var _79,_7a;
for(i=0;i<_6f.length;i++){
_71.push(_6f[i]);
}
for(i=0;i<_70.length;i++){
_71.push(_70[i]);
}
for(i=0;i<_6e.length;i++){
_71.push(_6e[i]);
}
for(i=0;i<_71.length;i++){
_73.splice(0);
_74=_71[i];
_75=_74.type.toLowerCase();
if(_75=="hidden"||_75=="submit"||_75=="reset"||_72.getIndex(_74.name)!=-1){
continue;
}
_72.push(_74.name);
if(_75=="radio"||_75=="checkbox"){
for(j=0;j<_71.length;j++){
if(_71[j].name!=_74.name){
continue;
}
_73.push(_71[j]);
}
}else{
_73.push(_74);
}
for(_7a=0,_79=0,j=0;j<_73.length&&!_79;j++){
_74=_73[j];
for(var col in _6c){
if(_74.name.toLowerCase()==_6c[col]){
_7a=1;
if(has_value(_74)){
_79=1;
}
}
}
}
if(_7a&&!_79){
_74=_73[0];
if(_74.options){
if(_74.options.length){
if(escape(_74.options[0].value)!="%A0"&&escape(_74.options[0].value)!=""){
continue;
}
}
}
if(_74.msg){
msg=_74.msg;
}else{
msg="Cannot leave field ("+_74.name+") empty.";
}
alert(msg);
setFocus(_74);
isValid=false;
return (false);
}
}
return (true);
}
function validate_month(m){
if(!m){
return;
}
var _7d=m.value;
if(!_7d){
return;
}
var _7e=parseInt(_7d,10);
if(_7e<1||_7e>12||isNaN(_7d)){
alert("Please enter a month between 1 and 12.");
setFocus(m);
isValid=false;
return false;
}
return (true);
}
function validate_day(d,m,y){
var _82,_83;
var day=d.value;
if(!day){
return;
}
var _85=parseInt(normalizeYear(y.value),10);
if(m.type){
_82=m.type.toLowerCase();
}
if(_82.substring(0,6)=="select"){
_83=m.options[m.selectedIndex].value;
}else{
_83=m.value;
}
var _86=new Array(31,31,((_85%4==0&&_85%100!=0)||_85%400==0||isNaN(_85)?29:28),31,30,31,30,31,31,30,31,30,31);
if(_83==""){
_83=0;
}
if(_83>12){
_83=0;
}
if(day<1||day>_86[_83]){
alert("Please enter a day between 1 and "+_86[_83]+".");
setFocus(d);
isValid=false;
return false;
}
return (true);
}
function validate_date_desc(_87,_88){
if(!_87.value){
return true;
}
var d;
var ms;
var _8b;
var _8c;
re=/-/g;
mydate=_87.value;
while(re.test(mydate)){
mydate=mydate.replace(re,"/");
}
_87.value=mydate;
var _8d=stripCharString(_87.value," ");
_8d=_8d.toUpperCase();
var _8e=0;
if(!allowInString(_8d,"/0123456789")||(_8d.length==2)){
_8e=1;
}
if(!_8e){
var _8f=0;
if(_8d.indexOf("T")>=0){
_8f=1;
}
if(!_8e&&_8f&&(_8d.indexOf("T")!=0)){
_8e=2;
}
if(!_8e&&_8f&&(_8d.length==1)){
d=new Date();
_8b=parseInt(d.getMonth()+1,10).toString();
_8b=(_8b.length==1?"0":"")+_8b;
_8c=parseInt(d.getDate(),10).toString();
_8c=(_8c.length==1?"0":"")+_8c;
_8d=_8b+"/"+_8c+"/"+get_full_year(d);
_8f=0;
}
if(!_8e&&_8f&&(_8d.length>1)&&!(_8d.charAt(1)=="+"||_8d.charAt(1)=="-")){
_8e=3;
}
if(!_8e&&_8f&&isNaN(parseInt(_8d.substring(2,_8d.length),10))){
_8e=4;
}
if(!_8e&&_8f&&(parseInt(_8d.substring(2,_8d.length),10)<0)){
_8e=5;
}
if(!_8e&&_8f){
d=new Date();
ms=d.getTime();
offset=parseInt(_8d.substring(2,_8d.length),10);
if(_8d.charAt(1)=="+"){
ms+=(86400000*offset);
}else{
ms-=(86400000*offset);
}
d.setTime(ms);
_8b=parseInt(d.getMonth()+1,10).toString();
_8b=(_8b.length==1?"0":"")+_8b;
_8c=parseInt(d.getDate(),10).toString();
_8c=(_8c.length==1?"0":"")+_8c;
_8d=_8b+"/"+_8c+"/"+get_full_year(d);
_8f=0;
}
}
if(!_8e){
var _90=new Array();
_90=_8d.split("/");
if(_90.length==2){
d=new Date();
_8d=_8d+"/"+get_full_year(d);
_90=_8d.split("/");
}
if(_90.length!=3||parseInt(_90[0],10)<1||parseInt(_90[0],10)>12||parseInt(_90[1],10)<1||parseInt(_90[1],10)>31||(_90[2].length!=2&&_90[2].length!=4)){
_8e=6;
}
}
if(_8e){
alert(_88+" must be in the format of mm/dd/yy OR mm/dd/yyyy.");
setFocus(_87);
isValid=false;
return (false);
}
ms=Date.parse(_8d);
d=new Date();
d.setTime(ms);
_8c=d.toLocaleString();
_8b=parseInt(d.getMonth()+1,10).toString();
_8b=(_8b.length==1?"0":"")+_8b;
_8c=parseInt(d.getDate(),10).toString();
_8c=(_8c.length==1?"0":"")+_8c;
_8c=_8b+"/"+_8c+"/"+get_full_year(d);
_87.value=_8c;
return true;
}
function get_full_year(d){
var y="";
y=d.getFullYear();
if(y<1910){
y+=100;
}
return y;
}
function get_full_year2(d){
var y="";
if(d.getFullYear()!=null){
y=d.getFullYear();
if(y<1970){
y+=100;
}
}else{
y=d.getYear();
if(y>69&&y<100){
y+=1900;
}
if(y<1000){
y+=2000;
}
}
return y;
}
function addLoadEvent(_95){
var _96=window.onload;
if(typeof window.onload!="function"){
window.onload=_95;
}else{
window.onload=function(){
_96();
_95();
};
}
if(navigator.userAgent.indexOf("Firefox")!=-1){
var _97=navigator.userAgent.indexOf("Firefox")+8;
if(parseFloat(navigator.userAgent.substring(_97))>=1.5){
if(typeof window.onpageshow=="function"){
var _98=window.onpageshow;
_96=window.onload;
window.onload=function(){
_98();
_96();
};
}
window.onpageshow=window.onload;
window.onload="";
}
}
}
function addPageShowEvent(_99){
var _9a=window.onpageshow;
if(typeof window.onpageshow!="function"){
window.onpageshow=_99;
}else{
window.onpageshow=function(){
_9a();
_99();
};
}
}
function addUnloadEvent(_9b){
var _9c=window.onunload;
if(typeof window.onunload!="function"){
window.onunload=_9b;
}else{
window.onunload=function(){
_9c();
_9b();
};
}
}
function setUnloadEvent(_9d){
window.onunload=_9d;
}
function addEvent(obj,_9f,fn){
if(obj.addEventListener){
obj.addEventListener(_9f,fn,false);
return true;
}else{
if(obj.attachEvent){
var r=obj.attachEvent("on"+_9f,fn);
return r;
}else{
eval("obj.on"+_9f+" = "+fn+";");
}
}
}
function getElementStyle(_a2,_a3,_a4){
var _a5=document.getElementById(_a2);
if(_a5.currentStyle){
return _a5.currentStyle[_a3];
}else{
if(window.getComputedStyle){
var _a6=window.getComputedStyle(_a5,"");
return _a6.getPropertyValue(_a4);
}
}
return "";
}
function getStyle(_a7){
var obj;
var _a9=new Object();
obj=findObj(_a7);
if(obj){
if(obj.style){
_a9=obj.style;
}
}
return (_a9);
}
function getCSSRule(_aa){
_aa=_aa.toLowerCase();
if(document.styleSheets){
var _ab;
var _ac=new Array();
for(var i=0;i<document.styleSheets.length;i++){
_ab=document.styleSheets[i];
if(_ab.cssRules){
_ac=_ab.cssRules;
}else{
if(_ab.rules){
_ac=_ab.rules;
}else{
continue;
}
}
for(j=0;j<_ac.length;j++){
var _ae=_ac[j];
if(!_ae.selectorText){
continue;
}
if(_ae.selectorText.toLowerCase()==_aa){
return _ae;
}
}
}
}
return false;
}
function addCSSRule(_af){
if(document.styleSheets){
if(!getCSSRule(_af)){
if(document.styleSheets[0].addRule){
document.styleSheets[0].addRule(_af,null,0);
}else{
document.styleSheets[0].insertRule(_af+" { }",0);
}
}
}
return getCSSRule(_af);
}
function disable_submit(btn){
if(!btn){
return;
}
btn.disabled=true;
if(typeof btn.className=="undefined"){
btn.className="disabled";
}else{
btn.className+=" disabled";
}
if(!getCSSRule(".disabled")){
var _b1=addCSSRule(".disabled");
if(!_b1.selectorText){
return;
}
if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){
_b1.style.color="#A9A9A9";
_b1.style.cssText+=" !important";
}else{
_b1.style.setProperty("color","#A9A9A9","important");
}
}
}
function enable_submit(btn){
if(!btn){
return;
}
btn.disabled=false;
if(btn.className.split(" ").length>1){
btn.className=btn.className.replace(new RegExp(" disabled\\b"),"");
}else{
btn.className=btn.className.replace(new RegExp("disabled\\b"),"");
}
}
function colorFocus(){
var _b3,s,t,i,j;
_b3=document.getElementsByTagName("INPUT");
for(i=0;i<_b3.length;i++){
t=_b3[i].type.toLowerCase();
if(t=="text"||t=="password"){
addEvent(_b3[i],"focus",addColorFocusClass);
addEvent(_b3[i],"blur",rmColorFocusClass);
}
if(t=="radio"||t=="checkbox"){
_b3[i].style.backgroundColor="transparent";
_b3[i].style.border="0px none";
_b3[i].className="radiocolor";
}
}
_b3=document.getElementsByTagName("TEXTAREA");
for(i=0;i<_b3.length;i++){
addEvent(_b3[i],"focus",addColorFocusClass);
addEvent(_b3[i],"blur",rmColorFocusClass);
}
_b3=document.getElementsByTagName("SELECT");
for(i=0;i<_b3.length;i++){
addEvent(_b3[i],"focus",addColorFocusClassSelect);
addEvent(_b3[i],"blur",rmColorFocusClassSelect);
colorOptionsFirstTime(_b3[i]);
}
}
function addColorFocusClass(_b8){
var e=_b8||window.event;
var el;
if(e.srcElement){
el=e.srcElement;
}else{
el=e.target;
}
if(!el){
return;
}
if(typeof el.className=="undefined"){
el.className="colorfocus";
}else{
el.className+=" colorfocus";
}
}
function addColorFocusClassSelect(_bb){
var e=_bb||window.event;
var el;
if(e.srcElement){
el=e.srcElement;
}else{
el=e.target;
}
addColorFocusClass(_bb);
if(!el){
return;
}
colorOptions(el);
}
function rmColorFocusClass(_be){
var e=_be||window.event;
var el;
if(e.srcElement){
el=e.srcElement;
}else{
el=e.target;
}
if(!el){
return;
}
if(el.className.split(" ").length>1){
el.className=el.className.replace(new RegExp(" colorfocus\\b"),"");
}else{
el.className=el.className.replace(new RegExp("colorfocus\\b"),"");
}
}
function rmColorFocusClassSelect(_c1){
var e=_c1||window.event;
var el;
if(e.srcElement){
el=e.srcElement;
}else{
el=e.target;
}
rmColorFocusClass(_c1);
if(!el){
return;
}
uncolorOptions(el);
}
function colorOptionsFirstTime(sel){
for(i=0;i<sel.length;i++){
if(i!=sel.selectedIndex){
if(sel[i].className=="undefined"){
sel[i].className="coloroption";
}else{
if(sel[i].className.indexOf("coloroption")==-1){
sel[i].className+=" coloroption";
}
}
}
}
}
function colorOptions(sel){
for(i=0;i<sel.length;i++){
if(typeof sel[i].className=="undefined"){
sel[i].className="coloroption";
}else{
if(sel[i].className.indexOf("coloroption")==-1){
sel[i].className+=" coloroption";
}
}
}
}
function uncolorOptions(sel){
if(sel.selectedIndex==-1){
return;
}
if(typeof sel[sel.selectedIndex].className!="undefined"){
if(sel[sel.selectedIndex].className.split(" ").length>1){
sel[sel.selectedIndex].className=sel[sel.selectedIndex].className.replace(new RegExp(" coloroption\\b"),"");
}else{
sel[sel.selectedIndex].className=sel[sel.selectedIndex].className.replace(new RegExp("coloroption\\b"),"");
}
}
}
function buttonStyle(){
var _c7,t,i,p;
var _cb=buttonStyle.caller;
_c7=document.getElementsByTagName("INPUT");
for(i=0;i<_c7.length;i++){
t=_c7[i].type.toLowerCase();
p=_c7[i].parentNode;
if(p){
p=p.className.indexOf("skip_buttonStyle");
}else{
p=0;
}
if((t=="reset"||t=="button"||t=="submit")&&p==-1){
if(typeof _c7[i].className=="undefined"){
_c7[i].className="buttonstyle";
}else{
if(_c7[i].className.indexOf("buttonstyle")==-1){
_c7[i].className="buttonstyle "+_c7[i].className;
}
}
}
}
}
function findObj(n,d){
var p,i,x;
if(!d){
d=document;
}
if((p=n.indexOf("?"))>0&&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<d.forms.length;i++){
x=d.forms[i][n];
}
for(i=0;!x&&d.layers&&i<d.layers.length;i++){
x=findObj(n,d.layers[i].document);
}
if(!x&&d.getElementById){
x=d.getElementById(n);
}
return x;
}
function stripCharString(_d1,_d2){
var _d3="";
for(var _d4=0;_d4<_d1.length;_d4++){
var _d5=_d1.substring(_d4,_d4+1);
var _d6=false;
for(var _d7=0;_d7<_d2.length;_d7++){
var _d8=_d2.substring(_d7,_d7+1);
if(_d5==_d8){
_d6=true;
break;
}
}
if(!_d6){
_d3=_d3+_d5;
}
}
return (_d3);
}
function allowInString(_d9,_da){
if(_d9.length==0){
return (false);
}
for(var _db=0;_db<_d9.length;_db++){
var _dc=_d9.substring(_db,_db+1);
if(_da.indexOf(_dc,0)==-1){
return (false);
}
}
return (true);
}
function TrimString(_dd){
_dd=_dd.replace(/^\s+/g,"");
return _dd.replace(/\s+$/g,"");
}
function ieColorFix(){
setTimeout("colorFocus();",3200);
}
if(typeof HTMLElement!="undefined"&&!HTMLElement.prototype.insertAdjacentElement){
HTMLElement.prototype.insertAdjacentElement=function(_de,_df){
switch(_de.toLowerCase()){
case "beforebegin":
this.parentNode.insertBefore(_df,this);
break;
case "afterbegin":
this.insertBefore(_df,this.firstChild);
break;
case "beforeend":
this.appendChild(_df);
break;
case "afterend":
if(this.nextSibling){
this.parentNode.insertBefore(_df,this.nextSibling);
}else{
this.parentNode.appendChild(_df);
}
break;
}
};
HTMLElement.prototype.insertAdjacentHTML=function(_e0,_e1){
var r=this.ownerDocument.createRange();
r.setStartBefore(this);
var _e3=r.createContextualFragment(_e1);
this.insertAdjacentElement(_e0,_e3);
};
HTMLElement.prototype.insertAdjacentText=function(_e4,_e5){
var _e6=document.createTextNode(_e5);
this.insertAdjacentElement(_e4,_e6);
};
}
if(typeof document.createStyleSheet==="undefined"){
document.createStyleSheet=(function(){
function createStyleSheet(_e7){
if(typeof _e7!=="undefined"){
var _e8=document.createElement("link");
_e8.type="text/css";
_e8.rel="stylesheet";
_e8.href=_e7;
}else{
var _e8=document.createElement("style");
_e8.type="text/css";
}
document.getElementsByTagName("head")[0].appendChild(_e8);
var _e9=document.styleSheets[document.styleSheets.length-1];
if(typeof _e9.addRule==="undefined"){
_e9.addRule=addRule;
}
if(typeof _e9.removeRule==="undefined"){
_e9.removeRule=_e9.deleteRule;
}
return _e9;
}
function addRule(_ea,_eb,_ec){
if(typeof _ec==="undefined"){
_ec=this.cssRules.length;
}
this.insertRule(_ea+" {"+_eb+"}",_ec);
}
return createStyleSheet;
})();
}
function insertAdjacentHTMLfunc(el,_ee,_ef){
var r=el.ownerDocument.createRange();
r.setStartBefore(el);
var _f1=r.createContextualFragment(_ef);
switch(_ee.toLowerCase()){
case "beforebegin":
el.parentNode.insertBefore(_f1,el);
break;
case "afterbegin":
el.insertBefore(_f1,el.firstChild);
break;
case "beforeend":
el.appendChild(_f1);
break;
case "afterend":
if(el.nextSibling){
el.parentNode.insertBefore(_f1,el.nextSibling);
}else{
el.parentNode.appendChild(_f1);
}
break;
}
}
function formKeyDown(e){
var _f3;
var _f4;
var _f5;
if(!e){
e=window.event;
}
if(e.keyCode){
_f3=e.keyCode;
}else{
if(e.which){
_f3=e.which;
}
}
if(e.target){
_f4=e.target;
}else{
if(e.srcElement){
_f4=e.srcElement;
}
}
if(_f4.tagName.toLowerCase()=="input"){
_f5=_f4.getAttribute("type").toLowerCase();
switch(_f5){
case "checkbox":
case "radio":
case "text":
if(_f3==13){
if(e.keyCode){
e.keyCode=9;
}else{
if(e.which){
e.which=9;
}
}
}
break;
}
}
return true;
}
function formKeyPress(e){
var _f7;
var _f8;
var _f9;
if(!e){
e=window.event;
}
if(e.keyCode){
_f7=e.keyCode;
}else{
if(e.which){
_f7=e.which;
}
}
if(e.target){
_f8=e.target;
}else{
if(e.srcElement){
_f8=e.srcElement;
}
}
if(_f8.tagName.toLowerCase()=="input"||_f8.tagName.toLowerCase()=="select"){
if(_f8.tagName.toLowerCase()=="select"){
_f9="select";
}else{
_f9=_f8.getAttribute("type").toLowerCase();
}
switch(_f9){
case "select":
case "checkbox":
case "radio":
if(_f7==8){
return false;
}
case "text":
if(_f7==13){
return false;
}
break;
case "submit":
case "button":
if(_f7==8){
return false;
}
}
}
return true;
}
enterAsTab=function(f,a){
addEvent(f,"keypress",function(e){
var l,i,f,j,o=e.target,_101,type;
if(e.keyCode){
_101=e.keyCode;
}else{
if(e.which){
_101=e.which;
}
}
type=o.type.toLowerCase();
if(_101==13&&(a||(type!="textarea"&&type.substring(0,6)!="select"))){
for(i=l=(f=o.form.elements).length;f[--i]!=o;){
}
for(j=i;(j=(j+1)%l)!=i&&(!f[j].type||f[j].disabled||f[j].readOnly||f[j].type.toLowerCase()=="hidden");){
}
e.preventDefault(),j!=i&&f[j].focus();
}
});
};
function bgimagesRemove(){
if(!document.styleSheets){
return;
}
if(document.getElementsByName("j_username").length>0){
return;
}
for(var i=0;i<document.styleSheets.length;i++){
var _104=false;
if(document.styleSheets[i].cssRules){
_104=document.styleSheets[i].cssRules;
}else{
_104=document.styleSheets[i].rules;
}
for(var j=0;j<_104.length;++j){
if(_104[j].selectorText.toLowerCase()!=".bgimages"){
continue;
}
if(_104[j].style.backgroundImage.search(/test_seal/)==-1){
_104[j].style.backgroundImage="";
}
break;
}
}
}
function bgimageLogin(){
if(document.getElementsByName("j_username").length==0){
return;
}
document.body.className="bglogin";
}
addLoadEvent(bgimageLogin);
function bgimagesAdd(){
if(!document.styleSheets){
return;
}
if(document.getElementsByName("j_username").length>0){
return;
}
for(var i=0;i<document.styleSheets.length;i++){
var _107=false;
if(document.styleSheets[i].cssRules){
_107=document.styleSheets[i].cssRules;
}else{
_107=document.styleSheets[i].rules;
}
for(var j=0;j<_107.length;++j){
if(_107[j].selectorText.toLowerCase()!=".bgimages"){
continue;
}
_107[j].style.backgroundImage="url(/Common/Images/test.gif)";
break;
}
}
}
if((window.location.hostname.substr(0,4).toLowerCase()=="test"||window.location.hostname.substr(0,4).toLowerCase()=="tdeb"||window.location.hostname.substr(0,4).toLowerCase()=="tceb"||window.location.hostname=="129.111.140.187")&&window.location.href.search(/NTIMassTrans/)==-1){
addLoadEvent(bgimagesAdd);
}
if(window.location.href.search(/Psych/)!=-1){
addLoadEvent(colorFocus);
}
if(window.location.href.search(/Transplant/)!=-1){
addLoadEvent(colorFocus);
}
if(window.location.href.search(/Transplant/)!=-1){
addLoadEvent(buttonStyle);
}

