The code is as follows:
/*
Description:CHECKBOX control
Version: 1.1
Note: The text that follows behind the CHECKBOX control
It is to obtain the htc_myLabel of the CHECKBOX object to display it
Updated and added the indeter attribute to increase uncertain choices
*/
<public:component>
<public:attachevent="oncontentready"onevent="fnInit()"/>
<public:attachevent="onpropertychange"onevent="fnPropertychange()"/>
<scriptlanguage="Javascript">
varcheckBoxImg=window.document.createElement("IMG");
ImageArray=[];
ImageArray["checkbox_false"]="checkbox_false.gif";
ImageArray["checkbox_false_down"]="checkbox_false_down.gif";
ImageArray["checkbox_false_over"]="checkbox_false_over.gif";
ImageArray["checkbox_true"]="checkbox_true.gif";
ImageArray["checkbox_true_down"]="checkbox_true_down.gif";
ImageArray["checkbox_true_over"]="checkbox_true_over.gif";
ImageArray["checkbox_indeter"]="checkbox_indeter.gif";
ImageArray["checkbox_indeter_down"]="checkbox_indeter_down.gif";
ImageArray["checkbox_indeter_over"]="checkbox_indeter_over.gif";
functionpreLoad(path,obj){
for(iinobj){
this[i]=newImage();
this[i].src=path+obj[i];
}
return this;
}
preb=newpreLoad("images/",ImageArray);
functionfnInit(){
varo=element;
if(o.type=="checkbox"){
var_table=window.document.createElement("TABLE");
_table.cellSpacing="0px";
_table.cellPadding="0px";
_table.border="0px";
if(o.disabled){
_table.style.filter="alpha(Opacity=50)";
}
else{
_table.style.filter="";
}
_table.style.display="inline";
var_tr=_table.insertRow();
var_td=_tr.insertCell();
if(o.checked){