function chgCB(){function chgRB(){
CHKB = document.getElementById('newCB').getElementsByTagName('input');
for(i=0; i < CHKB.length; i++){
if(CHKB[i].type == "checkbox"){
IMG = document.createElement('img');
CHKB[i].parentNode.insertBefore(IMG, CHKB[i]);
IMG.src = "radio0.gif";
if(CHKB[i].checked == true) IMG.src = "radion.gif";
if(CHKB[i].disabled == true) IMG.src = "radio.gif";
else{ // Changing state's behaviours are only applied if the box is clickable
CHKB[i].onchange = function(){
IMG = this.parentNode.getElementsByTagName('img')[0];
if(this.checked == true) IMG.src = 'radion.gif'
else IMG.src = 'radio0.gif'
}
if(!window.sidebar){
CHKB[i].parentNode.onclick = function(){
CHK = this.getElementsByTagName('input')[0];
CHK.checked = (CHK.checked == true) ? false : true;
CHK.onchange()
}
}
}
CHKB[i].style.visibility = 'hidden';
CHKB[i].style.position = 'absolute';
}
}
}
CHKB = document.getElementById('newRB').getElementsByTagName('input');
for(i=0; i < CHKB.length; i++){
if(CHKB[i].type == "radio"){
IMG = document.createElement('img');
CHKB[i].parentNode.insertBefore(IMG, CHKB[i]);
IMG.src = "radio0.gif";
IMG.id = 'img'+CHKB[i].id;
IMG.relation = CHKB[i].name;
if(CHKB[i].checked == true) IMG.src = "radion.gif";
if(CHKB[i].disabled == true) IMG.src = "radio.gif";
else{ // Changing state's behaviours are only applied if the box is clickable
CHKB[i].onchange = function(){
IMG = document.getElementById('newRB').getElementsByTagName('img');
for(i=0; i < IMG.length; i++){
if(IMG[i].relation != this.name) continue;
if(IMG[i].src.indexOf('radio.gif') != -1) continue;
if(IMG[i].id == 'img'+this.id) IMG[i].src = 'radion.gif';
else IMG[i].src = 'radio0.gif'
}
}
if(!window.sidebar){
CHKB[i].parentNode.onclick = function(){
CHK = this.getElementsByTagName('input')[0];
CHK.checked = (CHK.checked == true) ? false : true;
CHK.onchange()
}
}
}
CHKB[i].style.visibility = 'hidden';
CHKB[i].style.position = 'absolute';
}
}
}
Posted by marcosessa
Posted by marcosessa
Posted by marcosessa