Index: avail.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/avail.c,v
retrieving revision 1.50
diff -u -r1.50 avail.c
--- avail.c	23 Jun 2008 20:47:42 -0000	1.50
+++ avail.c	28 Sep 2008 05:22:57 -0000
@@ -523,11 +523,11 @@
 			printf("<input type='hidden' name='assumestatesduringnotrunning' value='%s'>\n",(assume_states_during_notrunning==TRUE)?"yes":"no");
 			printf("<input type='hidden' name='includesoftstates' value='%s'>\n",(include_soft_states==TRUE)?"yes":"no");
 
-			printf("<tr><td valign=top align=left class='optBoxItem'>First assumed %s state:</td><td valign=top align=left class='optBoxItem'>%s</td></tr>\n",(display_type==DISPLAY_SERVICE_AVAIL)?"service":"host",(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_HOSTGROUP_AVAIL || display_type==DISPLAY_SERVICEGROUP_AVAIL)?"First assumed service state":"");
+			printf("<tr><td valign=top align=left class='optBoxItem'><label for='initialassumed%sstate'>First assumed %s state</label></td><td valign=top align=left class='optBoxItem'>%s</td></tr>\n",(display_type==DISPLAY_SERVICE_AVAIL)?"service":"host",,(display_type==DISPLAY_SERVICE_AVAIL)?"service":"host",(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_HOSTGROUP_AVAIL || display_type==DISPLAY_SERVICEGROUP_AVAIL)?"<label for='initialassumedservicestate'>First assumed service state</label>":"");
 			printf("<tr>\n");
 			printf("<td valign=top align=left class='optBoxItem'>\n");
 			if(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_HOSTGROUP_AVAIL || display_type==DISPLAY_SERVICEGROUP_AVAIL){
-				printf("<select name='initialassumedhoststate'>\n");
+				printf("<select name='initialassumedhoststate' id='initialassumedhoststate'>\n");
 				printf("<option value=%d %s>Unspecified\n",AS_NO_DATA,(initial_assumed_host_state==AS_NO_DATA)?"SELECTED":"");
 				printf("<option value=%d %s>Current State\n",AS_CURRENT_STATE,(initial_assumed_host_state==AS_CURRENT_STATE)?"SELECTED":"");
 				printf("<option value=%d %s>Host Up\n",AS_HOST_UP,(initial_assumed_host_state==AS_HOST_UP)?"SELECTED":"");
@@ -537,7 +537,7 @@
 			        }
 			else{
 				printf("<input type='hidden' name='initialassumedhoststate' value='%d'>",initial_assumed_host_state);
-				printf("<select name='initialassumedservicestate'>\n");
+				printf("<select name='initialassumedservicestate' id='initialassumedservicestate'>\n");
 				printf("<option value=%d %s>Unspecified\n",AS_NO_DATA,(initial_assumed_service_state==AS_NO_DATA)?"SELECTED":"");
 				printf("<option value=%d %s>Current State\n",AS_CURRENT_STATE,(initial_assumed_service_state==AS_CURRENT_STATE)?"SELECTED":"");
 				printf("<option value=%d %s>Service Ok\n",AS_SVC_OK,(initial_assumed_service_state==AS_SVC_OK)?"SELECTED":"");
@@ -549,7 +549,7 @@
 			printf("</td>\n");
 			printf("<td CLASS='optBoxItem'>\n");
 			if(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_HOSTGROUP_AVAIL || display_type==DISPLAY_SERVICEGROUP_AVAIL){
-				printf("<select name='initialassumedservicestate'>\n");
+				printf("<select name='initialassumedservicestate' id='initialassumedservicestate'>\n");
 				printf("<option value=%d %s>Unspecified\n",AS_NO_DATA,(initial_assumed_service_state==AS_NO_DATA)?"SELECTED":"");
 				printf("<option value=%d %s>Current State\n",AS_CURRENT_STATE,(initial_assumed_service_state==AS_CURRENT_STATE)?"SELECTED":"");
 				printf("<option value=%d %s>Service Ok\n",AS_SVC_OK,(initial_assumed_service_state==AS_SVC_OK)?"SELECTED":"");
@@ -561,10 +561,10 @@
 			printf("</td>\n");
 			printf("</tr>\n");
 
-			printf("<tr><td valign=top align=left class='optBoxItem'>Report period:</td><td valign=top align=left class='optBoxItem'>Backtracked archives:</td></tr>\n");
+			printf("<tr><td valign=top align=left class='optBoxItem'><label for='timeperiod'>Report period:</label></td><td valign=top align=left class='optBoxItem'><label for='backtrack'>Backtracked archives:</label></td></tr>\n");
 			printf("<tr>\n");
 			printf("<td valign=top align=left class='optBoxItem'>\n");
-			printf("<select name='timeperiod'>\n");
+			printf("<select name='timeperiod' id='timeperiod'>\n");
 			printf("<option SELECTED>[ Current time range ]\n");
 			printf("<option value=today %s>Today\n",(timeperiod_type==TIMEPERIOD_TODAY)?"SELECTED":"");
 			printf("<option value=last24hours %s>Last 24 Hours\n",(timeperiod_type==TIMEPERIOD_LAST24HOURS)?"SELECTED":"");
@@ -580,7 +580,7 @@
 			printf("</select>\n");
 			printf("</td>\n");
 			printf("<td valign=top align=left CLASS='optBoxItem'>\n");
-			printf("<input type='text' size='2' maxlength='2' name='backtrack' value='%d'>\n",backtrack_archives);
+			printf("<input type='text' size='2' maxlength='2' name='backtrack' id='backtrack' value='%d'>\n",backtrack_archives);
 			printf("</td>\n");
 			printf("</tr>\n");
 
@@ -656,9 +656,9 @@
 		printf("<table border=0 cellpadding=5>\n");
 
 		printf("<tr>");
-		printf("<td valign=top class='reportSelectSubTitle'>Report Period:</td>\n");
+		printf("<td valign=top class='reportSelectSubTitle'><label for='timeperiod'>Report Period:</label></td>\n");
 		printf("<td valign=top align=left class='optBoxItem'>\n");
-		printf("<select name='timeperiod'>\n");
+		printf("<select name='timeperiod' id='timeperiod'>\n");
 		printf("<option value=today>Today\n");
 		printf("<option value=last24hours>Last 24 Hours\n");
 		printf("<option value=yesterday>Yesterday\n");
@@ -678,9 +678,9 @@
 		printf("<tr><td valign=top class='reportSelectSubTitle'>If Custom Report Period...</td></tr>\n");
 
 		printf("<tr>");
-		printf("<td valign=top class='reportSelectSubTitle'>Start Date (Inclusive):</td>\n");
+		printf("<td valign=top class='reportSelectSubTitle'><label for='smon'>Start Date (Inclusive):</label></td>\n");
 		printf("<td align=left valign=top class='reportSelectItem'>");
-		printf("<select name='smon'>\n");
+		printf("<select name='smon' id='smon'>\n");
 		printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 		printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 		printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -703,9 +703,9 @@
 		printf("</tr>\n");
 
 		printf("<tr>");
-		printf("<td valign=top class='reportSelectSubTitle'>End Date (Inclusive):</td>\n");
+		printf("<td valign=top class='reportSelectSubTitle'><label for='emon'>End Date (Inclusive):</label></td>\n");
 		printf("<td align=left valign=top class='reportSelectItem'>");
-		printf("<select name='emon'>\n");
+		printf("<select name='emon' id='emon'>\n");
 		printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 		printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 		printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -730,9 +730,9 @@
 		printf("<tr><td colspan=2><br></td></tr>\n");
 
 		printf("<tr>");
-		printf("<td valign=top class='reportSelectSubTitle'>Report time Period:</td>\n");
+		printf("<td valign=top class='reportSelectSubTitle'><label for='rpttimeperiod'>Report time Period:</label></td>\n");
 		printf("<td valign=top align=left class='optBoxItem'>\n");
-		printf("<select name='rpttimeperiod'>\n");
+		printf("<select name='rpttimeperiod' id='rpttimeperiod'>\n");
 		printf("<option value=\"\">None\n");
 		/* check all the time periods... */
 		for(temp_timeperiod=timeperiod_list;temp_timeperiod!=NULL;temp_timeperiod=temp_timeperiod->next)
@@ -742,42 +742,42 @@
 		printf("</tr>\n");
 		printf("<tr><td colspan=2><br></td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Assume Initial States:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='assumeinitialstates'>Assume Initial States:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='assumeinitialstates'>\n");
+		printf("<select name='assumeinitialstates' id='assumeinitialstates'>\n");
 		printf("<option value=yes>Yes\n");
 		printf("<option value=no>No\n");
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Assume State Retention:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='assumestateretention'>Assume State Retention:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='assumestateretention'>\n");
+		printf("<select name='assumestateretention' id='assumestateretention'>\n");
 		printf("<option value=yes>Yes\n");
 		printf("<option value=no>No\n");
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Assume States During Program Downtime:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='assumestatesduringnotrunning'>Assume States During Program Downtime:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='assumestatesduringnotrunning'>\n");
+		printf("<select name='assumestatesduringnotrunning' id='assumestatesduringnotrunning'>\n");
 		printf("<option value=yes>Yes\n");
 		printf("<option value=no>No\n");
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Include Soft States:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='includesoftstates'>Include Soft States:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='includesoftstates'>\n");
+		printf("<select name='includesoftstates' id='includesoftstates'>\n");
 		printf("<option value=yes>Yes\n");
 		printf("<option value=no SELECTED>No\n");
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
 		if(display_type!=DISPLAY_SERVICE_AVAIL){
-			printf("<tr><td class='reportSelectSubTitle' align=right>First Assumed Host State:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='initialassumedhoststate'>First Assumed Host State:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='initialassumedhoststate'>\n");
+			printf("<select name='initialassumedhoststate' id='initialassumedhoststate'>\n");
 			printf("<option value=%d>Unspecified\n",AS_NO_DATA);
 			printf("<option value=%d>Current State\n",AS_CURRENT_STATE);
 			printf("<option value=%d>Host Up\n",AS_HOST_UP);
@@ -787,9 +787,9 @@
 			printf("</td></tr>\n");
 		        }
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>First Assumed Service State:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='initialassumedservicestate'>First Assumed Service State:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='initialassumedservicestate'>\n");
+		printf("<select name='initialassumedservicestate' id='initialassumedservicestate'>\n");
 		printf("<option value=%d>Unspecified\n",AS_NO_DATA);
 		printf("<option value=%d>Current State\n",AS_CURRENT_STATE);
 		printf("<option value=%d>Service Ok\n",AS_SVC_OK);
@@ -799,16 +799,16 @@
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Backtracked Archives (To Scan For Initial States):</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='backtrack'>Backtracked Archives (To Scan For Initial States):</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<input type='text' name='backtrack' size='2' maxlength='2' value='%d'>\n",backtrack_archives);
+		printf("<input type='text' name='backtrack' id='backtrack' size='2' maxlength='2' value='%d'>\n",backtrack_archives);
 		printf("</td></tr>\n");
 
 		if((display_type==DISPLAY_HOST_AVAIL && show_all_hosts==TRUE) || (display_type==DISPLAY_SERVICE_AVAIL && show_all_services==TRUE)){
 			printf("<tr>");
-			printf("<td valign=top class='reportSelectSubTitle'>Output in CSV Format:</td>\n");
+			printf("<td valign=top class='reportSelectSubTitle'><label for='csvoutput'>Output in CSV Format:</label></td>\n");
 			printf("<td valign=top class='reportSelectItem'>");
-			printf("<input type='checkbox' name='csvoutput' value=''>\n");
+			printf("<input type='checkbox' name='csvoutput' id='csvoutput' value=''>\n");
 			printf("</td>\n");
 			printf("</tr>\n");
 		        }
@@ -833,8 +833,8 @@
 
 		printf("<table border=0 cellpadding=5>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' valign=center>Hostgroup(s):</td><td align=left valign=center class='reportSelectItem'>\n");
-		printf("<select name='hostgroup'>\n");
+		printf("<tr><td class='reportSelectSubTitle' valign=center><label for='hostgroup'>Hostgroup(s):</label></td><td align=left valign=center class='reportSelectItem'>\n");
+		printf("<select name='hostgroup' id='hostgroup'>\n");
 		printf("<option value='all'>** ALL HOSTGROUPS **\n");
 		for(temp_hostgroup=hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){
 			if(is_authorized_for_hostgroup(temp_hostgroup,&current_authdata)==TRUE)
@@ -863,8 +863,8 @@
 
 		printf("<table border=0 cellpadding=5>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' valign=center>Host(s):</td><td align=left valign=center class='reportSelectItem'>\n");
-		printf("<select name='host'>\n");
+		printf("<tr><td class='reportSelectSubTitle' valign=center><label for='host'>Host(s):</label></td><td align=left valign=center class='reportSelectItem'>\n");
+		printf("<select name='host' id='host'>\n");
 		printf("<option value='all'>** ALL HOSTS **\n");
 		for(temp_host=host_list;temp_host!=NULL;temp_host=temp_host->next){
 			if(is_authorized_for_host(temp_host,&current_authdata)==TRUE)
@@ -895,8 +895,8 @@
 
 		printf("<table border=0 cellpadding=5>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' valign=center>Servicegroup(s):</td><td align=left valign=center class='reportSelectItem'>\n");
-		printf("<select name='servicegroup'>\n");
+		printf("<tr><td class='reportSelectSubTitle' valign=center><label for='servicegroup'>Servicegroup(s):</label></td><td align=left valign=center class='reportSelectItem'>\n");
+		printf("<select name='servicegroup' id='servicegroup'>\n");
 		printf("<option value='all'>** ALL SERVICEGROUPS **\n");
 		for(temp_servicegroup=servicegroup_list;temp_servicegroup!=NULL;temp_servicegroup=temp_servicegroup->next){
 			if(is_authorized_for_servicegroup(temp_servicegroup,&current_authdata)==TRUE)
@@ -945,8 +945,8 @@
 
 		printf("<table border=0 cellpadding=5>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' valign=center>Service(s):</td><td align=left valign=center class='reportSelectItem'>\n");
-		printf("<select name='service' onFocus='document.serviceform.host.value=gethostname(this.selectedIndex);' onChange='document.serviceform.host.value=gethostname(this.selectedIndex);'>\n");
+		printf("<tr><td class='reportSelectSubTitle' valign=center><label for='service'>Service(s):</label></td><td align=left valign=center class='reportSelectItem'>\n");
+		printf("<select name='service' id='service' onFocus='document.serviceform.host.value=gethostname(this.selectedIndex);' onChange='document.serviceform.host.value=gethostname(this.selectedIndex);'>\n");
 		printf("<option value='all'>** ALL SERVICES **\n");
 		for(temp_service=service_list;temp_service!=NULL;temp_service=temp_service->next){
 			if(is_authorized_for_service(temp_service,&current_authdata)==TRUE)
@@ -1032,9 +1032,9 @@
 
 		printf("<table border=0 cellpadding=5>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Type:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='report_type'>Type:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='report_type'>\n");
+		printf("<select name='report_type' id='report_type'>\n");
 		printf("<option value=hostgroups>Hostgroup(s)\n");
 		printf("<option value=hosts>Host(s)\n");
 		printf("<option value=servicegroups>Servicegroup(s)\n");
Index: cmd.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/cmd.c,v
retrieving revision 1.42
diff -u -r1.42 cmd.c
--- cmd.c	19 May 2008 18:42:26 -0000	1.42
+++ cmd.c	28 Sep 2008 05:22:57 -0000
@@ -937,99 +937,99 @@
 
 	case CMD_ADD_HOST_COMMENT:
 	case CMD_ACKNOWLEDGE_HOST_PROBLEM:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' id='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
 		if(cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM){
-			printf("<tr><td CLASS='optBoxItem'>Sticky Acknowledgement:</td><td><b>");
-			printf("<INPUT TYPE='checkbox' NAME='sticky_ack' CHECKED>");
+			printf("<tr><td CLASS='optBoxItem'><label for='sticky_ack'>Sticky Acknowledgement:</label></td><td><b>");
+			printf("<INPUT TYPE='checkbox' NAME='sticky_ack' id='sticky_ack' CHECKED>");
 			printf("</b></td></tr>\n");
-			printf("<tr><td CLASS='optBoxItem'>Send Notification:</td><td><b>");
-			printf("<INPUT TYPE='checkbox' NAME='send_notification' CHECKED>");
+			printf("<tr><td CLASS='optBoxItem'><label for='send_notification'>Send Notification:</label></td><td><b>");
+			printf("<INPUT TYPE='checkbox' NAME='send_notification' id='send_notification' CHECKED>");
 			printf("</b></td></tr>\n");
 		        }
-		printf("<tr><td CLASS='optBoxItem'>Persistent%s:</td><td><b>",(cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM)?" Comment":"");
-		printf("<INPUT TYPE='checkbox' NAME='persistent' %s>",(cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM)?"":"CHECKED");
+		printf("<tr><td CLASS='optBoxItem'><label for='persistent'>Persistent%s:</label></td><td><b>",(cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM)?" Comment":"");
+		printf("<INPUT TYPE='checkbox' NAME='persistent' id='persistent' %s>",(cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM)?"":"CHECKED");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_author'>Author (Your Name):</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_author' id='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_data'>Comment:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_data' id='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
 		printf("</b></td></tr>\n");
 		break;
 		
 	case CMD_ADD_SVC_COMMENT:
 	case CMD_ACKNOWLEDGE_SVC_PROBLEM:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' id='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Service:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='service'>Service:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='service' id='service' VALUE='%s'>",service_desc);
 		if(cmd==CMD_ACKNOWLEDGE_SVC_PROBLEM){
-			printf("<tr><td CLASS='optBoxItem'>Sticky Acknowledgement:</td><td><b>");
-			printf("<INPUT TYPE='checkbox' NAME='sticky_ack' CHECKED>");
+			printf("<tr><td CLASS='optBoxItem'><label for='sticky_ack'>Sticky Acknowledgement:</label></td><td><b>");
+			printf("<INPUT TYPE='checkbox' NAME='sticky_ack' id='sticky_ack' CHECKED>");
 			printf("</b></td></tr>\n");
-			printf("<tr><td CLASS='optBoxItem'>Send Notification:</td><td><b>");
-			printf("<INPUT TYPE='checkbox' NAME='send_notification' CHECKED>");
+			printf("<tr><td CLASS='optBoxItem'><label for='send_notification'>Send Notification:</label></td><td><b>");
+			printf("<INPUT TYPE='checkbox' NAME='send_notification' id='send_notification' CHECKED>");
 			printf("</b></td></tr>\n");
 		        }
-		printf("<tr><td CLASS='optBoxItem'>Persistent%s:</td><td><b>",(cmd==CMD_ACKNOWLEDGE_SVC_PROBLEM)?" Comment":"");
-		printf("<INPUT TYPE='checkbox' NAME='persistent' %s",(cmd==CMD_ACKNOWLEDGE_SVC_PROBLEM)?"":"CHECKED");
+		printf("<tr><td CLASS='optBoxItem'><label for='persistent'>Persistent%s:</label></td><td><b>",(cmd==CMD_ACKNOWLEDGE_SVC_PROBLEM)?" Comment":"");
+		printf("<INPUT TYPE='checkbox' NAME='persistent' id='persistent' %s",(cmd==CMD_ACKNOWLEDGE_SVC_PROBLEM)?"":"CHECKED");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_author'>Author (Your Name):</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_author' id='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_data'>Comment:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_data' id='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
 		printf("</b></td></tr>\n");
 		break;
 
 	case CMD_DEL_HOST_COMMENT:
 	case CMD_DEL_SVC_COMMENT:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Comment ID:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_id' VALUE='%lu'>",comment_id);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_id'>Comment ID:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_id' id='com_id' VALUE='%lu'>",comment_id);
 		printf("</b></td></tr>\n");
 		break;
 		
 	case CMD_DELAY_HOST_NOTIFICATION:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Notification Delay (minutes from now):</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='not_dly' VALUE='%d'>",notification_delay);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='not_dly'>Notification Delay (minutes from now):</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='not_dly' ID='not_dly' VALUE='%d'>",notification_delay);
 		printf("</b></td></tr>\n");
 		break;
 
 	case CMD_DELAY_SVC_NOTIFICATION:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Service:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
-		printf("<tr><td CLASS='optBoxRequiredItem'>Notification Delay (minutes from now):</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='not_dly' VALUE='%d'>",notification_delay);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='service'>Service:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='service' ID='service' VALUE='%s'>",service_desc);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='not_dly'>Notification Delay (minutes from now):</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='not_dly' ID='not_dly' VALUE='%d'>",notification_delay);
 		printf("</b></td></tr>\n");
 		break;
 
 	case CMD_SCHEDULE_SVC_CHECK:
 	case CMD_SCHEDULE_HOST_CHECK:
 	case CMD_SCHEDULE_HOST_SVC_CHECKS:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
 		if(cmd==CMD_SCHEDULE_SVC_CHECK){
-			printf("<tr><td CLASS='optBoxRequiredItem'>Service:</td><td><b>");
-			printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
+			printf("<tr><td CLASS='optBoxRequiredItem'><label for='service'>Service:</label></td><td><b>");
+			printf("<INPUT TYPE='TEXT' NAME='service' ID='service' VALUE='%s'>",service_desc);
 			printf("</b></td></tr>\n");
 		        }
 		time(&t);
 		get_time_string(&t,buffer,sizeof(buffer)-1,SHORT_DATE_TIME);
-		printf("<tr><td CLASS='optBoxRequiredItem'>Check Time:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='start_time' VALUE='%s'>",buffer);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='start_time'>Check Time:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='start_time' ID='start_time' VALUE='%s'>",buffer);
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxItem'>Force Check:</td><td><b>");
-		printf("<INPUT TYPE='checkbox' NAME='force_check' %s>",(force_check==TRUE)?"CHECKED":"");
+		printf("<tr><td CLASS='optBoxItem'><label for='force_check'>Force Check:</label></td><td><b>");
+		printf("<INPUT TYPE='checkbox' NAME='force_check' ID='force_check' %s>",(force_check==TRUE)?"CHECKED":"");
 		printf("</b></td></tr>\n");
 		break;
 
@@ -1047,11 +1047,11 @@
 	case CMD_DISABLE_SVC_FLAP_DETECTION:
 	case CMD_START_OBSESSING_OVER_SVC:
 	case CMD_STOP_OBSESSING_OVER_SVC:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Service:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='service'>Service:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='service' ID='service' VALUE='%s'>",service_desc);
 		printf("</b></td></tr>\n");
 		break;
 		
@@ -1075,17 +1075,17 @@
 	case CMD_DISABLE_PASSIVE_HOST_CHECKS:
 	case CMD_START_OBSESSING_OVER_HOST:
 	case CMD_STOP_OBSESSING_OVER_HOST:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
 		if(cmd==CMD_ENABLE_HOST_SVC_CHECKS || cmd==CMD_DISABLE_HOST_SVC_CHECKS || cmd==CMD_ENABLE_HOST_SVC_NOTIFICATIONS || cmd==CMD_DISABLE_HOST_SVC_NOTIFICATIONS){
-			printf("<tr><td CLASS='optBoxItem'>%s For Host Too:</td><td><b>",(cmd==CMD_ENABLE_HOST_SVC_CHECKS || cmd==CMD_ENABLE_HOST_SVC_NOTIFICATIONS)?"Enable":"Disable");
-			printf("<INPUT TYPE='checkbox' NAME='ahas'>");
+			printf("<tr><td CLASS='optBoxItem'><label for='ahas'>%s For Host Too:</label></td><td><b>",(cmd==CMD_ENABLE_HOST_SVC_CHECKS || cmd==CMD_ENABLE_HOST_SVC_NOTIFICATIONS)?"Enable":"Disable");
+			printf("<INPUT TYPE='checkbox' NAME='ahas' ID='ahas'>");
 			printf("</b></td></tr>\n");
 		        }
 		if(cmd==CMD_ENABLE_HOST_NOTIFICATIONS || cmd==CMD_DISABLE_HOST_NOTIFICATIONS){
-			printf("<tr><td CLASS='optBoxItem'>%s Notifications For Child Hosts Too:</td><td><b>",(cmd==CMD_ENABLE_HOST_NOTIFICATIONS)?"Enable":"Disable");
-			printf("<INPUT TYPE='checkbox' NAME='ptc'>");
+			printf("<tr><td CLASS='optBoxItem'><label for='ptc'>%s Notifications For Child Hosts Too:</label></td><td><b>",(cmd==CMD_ENABLE_HOST_NOTIFICATIONS)?"Enable":"Disable");
+			printf("<INPUT TYPE='checkbox' NAME='ptc' ID='ptc'>");
 			printf("</b></td></tr>\n");
 		        }
 		break;
@@ -1119,16 +1119,16 @@
 		
 	case CMD_PROCESS_HOST_CHECK_RESULT:
 	case CMD_PROCESS_SERVICE_CHECK_RESULT:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
 		if(cmd==CMD_PROCESS_SERVICE_CHECK_RESULT){
-			printf("<tr><td CLASS='optBoxRequiredItem'>Service:</td><td><b>");
-			printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
+			printf("<tr><td CLASS='optBoxRequiredItem'><label for='service'>Service:</label></td><td><b>");
+			printf("<INPUT TYPE='TEXT' NAME='service' ID='service' VALUE='%s'>",service_desc);
 			printf("</b></td></tr>\n");
 		        }
-		printf("<tr><td CLASS='optBoxRequiredItem'>Check Result:</td><td><b>");
-		printf("<SELECT NAME='plugin_state'>");
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='plugin_state'>Check Result:</label></td><td><b>");
+		printf("<SELECT NAME='plugin_state' ID='plugin_state'>");
 		if(cmd==CMD_PROCESS_SERVICE_CHECK_RESULT){
 			printf("<OPTION VALUE=%d SELECTED>OK\n",STATE_OK);
 			printf("<OPTION VALUE=%d>WARNING\n",STATE_WARNING);
@@ -1142,35 +1142,35 @@
 		        }
 		printf("</SELECT>\n");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Check Output:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='plugin_output' VALUE=''>");
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='plugin_output'>Check Output:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='plugin_output' ID='plugin_output' VALUE=''>");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxItem'>Performance Data:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='performance_data' VALUE=''>");
+		printf("<tr><td CLASS='optBoxItem'><label for='performance_data'>Performance Data:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='performance_data' ID='performance_data' VALUE=''>");
 		printf("</b></td></tr>\n");
 		break;
 		
 	case CMD_SCHEDULE_HOST_DOWNTIME:
 	case CMD_SCHEDULE_SVC_DOWNTIME:
 
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
 		if(cmd==CMD_SCHEDULE_SVC_DOWNTIME){
-			printf("<tr><td CLASS='optBoxRequiredItem'>Service:</td><td><b>");
-			printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
+			printf("<tr><td CLASS='optBoxRequiredItem'><label for='service'>Service:</label></td><td><b>");
+			printf("<INPUT TYPE='TEXT' NAME='service' ID='service' VALUE='%s'>",service_desc);
 		        }
-		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_author'>Author (Your Name):</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_author' ID='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_data'>Comment:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_data' ID='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
 		printf("</b></td></tr>\n");
 
 		printf("<tr><td CLASS='optBoxItem'><br></td></tr>\n");
 
-		printf("<tr><td CLASS='optBoxItem'>Triggered By:</td><td>\n");
-		printf("<select name='trigger'>\n");
+		printf("<tr><td CLASS='optBoxItem'><label for='trigger'>Triggered By:</label></td><td>\n");
+		printf("<select name='trigger' id='trigger'>\n");
 		printf("<option value='0'>N/A\n");
 
 		for(temp_downtime=scheduled_downtime_list;temp_downtime!=NULL;temp_downtime=temp_downtime->next){
@@ -1195,16 +1195,16 @@
 
 		time(&t);
 		get_time_string(&t,buffer,sizeof(buffer)-1,SHORT_DATE_TIME);
-		printf("<tr><td CLASS='optBoxRequiredItem'>Start Time:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='start_time' VALUE='%s'>",buffer);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='start_time'>Start Time:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='start_time' ID='start_time' VALUE='%s'>",buffer);
 		printf("</b></td></tr>\n");
 		t+=(unsigned long)7200;
 		get_time_string(&t,buffer,sizeof(buffer)-1,SHORT_DATE_TIME);
-		printf("<tr><td CLASS='optBoxRequiredItem'>End Time:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='end_time' VALUE='%s'>",buffer);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='end_time'>End Time:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='end_time' ID='end_time' VALUE='%s'>",buffer);
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxItem'>Type:</td><td><b>");
-		printf("<SELECT NAME='fixed'>");
+		printf("<tr><td CLASS='optBoxItem'><label for='fixed'>Type:</label></td><td><b>");
+		printf("<SELECT NAME='fixed' ID='fixed'>");
 		printf("<OPTION VALUE=1>Fixed\n");
 		printf("<OPTION VALUE=0>Flexible\n");
 		printf("</SELECT>\n");
@@ -1212,18 +1212,18 @@
 
 		printf("<tr><td CLASS='optBoxItem'>If Flexible, Duration:</td><td>");
 		printf("<table border=0><tr>\n");
-		printf("<td align=right><INPUT TYPE='TEXT' NAME='hours' VALUE='2' SIZE=2 MAXLENGTH=2></td>\n");
-		printf("<td align=left>Hours</td>\n");
-		printf("<td align=right><INPUT TYPE='TEXT' NAME='minutes' VALUE='0' SIZE=2 MAXLENGTH=2></td>\n");
-		printf("<td align=left>Minutes</td>\n");
+		printf("<td align=right><INPUT TYPE='TEXT' NAME='hours' ID='hours' VALUE='2' SIZE=2 MAXLENGTH=2></td>\n");
+		printf("<td align=left><label for='hours'>Hours</label></td>\n");
+		printf("<td align=right><INPUT TYPE='TEXT' NAME='minutes' ID='minutes' VALUE='0' SIZE=2 MAXLENGTH=2></td>\n");
+		printf("<td align=left><label for='minutes'>Minutes</label></td>\n");
 		printf("</tr></table>\n");
 		printf("</td></tr>\n");
 
 		printf("<tr><td CLASS='optBoxItem'><br></td></tr>\n");
 
 		if(cmd==CMD_SCHEDULE_HOST_DOWNTIME){
-			printf("<tr><td CLASS='optBoxItem'>Child Hosts:</td><td><b>");
-			printf("<SELECT name='childoptions'>");
+			printf("<tr><td CLASS='optBoxItem'><label for='childoptions'>Child Hosts:</label></td><td><b>");
+			printf("<SELECT name='childoptions' id='childoptions'>");
 			printf("<option value='0'>Do nothing with child hosts\n");
 			printf("<option value='1'>Schedule triggered downtime for all child hosts\n");
 			printf("<option value='2'>Schedule non-triggered downtime for all child hosts\n");
@@ -1241,12 +1241,12 @@
 	case CMD_DISABLE_HOSTGROUP_HOST_NOTIFICATIONS:
 	case CMD_ENABLE_HOSTGROUP_SVC_CHECKS:
 	case CMD_DISABLE_HOSTGROUP_SVC_CHECKS:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Hostgroup Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='hostgroup' VALUE='%s'>",hostgroup_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='hostgroup'>Hostgroup Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='hostgroup' ID='hostgroup' VALUE='%s'>",hostgroup_name);
 		printf("</b></td></tr>\n");
 		if(cmd==CMD_ENABLE_HOSTGROUP_SVC_CHECKS || cmd==CMD_DISABLE_HOSTGROUP_SVC_CHECKS || cmd==CMD_ENABLE_HOSTGROUP_SVC_NOTIFICATIONS || cmd==CMD_DISABLE_HOSTGROUP_SVC_NOTIFICATIONS){
-			printf("<tr><td CLASS='optBoxItem'>%s For Hosts Too:</td><td><b>",(cmd==CMD_ENABLE_HOSTGROUP_SVC_CHECKS || cmd==CMD_ENABLE_HOSTGROUP_SVC_NOTIFICATIONS)?"Enable":"Disable");
-			printf("<INPUT TYPE='checkbox' NAME='ahas'>");
+			printf("<tr><td CLASS='optBoxItem'><label for='ahas'>%s For Hosts Too:</label></td><td><b>",(cmd==CMD_ENABLE_HOSTGROUP_SVC_CHECKS || cmd==CMD_ENABLE_HOSTGROUP_SVC_NOTIFICATIONS)?"Enable":"Disable");
+			printf("<INPUT TYPE='checkbox' NAME='ahas' ID='ahas'>");
 			printf("</b></td></tr>\n");
 		        }
 		break;
@@ -1257,20 +1257,20 @@
 	case CMD_DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS:
 	case CMD_ENABLE_SERVICEGROUP_SVC_CHECKS:
 	case CMD_DISABLE_SERVICEGROUP_SVC_CHECKS:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Servicegroup Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='servicegroup' VALUE='%s'>",servicegroup_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='servicegroup'>Servicegroup Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='servicegroup' ID='servicegroup' VALUE='%s'>",servicegroup_name);
 		printf("</b></td></tr>\n");
 		if(cmd==CMD_ENABLE_SERVICEGROUP_SVC_CHECKS || cmd==CMD_DISABLE_SERVICEGROUP_SVC_CHECKS || cmd==CMD_ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS || cmd==CMD_DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS){
-			printf("<tr><td CLASS='optBoxItem'>%s For Hosts Too:</td><td><b>",(cmd==CMD_ENABLE_SERVICEGROUP_SVC_CHECKS || cmd==CMD_ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS)?"Enable":"Disable");
-			printf("<INPUT TYPE='checkbox' NAME='ahas'>");
+			printf("<tr><td CLASS='optBoxItem'><label for='ahas'>%s For Hosts Too:</label></td><td><b>",(cmd==CMD_ENABLE_SERVICEGROUP_SVC_CHECKS || cmd==CMD_ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS)?"Enable":"Disable");
+			printf("<INPUT TYPE='checkbox' NAME='ahas' ID='ahas'>");
 			printf("</b></td></tr>\n");
 		        }
 		break;
 		
 	case CMD_DEL_HOST_DOWNTIME:
 	case CMD_DEL_SVC_DOWNTIME:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Scheduled Downtime ID:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='down_id' VALUE='%lu'>",downtime_id);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='down_id'>Scheduled Downtime ID:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='down_id' ID='down_id' VALUE='%lu'>",downtime_id);
 		printf("</b></td></tr>\n");
 		break;
 
@@ -1281,33 +1281,33 @@
 	case CMD_SCHEDULE_SERVICEGROUP_SVC_DOWNTIME:
 
 		if(cmd==CMD_SCHEDULE_HOSTGROUP_HOST_DOWNTIME || cmd==CMD_SCHEDULE_HOSTGROUP_SVC_DOWNTIME){
-			printf("<tr><td CLASS='optBoxRequiredItem'>Hostgroup Name:</td><td><b>");
-			printf("<INPUT TYPE='TEXT' NAME='hostgroup' VALUE='%s'>",hostgroup_name);
+			printf("<tr><td CLASS='optBoxRequiredItem'><label for='hostgroup'>Hostgroup Name:</label></td><td><b>");
+			printf("<INPUT TYPE='TEXT' NAME='hostgroup' ID='hostgroup' VALUE='%s'>",hostgroup_name);
 			printf("</b></td></tr>\n");
 		        }
 		else{
-			printf("<tr><td CLASS='optBoxRequiredItem'>Servicegroup Name:</td><td><b>");
-			printf("<INPUT TYPE='TEXT' NAME='servicegroup' VALUE='%s'>",servicegroup_name);
+			printf("<tr><td CLASS='optBoxRequiredItem'><label for='servicegroup'>Servicegroup Name:</label></td><td><b>");
+			printf("<INPUT TYPE='TEXT' NAME='servicegroup' ID='servicegroup' VALUE='%s'>",servicegroup_name);
 			printf("</b></td></tr>\n");
 		        }
-		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_author'>Author (Your Name):</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_author' ID='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_data'>Comment:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_data' ID='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
 		printf("</b></td></tr>\n");
 		time(&t);
 		get_time_string(&t,buffer,sizeof(buffer)-1,SHORT_DATE_TIME);
-		printf("<tr><td CLASS='optBoxRequiredItem'>Start Time:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='start_time' VALUE='%s'>",buffer);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='start_time'>Start Time:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='start_time' ID='start_time' VALUE='%s'>",buffer);
 		printf("</b></td></tr>\n");
 		t+=(unsigned long)7200;
 		get_time_string(&t,buffer,sizeof(buffer)-1,SHORT_DATE_TIME);
-		printf("<tr><td CLASS='optBoxRequiredItem'>End Time:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='end_time' VALUE='%s'>",buffer);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='end_time'>End Time:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='end_time' ID='end_time' VALUE='%s'>",buffer);
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxItem'>Type:</td><td><b>");
-		printf("<SELECT NAME='fixed'>");
+		printf("<tr><td CLASS='optBoxItem'><label for='fixed'>Type:</label></td><td><b>");
+		printf("<SELECT NAME='fixed' ID='fixed'>");
 		printf("<OPTION VALUE=1>Fixed\n");
 		printf("<OPTION VALUE=0>Flexible\n");
 		printf("</SELECT>\n");
@@ -1315,44 +1315,44 @@
 
 		printf("<tr><td CLASS='optBoxItem'>If Flexible, Duration:</td><td>");
 		printf("<table border=0><tr>\n");
-		printf("<td align=right><INPUT TYPE='TEXT' NAME='hours' VALUE='2' SIZE=2 MAXLENGTH=2></td>\n");
-		printf("<td align=left>Hours</td>\n");
-		printf("<td align=right><INPUT TYPE='TEXT' NAME='minutes' VALUE='0' SIZE=2 MAXLENGTH=2></td>\n");
-		printf("<td align=left>Minutes</td>\n");
+		printf("<td align=right><INPUT TYPE='TEXT' NAME='hours' ID='hours' VALUE='2' SIZE=2 MAXLENGTH=2></td>\n");
+		printf("<td align=left><label for='hours'>Hours</label></td>\n");
+		printf("<td align=right><INPUT TYPE='TEXT' NAME='minutes' ID='minutes' VALUE='0' SIZE=2 MAXLENGTH=2></td>\n");
+		printf("<td align=left><label for='minutes'>Minutes</label></td>\n");
 		printf("</tr></table>\n");
 		printf("</td></tr>\n");
 		if(cmd==CMD_SCHEDULE_HOSTGROUP_SVC_DOWNTIME || cmd==CMD_SCHEDULE_SERVICEGROUP_SVC_DOWNTIME){
-			printf("<tr><td CLASS='optBoxItem'>Schedule Downtime For Hosts Too:</td><td><b>");
-			printf("<INPUT TYPE='checkbox' NAME='ahas'>");
+			printf("<tr><td CLASS='optBoxItem'><label for='ahas'>Schedule Downtime For Hosts Too:</label></td><td><b>");
+			printf("<INPUT TYPE='checkbox' NAME='ahas' ID='ahas'>");
 			printf("</b></td></tr>\n");
 		        }
 		break;
 
 	case CMD_SEND_CUSTOM_HOST_NOTIFICATION:
 	case CMD_SEND_CUSTOM_SVC_NOTIFICATION:
-		printf("<tr><td CLASS='optBoxRequiredItem'>Host Name:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='host' VALUE='%s'>",host_name);
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='host'>Host Name:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='host' ID='host' VALUE='%s'>",host_name);
 		printf("</b></td></tr>\n");
 
 		if(cmd==CMD_SEND_CUSTOM_SVC_NOTIFICATION){
-			printf("<tr><td CLASS='optBoxRequiredItem'>Service:</td><td><b>");
-			printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
+			printf("<tr><td CLASS='optBoxRequiredItem'><label for='service'>Service:</label></td><td><b>");
+			printf("<INPUT TYPE='TEXT' NAME='service' ID='service' VALUE='%s'>",service_desc);
 			printf("</b></td></tr>\n");
 			}
 
-		printf("<tr><td CLASS='optBoxItem'>Forced:</td><td><b>");
-		printf("<INPUT TYPE='checkbox' NAME='force_notification' ");
+		printf("<tr><td CLASS='optBoxItem'><label for='force_notification'>Forced:</label></td><td><b>");
+		printf("<INPUT TYPE='checkbox' NAME='force_notification' ID='force_notification'>");
 		printf("</b></td></tr>\n");
 
-		printf("<tr><td CLASS='optBoxItem'>Broadcast:</td><td><b>");
-		printf("<INPUT TYPE='checkbox' NAME='broadcast_notification' ");
+		printf("<tr><td CLASS='optBoxItem'><label for='broadcast_notification'>Broadcast:</label></td><td><b>");
+		printf("<INPUT TYPE='checkbox' NAME='broadcast_notification' ID='broadcast_notification'>");
 		printf("</b></td></tr>\n");
 
-		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_author'>Author (Your Name):</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_author' ID='com_author' VALUE='%s' %s>",url_encode(comment_author),(lock_author_names==TRUE)?"READONLY DISABLED":"");
 		printf("</b></td></tr>\n");
-		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
-		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
+		printf("<tr><td CLASS='optBoxRequiredItem'><label for='com_data'>Comment:</label></td><td><b>");
+		printf("<INPUT TYPE='TEXT' NAME='com_data' ID='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
 		printf("</b></td></tr>\n");
 		break;
 
Index: config.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/config.c,v
retrieving revision 1.46
diff -u -r1.46 config.c
--- config.c	13 Apr 2008 18:34:27 -0000	1.46
+++ config.c	28 Sep 2008 05:22:57 -0000
@@ -156,9 +156,9 @@
 		printf("<form method=\"get\" action=\"%s\">\n",CONFIG_CGI);
 		printf("<table border=0>\n");
 
-		printf("<tr><td align=left class='reportSelectSubTitle'>Object Type:</td></tr>\n");
+		printf("<tr><td align=left class='reportSelectSubTitle'><label for='type'>Object Type:</label></td></tr>\n");
 		printf("<tr><td align=left class='reportSelectItem'>");
-		printf("<select name='type'>\n");
+		printf("<select name='type' id='type'>\n");
 		printf("<option value='hosts' %s>Hosts\n",(display_type==DISPLAY_HOSTS)?"SELECTED":"");
 		printf("<option value='hostdependencies' %s>Host Dependencies\n",(display_type==DISPLAY_HOSTDEPENDENCIES)?"SELECTED":"");
 		printf("<option value='hostescalations' %s>Host Escalations\n",(display_type==DISPLAY_HOSTESCALATIONS)?"SELECTED":"");
@@ -2143,9 +2143,9 @@
 	printf("<div align=center>\n");
 	printf("<table border=0>\n");
 
-	printf("<tr><td align=left class='reportSelectSubTitle'>Object Type:</td></tr>\n");
+	printf("<tr><td align=left class='reportSelectSubTitle'><label for='type'>Object Type:</label></td></tr>\n");
 	printf("<tr><td align=left class='reportSelectItem'>");
-	printf("<select name='type'>\n");
+	printf("<select name='type' id='type'>\n");
 	printf("<option value='hosts' %s>Hosts\n",(display_type==DISPLAY_HOSTS)?"SELECTED":"");
 	printf("<option value='hostdependencies' %s>Host Dependencies\n",(display_type==DISPLAY_HOSTDEPENDENCIES)?"SELECTED":"");
 	printf("<option value='hostescalations' %s>Host Escalations\n",(display_type==DISPLAY_HOSTESCALATIONS)?"SELECTED":"");
Index: histogram.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/histogram.c,v
retrieving revision 1.27
diff -u -r1.27 histogram.c
--- histogram.c	19 May 2008 18:42:26 -0000	1.27
+++ histogram.c	28 Sep 2008 05:22:58 -0000
@@ -409,12 +409,12 @@
 			printf("<input type='hidden' name='t2' value='%lu'>\n",(unsigned long)t2);
 			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
 			if(display_type==DISPLAY_SERVICE_HISTOGRAM)
-				printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
+			printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
 
 
-			printf("<tr><td CLASS='optBoxItem' valign=top align=left>Report period:</td><td CLASS='optBoxItem' valign=top align=left>Assume state retention:</td></tr>\n");
+			printf("<tr><td CLASS='optBoxItem' valign=top align=left><label for='timeperiod'>Report period:</label></td><td CLASS='optBoxItem' valign=top align=left><label for='assumestateretention'>Assume state retention:</label></td></tr>\n");
 			printf("<tr><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='timeperiod'>\n");
+			printf("<select name='timeperiod' id='timeperiod'>\n");
 			printf("<option value=custom>[ Current time range ]\n");
 			printf("<option value=today %s>Today\n",(timeperiod_type==TIMEPERIOD_TODAY)?"SELECTED":"");
 			printf("<option value=last24hours %s>Last 24 Hours\n",(timeperiod_type==TIMEPERIOD_LAST24HOURS)?"SELECTED":"");
@@ -429,30 +429,30 @@
 			printf("<option value=lastyear %s>Last Year\n",(timeperiod_type==TIMEPERIOD_LASTYEAR)?"SELECTED":"");
 			printf("</select>\n");
 			printf("</td><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='assumestateretention'>\n");
+			printf("<select name='assumestateretention' id='assumestateretention'>\n");
 			printf("<option value=yes %s>yes\n",(assume_state_retention==TRUE)?"SELECTED":"");
 			printf("<option value=no %s>no\n",(assume_state_retention==TRUE)?"":"SELECTED");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td CLASS='optBoxItem' valign=top align=left>Breakdown type:</td><td CLASS='optBoxItem' valign=top align=left>Initial states logged:</td></tr>\n");
+			printf("<tr><td CLASS='optBoxItem' valign=top align=left><label for='breakdown'>Breakdown type:</label></td><td CLASS='optBoxItem' valign=top align=left><label for='initialstateslogged'>Initial states logged:</label></td></tr>\n");
 			printf("<tr><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='breakdown'>\n");
+			printf("<select name='breakdown' id='breakdown'>\n");
 			printf("<option value=monthly %s>Month\n",(breakdown_type==BREAKDOWN_MONTHLY)?"SELECTED":"");
 			printf("<option value=dayofmonth %s>Day of the Month\n",(breakdown_type==BREAKDOWN_DAY_OF_MONTH)?"SELECTED":"");
 			printf("<option value=dayofweek %s>Day of the Week\n",(breakdown_type==BREAKDOWN_DAY_OF_WEEK)?"SELECTED":"");
 			printf("<option value=hourly %s>Hour of the Day\n",(breakdown_type==BREAKDOWN_HOURLY)?"SELECTED":"");
 			printf("</select>\n");
 			printf("</td><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='initialstateslogged'>\n");
+			printf("<select name='initialstateslogged' id='initialstateslogged'>\n");
 			printf("<option value=yes %s>yes\n",(initial_states_logged==TRUE)?"SELECTED":"");
 			printf("<option value=no %s>no\n",(initial_states_logged==TRUE)?"":"SELECTED");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td CLASS='optBoxItem' valign=top align=left>Events to graph:</td><td CLASS='optBoxItem' valign=top align=left>Ignore repeated states:</td></tr>\n");
+			printf("<tr><td CLASS='optBoxItem' valign=top align=left><label for='graphevents'>Events to graph:</label></td><td CLASS='optBoxItem' valign=top align=left><label for='newstatesonly'>Ignore repeated states:</label></td></tr>\n");
 			printf("<tr><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='graphevents'>\n");
+			printf("<select name='graphevents' id='graphevents'>\n");
 			if(display_type==DISPLAY_HOST_HISTOGRAM){
 				printf("<option value=%d %s>All host events\n",GRAPH_HOST_ALL,(graph_events==GRAPH_HOST_ALL)?"SELECTED":"");
 				printf("<option value=%d %s>Host problem events\n",GRAPH_HOST_PROBLEMS,(graph_events==GRAPH_HOST_PROBLEMS)?"SELECTED":"");
@@ -470,15 +470,15 @@
 			        }
 			printf("</select>\n");
 			printf("</td><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='newstatesonly'>\n");
+			printf("<select name='newstatesonly' id='newstatesonly'>\n");
 			printf("<option value=yes %s>yes\n",(new_states_only==TRUE)?"SELECTED":"");
 			printf("<option value=no %s>no\n",(new_states_only==TRUE)?"":"SELECTED");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td CLASS='optBoxItem' valign=top align=left>State types to graph:</td><td CLASS='optBoxItem' valign=top align=left></td></tr>\n");
+			printf("<tr><td CLASS='optBoxItem' valign=top align=left><label for='graphstatetypes'>State types to graph:</label></td><td CLASS='optBoxItem' valign=top align=left></td></tr>\n");
 			printf("<tr><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='graphstatetypes'>\n");
+			printf("<select name='graphstatetypes' id='graphstatetypes'>\n");
 			printf("<option value=%d %s>Hard states\n",GRAPH_HARD_STATETYPES,(graph_statetypes==GRAPH_HARD_STATETYPES)?"SELECTED":"");
 			printf("<option value=%d %s>Soft states\n",GRAPH_SOFT_STATETYPES,(graph_statetypes==GRAPH_SOFT_STATETYPES)?"SELECTED":"");
 			printf("<option value=%d %s>Hard and soft states\n",GRAPH_ALL_STATETYPES,(graph_statetypes==GRAPH_ALL_STATETYPES)?"SELECTED":"");
@@ -691,9 +691,9 @@
 			printf("<form method=\"GET\" action=\"%s\">\n",HISTOGRAM_CGI);
 			printf("<input type='hidden' name='input' value='getoptions'>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' valign=center>Host:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' valign=center><label for='host'>Host:</label></td>\n");
 			printf("<td class='reportSelectItem' valign=center>\n");
-			printf("<select name='host'>\n");
+			printf("<select name='host' id='host'>\n");
 
 			for(temp_host=host_list;temp_host!=NULL;temp_host=temp_host->next){
 				if(is_authorized_for_host(temp_host,&current_authdata)==TRUE)
@@ -748,9 +748,9 @@
 			printf("<input type='hidden' name='input' value='getoptions'>\n");
 			printf("<input type='hidden' name='host' value='%s'>\n",(first_service==NULL)?"unknown":first_service);
 
-			printf("<tr><td class='reportSelectSubTitle'>Service:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle'><label for='service'>Service:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='service' onFocus='document.serviceform.host.value=gethostname(this.selectedIndex);' onChange='document.serviceform.host.value=gethostname(this.selectedIndex);'>\n");
+			printf("<select name='service' id='service' onFocus='document.serviceform.host.value=gethostname(this.selectedIndex);' onChange='document.serviceform.host.value=gethostname(this.selectedIndex);'>\n");
 
 			for(temp_service=service_list;temp_service!=NULL;temp_service=temp_service->next){
 				if(is_authorized_for_service(temp_service,&current_authdata)==TRUE)
@@ -793,9 +793,9 @@
 			if(display_type==DISPLAY_SERVICE_HISTOGRAM)
 				printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Report Period:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='timeperiod'>Report Period:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='timeperiod'>\n");
+			printf("<select name='timeperiod' id='timeperiod'>\n");
 			printf("<option value=today>Today\n");
 			printf("<option value=last24hours>Last 24 Hours\n");
 			printf("<option value=yesterday>Yesterday\n");
@@ -814,9 +814,9 @@
 			printf("<tr><td valign=top calss='reportSelectSubTitle'>If Custom Report Period...</td></tr>\n");
 
 			printf("<tr>");
-			printf("<td valign=top class='reportSelectSubTitle'>Start Date (Inclusive):</td>\n");
+			printf("<td valign=top class='reportSelectSubTitle'><label for='smon'>Start Date (Inclusive):</label></td>\n");
 			printf("<td align=left valign=top class='reportSelectItem'>");
-			printf("<select name='smon'>\n");
+			printf("<select name='smon' id='smon'>\n");
 			printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 			printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 			printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -839,9 +839,9 @@
 			printf("</tr>\n");
 
 			printf("<tr>");
-			printf("<td valign=top class='reportSelectSubTitle'>End Date (Inclusive):</td>\n");
+			printf("<td valign=top class='reportSelectSubTitle'><label for='emon'>End Date (Inclusive):</label></td>\n");
 			printf("<td align=left valign=top class='reportSelectItem'>");
-			printf("<select name='emon'>\n");
+			printf("<select name='emon' id='emon'>\n");
 			printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 			printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 			printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -865,9 +865,9 @@
 
 			printf("<tr><td colspan=2><br></td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Statistics Breakdown:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='breakdown'>Statistics Breakdown:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='breakdown'>\n");
+			printf("<select name='breakdown' id='breakdown'>\n");
 			printf("<option value=monthly>Month\n");
 			printf("<option value=dayofmonth SELECTED>Day of the Month\n");
 			printf("<option value=dayofweek>Day of the Week\n");
@@ -875,9 +875,9 @@
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Events To Graph:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='graphevents'>Events To Graph:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='graphevents'>\n");
+			printf("<select name='graphevents' id='graphevents'>\n");
 			if(display_type==DISPLAY_HOST_HISTOGRAM){
 				printf("<option value=%d %s>All host events\n",GRAPH_HOST_ALL,(graph_events==GRAPH_HOST_ALL)?"SELECTED":"");
 				printf("<option value=%d %s>Host problem events\n",GRAPH_HOST_PROBLEMS,(graph_events==GRAPH_HOST_PROBLEMS)?"SELECTED":"");
@@ -896,32 +896,32 @@
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>State Types To Graph:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='graphstatetypes'>State Types To Graph:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='graphstatetypes'>\n");
+			printf("<select name='graphstatetypes' id='graphstatetypes'>\n");
 			printf("<option value=%d>Hard states\n",GRAPH_HARD_STATETYPES);
 			printf("<option value=%d>Soft states\n",GRAPH_SOFT_STATETYPES);
 			printf("<option value=%d SELECTED>Hard and soft states\n",GRAPH_ALL_STATETYPES);
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Assume State Retention:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='assumestateretention'>Assume State Retention:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='assumestateretention'>\n");
+			printf("<select name='assumestateretention' id='assumestateretention'>\n");
 			printf("<option value='yes'>Yes\n");
 			printf("<option value='no'>No\n");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Initial States Logged:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='initialstateslogged'>Initial States Logged:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='initialstateslogged'>\n");
+			printf("<select name='initialstateslogged' id='initialstateslogged'>\n");
 			printf("<option value='yes'>Yes\n");
 			printf("<option value='no' SELECTED>No\n");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Ignore Repeated States:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='newstatesonly'>Ignore Repeated States:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
 			printf("<select name='newstatesonly'>\n");
 			printf("<option value='yes'>Yes\n");
@@ -937,7 +937,7 @@
 			printf("</DIV></P>\n");
 		        }
 
-		/* as the user whether they want a graph for a host or service */
+		/* ask the user whether they want a graph for a host or service */
 		else{
 			printf("<P><DIV ALIGN=CENTER>\n");
 			printf("<DIV CLASS='reportSelectTitle'>Step 1: Select Report Type</DIV>\n");
@@ -948,9 +948,9 @@
 			printf("<TABLE BORDER=0 cellpadding=5>\n");
 			printf("<form method=\"GET\" action=\"%s\">\n",HISTOGRAM_CGI);
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Type:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='input'>Type:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='input'>\n");
+			printf("<select name='input' id='input'>\n");
 			printf("<option value=gethost>Host\n");
 			printf("<option value=getservice>Service\n");
 			printf("</select>\n");
Index: history.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/history.c,v
retrieving revision 1.31
diff -u -r1.31 history.c
--- history.c	23 Jun 2008 20:47:44 -0000	1.31
+++ history.c	28 Sep 2008 05:22:58 -0000
@@ -210,11 +210,11 @@
 		printf("<input type='hidden' name='archive' value='%d'>\n",log_archive);
 
 		printf("<tr>\n");
-		printf("<td align=left CLASS='optBoxItem'>State type options:</td>\n");
+		printf("<td align=left CLASS='optBoxItem'><label for='statetype'>State type options:</label></td>\n");
 		printf("</tr>\n");
 
 		printf("<tr>\n");
-		printf("<td align=left CLASS='optBoxItem'><select name='statetype'>\n");
+		printf("<td align=left CLASS='optBoxItem'><select name='statetype' id='statetype'>\n");
 		printf("<option value=%d %s>All state types\n",STATE_ALL,(state_options==STATE_ALL)?"selected":"");
 		printf("<option value=%d %s>Soft states\n",STATE_SOFT,(state_options==STATE_SOFT)?"selected":"");
 		printf("<option value=%d %s>Hard states\n",STATE_HARD,(state_options==STATE_HARD)?"selected":"");
@@ -222,16 +222,16 @@
 		printf("</tr>\n");
 
 		printf("<tr>\n");
-		printf("<td align=left CLASS='optBoxItem'>History detail level for ");
+		printf("<td align=left CLASS='optBoxItem'><label for='type'>History detail level for ");
 		if(display_type==DISPLAY_HOSTS)
 			printf("%s host%s",(show_all_hosts==TRUE)?"all":"this",(show_all_hosts==TRUE)?"s":"");
 		else
 			printf("service");
-		printf(":</td>\n");
+		printf(":</label></td>\n");
 		printf("</tr>\n")
 ;
 		printf("<tr>\n");
-		printf("<td align=left CLASS='optBoxItem'><select name='type'>\n");
+		printf("<td align=left CLASS='optBoxItem'><select name='type' id='type'>\n");
 		if(display_type==DISPLAY_HOSTS)
 			printf("<option value=%d %s>All alerts\n",HISTORY_ALL,(history_options==HISTORY_ALL)?"selected":"");
 		printf("<option value=%d %s>All service alerts\n",HISTORY_SERVICE_ALL,(history_options==HISTORY_SERVICE_ALL)?"selected":"");
@@ -250,17 +250,17 @@
 		printf("</tr>\n");
 
 		printf("<tr>\n");
-		printf("<td align=left valign=bottom CLASS='optBoxItem'><input type='checkbox' name='noflapping' %s> Hide Flapping Alerts</td>",(display_flapping_alerts==FALSE)?"checked":"");
+		printf("<td align=left valign=bottom CLASS='optBoxItem'><label><input type='checkbox' name='noflapping' %s> Hide Flapping Alerts</label></td>",(display_flapping_alerts==FALSE)?"checked":"");
 		printf("</tr>\n");
 		printf("<tr>\n");
-		printf("<td align=left valign=bottom CLASS='optBoxItem'><input type='checkbox' name='nodowntime' %s> Hide Downtime Alerts</td>",(display_downtime_alerts==FALSE)?"checked":"");
+		printf("<td align=left valign=bottom CLASS='optBoxItem'><label><input type='checkbox' name='nodowntime' %s> Hide Downtime Alerts</label></td>",(display_downtime_alerts==FALSE)?"checked":"");
 		printf("</tr>\n");
 
 		printf("<tr>\n");
-		printf("<td align=left valign=bottom CLASS='optBoxItem'><input type='checkbox' name='nosystem' %s> Hide Process Messages</td>",(display_system_messages==FALSE)?"checked":"");
+		printf("<td align=left valign=bottom CLASS='optBoxItem'><label><input type='checkbox' name='nosystem' %s> Hide Process Messages</label></td>",(display_system_messages==FALSE)?"checked":"");
 		printf("</tr>\n");
 		printf("<tr>\n");
-		printf("<td align=left valign=bottom CLASS='optBoxItem'><input type='checkbox' name='oldestfirst' %s> Older Entries First</td>",(use_lifo==FALSE)?"checked":"");
+		printf("<td align=left valign=bottom CLASS='optBoxItem'><label><input type='checkbox' name='oldestfirst' %s> Older Entries First</label></td>",(use_lifo==FALSE)?"checked":"");
 		printf("</tr>\n");
 
 		printf("<tr>\n");
Index: notifications.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/notifications.c,v
retrieving revision 1.25
diff -u -r1.25 notifications.c
--- notifications.c	19 May 2008 18:42:27 -0000	1.25
+++ notifications.c	28 Sep 2008 05:22:58 -0000
@@ -212,20 +212,20 @@
 		printf("<table border=0 CLASS='optBox'>\n");
 		printf("<form method='GET' action='%s'>\n",NOTIFICATIONS_CGI);
 		if(query_type==FIND_SERVICE){
-			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(query_host_name));
-			printf("<input type='hidden' name='service' value='%s'>\n",url_encode(query_svc_description));
-	                }
+		printf("<input type='hidden' name='host' value='%s'>\n",url_encode(query_host_name));
+		printf("<input type='hidden' name='service' value='%s'>\n",url_encode(query_svc_description));
+                }
 		else
 			printf("<input type='hidden' name='%s' value='%s'>\n",(query_type==FIND_HOST)?"host":"contact",url_encode((query_type==FIND_HOST)?query_host_name:query_contact_name));
 		printf("<input type='hidden' name='archive' value='%d'>\n",log_archive);
 		printf("<tr>\n");
 		if(query_type==FIND_SERVICE)
-			printf("<td align=left colspan=2 CLASS='optBoxItem'>Notification detail level for this service:</td>");
+			printf("<td align=left colspan=2 CLASS='optBoxItem'><label for='type'>Notification detail level for this service:</label></td>");
 		else
-			printf("<td align=left colspan=2 CLASS='optBoxItem'>Notification detail level for %s %s%s:</td>",(find_all==TRUE)?"all":"this",(query_type==FIND_HOST)?"host":"contact",(find_all==TRUE)?"s":"");
+			printf("<td align=left colspan=2 CLASS='optBoxItem'><label for='type'>Notification detail level for %s %s%s:</label></td>",(find_all==TRUE)?"all":"this",(query_type==FIND_HOST)?"host":"contact",(find_all==TRUE)?"s":"");
 		printf("</tr>\n");
 		printf("<tr>\n");
-		printf("<td align=left colspan=2 CLASS='optBoxItem'><select name='type'>\n");
+		printf("<td align=left colspan=2 CLASS='optBoxItem'><select name='type' id='type'>\n");
 		printf("<option value=%d %s>All notifications\n",NOTIFICATION_ALL,(notification_options==NOTIFICATION_ALL)?"selected":"");
 		if(query_type!=FIND_SERVICE){
 			printf("<option value=%d %s>All service notifications\n",NOTIFICATION_SERVICE_ALL,(notification_options==NOTIFICATION_SERVICE_ALL)?"selected":"");
@@ -249,7 +249,7 @@
 		printf("</select></td>\n");
 		printf("</tr>\n");
 		printf("<tr>\n");
-		printf("<td align=left CLASS='optBoxItem'>Older Entries First:</td>\n");
+		printf("<td align=left CLASS='optBoxItem'><label for='oldestfirst'>Older Entries First:</label></td>\n");
 		printf("<td></td>\n");
 		printf("</tr>\n");
 		printf("<tr>\n");
Index: showlog.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/showlog.c,v
retrieving revision 1.22
diff -u -r1.22 showlog.c
--- showlog.c	9 Jan 2008 17:51:23 -0000	1.22
+++ showlog.c	28 Sep 2008 05:22:58 -0000
@@ -132,7 +132,7 @@
 		printf("<form method='GET' action='%s'>\n",SHOWLOG_CGI);
 		printf("<input type='hidden' name='archive' value='%d'>\n",log_archive);
 		printf("<tr>");
-		printf("<td align=left valign=bottom CLASS='optBoxItem'><input type='checkbox' name='oldestfirst' %s> Older Entries First:</td>",(use_lifo==FALSE)?"checked":"");
+		printf("<td align=left valign=bottom CLASS='optBoxItem'><label><input type='checkbox' name='oldestfirst' %s> Older Entries First:</label></td>",(use_lifo==FALSE)?"checked":"");
 		printf("</tr>\n");
 		printf("<tr>");
 		printf("<td align=left valign=bottom CLASS='optBoxItem'><input type='submit' value='Update'></td>\n");
Index: statusmap.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/statusmap.c,v
retrieving revision 1.40
diff -u -r1.40 statusmap.c
--- statusmap.c	19 May 2008 18:42:28 -0000	1.40
+++ statusmap.c	28 Sep 2008 05:22:58 -0000
@@ -708,7 +708,7 @@
 		printf("<table border=0>\n");
 
 		printf("<tr><td CLASS='optBoxItem'>\n");
-		printf("Layout Method:<br>\n");
+		printf("<label>Layout Method:<br>\n");
 		printf("<select name='layout'>\n");
 #ifndef DUMMY_INSTALL
 		printf("<option value=%d %s>User-supplied coords\n",LAYOUT_USER_SUPPLIED,(layout_method==LAYOUT_USER_SUPPLIED)?"selected":"");
@@ -719,30 +719,30 @@
 		printf("<option value=%d %s>Circular\n",LAYOUT_CIRCULAR,(layout_method==LAYOUT_CIRCULAR)?"selected":"");
 		printf("<option value=%d %s>Circular (Marked Up)\n",LAYOUT_CIRCULAR_MARKUP,(layout_method==LAYOUT_CIRCULAR_MARKUP)?"selected":"");
 		printf("<option value=%d %s>Circular (Balloon)\n",LAYOUT_CIRCULAR_BALLOON,(layout_method==LAYOUT_CIRCULAR_BALLOON)?"selected":"");
-		printf("</select>\n");
+		printf("</select></label>\n");
 		printf("</td>\n");
 		printf("<td CLASS='optBoxItem'>\n");
-		printf("Scaling factor:<br>\n");
-		printf("<input type='text' name='scaling_factor' maxlength='5' size='4' value='%2.1f'>\n",(user_supplied_scaling==TRUE)?user_scaling_factor:0.0);
+		printf("<label>Scaling factor:<br>\n");
+		printf("<input type='text' name='scaling_factor' maxlength='5' size='4' value='%2.1f'></label>\n",(user_supplied_scaling==TRUE)?user_scaling_factor:0.0);
 		printf("</td></tr>\n");
 
 		/*
 		printf("<tr><td CLASS='optBoxItem'>\n");
-		printf("Max image width:<br>\n");
-		printf("<input type='text' name='max_width' maxlength='5' size='4' value='%d'>\n",max_image_width);
+		printf("<label>Max image width:<br>\n");
+		printf("<input type='text' name='max_width' maxlength='5' size='4' value='%d'></label>\n",max_image_width);
 		printf("</td>\n");
 		printf("<td CLASS='optBoxItem'>\n");
-		printf("Max image height:<br>\n");
-		printf("<input type='text' name='max_height' maxlength='5' size='4' value='%d'>\n",max_image_height);
+		printf("<label>Max image height:<br>\n");
+		printf("<input type='text' name='max_height' maxlength='5' size='4' value='%d'></label>\n",max_image_height);
 		printf("</td></tr>\n");
 
 		printf("<tr><td CLASS='optBoxItem'>\n");
-		printf("Proximity width:<br>\n");
-		printf("<input type='text' name='proximity_width' maxlength='5' size='4' value='%d'>\n",proximity_width);
+		printf("<label>Proximity width:<br>\n");
+		printf("<input type='text' name='proximity_width' maxlength='5' size='4' value='%d'></label>\n",proximity_width);
 		printf("</td>\n");
 		printf("<td CLASS='optBoxItem'>\n");
-		printf("Proximity height:<br>\n");
-		printf("<input type='text' name='proximity_height' maxlength='5' size='4' value='%d'>\n",proximity_height);
+		printf("<label>Proximity height:<br>\n");
+		printf("<input type='text' name='proximity_height' maxlength='5' size='4' value='%d'></label>\n",proximity_height);
 		printf("</td></tr>\n");
 		*/
 
@@ -751,7 +751,7 @@
 		printf("<input type='hidden' name='proximity_width' value='%d'>\n",proximity_width);
 		printf("<input type='hidden' name='proximity_height' value='%d'>\n",proximity_height);
 
-		printf("<tr><td CLASS='optBoxItem'>Drawing Layers:<br>\n");
+		printf("<tr><td CLASS='optBoxItem'><label>Drawing Layers:<br>\n");
 		printf("<select multiple name='layer' size='4'>\n");
 		for(temp_hostgroup=hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){
 			if(is_authorized_for_hostgroup(temp_hostgroup,&current_authdata)==FALSE)
@@ -765,15 +765,15 @@
 			        }
 			printf("<option value='%s' %s>%s\n",temp_hostgroup->group_name,(found==1)?"SELECTED":"",temp_hostgroup->alias);
 		        }
-		printf("</select>\n");
+		printf("</select></label>\n");
 		printf("</td><td CLASS='optBoxItem' valign=top>Layer mode:<br>");
-		printf("<input type='radio' name='layermode' value='include' %s>Include<br>\n",(exclude_layers==FALSE)?"CHECKED":"");
-		printf("<input type='radio' name='layermode' value='exclude' %s>Exclude\n",(exclude_layers==TRUE)?"CHECKED":"");
+		printf("<label><input type='radio' name='layermode' value='include' %s>Include</label><br>\n",(exclude_layers==FALSE)?"CHECKED":"");
+		printf("<label><input type='radio' name='layermode' value='exclude' %s>Exclude</label>\n",(exclude_layers==TRUE)?"CHECKED":"");
 		printf("</td></tr>\n");
 
 		printf("<tr><td CLASS='optBoxItem'>\n");
-		printf("Suppress popups:<br>\n");
-		printf("<input type='checkbox' name='nopopups' %s>\n",(display_popups==FALSE)?"CHECKED":"");
+		printf("<label>Suppress popups:<br>\n");
+		printf("<input type='checkbox' name='nopopups' %s></label>\n",(display_popups==FALSE)?"CHECKED":"");
 		printf("</td><td CLASS='optBoxItem'>\n");
 		printf("<input type='submit' value='Update'>\n");
 		printf("</td></tr>\n");
Index: summary.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/summary.c,v
retrieving revision 1.27
diff -u -r1.27 summary.c
--- summary.c	24 Jan 2008 02:51:30 -0000	1.27
+++ summary.c	28 Sep 2008 05:22:58 -0000
@@ -470,9 +470,9 @@
 
 		printf("<table border=0 cellpadding=5>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Report Type:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='standardreport'>Report Type:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='standardreport'>\n");
+		printf("<select name='standardreport' id='standardreport'>\n");
 		printf("<option value=%d>25 Most Recent Hard Alerts\n",SREPORT_RECENT_ALERTS);
 		printf("<option value=%d>25 Most Recent Hard Host Alerts\n",SREPORT_RECENT_HOST_ALERTS);
 		printf("<option value=%d>25 Most Recent Hard Service Alerts\n",SREPORT_RECENT_SERVICE_ALERTS);
@@ -496,9 +496,9 @@
 
 		printf("<table border=0 cellpadding=5>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Report Type:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='displaytype'>Report Type:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='displaytype'>\n");
+		printf("<select name='displaytype' id='displaytype'>\n");
 		printf("<option value=%d>Most Recent Alerts\n",REPORT_RECENT_ALERTS);
 		printf("<option value=%d>Alert Totals\n",REPORT_ALERT_TOTALS);
 		printf("<option value=%d>Alert Totals By Hostgroup\n",REPORT_HOSTGROUP_ALERT_TOTALS);
@@ -510,9 +510,9 @@
 		printf("</td></tr>\n");
 
 		printf("<tr>");
-		printf("<td valign=top class='reportSelectSubTitle'>Report Period:</td>\n");
+		printf("<td valign=top class='reportSelectSubTitle'><label for='timeperiod'>Report Period:</label></td>\n");
 		printf("<td valign=top align=left class='optBoxItem'>\n");
-		printf("<select name='timeperiod'>\n");
+		printf("<select name='timeperiod' id='timeperiod'>\n");
 		printf("<option value=today>Today\n");
 		printf("<option value=last24hours>Last 24 Hours\n");
 		printf("<option value=yesterday>Yesterday\n");
@@ -532,9 +532,9 @@
 		printf("<tr><td valign=top class='reportSelectSubTitle'>If Custom Report Period...</td></tr>\n");
 
 		printf("<tr>");
-		printf("<td valign=top class='reportSelectSubTitle'>Start Date (Inclusive):</td>\n");
+		printf("<td valign=top class='reportSelectSubTitle'><label for='smon'>Start Date (Inclusive):</label></td>\n");
 		printf("<td align=left valign=top class='reportSelectItem'>");
-		printf("<select name='smon'>\n");
+		printf("<select name='smon' id='smon'>\n");
 		printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 		printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 		printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -557,9 +557,9 @@
 		printf("</tr>\n");
 
 		printf("<tr>");
-		printf("<td valign=top class='reportSelectSubTitle'>End Date (Inclusive):</td>\n");
+		printf("<td valign=top class='reportSelectSubTitle'><label for='emon'>End Date (Inclusive):</label></td>\n");
 		printf("<td align=left valign=top class='reportSelectItem'>");
-		printf("<select name='emon'>\n");
+		printf("<select name='emon' id='emon'>\n");
 		printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 		printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 		printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -583,8 +583,8 @@
 
 		printf("<tr><td colspan=2><br></td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' valign=center>Limit To Hostgroup:</td><td align=left valign=center class='reportSelectItem'>\n");
-		printf("<select name='hostgroup'>\n");
+		printf("<tr><td class='reportSelectSubTitle' valign=center><label for='hostgroup'>Limit To Hostgroup:</label></td><td align=left valign=center class='reportSelectItem'>\n");
+		printf("<select name='hostgroup' id='hostgroup'>\n");
 		printf("<option value='all'>** ALL HOSTGROUPS **\n");
 		for(temp_hostgroup=hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){
 			if(is_authorized_for_hostgroup(temp_hostgroup,&current_authdata)==TRUE)
@@ -593,8 +593,8 @@
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' valign=center>Limit To Servicegroup:</td><td align=left valign=center class='reportSelectItem'>\n");
-		printf("<select name='servicegroup'>\n");
+		printf("<tr><td class='reportSelectSubTitle' valign=center><label for='servicegroup'>Limit To Servicegroup:</label></td><td align=left valign=center class='reportSelectItem'>\n");
+		printf("<select name='servicegroup' id='servicegroup'>\n");
 		printf("<option value='all'>** ALL SERVICEGROUPS **\n");
 		for(temp_servicegroup=servicegroup_list;temp_servicegroup!=NULL;temp_servicegroup=temp_servicegroup->next){
 			if(is_authorized_for_servicegroup(temp_servicegroup,&current_authdata)==TRUE)
@@ -603,8 +603,8 @@
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' valign=center>Limit To Host:</td><td align=left valign=center class='reportSelectItem'>\n");
-		printf("<select name='host'>\n");
+		printf("<tr><td class='reportSelectSubTitle' valign=center><label for='host'>Limit To Host:</label></td><td align=left valign=center class='reportSelectItem'>\n");
+		printf("<select name='host' id='host'>\n");
 		printf("<option value='all'>** ALL HOSTS **\n");
 
 		for(temp_host=host_list;temp_host!=NULL;temp_host=temp_host->next){
@@ -614,27 +614,27 @@
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Alert Types:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='alerttypes'>Alert Types:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='alerttypes'>\n");
+		printf("<select name='alerttypes' id='alerttypes'>\n");
 		printf("<option value=%d %s>Host and Service Alerts\n",AE_HOST_ALERT+AE_SERVICE_ALERT,(alert_types==AE_HOST_ALERT+AE_SERVICE_ALERT)?"SELECTED":"");
 		printf("<option value=%d %s>Host Alerts\n",AE_HOST_ALERT,(alert_types==AE_HOST_ALERT)?"SELECTED":"");
 		printf("<option value=%d %s>Service Alerts\n",AE_SERVICE_ALERT,(alert_types==AE_SERVICE_ALERT)?"SELECTED":"");
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>State Types:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='statetypes'>State Types:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='statetypes'>\n");
+		printf("<select name='statetypes' id='statetypes'>\n");
 		printf("<option value=%d %s>Hard and Soft States\n",AE_HARD_STATE+AE_SOFT_STATE,(state_types==AE_HARD_STATE+AE_SOFT_STATE)?"SELECTED":"");
 		printf("<option value=%d %s>Hard States\n",AE_HARD_STATE,(state_types==AE_HARD_STATE)?"SELECTED":"");
 		printf("<option value=%d %s>Soft States\n",AE_SOFT_STATE,(state_types==AE_SOFT_STATE)?"SELECTED":"");
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Host States:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='hoststates'>Host States:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='hoststates'>\n");
+		printf("<select name='hoststates' id='hoststates'>\n");
 		printf("<option value=%d>All Host States\n",AE_HOST_UP+AE_HOST_DOWN+AE_HOST_UNREACHABLE);
 		printf("<option value=%d>Host Problem States\n",AE_HOST_DOWN+AE_HOST_UNREACHABLE);
 		printf("<option value=%d>Host Up States\n",AE_HOST_UP);
@@ -643,9 +643,9 @@
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Service States:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='servicestates'>Service States:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<select name='servicestates'>\n");
+		printf("<select name='servicestates' id='servicestates'>\n");
 		printf("<option value=%d>All Service States\n",AE_SERVICE_OK+AE_SERVICE_WARNING+AE_SERVICE_UNKNOWN+AE_SERVICE_CRITICAL);
 		printf("<option value=%d>Service Problem States\n",AE_SERVICE_WARNING+AE_SERVICE_UNKNOWN+AE_SERVICE_CRITICAL);
 		printf("<option value=%d>Service Ok States\n",AE_SERVICE_OK);
@@ -655,9 +655,9 @@
 		printf("</select>\n");
 		printf("</td></tr>\n");
 
-		printf("<tr><td class='reportSelectSubTitle' align=right>Max List Items:</td>\n");
+		printf("<tr><td class='reportSelectSubTitle' align=right><label for='limit'>Max List Items:</label></td>\n");
 		printf("<td class='reportSelectItem'>\n");
-		printf("<input type='text' name='limit' size='3' maxlength='3' value='%d'>\n",item_limit);
+		printf("<input type='text' name='limit' id='limit' size='3' maxlength='3' value='%d'>\n",item_limit);
 		printf("</td></tr>\n");
 
 		printf("<tr><td></td><td align=left class='dateSelectItem'><input type='submit' value='Create Summary Report!'></td></tr>\n");
Index: trends.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/trends.c,v
retrieving revision 1.41
diff -u -r1.41 trends.c
--- trends.c	23 Jun 2008 20:47:46 -0000	1.41
+++ trends.c	28 Sep 2008 05:22:58 -0000
@@ -463,11 +463,11 @@
 			printf("<input type='hidden' name='assumestatesduringnotrunning' value='%s'>\n",(assume_states_during_notrunning==TRUE)?"yes":"no");
 			printf("<input type='hidden' name='includesoftstates' value='%s'>\n",(include_soft_states==TRUE)?"yes":"no");
 
-			printf("<tr><td CLASS='optBoxItem' valign=top align=left>First assumed %s state:</td><td CLASS='optBoxItem' valign=top align=left>Backtracked archives:</td></tr>\n",(display_type==DISPLAY_HOST_TRENDS)?"host":"service");
+			printf("<tr><td CLASS='optBoxItem' valign=top align=left><label for='initialassumed%sstate'>First assumed %s state:</label></td><td CLASS='optBoxItem' valign=top align=left><label for='backtrack'>Backtracked archives:</label></td></tr>\n",(display_type==DISPLAY_HOST_TRENDS)?"host":"service",(display_type==DISPLAY_HOST_TRENDS)?"host":"service");
 			printf("<tr><td CLASS='optBoxItem' valign=top align=left>");
 			if(display_type==DISPLAY_HOST_TRENDS){
 				printf("<input type='hidden' name='initialassumedservicestate' value='%d'>",initial_assumed_service_state);
-				printf("<select name='initialassumedhoststate'>\n");
+				printf("<select name='initialassumedhoststate' id='initialassumedhoststate'>\n");
 				printf("<option value=%d %s>Unspecified\n",AS_NO_DATA,(initial_assumed_host_state==AS_NO_DATA)?"SELECTED":"");
 				printf("<option value=%d %s>Current State\n",AS_CURRENT_STATE,(initial_assumed_host_state==AS_CURRENT_STATE)?"SELECTED":"");
 				printf("<option value=%d %s>Host Up\n",AS_HOST_UP,(initial_assumed_host_state==AS_HOST_UP)?"SELECTED":"");
@@ -476,7 +476,7 @@
 			        }
 			else{
 				printf("<input type='hidden' name='initialassumedhoststate' value='%d'>",initial_assumed_host_state);
-				printf("<select name='initialassumedservicestate'>\n");
+				printf("<select name='initialassumedservicestate' id='initialassumedservicestate'>\n");
 				printf("<option value=%d %s>Unspecified\n",AS_NO_DATA,(initial_assumed_service_state==AS_NO_DATA)?"SELECTED":"");
 				printf("<option value=%d %s>Current State\n",AS_CURRENT_STATE,(initial_assumed_service_state==AS_CURRENT_STATE)?"SELECTED":"");
 				printf("<option value=%d %s>Service Ok\n",AS_SVC_OK,(initial_assumed_service_state==AS_SVC_OK)?"SELECTED":"");
@@ -486,12 +486,12 @@
 			        }
 			printf("</select>\n");
 			printf("</td><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<input type='text' name='backtrack' size='2' maxlength='2' value='%d'>\n",backtrack_archives);
+			printf("<input type='text' name='backtrack' id='backtrack' size='2' maxlength='2' value='%d'>\n",backtrack_archives);
 			printf("</td></tr>\n");
 
-			printf("<tr><td CLASS='optBoxItem' valign=top align=left>Report period:</td><td CLASS='optBoxItem' valign=top align=left>Zoom factor:</td></tr>\n");
+			printf("<tr><td CLASS='optBoxItem' valign=top align=left><label for='timeperiod'>Report period:</label></td><td CLASS='optBoxItem' valign=top align=left><label for='zoom'>Zoom factor:</label></td></tr>\n");
 			printf("<tr><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='timeperiod'>\n");
+			printf("<select name='timeperiod' id='timeperiod'>\n");
 			printf("<option>[ Current time range ]\n");
 			printf("<option value=today %s>Today\n",(timeperiod_type==TIMEPERIOD_TODAY)?"SELECTED":"");
 			printf("<option value=last24hours %s>Last 24 Hours\n",(timeperiod_type==TIMEPERIOD_LAST24HOURS)?"SELECTED":"");
@@ -506,7 +506,7 @@
 			printf("<option value=lastyear %s>Last Year\n",(timeperiod_type==TIMEPERIOD_LASTYEAR)?"SELECTED":"");
 			printf("</select>\n");
 			printf("</td><td CLASS='optBoxItem' valign=top align=left>\n");
-			printf("<select name='zoom'>\n");
+			printf("<select name='zoom' id='zoom'>\n");
 			printf("<option value=%d selected>%d\n",zoom_factor,zoom_factor);
 			printf("<option value=+2>+2\n");
 			printf("<option value=+3>+3\n");
@@ -790,7 +790,7 @@
 	/* show user a selection of hosts and services to choose from... */
 	if(display_type==DISPLAY_NO_TRENDS || input_type!=GET_INPUT_NONE){
 
-		/* ask the user for what host they want a report for */
+		/* ask the user for what host they want a report */
 		if(input_type==GET_INPUT_HOST_TARGET){
 
 			printf("<P><DIV ALIGN=CENTER>\n");
@@ -803,9 +803,9 @@
 			printf("<form method=\"GET\" action=\"%s\">\n",TRENDS_CGI);
 			printf("<input type='hidden' name='input' value='getoptions'>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' valign=center>Host:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' valign=center><label for='host'>Host:</label></td>\n");
 			printf("<td class='reportSelectItem' valign=center>\n");
-			printf("<select name='host'>\n");
+			printf("<select name='host' id='host'>\n");
 
 			for(temp_host=host_list;temp_host!=NULL;temp_host=temp_host->next){
 				if(is_authorized_for_host(temp_host,&current_authdata)==TRUE)
@@ -825,7 +825,7 @@
 			printf("</DIV></P>\n");
 		        }
 
-		/* ask the user for what service they want a report for */
+		/* ask the user for what service they want a report */
 		else if(input_type==GET_INPUT_SERVICE_TARGET){
 
 			printf("<SCRIPT LANGUAGE='JavaScript'>\n");
@@ -860,9 +860,9 @@
 			printf("<input type='hidden' name='input' value='getoptions'>\n");
 			printf("<input type='hidden' name='host' value='%s'>\n",(first_service==NULL)?"unknown":first_service);
 
-			printf("<tr><td class='reportSelectSubTitle'>Service:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle'><label for='service'>Service:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='service' onFocus='document.serviceform.host.value=gethostname(this.selectedIndex);' onChange='document.serviceform.host.value=gethostname(this.selectedIndex);'>\n");
+			printf("<select name='service' id='service' onFocus='document.serviceform.host.value=gethostname(this.selectedIndex);' onChange='document.serviceform.host.value=gethostname(this.selectedIndex);'>\n");
 
 			for(temp_service=service_list;temp_service!=NULL;temp_service=temp_service->next){
 				if(is_authorized_for_service(temp_service,&current_authdata)==TRUE)
@@ -905,9 +905,9 @@
 			if(display_type==DISPLAY_SERVICE_TRENDS)
 				printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Report period:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='timeperiod'>Report period:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='timeperiod'>\n");
+			printf("<select name='timeperiod' id='timeperiod'>\n");
 			printf("<option value=today>Today\n");
 			printf("<option value=last24hours>Last 24 Hours\n");
 			printf("<option value=yesterday>Yesterday\n");
@@ -926,9 +926,9 @@
 			printf("<tr><td valign=top class='reportSelectSubTitle'>If Custom Report Period...</td></tr>\n");
 
 			printf("<tr>");
-			printf("<td valign=top class='reportSelectSubTitle'>Start Date (Inclusive):</td>\n");
+			printf("<td valign=top class='reportSelectSubTitle'><label for='smon'>Start Date (Inclusive):</label></td>\n");
 			printf("<td align=left valign=top class='reportSelectItem'>");
-			printf("<select name='smon'>\n");
+			printf("<select name='smon' id='smon'>\n");
 			printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 			printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 			printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -951,9 +951,9 @@
 			printf("</tr>\n");
 
 			printf("<tr>");
-			printf("<td valign=top class='reportSelectSubTitle'>End Date (Inclusive):</td>\n");
+			printf("<td valign=top class='reportSelectSubTitle'><label for='emon'>End Date (Inclusive):</label></td>\n");
 			printf("<td align=left valign=top class='reportSelectItem'>");
-			printf("<select name='emon'>\n");
+			printf("<select name='emon' id='emon'>\n");
 			printf("<option value='1' %s>January\n",(t->tm_mon==0)?"SELECTED":"");
 			printf("<option value='2' %s>February\n",(t->tm_mon==1)?"SELECTED":"");
 			printf("<option value='3' %s>March\n",(t->tm_mon==2)?"SELECTED":"");
@@ -977,42 +977,42 @@
 
 			printf("<tr><td colspan=2><br></td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Assume Initial States:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='assumeinitialstates'>Assume Initial States:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='assumeinitialstates'>\n");
+			printf("<select name='assumeinitialstates' id='assumeinitialstates'>\n");
 			printf("<option value=yes>Yes\n");
 			printf("<option value=no>No\n");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Assume State Retention:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='assumestateretention'>Assume State Retention:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='assumestateretention'>\n");
+			printf("<select name='assumestateretention' id='assumestateretention'>\n");
 			printf("<option value=yes>Yes\n");
 			printf("<option value=no>No\n");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Assume States During Program Downtime:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='assumestatesduringnotrunning'>Assume States During Program Downtime:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='assumestatesduringnotrunning'>\n");
+			printf("<select name='assumestatesduringnotrunning' id='assumestatesduringnotrunning'>\n");
 			printf("<option value=yes>Yes\n");
 			printf("<option value=no>No\n");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Include Soft States:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='includesoftstates'>Include Soft States:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='includesoftstates'>\n");
+			printf("<select name='includesoftstates' id='includesoftstates'>\n");
 			printf("<option value=yes>Yes\n");
 			printf("<option value=no SELECTED>No\n");
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>First Assumed %s State:</td>\n",(display_type==DISPLAY_HOST_TRENDS)?"Host":"Service");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='initialassumed%sstate'>First Assumed %s State:</td>\n",(display_type==DISPLAY_HOST_TRENDS)?"Host":"Service");
 			printf("<td class='reportSelectItem'>\n");
 			if(display_type==DISPLAY_HOST_TRENDS){
-				printf("<select name='initialassumedhoststate'>\n");
+				printf("<select name='initialassumedhoststate' id='initialassumedHoststate'>\n");
 				printf("<option value=%d>Unspecified\n",AS_NO_DATA);
 				printf("<option value=%d>Current State\n",AS_CURRENT_STATE);
 				printf("<option value=%d>Host Up\n",AS_HOST_UP);
@@ -1020,7 +1020,7 @@
 				printf("<option value=%d>Host Unreachable\n",AS_HOST_UNREACHABLE);
 			        }
 			else{
-				printf("<select name='initialassumedservicestate'>\n");
+				printf("<select name='initialassumedservicestate' id='initialassumedServicestate'>\n");
 				printf("<option value=%d>Unspecified\n",AS_NO_DATA);
 				printf("<option value=%d>Current State\n",AS_CURRENT_STATE);
 				printf("<option value=%d>Service Ok\n",AS_SVC_OK);
@@ -1031,13 +1031,13 @@
 			printf("</select>\n");
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Backtracked Archives (To Scan For Initial States):</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='backtrack'>Backtracked Archives (To Scan For Initial States):</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<input type='text' name='backtrack' size='2' maxlength='2' value='%d'>\n",backtrack_archives);
+			printf("<input type='text' name='backtrack' id='backtrack' size='2' maxlength='2' value='%d'>\n",backtrack_archives);
 			printf("</td></tr>\n");
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Suppress image map:</td><td class='reportSelectItem'><input type='checkbox' name='nomap'></td></tr>");
-			printf("<tr><td class='reportSelectSubTitle' align=right>Suppress popups:</td><td class='reportSelectItem'><input type='checkbox' name='nopopups'></td></tr>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='nomap'>Suppress image map:</label></td><td class='reportSelectItem'><input type='checkbox' name='nomap' id='nomap'></td></tr>");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='nopopups'>Suppress popups:</label></td><td class='reportSelectItem'><input type='checkbox' name='nopopups' id='nopopups'></td></tr>\n");
 
 			printf("<tr><td></td><td class='reportSelectItem'><input type='submit' value='Create Report'></td></tr>\n");
 
@@ -1053,7 +1053,7 @@
 			*/
 		        }
 
-		/* as the user whether they want a graph for a host or service */
+		/* ask the user whether they want a graph for a host or service */
 		else{
 			printf("<P><DIV ALIGN=CENTER>\n");
 			printf("<DIV CLASS='reportSelectTitle'>Step 1: Select Report Type</DIV>\n");
@@ -1064,9 +1064,9 @@
 			printf("<TABLE BORDER=0 cellpadding=5>\n");
 			printf("<form method=\"GET\" action=\"%s\">\n",TRENDS_CGI);
 
-			printf("<tr><td class='reportSelectSubTitle' align=right>Type:</td>\n");
+			printf("<tr><td class='reportSelectSubTitle' align=right><label for='input'>Type:</label></td>\n");
 			printf("<td class='reportSelectItem'>\n");
-			printf("<select name='input'>\n");
+			printf("<select name='input' id='input'>\n");
 			printf("<option value=gethost>Host\n");
 			printf("<option value=getservice>Service\n");
 			printf("</select>\n");
