2 function updateMode(i, s)
5 var mode_list = mode.split(",");
9 for (j = 0; j < mode_list.length; j++) {
11 else res += mode_list[j];
12 if (j < mode_list.length - 1) res += ",";
18 function updateOutput(output,format)
20 var theoryuri = top.theoryuri;
21 var cicuri = top.cicuri;
23 var topurl = top.topurl;
24 var processorURL = top.processorURL;
25 var getterURL = top.getterURL;
26 var mode_list = mode.split(",");
27 var new_mode = output.options[output.selectedIndex].value;
28 var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&topurl=" + topurl + "&processorURL=" + processorURL + "&getterURL=" + getterURL + "&mode=";
30 if (new_mode != mode_list[0]) {
31 updateMode(0, new_mode);
32 if (new_mode == "raw") updateMode(2, format.options[format.selectedIndex].value);
33 else updateMode(1, format.options[format.selectedIndex].value);
34 location.search = dest + top.mode;
38 function updateFormat(format)
41 var mode_list = mode.split(",");
43 if (mode_list[0] == "raw") {
44 updateMode(1, format.options[format.selectedIndex].value);
46 updateMode(2, format.options[format.selectedIndex].value);
52 function updateNatural(checkbox)
54 if (checkbox.checked) updateMode(3, "yes");
55 else updateMode(3, "no");
59 function updateAnnotations(checkbox)
61 if (checkbox.checked) updateMode(4, "yes");
62 else updateMode(4, "no");
66 function refreshReload()
70 "&cicuri=" + top.cicuri +
71 "&theoryuri=" + top.theoryuri +
72 "&processorURL=" + top.processorURL +
73 "&getterURL=" + top.getterURL;
75 top.frames[0].document.links[0].search = search;
76 top.frames[0].document.links[1].search = search;
81 function refreshcicHeader(headerURL)
83 top.cicheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.cicuri;
87 function refreshtheoryHeader(headerURL)
89 top.theoryheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.theoryuri;
93 function makeURL(type,uri,cicflags,typesflags)
96 var processorURL = top.processorURL;
97 var getterURL = top.getterURL;
98 var mode_list = mode.split(",");
103 var output = mode_list[0];
105 if (output == "raw") format = mode_list[1];
106 else format = mode_list[2];
108 if (output == "raw") {
109 url = getterURL + "getxml?uri=" + uri +
110 "&format=" + (format == "zcic" ? "gz" : "normal");
112 if (format == "html" && type == "cic") {
113 keys = "C1,HC2,L¶m.processorURL=" + escape(processorURL) +
114 "¶m.getterURL=" + escape(getterURL) +
115 "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
116 "&prop.encoding=iso-8859-1" +
117 "&prop.media-type=text/html" +
118 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
119 "¶m.encoding=iso-8859-1" +
120 "¶m.media-type=text/html" +
121 "¶m.keys=" + escape("C1,HC2,L");
122 } else if (format == "html" && type == "theory") {
123 keys = "T1,T2,L,E¶m.processorURL=" + escape(processorURL) +
124 "¶m.getterURL=" + escape(getterURL) +
125 "¶m.thkeys=" + escape("TC1,HC2,L") +
126 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
127 "¶m.encoding=iso-8859-1" +
128 "¶m.media-type=text/html" +
129 "¶m.keys=" + escape("C1,HC2,L");
130 } else if (format == "mml_cont" && type == "cic") {
132 } else if (format == "mml_cont" && type == "theory") {
133 keys = "T1,E¶m.keys=C1¶m.thkeys=TC1";
134 } else if (format == "mml_pres" && type == "cic") {
135 keys = "C1,C2,L¶m.processorURL=" + escape(processorURL) +
136 "¶m.getterURL=" + escape(getterURL) +
137 "&prop.doctype-public="+
139 "&prop.media-type=text/xml" +
140 "¶m.doctype-public=" +
142 "¶m.media-type=text/xml" +
143 "¶m.keys=" + escape("C1,C2,L");
144 } else if (format == "mml_pres" && type == "theory") {
145 keys = "T1,T2,L,E¶m.keys=C1,C2¶m.thkeys=TC1,C2,L" +
146 "¶m.doctype-public=" +
148 "¶m.media-type=text/xml";
151 var naturalLanguage = typesflags;
152 if (typesflags != "NO" || type == "theory") {
153 naturalLanguage = mode_list[3];
155 var annotations = cicflags;
156 if (cicflags != "NO" || type == "theory") {
157 annotations = mode_list[4];
159 url = processorURL + "apply?xmluri=" + escape(getterURL + "getxml?uri=" + uri) + "&keys=" + keys + "¶m.CICURI=" + uri + "¶m.naturalLanguage=" + naturalLanguage + "¶m.annotations=" + annotations;