function checkall(formname,checkname,thestate){ 
var el_collection=eval("document.forms."+formname+"."+checkname) 
for (c=0;c<el_collection.length;c++) 
el_collection[c].checked=thestate; 
var e = document.getElementById('buton'); 
var e2 = document.getElementById('buton2'); 
if(thestate == true){ 
e2.style.display = 'inline'; 
e.style.display = 'none'; 
} 
else { 
e.style.display = 'inline'; 
e2.style.display = 'none'; 
} 
}