b7b15a261ae3e28941a2891ee568c9b472fcda7e
angie
  Wed Jul 30 14:44:14 2014 -0700
Added jsMakeSetClearContainer / jsEndContainer to jsHelper.c, and apppliedthem to a couple long lists of checkboxes in hgVai.  While at it, I moved
jsHelper.c's javascript-inlined-in-HTML out to a new .js file, jsHelper.js.

diff --git src/hg/hgVai/hgVai.c src/hg/hgVai/hgVai.c
index c0a6e81..b5c68d0 100644
--- src/hg/hgVai/hgVai.c
+++ src/hg/hgVai/hgVai.c
@@ -619,41 +619,43 @@
 			TRUE);
 printf("<A HREF='https://sites.google.com/site/jpopgen/dbNSFP' TARGET=_BLANK>dbNSFP</A> "
        "(<A HREF='http://onlinelibrary.wiley.com/doi/10.1002/humu.22376/abstract' "
        "TARGET=_BLANK>Liu <em>et al.</em> 2013</A>) "
        "release 2.0 "
        "provides pre-computed scores and predictions of functional significance "
        "from a variety of tools.  Every possible coding change to transcripts in "
  //#*** hardcoded version info... sigh, we need trackDb... or metaDb??
        "Gencode release 9 (Ensembl 64, Dec. 2011) gene predictions "
        "has been evaluated.  "
        "<em>Note: This may not encompass all transcripts in your "
        "selected gene set.</em><BR>\n");
 //#*** Another cheap hack: reverse alph order happens to be what we want,
 //#*** but priorities would be cleaner:
 slReverse(&dbNsfpTables);
+jsMakeSetClearContainer();
 struct slName *table;
 for (table = dbNsfpTables;  table != NULL;  table = table->next)
     {
     if (sameString(table->name, "dbNsfpPolyPhen2"))
 	{
 	printDbNsfpSource(table->name, HDIV);
 	printDbNsfpSource(table->name, HVAR);
 	}
     else
 	printDbNsfpSource(table->name, 0);
     }
+jsEndContainer();
 puts("<BR>");
 endCollapsibleSection();
 }
 
 char *findLatestSnpTable(char *suffix)
 /* Return the name of the 'snp1__<suffix>' table with the highest build number, if any. */
 {
 if (startsWith(hubTrackPrefix, database))
     return NULL;
 if (suffix == NULL)
     suffix = "";
 char likeExpr[64];
 safef(likeExpr, sizeof(likeExpr), "LIKE 'snp1__%s'", suffix);
 struct sqlConnection *conn = hAllocConn(database);
 struct slName *snpNNNTables = sqlListTablesLike(conn, likeExpr);
@@ -863,57 +865,59 @@
 // Make wrapper table for collapsible sections:
 puts("<TABLE border=0 cellspacing=5 cellpadding=0 style='padding-left: 10px;'>");
 selectDbNsfp(dbNsfpTables);
 selectDbSnp(gotSnp);
 trackCheckBoxSection("Cosmic", "COSMIC", cosmicTrackRefList);
 trackCheckBoxSection("ConsEl", "Conserved elements", elTrackRefList);
 trackCheckBoxSection("ConsScore", "Conservation scores", scoreTrackRefList);
 puts("</TABLE>");
 }
 
 void selectFiltersFunc()
 /* Options to restrict variants based on gene region/soTerm from gpFx */
 {
 startCollapsibleSection("filtersFunc", "Functional role", FALSE);
 printf("Include variants annotated as<BR>\n");
+jsMakeSetClearContainer();
 cartMakeCheckBox(cart, "hgva_include_intergenic", TRUE);
 printf("intergenic<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_upDownstream", TRUE);
 printf("upstream/downstream of gene<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_nmdTranscript", TRUE);
 printf("in transcript already subject to nonsense-mediated decay (NMD)<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_exonLoss", TRUE);
 printf("exon loss caused by deletion<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_utr", TRUE);
 printf("5' or 3' UTR<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_cdsSyn", TRUE);
 printf("CDS - synonymous coding change<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_cdsNonSyn", TRUE);
 printf("CDS - non-synonymous (missense, stop gain/loss, frameshift etc)<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_intron", TRUE);
 printf("intron<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_splice", TRUE);
 printf("splice site or splice region<BR>\n");
 cartMakeCheckBox(cart, "hgva_include_nonCodingExon", TRUE);
 printf("exon of non-coding gene<BR>\n");
 struct slRef *regTrackRefList = findRegulatoryTracks();
 if (regTrackRefList != NULL)
     {
     cartMakeCheckBox(cart, "hgva_include_regulatory", TRUE);
     printf("regulatory element (note: these are detected only if one or more tracks "
 	   "are selected in Regulatory regions above)<BR>\n");
     }
+jsEndContainer();
 puts("<BR>");
 endCollapsibleSection();
 }
 
 void selectFiltersKnownVar()
 /* Options to restrict output based on overlap with known variants. */
 {
 boolean gotCommon = findSnpBed4("Common", NULL, NULL);
 boolean gotMult = findSnpBed4("Mult", NULL, NULL);
 if (!gotCommon && !gotMult)
     return;
 startCollapsibleSection("filtersVar", "Known variation", FALSE);
 if (gotMult)
     {
     cartMakeCheckBox(cart, "hgva_include_snpMult", TRUE);