var dynamicOptionListCount=0;
var dynamicOptionListObjects=new Array();
function initDynamicOptionLists(){for(var H=0;
H<dynamicOptionListObjects.length;
H++){var G=dynamicOptionListObjects[H];
if(G.formName!=null){G.form=document.forms[G.formName]
}else{if(G.formIndex!=null){G.form=document.forms[G.formIndex]
}else{var A=G.fieldNames[0][0];
for(var I=0;
I<document.forms.length;
I++){if(typeof (document.forms[I][A])!="undefined"){G.form=document.forms[I];
break
}}if(G.form==null){alert("ERROR: Couldn't find form element "+A+" in any form on the page! Init aborted");
return 
}}}for(var F=0;
F<G.fieldNames.length;
F++){for(var E=0;
E<G.fieldNames[F].length-1;
E++){var J=G.form[G.fieldNames[F][E]];
if(typeof (J)=="undefined"){alert("Select box named "+G.fieldNames[F][E]+" could not be found in the form. Init aborted");
return 
}if(E==0){if(J.options!=null){for(l=0;
l<J.options.length;
l++){var C=J.options[l];
var D=G.findMatchingOptionInArray(G.options,C.text,C.value,false);
if(D!=null){var B=C.selected;
var K=new Option(C.text,C.value,C.defaultSelected,C.selected);
K.selected=C.selected;
K.defaultSelected=C.defaultSelected;
K.DOLOption=D;
J.options[l]=K;
J.options[l].selected=B
}}}}if(J.onchange==null){J.onchange=new Function("dynamicOptionListObjects["+G.index+"].change(this)")
}}}}resetDynamicOptionLists()
}function resetDynamicOptionLists(A){for(var C=0;
C<dynamicOptionListObjects.length;
C++){var D=dynamicOptionListObjects[C];
if(typeof (A)=="undefined"||A==null||A==D.form){for(var B=0;
B<D.fieldNames.length;
B++){D.change(D.form[D.fieldNames[B][0]],true)
}}}}function DOLOption(D,C,B,A){this.text=D;
this.value=C;
this.defaultSelected=B;
this.selected=A;
this.options=new Array();
return this
}function DynamicOptionList(){this.form=null;
this.options=new Array();
this.longestString=new Array();
this.numberOfOptions=new Array();
this.currentNode=null;
this.currentField=null;
this.currentNodeDepth=0;
this.fieldNames=new Array();
this.formIndex=null;
this.formName=null;
this.fieldListIndexes=new Object();
this.fieldIndexes=new Object();
this.selectFirstOption=true;
this.numberOfOptions=new Array();
this.longestString=new Array();
this.values=new Object();
this.forValue=DOL_forValue;
this.forText=DOL_forText;
this.forField=DOL_forField;
this.forX=DOL_forX;
this.addOptions=DOL_addOptions;
this.addOptionsTextValue=DOL_addOptionsTextValue;
this.setDefaultOptions=DOL_setDefaultOptions;
this.setValues=DOL_setValues;
this.setValue=DOL_setValues;
this.setFormIndex=DOL_setFormIndex;
this.setFormName=DOL_setFormName;
this.printOptions=DOL_printOptions;
this.addDependentFields=DOL_addDependentFields;
this.change=DOL_change;
this.child=DOL_child;
this.selectChildOptions=DOL_selectChildOptions;
this.populateChild=DOL_populateChild;
this.change=DOL_change;
this.addNewOptionToList=DOL_addNewOptionToList;
this.findMatchingOptionInArray=DOL_findMatchingOptionInArray;
if(arguments.length>0){for(var A=0;
A<arguments.length;
A++){this.fieldListIndexes[arguments[A].toString()]=this.fieldNames.length;
this.fieldIndexes[arguments[A].toString()]=A
}this.fieldNames[this.fieldNames.length]=arguments
}this.index=window.dynamicOptionListCount++;
window["dynamicOptionListObjects"][this.index]=this
}function DOL_findMatchingOptionInArray(A,E,D,H){if(A==null||typeof (A)=="undefined"){return null
}var G=null;
var F=null;
for(var C=0;
C<A.length;
C++){var B=A[C];
if(B.value==D&&B.text==E){return B
}if(!H){if(G==null&&D!=null&&B.value==D){G=B
}if(F==null&&E!=null&&B.text==E){F=B
}}}return(G!=null)?G:F
}function DOL_forX(C,B){if(this.currentNode==null){this.currentNodeDepth=0
}var A=(this.currentNode==null)?this:this.currentNode;
var D=this.findMatchingOptionInArray(A["options"],(B=="text")?C:null,(B=="value")?C:null,false);
if(D==null){D=new DOLOption(null,null,false,false);
D[B]=C;
A.options[A.options.length]=D
}this.currentNode=D;
this.currentNodeDepth++;
return this
}function DOL_forValue(A){return this.forX(A,"value")
}function DOL_forText(A){return this.forX(A,"text")
}function DOL_forField(A){this.currentField=A;
return this
}function DOL_addNewOptionToList(A,F,D,C){var E=new DOLOption(F,D,C,false);
if(A==null){A=new Array()
}for(var B=0;
B<A.length;
B++){if(A[B].text==E.text&&A[B].value==E.value){if(E.selected){A[B].selected=true
}if(E.defaultSelected){A[B].defaultSelected=true
}return A
}}A[A.length]=E
}function DOL_addOptions(){if(this.currentNode==null){this.currentNode=this
}if(this.currentNode["options"]==null){this.currentNode["options"]=new Array()
}for(var A=0;
A<arguments.length;
A++){var B=arguments[A];
this.addNewOptionToList(this.currentNode.options,B,B,false);
if(typeof (this.numberOfOptions[this.currentNodeDepth])=="undefined"){this.numberOfOptions[this.currentNodeDepth]=0
}if(this.currentNode.options.length>this.numberOfOptions[this.currentNodeDepth]){this.numberOfOptions[this.currentNodeDepth]=this.currentNode.options.length
}if(typeof (this.longestString[this.currentNodeDepth])=="undefined"||(B.length>this.longestString[this.currentNodeDepth].length)){this.longestString[this.currentNodeDepth]=B
}}this.currentNode=null;
this.currentNodeDepth=0
}function DOL_addOptionsTextValue(){if(this.currentNode==null){this.currentNode=this
}if(this.currentNode["options"]==null){this.currentNode["options"]=new Array()
}for(var A=0;
A<arguments.length;
A++){var C=arguments[A++];
var B=arguments[A];
this.addNewOptionToList(this.currentNode.options,C,B,false);
if(typeof (this.numberOfOptions[this.currentNodeDepth])=="undefined"){this.numberOfOptions[this.currentNodeDepth]=0
}if(this.currentNode.options.length>this.numberOfOptions[this.currentNodeDepth]){this.numberOfOptions[this.currentNodeDepth]=this.currentNode.options.length
}if(typeof (this.longestString[this.currentNodeDepth])=="undefined"||(C.length>this.longestString[this.currentNodeDepth].length)){this.longestString[this.currentNodeDepth]=C
}}this.currentNode=null;
this.currentNodeDepth=0
}function DOL_child(C){var B=this.fieldListIndexes[C.name];
var A=this.fieldIndexes[C.name];
if(A<(this.fieldNames[B].length-1)){return this.form[this.fieldNames[B][A+1]]
}return null
}function DOL_setDefaultOptions(){if(this.currentNode==null){this.currentNode=this
}for(var A=0;
A<arguments.length;
A++){var B=this.findMatchingOptionInArray(this.currentNode.options,null,arguments[A],false);
if(B!=null){B.defaultSelected=true
}}this.currentNode=null
}function DOL_setValues(){if(this.currentField==null){alert("Can't call setValues() without using forField() first!");
return 
}if(typeof (this.values[this.currentField])=="undefined"){this.values[this.currentField]=new Object()
}for(var A=0;
A<arguments.length;
A++){this.values[this.currentField][arguments[A]]=true
}this.currentField=null
}function DOL_setFormIndex(A){this.formIndex=A
}function DOL_setFormName(A){this.formName=A
}function DOL_printOptions(C){if((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)<=4)){var B=this.fieldIndexes[C];
var A="";
if(typeof (this.numberOfOptions[B])!="undefined"){for(var D=0;
D<this.numberOfOptions[B];
D++){A+="<OPTION>"
}}A+="<OPTION>";
if(typeof (this.longestString[B])!="undefined"){for(var D=0;
D<this.longestString[B].length;
D++){A+="_"
}}document.writeln(A)
}}function DOL_addDependentFields(){for(var A=0;
A<arguments.length;
A++){this.fieldListIndexes[arguments[A].toString()]=this.fieldNames.length;
this.fieldIndexes[arguments[A].toString()]=A
}this.fieldNames[this.fieldNames.length]=arguments
}function DOL_change(E,G){if(G==null||typeof (G)=="undefined"){G=false
}var K=this.fieldListIndexes[E.name];
var D=this.fieldIndexes[E.name];
var A=this.child(E);
if(A==null){return 
}if(E.type=="select-one"){if(A.options!=null){A.options.length=0
}if(E.options!=null&&E.options.length>0&&E.selectedIndex>=0){var B=E.options[E.selectedIndex];
this.populateChild(B.DOLOption,A,G);
this.selectChildOptions(A,G)
}}else{if(E.type=="select-multiple"){var H=new Array();
if(!G){for(var F=0;
F<A.options.length;
F++){var J=A.options[F];
if(J.selected){this.addNewOptionToList(H,J.text,J.value,J.defaultSelected)
}}}A.options.length=0;
if(E.options!=null){var L=E.options;
for(var F=0;
F<L.length;
F++){if(L[F].selected){this.populateChild(L[F].DOLOption,A,G)
}}var I=false;
if(!G){for(var F=0;
F<A.options.length;
F++){var C=this.findMatchingOptionInArray(H,A.options[F].text,A.options[F].value,true);
if(C!=null){A.options[F].selected=true;
I=true
}}}if(!I){this.selectChildOptions(A,G)
}}}}this.change(A,G)
}function DOL_populateChild(G,C,H){if(G!=null&&G.options!=null){for(var E=0;
E<G.options.length;
E++){var I=G.options[E];
if(C.options==null){C.options=new Array()
}var F=false;
var B=false;
for(var D=0;
D<C.options.length;
D++){var J=C.options[D];
if(J.text==I.text&&J.value==I.value){F=true;
break
}}if(!F){var A=new Option(I.text,I.value,false,false);
A.selected=false;
A.defaultSelected=false;
A.DOLOption=I;
C.options[C.options.length]=A
}}}}function DOL_selectChildOptions(E,H){var B=this.values[E.name];
var D=false;
if(H&&B!=null&&typeof (B)!="undefined"){for(var C=0;
C<E.options.length;
C++){var A=E.options[C].value;
if(A!=null&&B[A]!=null&&typeof (B[A])!="undefined"){D=true;
break
}}}var G=false;
for(var C=0;
C<E.options.length;
C++){var F=E.options[C];
if(D&&F.value!=null&&B[F.value]!=null&&typeof (B[F.value])!="undefined"){F.selected=true;
G=true
}else{if(!D&&F.DOLOption!=null&&F.DOLOption.defaultSelected){F.selected=true;
G=true
}else{F.selected=false
}}}if(this.selectFirstOption&&!G&&E.options.length>0){E.options[0].selected=true
}else{if(!G&&E.type=="select-one"){E.selectedIndex=-1
}}};
