function CheckboxList(a){this.listId=a;this.oList=null;this.oListElements=null;this.checkBoxesClickEnabled=true;
this.checkboxCursor=false;this.checkBoxClassName="checkbox";this.checkBoxCheckedClassName="checked";
this.bgImageOn="";this.bgImageOnHover="";this.bgImageOff="";this.bgImageOffHover="";
this.styleClassOn="";this.styleClassOff="";this.styleClassOnHover="";this.styleClassOffHover="";
this.multipleSelection=true;this.minSelectedItems=0;this.alsoLIHoverCheckbox=true;
this.useStyleClass=false;this.onchange=null}CheckboxList.prototype.changeStyle=function(c,a,b){if(this.useStyleClass){if(this.styleClassOnHover||this.styleClassOffHover){HTMLUtils.removeClassName(c,this.styleClassOnHover);
HTMLUtils.removeClassName(c,this.styleClassOffHover)}HTMLUtils.removeClassName(c,this.styleClassOn);
HTMLUtils.removeClassName(c,this.styleClassOff);HTMLUtils.removeClassName(c,this.checkBoxClassName+"-"+this.styleClassOn);
HTMLUtils.removeClassName(c,this.checkBoxClassName+"-"+this.styleClassOff);HTMLUtils.addClassName(c,b);
HTMLUtils.addClassName(c,this.checkBoxClassName+"-"+b)}else{c.style.backgroundImage="url("+a+")"
}};CheckboxList.prototype.setBoxStatus=function(b,a){if(a==null){a=!b.checked}b.checked=a;
this.changeStyle(b,a?this.bgImageOn:this.bgImageOff,a?this.styleClassOn:this.styleClassOff)
};CheckboxList.prototype.setCheckedBoxes=function(c,b){var a;if(b===undefined){b=true
}for(a=0;a<this.oListElements.length;a++){this.setBoxStatus(this.oListElements[a].childNodes[this.oListElements[a].iCheckboxElement],ArrayUtils.inArray(c,this.oListElements[a].id))
}if((b)&&(this.onchange!=null)&&(typeof(this.onchange)=="function")){this.onchange()
}return true};CheckboxList.prototype.setCheckedBoxByValue=function(b){var a;for(a=0;
a<this.oListElements.length;a++){this.setBoxStatus(this.oListElements[a].childNodes[this.oListElements[a].iCheckboxElement],(b.toString()==this.oListElements[a].varValue.toString()))
}if((this.onchange!=null)&&(typeof(this.onchange)=="function")){this.onchange()}return true
};CheckboxList.prototype.selectAllCheckedBoxes=function(){var b,a;a=new Array();for(b=0;
b<this.oListElements.length;b++){a.push(this.oListElements[b].id)}this.setCheckedBoxes(a)
};CheckboxList.prototype.deselectAllCheckedBoxes=function(){this.setCheckedBoxes(new Array(),false)
};CheckboxList.prototype.getCheckedBoxes=function(){var b,a;a=new Array();for(b=0;
b<this.oListElements.length;b++){if(this.oListElements[b].childNodes[this.oListElements[b].iCheckboxElement].checked){a.push(this.oListElements[b].id)
}}return a};CheckboxList.prototype.getValuesFromCheckedBoxes=function(){var b,a;a=new Array();
for(b=0;b<this.oListElements.length;b++){if(this.oListElements[b].childNodes[this.oListElements[b].iCheckboxElement].checked){a.push(this.oListElements[b].varValue)
}}return a};CheckboxList.prototype.checkbox_click=function(a,b){if(this.control){return this.control.checkbox_click(a?a:event,this)
}if(!this.checkBoxesClickEnabled){return false}if((b.checked==true)&&(this.minSelectedItems>0)&&(this.minSelectedItems>=this.getCheckedBoxes().length)){return false
}if((this.multipleSelection==false)&&(b.checked==false)){this.deselectAllCheckedBoxes()
}this.setBoxStatus(b,null);if(this.bgImageOnHover||this.bgImageOffHover){this.changeStyle(b,b.checked?this.bgImageOnHover:this.bgImageOffHover,b.checked?this.styleClassOnHover:this.styleClassOffHover)
}if((this.onchange!=null)&&(typeof(this.onchange)=="function")){this.onchange()}};
CheckboxList.prototype.checkbox_mouseover=function(a,b){var c;if(this.control){return this.control.checkbox_mouseover(a?a:event,this)
}c=(b.tagName=="LI")?b.childNodes[b.iCheckboxElement]:b;if(this.bgImageOnHover||this.bgImageOffHover){this.changeStyle(c,c.checked?this.bgImageOnHover:this.bgImageOffHover,c.checked?this.styleClassOnHover:this.styleClassOffHover)
}};CheckboxList.prototype.checkbox_mouseout=function(a,b){var c;if(this.control){return this.control.checkbox_mouseout(a?a:event,this)
}c=(b.tagName=="LI")?b.childNodes[b.iCheckboxElement]:b;if(this.bgImageOnHover||this.bgImageOffHover){this.changeStyle(c,c.checked?this.bgImageOn:this.bgImageOff,c.checked?this.styleClassOn:this.styleClassOff)
}};CheckboxList.prototype.init=function(){var a,b;if(typeof(ArrayUtils)=="undefined"){alert("This script need the ArrayUtils.js module!");
return false}if(typeof(HTMLUtils)=="undefined"){alert("This script need the HTMLUtils.js module!");
return false}this.oList=document.getElementById(this.listId);if(this.oList==null){alert("Can't find the ID: "+this.listId);
return false}this.oListElements=this.oList.getElementsByTagName("li");for(a=0;a<this.oListElements.length;
a++){for(b=0;b<this.oListElements[a].childNodes.length;b++){if(this.oListElements[a].childNodes[b].tagName=="VAR"){this.oListElements[a].varValue=this.oListElements[a].childNodes[b].firstChild.nodeValue
}if(HTMLUtils.hasClassName(this.oListElements[a].childNodes[b],this.checkBoxClassName)){this.oListElements[a].iCheckboxElement=b;
if(this.checkboxCursor){this.oListElements[a].childNodes[b].style.cursor=this.checkboxCursor
}this.oListElements[a].childNodes[b].checked=HTMLUtils.hasClassName(this.oListElements[a].childNodes[b],this.checkBoxCheckedClassName);
this.oListElements[a].childNodes[b].onmouseup=this.checkbox_click;this.oListElements[a].childNodes[b].control=this;
if(this.alsoLIHoverCheckbox){this.oListElements[a].onmouseover=this.checkbox_mouseover;
this.oListElements[a].onmouseout=this.checkbox_mouseout;this.oListElements[a].control=this
}else{this.oListElements[a].childNodes[b].onmouseover=this.checkbox_mouseover;this.oListElements[a].childNodes[b].onmouseout=this.checkbox_mouseout;
this.oListElements[a].childNodes[b].control=this}this.setBoxStatus(this.oListElements[a].childNodes[b],this.oListElements[a].childNodes[b].checked)
}}}};CheckboxList.prototype.disableCheckboxClicks=function(){this.checkBoxesClickEnabled=false
};CheckboxList.prototype.enableCheckboxClicks=function(){this.checkBoxesClickEnabled=true
};