Index: src/lib/cheapcgi.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/cheapcgi.c,v
retrieving revision 1.130
retrieving revision 1.131
diff -b -B -U 4 -r1.130 -r1.131
--- src/lib/cheapcgi.c	13 Jan 2010 23:45:56 -0000	1.130
+++ src/lib/cheapcgi.c	8 Feb 2010 22:08:41 -0000	1.131
@@ -1176,15 +1176,34 @@
 {
 cgiMakeCheckBox2Bool(name,checked,TRUE,id,javascript);
 }
 
-void cgiMakeCheckBox2BoolWithIdAndJS(char *name, boolean checked, boolean enabled,char *id, char *javascript)
-/* Make check box supporting 2 boolean state: checke/unchecked and enabled/disabled
-   Also support ID and javascript.*/
+void cgiMakeCheckBoxFourWay(char *name, boolean checked, boolean enabled, char *id, char *classes, char *moreHtml)
+/* Make check box - with fourWay functionality (checked/unchecked by enabled/disabled)
+ * Also makes a shadow hidden variable that supports the 2 boolean states. */
 {
-cgiMakeCheckBox2Bool(name,checked,enabled,id,javascript);
+char shadName[256], extra[256];
+
+printf("<INPUT TYPE=CHECKBOX NAME='%s'", name);
+if(id)
+    printf(" id='%s'", id);
+if(checked)
+    printf(" CHECKED");
+if(!enabled)
+    printf(" DISABLED");
+if(classes)
+    printf(" class='%s'",classes);
+if(moreHtml)
+    printf(" %s",moreHtml);
+printf(">");
+
+// The hidden var needs to hold the 4way state
+safef(shadName, sizeof(shadName), "%s%s", cgiBooleanShadowPrefix(), name);
+safef(extra, sizeof(extra), "id='%s_4way'",name);
+cgiMakeHiddenVarWithExtra(shadName, ( enabled ? "0" : (checked ? "-1" : "-2")),extra); // Doesn't need enabled/checked!
 }
 
+
 void cgiMakeHiddenBoolean(char *name, boolean on)
 /* Make hidden boolean variable. Also make a shadow hidden variable so we
  * can distinguish between variable not present and
  * variable set to false. */
@@ -1556,12 +1575,16 @@
     }
 printf("</SELECT>\n");
 }
 
-void cgiMakeHiddenVar(char *varName, char *string)
+void cgiMakeHiddenVarWithExtra(char *varName, char *string,char *extra)
 /* Store string in hidden input for next time around. */
 {
-printf("<INPUT TYPE=HIDDEN NAME=\"%s\" VALUE=\"%s\">", varName, string);
+printf("<INPUT TYPE=HIDDEN NAME='%s' VALUE='%s'", varName, string);
+if(extra)
+    printf(" %s>\n",extra);
+else
+    puts(">");
 }
 
 void cgiContinueHiddenVar(char *varName)
 /* Write CGI var back to hidden input for next time around. */
@@ -1830,8 +1853,8 @@
     //printf(".hiddenRoof {border-top: 0px solid %s;}\n",COLOR_BG_ALTDEFAULT);     // Doesn't work
     //printf(".hiddenFloor {border-bottom: 0px solid %s;}\n",COLOR_BG_ALTDEFAULT); // Doesn't work
     printf(".greenBox {border: 5px outset %s;}\n",COLOR_DARKGREEN);
     printf(".blueBox {border: 4px inset %s;}\n",COLOR_DARKBLUE);
-    printf(".halfVis {opacity: 0.5;}\n");
+    printf(".halfVis {opacity: 0.5; filter:alpha(opacity=50;}\n");
     puts("</style>");
 }
 

