+<HTML>
+<HEAD>
+<SCRIPT language="Javascript">
+var query="*"; // stringa che contiene la query nel suo stato attuale.
+var storeps=1;
+var storepv=1;
+var storepb=1; // queste tre variabili contengono il numero da assegnare al prossimo simbolo set, val o boole per creare il link nel frame in alto a sinistra.
+var stadd; // contiene la stringa da aggiungere alla query.
+var fb; // contiene la stringa da aggiungere alla query prima che i set,val e boole siano convertiti in link.
+var ltr="*"; // qui viene memorizzato qual è l' ultimo link su cui si è cliccato.
+var norvars=0;
+var nosvars=0;
+var novvars1=0;
+var novvars2=0; // queste tre variabili servono per sapere dove memorizzare i nomi delle rvar,svar e vvar inserite dall' utente.
+var wrong=0;
+var ricordaliaslist=0;
+var actinput=0;
+var numeroazioniannullate=0;
+var terminecic="";var listaliases="";var choices;var vlds=new Array();//contengono i parametri per dialogare col server in caso di ambiguità nella Match Conclusion.
+aliasglob=new Array();//per conservare la lista degli alias
+function initialize()
+ {
+ rvars=new Array(100);
+ svars=new Array(100);
+ vvars1=new Array(100);
+ vvars2=new Array(100); // contengono le rvar,svar e vvar inserite dall' utente.
+ storia=new Array();
+ storia[0]="*";
+ norvars=0;
+ nosvars=0;
+ novvars1=0;
+ novvars2=0;
+ ltr="*";
+ query="*";
+ storeps=1;
+ storepv=1;
+ storepb=1;
+ ricordaliaslist=0;
+ vlds=new Array();
+ aliasglob=new Array();
+ actinput=0;
+ numeroazioniannullate=0;
+ }
+
+// @variable@ will be substituted by the searchEngine with the param.variable
+// argument value
+var processorURL="@processorURL@";
+var getterURL="@getterURL@";
+var thkeys="@thkeys@";
+var proofcheckerURL="@proofcheckerURL@";
+var draw_graphURL="@draw_graphURL@";
+var uri_set_queueURL="@uri_set_queueURL@";
+var UNICODEvsSYMBOL="@UNICODEvsSYMBOL@";
+var keys="@keys@";
+var thkeys="@thkeys@";
+var embedkeys="@embedkeys@";
+var doctype_public="@doctype-public@";
+var encoding="@encoding@";
+var thencoding="@thencoding@";
+var media_type="@media-type@";
+var thmedia_type="@thmedia-type@";
+var interfaceURL="@interfaceURL@";
+var thinterfaceURL="@thinterfaceURL@";
+var CICURI="@CICURI@";
+var naturalLanguage="@naturalLanguage@";
+var annotations="@annotations@";
+var interface_topurl="@topurl@";
+
+function ask_uwobo(url)
+ {
+ return (top.topurl+"/ask_uwobo?url="+
+ escape(processorURL + "apply?" +
+ "xmluri=" + escape(url) +
+ "&keys=" + escape(thkeys) +
+ "¶m.processorURL=" + escape(processorURL) +
+ "¶m.getterURL=" + escape(getterURL) +
+ "¶m.proofcheckerURL=" + escape(proofcheckerURL) +
+ "¶m.draw_graphURL=" + escape(draw_graphURL) +
+ "¶m.uri_set_queueURL=" + escape(uri_set_queueURL) +
+ "¶m.UNICODEvsSYMBOL=" + escape(UNICODEvsSYMBOL) +
+ "¶m.keys=" + escape(keys) +
+ "¶m.thkeys=" + escape(thkeys) +
+ "¶m.embedkeys=" + escape(embedkeys) +
+ "¶m.doctype-public=" + escape(doctype_public) +
+ "¶m.encoding=" + escape(encoding) +
+ "¶m.thencoding=" + escape(thencoding) +
+ "¶m.media-type=" + escape(media_type) +
+ "¶m.thmedia-type=" + escape(thmedia_type) +
+ "¶m.interfaceURL=" + escape(interfaceURL) +
+ "¶m.thinterfaceURL=" + escape(thinterfaceURL) +
+ "¶m.CICURI=" + escape(CICURI) +
+ "¶m.naturalLanguage=" + escape(naturalLanguage) +
+ "¶m.annotations=" + escape(annotations) +
+ "¶m.topurl=" + escape(interface_topurl) +
+ "&prop.method=html"));
+ }
+function help(w) // quando invocata, visualizza l' help relativo ad un oggetto. Di solito è legata ad un evento onFocus o onMouseOver.
+ {
+ hw.document.close();
+ switch (w) {
+ case -10: hw.document.write("Insert an <a href="+top.topurl+top.action+"grammarpdq.html#Id target=gw>Id</a> or an <a href="+top.topurl+top.action+"grammarpdq.html#Uri target=gw>Uri</a> here.")
+ break;
+ case -9: hw.document.write("By clicking this you may add or remove aliases as you wish.")
+ break;
+ case -81: hw.document.write("Allows you to recover your last input")
+ break;
+ case -8: hw.document.write("Allows you to delete your last input")
+ break;
+ case -7: hw.document.write("Erases your query and starts a new pre-defined query, you will keep your list of aliases.")
+ break;
+ case -6: hw.document.write("Puts this string in the current cursor position. This button works only with Internet Explorer.")
+ break;
+ case -5: hw.document.write("Erases your query and starts a new one.")
+ break;
+ case -4: hw.document.write("If you click this your query will be processed and the results will appear in the frame above.")
+ break;
+ case -3: hw.document.write("Substitutes your query with the text written in the area above. Unless you have a good knowledge of MathQL, it's recommended that you use this only to recover errors.")
+ break;
+ case -2: hw.document.write("This is the edit/submit window. You can modify your query here, but be aware that no syntax check will be performed and that if you enter a <a href="+top.topurl+top.action+"grammar.html#rvar target=gw>variable</a> it won't be available for quick composition later. You may also want to add a <a href="+top.topurl+top.action+"grammar.html#set target=gw>set</a>, a <a href="+top.topurl+top.action+"grammar.html#val target=gw>val</a> or a <a href="+top.topurl+top.action+"grammar.html#boole target=gw>boole</a> somewhere in the query. If you do, write '<set>','<val>' or '<bol>' in the point you'd like it to appear, or use the buttons on the right if you are using IE. When you're done with the query, click the Submit button.")
+ break;
+ case -1: hw.document.write("You may see the grammar here.")
+ break;
+ case 0: hw.document.write("")
+ break;
+ case 1: hw.document.write("You may enter an arbitrary statement here; be careful since syntax errors won't be detected.");
+ break;
+ case 2: hw.document.write("Enter an <a href="+top.topurl+top.action+"grammar.html#attr_list target=gw>attr_list</a> here.");
+ break;
+ case 3: hw.document.write("Enter an <a href="+top.topurl+top.action+"grammar.html#id target=gw>id</a> here.");
+ break;
+ case 4: hw.document.write("You must select one previously entered <a href="+top.topurl+top.action+"grammar.html#rvar target=gw>rvar</a>. If you haven't already entered at least one, you can't choose this. ");
+ break;
+ case 5: hw.document.write("Enter a <a href="+top.topurl+top.action+"grammar.html#path target=gw>path</a> here.");
+ break;
+ case 6: hw.document.write("You must select one previously entered <a href="+top.topurl+top.action+"grammar.html#svar target=gw>svar</a>. If you haven't already entered at least one, you can't choose this. ");
+ break;
+ case 7: hw.document.write("Enter a <a href="+top.topurl+top.action+"grammar.html#string_list target=gw>string_list</a> here.");
+ break;
+ case 8: hw.document.write("You must select one <a href="+top.topurl+top.action+"grammar.html#vvar target=gw>vvar</a> previously entered as an 'attr'. If you haven't already entered at least one, you can't choose this. ");
+ break;
+ case 81: hw.document.write("You must select one <a href="+top.topurl+top.action+"grammar.html#vvar target=gw>vvar</a> previously entered in a 'let' statement. If you haven't already entered at least one, you can't choose this. ");
+ break;
+ case 9: hw.document.write("Enter a single <a href="+top.topurl+top.action+"grammar.html#quoted_string target=gw>quoted_string</a> here.");
+ break;
+ }
+ }
+function tpa(quotpath)
+ {
+ while (quotpath.indexOf("<")>-1)
+ {quotpath=quotpath.replace("<","<");}
+ while (quotpath.indexOf(">")>-1)
+ {quotpath=quotpath.replace(">",">");}
+ return (quotpath);
+ }
+function idcheck(ident)
+ {
+ lettera=/[a-zA-Z]/;
+ partediid=/[a-zA-Z0-9_\-\']/;
+ if (!lettera.test(ident.charAt(0))){alert("an Id must begin with a letter.");return(0)}
+ while (ident.length>0)
+ {
+ ident=ident.substring(1,(ident.length));
+ if (ident.length>0){
+ if (!partediid.test(ident.charAt(0))){alert(ident.charAt(0)+" is not a valid character for an Id.");return(0);}
+ }}
+ return(1)
+ }
+function uricheck(ident)
+ {
+ cifra=/[0-9]/
+ cic=ident.substring(0,5);//alert(cic);
+ if (cic!="cic:/"){alert("an Uri must begin with the string 'cic:/'");return(0);}
+ ident=ident.substring(5,ident.length);//alert(ident);
+ if (ident.indexOf(".")<0){alert("an Uri must contain a '.'");return(0);}
+ ident1=ident.substring(0,ident.indexOf("."));//alert(ident1);
+ ident2=ident.substring(ident.indexOf(".")+1,ident.length);//alert(ident2);
+ while (ident1.length>0)
+ {
+ if (ident1.indexOf("/")>-1)
+ {
+ if (idcheck(ident1.substring(0,ident1.indexOf("/")))==0){return (0)}
+ ident1=ident1.substring(ident1.indexOf("/")+1,ident1.length);//alert(ident1);
+ }
+ else {if (idcheck(ident1)==0){return (0)}
+ ident1="";}
+ }
+ if (ident2=="con"||ident2=="var"){return(1)}
+ if (ident2.substring(0,6)!="ind#1/"){alert ("syntax error in the Uri.");return(0);}
+ ident2=ident2.substring(6,ident2.length);//alert(ident2);
+ if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+ if (ident2.indexOf("/")>-1)
+ {
+ while (ident2.charAt(0)!="/")
+ {
+ //alert(ident2);
+ if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+ ident2=ident2.substring(1,ident2.length);
+ }
+ }
+ while (ident2.length>0)
+ {
+ //alert(ident2);
+ ident2=ident2.substring(1,ident2.length);
+ if (ident2.length>0){
+ if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+ }}
+
+ return(1)
+ }
+function gramcheck(how,what) // esegue il controllo sintattico sulla stringa "what", controllando che rispetti i requisiti indicati dalla clausola "how". Se qualcosa non è ok, la variabile "wrong" viene posta ad 1 e la stringa da aggiungere viene ignorata, mentre viene visualizzato un apposito messaggio di errore.
+ {
+ var slash=0;
+ var alpha=/[A-Za-z:_]/
+ var numero=/[0-9]/
+ switch (how) {
+ case "qsl": // lista di quoted string
+ if (what.charAt(0)!="{") {gramcheck("qs",what);break;}
+ if (what.charAt(what.length-1)!="}") {alert ("The list must end with a '}'.");wrong=1;break;}
+ what=what.substring(1,what.length-1);//alert (what);
+ while (what.indexOf("\",\"")>-1)
+ {
+ as=what.substring(0,what.indexOf("\",\"")+1);//alert(as);
+ what=what.substring(what.indexOf("\",\"")+2,what.length);//alert(what);
+ gramcheck("qs",as);
+ }
+ gramcheck("qs",what);
+ break;
+ case "qp": // quoted path
+ if (what.charAt(0)!="\"") {alert ("A quoted string must be included between quotes."); wrong=1; break;}
+ if (what.charAt(what.length-1)!="\"") {alert ("A quoted string must be included between quotes."); wrong=1; break;}
+ while (what.indexOf("\"/\"")>-1)
+ {
+ as=what.substring(0,what.indexOf("\"/\"")+1);//alert(as);
+ what=what.substring(what.indexOf("\"/\"")+2,what.length);//alert(what);
+ gramcheck("qs",as);
+ }
+ gramcheck("qs",what);
+ break;
+ case "qs": // quoted string
+ if (what.charAt(0)!="\"") {alert ("A quoted string must be included between quotes."); wrong=1; break;}
+ if (what.charAt(what.length-1)!="\"") {alert ("A quoted string must be included between quotes."); wrong=1; break;}
+ what=what.substring(0,what.length-1);//alert (what);
+ if (wrong==1) break;
+ else while (what.length>0)
+ {
+ what=what.substring(1,what.length);
+ if (what.charAt(0)=="\"" && slash==0) {alert ("A \" in a quoted string must be preceded by a \\.");wrong=1;break;}
+ if (what.charAt(0)=="\\") {slash=1} else {slash=0}
+ if (slash==1 && what.length==1) {alert ("A \\ in a quoted string must be followed by something.");wrong=1;}
+ }
+ break;
+ case "vlist": // lista di vvar (tutto ciò che si trova dopo "attr")
+ //alert(what.substring(0,4));
+ if ((what.substring(0,4))!="attr"){wrong=1;alert("A vvar_list must begin with the word 'attr'")}
+ what=what.substring(5,(what.length));vl=what;
+ //alert(what+"what");
+ while (what.length>0)
+ {
+ if (what.indexOf(",")>0) {vv=(what.substring(0,what.indexOf(",")));}
+ else {vv=what}
+ //alert(vv+"vv");
+ if (vv.charAt(0)!="$"){wrong=1;alert("A vvar must begin with a '$'");}
+ if (vv.indexOf("<-")>0)
+ {
+ what=what.substring(vv.length+1,what.length);
+ //alert(what+" nuovowhat "+wrong);
+ path=vv.substring(vv.indexOf("<-")+2,vv.length);
+ //alert(path+" path "+wrong);
+ gramcheck("qp",path);
+ vv=vv.substring(1,(vv.indexOf("<-")));
+ //alert(vv+" vv "+wrong);
+ gramcheck("id",vv);
+ }
+ else {wrong=1;alert("An Assign must contain a '<-'.");what="";}
+ //alert (what+"what");
+ }
+ break;
+ case "id":
+ //alert (what.charAt(0));
+ if (!alpha.test(what.charAt(0))) {wrong=1;alert("An ID must begin with a letter , ':' , or '_' .");}
+ while (what.length>1) {
+ what=what.substring(1,(what.length));
+ if (!alpha.test(what.charAt(0)) && !numero.test(what.charAt(0)))
+ {wrong=1;alert(what.charAt(0)+" is not a valid character for an id.");}
+ //document.write(what+"<BR>");
+ }
+ break;
+ }
+
+ if (how=="vlist" && wrong==0) // nel caso in cui sia stato eseguito il controllo su una lista di vvar e non siano stati riscontrati errori, tutte le variabili inserite vengono memorizzate.
+ {
+ while (vl.length>0)
+ {
+ if (vl.indexOf(",")>-1)
+ {
+ vvars2[novvars2++]=vl.substring(0,vl.indexOf("<"));
+ vl=vl.substring(vl.indexOf(",")+1,vl.length);
+ }
+ else
+ {
+ vvars2[novvars2++]=vl.substring(0,vl.indexOf("<"));;
+ vl="";
+ }
+ }
+ //alert ("esco dal loop");
+ }
+ if (wrong==0) {cw.inputok=1} else stadd="";
+ }
+function savelink(n,t) // invocata quando si clicca su un link, memorizza quale di questi debba poi essere sostituito.
+ {
+ if (t=='s') { top.ltr="[?set"+String(n)+"]";}
+ if (t=='v') { top.ltr="[?val"+String(n)+"]";}
+ if (t=='b') { top.ltr="[?bol"+String(n)+"]";}
+// alert(ltr);
+ }
+function aggcw() // invocata automaticamente ad ogni modifica della variabile "query", fa apparire nel frame in alto a destra il menu di composizione relativo al primo link della query. Consente quindi di comporre tutta la query senza mai cliccare su alcun link.
+ {
+ pq=query;
+ while (pq.length>0)
+ {
+ if (pq.indexOf("[?")>-1)
+ {
+ ltr=pq.slice(pq.indexOf("[?"));
+ ltr=ltr.substring(ltr.indexOf("[?"),(ltr.length-ltr.indexOf("[?"))-(ltr.length-ltr.indexOf("]")-1));
+ wto=ltr.substring(2,5);
+ if (wto=="set") {window.open(top.topurl+action+"set.html","cw");pq="";}
+ else if (wto=="val") {window.open(top.topurl+action+"val.html","cw");pq="";}
+ else if (wto=="bol") {window.open(top.topurl+action+"boole.html","cw");pq="";}
+ else pq=pq.substring(pq.indexOf("[?")+2,pq.length);
+ }
+ else {window.open(top.topurl+action+"blank.html","cw");pq="";}
+ }
+ }
+function aggform() // aggiorna il form nel frame centrale. Invocata ad ogni cambio della variabile "query".
+ {
+ cquery=query;
+ while (cquery.indexOf("<")>-1)
+ {
+ cquery=cquery.replace(cquery.substring(cquery.indexOf("<"),cquery.indexOf(">")+1),"");
+ //alert(cquery);
+ }
+ while (cquery.indexOf("[?")>-1)
+ {
+ //alert(cquery);
+ if (cquery.indexOf("]")>-1)
+ {
+ while (cquery.indexOf("]")<cquery.indexOf("[?") && cquery.indexOf("]")>-1)
+ {cquery=cquery.replace("]","q+u+a+d+r+a+c+h+i+u+s+a");}//alert("loop"+cquery.indexOf("]")+cquery.indexOf("[?"))}
+ ag1=cquery.slice(cquery.indexOf("[?"));//alert(ag1);
+ ag1=ag1.substring(ag1.indexOf("[?"),(ag1.length-ag1.indexOf("[?"))-(ag1.length-ag1.indexOf("]")));//alert(ag1);
+ ag2=ag1.substring(2,5);//alert(ag2);
+ if (ag2=="set") cquery=cquery.replace(cquery.substring(cquery.indexOf("[?"),cquery.indexOf("]")+1),"<set>");
+ else if (ag2=="val") cquery=cquery.replace(cquery.substring(cquery.indexOf("[?"),cquery.indexOf("]")+1),"<val>");
+ else if (ag2=="bol") cquery=cquery.replace(cquery.substring(cquery.indexOf("[?"),cquery.indexOf("]")+1),"<boole>");
+ else cquery=cquery.replace(cquery.substring(cquery.indexOf("[?"),cquery.indexOf("[?")+1),"q+u+a+d+r+a");
+ //alert(cquery);
+ }
+ else {cquery=cquery.replace("[?","q+u+a+d+r+a?")}
+ //alert(cquery);
+ }
+ while (cquery.indexOf("q+u+a+d+r+a+c+h+i+u+s+a")>-1)
+ {
+ cquery=cquery.replace("q+u+a+d+r+a+c+h+i+u+s+a","]");
+ }
+ while (cquery.indexOf("q+u+a+d+r+a")>-1)
+ {
+ cquery=cquery.replace("q+u+a+d+r+a","[");
+ }
+ while (cquery.indexOf("<")>-1)
+ {
+ cquery=cquery.replace("<","<");
+ }
+ while (cquery.indexOf(">")>-1)
+ {
+ cquery=cquery.replace(">",">");
+ }
+ top.sw.agg();
+ }
+function ripristina()
+ {
+ //alert (actinput+" "+storia.length);
+ if (numeroazioniannullate>0)
+ {
+ numeroazioniannullate--;
+ query=storia[actinput+1];actinput++;
+ qw.document.close();
+ qw.document.write(query);
+ aggform();
+ sw.apply();
+ aggcw();
+ cw.focus();
+ }
+ }
+function annulla()
+ {
+ //alert (actinput+" "+storia.length);
+ if (actinput>0)
+ {
+ numeroazioniannullate++;
+ query=storia[actinput-1];actinput--;
+ qw.document.close();
+ qw.document.write(query);
+ aggform();
+ sw.apply();
+ if (query=="*"){cw.location=top.topurl+action+"set.html";ltr="*";} else {aggcw();}
+ cw.focus();
+ }
+ }
+function parse() // prende la stringa che si sta tentando di inserire nella query, aggiunge i link dove necessario e mette il risultato nella variabile "fb"
+ {
+ while (fb.indexOf("[set]")>-1){
+ if (fb.indexOf("set")>0)
+ {
+ fb=fb.replace("[set]","<A HREF="+top.topurl+action+"set.html target=cw onclick=top.savelink("+top.storeps+",'s')>[?set"+top.storeps+"]</A>");
+ top.storeps++;
+ }
+ }
+ while (fb.indexOf("[val]")>-1){
+ if (fb.indexOf("val")>0)
+ {
+ fb=fb.replace("[val]","<A HREF="+top.topurl+action+"val.html target=cw onclick=top.savelink("+top.storepv+",'v')>[?val"+top.storepv+"]</A>");
+ top.storepv++;
+ }
+ }
+ while (fb.indexOf("[boole]")>-1){
+ if (fb.indexOf("boole")>0)
+ {
+ fb=fb.replace("[boole]","<A HREF="+top.topurl+action+"boole.html target=cw onclick=top.savelink("+top.storepb+",'b')>[?bol"+top.storepb+"]</A>");
+ top.storepb++;
+ }
+ }
+ }
+function aggq() // aggiorna la query sostituendo l' ultimo link editato con la stringa inserita, poi aggiorna tutti i frame.
+ {
+ //window.open(top.topurl+action+"summary.html","cw");
+ qw.document.close();
+ fb=stadd;
+ nst=ltr.substring(5,(ltr.length-1));// alert(nst+" "+ltr);
+ query=query.replace("<A HREF="+top.topurl+action+"set.html target=cw onclick=top.savelink("+nst+",'s')>"+ltr+"</A>",ltr);
+ query=query.replace("<A HREF="+top.topurl+action+"val.html target=cw onclick=top.savelink("+nst+",'v')>"+ltr+"</A>",ltr);
+ query=query.replace("<A HREF="+top.topurl+action+"boole.html target=cw onclick=top.savelink("+nst+",'b')>"+ltr+"</A>",ltr);
+ parse();
+ query=query.replace(ltr,fb);
+ actinput++;storia[actinput]=query;numeroazioniannullate=0;//alert (actinput+" "+storia.length);
+ qw.document.write(query);aggform();
+ aggcw();
+ cw.focus();
+ }
+var re1 = /(.*)\?.*/;
+var re2 = /(.*)\/.*/;
+var topurl=document.location+"";
+topurl = topurl.replace(re1,"$1");
+topurl = topurl.replace(re2,"$1");
+//var topurl=document.location.protocol+'//'+document.location.host;
+var action="/getpage?url=";
+//var action="";
+
+
+// UTILITY FUNCTIONS FOR templateambigpdq1.html
+function templateambigpdq1_armageddon()
+ {
+ top.initialize();
+ top.window.open(top.topurl+top.action+"start.html","qw");
+ top.window.open(top.topurl+top.action+"blank.html","cw");
+ top.window.open(top.topurl+top.action+"blank.html","hw");
+ top.window.open(top.topurl+top.action+"blank.html","gw");
+ top.window.open(top.topurl+top.action+"blank.html","sw");
+ }
+
+function templateambigpdq1_resetta()
+ {
+ if (confirm("This will erase your query and start a new one. Are you sure you want to do this?"))
+ {templateambigpdq1_armageddon();}
+ }
+
+function templateambigpdq1_listauri(document,elenco)
+ {
+ for (i=0;i<elenco.length;i++)
+ {
+ document.write("<input type=checkbox name=uricheck value="+elenco[i]+"> "+elenco[i]+"<br>");
+ }
+ }
+
+function templateambigpdq1_invia(document,top,elenco,ident)
+ {
+ vecchiavlds=top.vlds.length;
+ stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
+ stringa=stringa+"&aliases="+top.listaliases;
+ stringa=stringa+"&choices=";
+ var choices = "";
+ top.vlds[top.vlds.length]=ident;
+ for (j=0;j<elenco.length;j++)
+ {
+ if (document.disamb.uricheck[j].checked)
+ {
+ top.vlds[top.vlds.length]=document.disamb.uricheck[j].value;
+ }
+ }
+ top.vlds[top.vlds.length]=";";
+ for (j=0;j<top.vlds.length;j++)
+ {
+ choices=choices+(top.vlds[j]==";"?";":escape(top.vlds[j]))+" ";
+ }
+ choices=choices.substring(0,choices.length-2);
+ top.choices = choices;
+ stringa=stringa+escape(choices);
+ if (top.vlds.length==vecchiavlds){alert("You must select at least one of the options.");}
+ else
+ {
+ window.open(ask_uwobo(stringa),"cw");
+ }
+ }
+
+ function templateambigpdq1_selezionaCostanti(document,elenco) {
+ for (i=0; i<elenco.length; i++) {
+ if (elenco[i].substring(elenco[i].length-4, elenco[i].length) != ".var") {
+ document.disamb.uricheck[i].checked = true;
+ } else {
+ document.disamb.uricheck[i].checked = false;
+ }
+ }
+ }
+
+
+
+// UTILITY FUNCTIONS FOR templateambigpdq2.html
+function templateambigpdq2_armageddon()
+ {
+ top.initialize();
+ top.window.open(top.topurl+top.action+"start.html","qw");
+ top.window.open(top.topurl+top.action+"blank.html","cw");
+ top.window.open(top.topurl+top.action+"blank.html","hw");
+ top.window.open(top.topurl+top.action+"blank.html","gw");
+ top.window.open(top.topurl+top.action+"blank.html","sw");
+ }
+
+function templateambigpdq2_resetta()
+ {
+ if (confirm("This will erase your query and start a new one. Are you sure you want to do this?"))
+ {templateambigpdq2_armageddon();}
+ }
+
+function templateambigpdq2_listainterpretazioni(document,elenco,labels)
+ {
+ for (i=0;i<elenco.length;i++)
+ {
+ document.write("<input type=radio name=interp value="+elenco[i]+"> "+labels[i]+"<br />");
+ }
+ }
+
+function templateambigpdq2_invia(document,elenco)
+ {
+ stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
+ stringa=stringa+"&aliases=";
+ controllo=stringa.length;
+ for (j=0;j<elenco.length;j++)
+ {
+ if (document.disamb.interp[j].checked)
+ {
+ stringa=stringa+escape(elenco[j]);
+
+ // TODO da implementare nella terza fase
+ //top.aliasglob[top.aliasglob.length]=document.disamb.interp[j].value;
+
+ //for (k=0;k<top.aliasglob.length;k++){alert(top.aliasglob[k])}
+ //top.listaliases=top.listaliases+document.disamb.interp[j].value;//in caso di query ulteriori con la stessa lista di alias
+ }
+
+ }
+ if (stringa.length!=controllo)
+ {
+ window.open(ask_uwobo(stringa),"cw");
+ }
+ else {alert("You must choose one option.");}
+ }
+
+
+
+// UTILITY FUNCTIONS FOR templateambigpdq3.html
+function templateambigpdq3_init(aliases)
+{
+ top.aliasglob = new Array();
+ for (i=0; i<aliases.length; i++) {
+ top.aliasglob[i] = aliases[i];
+ }
+ top.vlds=new Array();
+ top.window.open(top.topurl+top.action+"editorpdq.html", "sw");
+}
+
+// UTILITY FUNCTIONS FOR constraints_choice_template.html
+function get_value_of_checkbox(checkbox)
+ {
+ return (checkbox.checked ? "1" : "0");
+ }
+
+function constraints_choice_template_invia(document,aliases,constr_obj_len,constr_rel_len,constr_sort_len)
+ {
+ stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
+ stringa=stringa+"&aliases="+escape(aliases);
+ stringa=stringa+"&choices="+escape(top.choices);
+ stringa=stringa+"&constraints=";
+ for (j=0;j<constr_obj_len;j++)
+ {
+ stringa += document.constraints.constr_obj[j].checked ? "1" : "0";
+ stringa += !document.constraints.obj_depth[j] ||
+ document.constraints.obj_depth[j].value == "" ? "_" :
+ document.constraints.obj_depth[j].value;
+ if (j < constr_obj_len - 1) { stringa += "," }
+ }
+ stringa += ":";
+ for (j=0;j<constr_rel_len;j++)
+ {
+ stringa += document.constraints.constr_rel[j].checked ? "1" : "0";
+ stringa += document.constraints.rel_depth[j].value == "" ? "_" :
+ document.constraints.rel_depth[j].value;
+ if (j < constr_rel_len - 1) { stringa += "," }
+ }
+ stringa += ":";
+ for (j=0;j<constr_sort_len;j++)
+ {
+ stringa += document.constraints.constr_sort[j].checked ? "1" : "0";
+ stringa += document.constraints.sort_depth[j].value == "" ? "_" :
+ document.constraints.sort_depth[j].value;
+ if (j < constr_sort_len - 1) { stringa += "," }
+ }
+ stringa += ":"+get_value_of_checkbox(document.constraints.only_obj)+
+ ":"+get_value_of_checkbox(document.constraints.only_rel)+
+ ":"+get_value_of_checkbox(document.constraints.only_sort);
+ window.open(ask_uwobo(stringa),"cw");
+ }
+</SCRIPT>
+</HEAD>
+ <SCRIPT>
+ document.write(' <FRAMESET ROWS="69%,31%"> <FRAMESET COLS="40%,60%"> <FRAMESET ROWS="46%,54%"> <FRAME NAME="qw" SRC="'+topurl+action+'start.html"> <FRAME NAME="sw" SRC="'+topurl+action+'blank.html"> </FRAMESET> <FRAME NAME="cw" SRC="'+topurl+action+'blank.html"> </FRAMESET> <FRAMESET COLS="49%,51%"> <FRAME NAME="gw" SRC="'+topurl+action+'blank.html" onFocus="help(-1)";> <FRAME NAME="hw" SRC="'+topurl+action+'blank.html"> </FRAMESET> </FRAMESET>');
+ </SCRIPT>
+</HTML>