// JavaScript Document
function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = theElement.checked;
	  }
     }
    }

//usage
//<form><input type="checkbox" name="check1"/>
//<br/>
//<input type="checkbox" name="check2"/>
//<br/>
//<input type="checkbox" name="check3"/>
//<br/>
//<input type="checkbox" name="check4"/>
//<br/>
//<input type="checkbox" name="check5"/>
//<br/>
//<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>select/unselect</form>