<script type="text/javascript">
	function htmllist_get_select_options(tableId, fieldname) {
		if (fieldname == 'forwardto')
			return "<?php 
echo haproxy_js_select_options($primaryfrontends);
?>
";
		else
		if (fieldname == 'errorfile')
			return "<?php 
echo haproxy_js_select_options($a_files);
?>
";
		else
			return "<?php 
echo haproxy_js_select_options($a_servermodes);
?>
";
	}
	
	function clearcombo(){
	  for (var i=document.iform.serversSelect.options.length-1; i>=0; i--){
		document.iform.serversSelect.options[i] = null;
	  }
	  document.iform.serversSelect.selectedIndex = -1;
	}

	function setCSSdisplay(cssID, display)
	{
		var ss = document.styleSheets;
		for (var i=0; i<ss.length; i++) {
		}
		if (tableId == 'tableA_sslCertificates'){
			seltext = "<?php 
echo haproxy_js_select_options($servercerts);
?>
";
		}
		if (tableId == 'table_clientcert_ca'){
			seltext = "<?php 
echo haproxy_js_select_options($certs_ca);
?>
";
		}
		if (tableId == 'table_clientcert_crl'){
			seltext = "<?php 
echo haproxy_js_select_options($certs_crl);
?>
";
		}
		return seltext;
	}

	function setCSSdisplay(cssID, display) {
		var ss = document.styleSheets;
		for (var i=0; i<ss.length; i++) {
			var rules = ss[i].cssRules || ss[i].rules;
			for (var j=0; j<rules.length; j++) {
				if (rules[j].selectorText === cssID) {
					rules[j].style.display = display ? "" : "none";
				}
			}
echo haproxy_js_acl_select('https');
?>
";
			else
				seltext = "<?php 
echo haproxy_js_acl_select('http');
?>
";
			if (seltext == '') {
				alert("No ACL types available in current frontend type");
				return;
			}
		}
		if (tableId == 'tableA_sslCertificates'){
			seltext = "<?php 
echo haproxy_js_select_options($servercerts);
?>
";
		}
		return seltext;
	}

	function setCSSdisplay(cssID, display) {
		var ss = document.styleSheets;
		for (var i=0; i<ss.length; i++) {
			var rules = ss[i].cssRules || ss[i].rules;
			for (var j=0; j<rules.length; j++) {
				if (rules[j].selectorText === cssID) {
					rules[j].style.display = display ? "" : "none";
				}
			}
		}
		if (tableId == 'table_clientcert_ca'){
			seltext = "<?php 
echo haproxy_js_select_options($certs_ca);
?>
";
		}
		if (tableId == 'table_clientcert_crl'){
			seltext = "<?php 
echo haproxy_js_select_options($certs_crl);
?>
";
		}
		if (tableId == 'table_extaddr'){
			seltext = "<?php 
echo haproxy_js_select_options($interfaces);
?>
";
		}
		return seltext;
	}

	function setCSSdisplay(cssID, display) {
		var ss = document.styleSheets;
		for (var i=0; i<ss.length; i++) {
			var rules = ss[i].cssRules || ss[i].rules;
			for (var j=0; j<rules.length; j++) {
				if (rules[j].selectorText === cssID) {
					rules[j].style.display = display ? "" : "none";
				}
			}