y que tal algo asi
Código PHP:
<script>
function jsAddSwitch(trigger,trigger_evt,target,target_prop,value1,value2){
var tobj=document.all?eval("document.all."+trigger):document.getElementById(trigger);
var tar=document.all?eval("document.all."+target):document.getElementById(target);
tar.state=0;
eval("tar."+target_prop+"='"+value1+"'");
tobj.target=tar;
tobj.prop=target_prop;
tobj.v1=value1;
tobj.v2=value2;
eval("tobj."+trigger_evt+"=function(){ if(eval('this.target.'+this.prop)==this.v1){ eval('this.target.'+this.prop+'='+this.v2); }else{ eval('this.target.'+this.prop+'='+this.v1); } }")
}
</script>
<textarea id="t1">texto</textarea>
<hr>
<button id="master">Test</button>
<input type="checkbox" id="master2">
<div id="master3" style="background-color:#FF0000; width:100px; height:25px;">
switch3
</div>
<script>
jsAddSwitch("master","onclick","t1","disabled",false,true);
jsAddSwitch("master2","onclick","t1","disabled",false,true);
jsAddSwitch("master3","onmouseover","t1","disabled",false,true);
</script>
claro que se puede mejorar... es solo algo que se me acaba de ocurrir