"      top.frames[list_frame].document.open();\n" "      top.frames[list_frame].document.close();\n" "      top.frames[button_frame].document.open();\n" "      top.frames[button_frame].document.close();\n"
wallet_RequestToPrefill(XP_List * list) {  char *buffer = (char*)XP_ALLOC(BUFLEN);  char *buffer2 = 0;  PRInt32 g = 0;  XPDialogStrings* strings;  strings = XP_GetDialogStrings(16024);//strings = XP_GetDialogStrings(XP_CERT_PAGE_STRINGS); /* why doesn't this link? */  if (!strings) {    return;  }  LocalStrAllocCopy(buffer2, "");  /* generate initial section of html file */  g += PR_snprintf(buffer+g, BUFLEN-g,"<HTML>\n""<HEAD>\n""  <TITLE>Pre-Filling</TITLE>\n""  <SCRIPT>\n""    index_frame = 0;\n""    title_frame = 1;\n""    list_frame = 2;\n""    button_frame = 3;\n""\n"    );  FLUSH_BUFFER  /* start generating list of fillins *///  StrAllocCopy (heading, XP_GetString(???); !!!HOW DO WE DO I18N IN RAPTOR???  g += PR_snprintf(buffer+g, BUFLEN-g,"    function loadFillins(){\n""      top.frames[title_frame].document.open();\n""      top.frames[title_frame].document.write\n""        (\"&nbsp;%s\");\n""      top.frames[title_frame].document.close();\n""\n""      top.frames[list_frame].document.open();\n""      top.frames[list_frame].document.write(\n""        \"<FORM name=fSelectFillin>\" +\n""          \"<BR>\" +\n""          \"<TABLE BORDER=0>\" +\n""            \"<TR>\" +\n""              \"<TD>\" +\n""                \"<BR>\" +\n",    "Following items can be pre-filled for you."); //!!!NEED I18N!!!  FLUSH_BUFFER//  PR_FREEIF(heading); !!! NEED TO I18N THIS !!!  /* generate the html for the list of fillins */  wallet_PrefillElement * ptr;  XP_List * list_ptr = list;  PRUint32 count;  while((ptr = (wallet_PrefillElement *) XP_ListNextObject(list_ptr))!=0) {    char * schema;    schema = ptr->schema->ToNewCString();    char * value;    value = ptr->value->ToNewCString();    if (ptr->count) {      count = ptr->count;      g += PR_snprintf(buffer+g, BUFLEN-g,"                \"<TR>\" +\n""                  \"<TD>%s:  </TD>\" +\n""                  \"<TD>\" +\n""                    \"<SELECT>\" +\n""                      \"<OPTION VALUE=\\\"%s\\\">%s</OPTION>\" +\n",        schema, schema, value);    } else {      g += PR_snprintf(buffer+g, BUFLEN-g,"                      \"<OPTION VALUE=\\\"%s\\\">%s</OPTION>\" +\n",        schema, value);    }    count--;    if (count == 0) {    g += PR_snprintf(buffer+g, BUFLEN-g,"                      \"<OPTION VALUE=\\\"%s\\\"></OPTION>\" +\n""                    \"</SELECT><BR>\" +\n""                  \"</TD>\" +\n""                \"</TR>\" +\n",      schema);    }    FLUSH_BUFFER    delete schema;    delete value;  }      /* finish generating list of fillins */  g += PR_snprintf(buffer+g, BUFLEN-g,"              \"</TD>\" +\n""            \"</TR>\" +\n""          \"</TABLE>\" +\n""        \"</FORM>\"\n""      );\n""      top.frames[list_frame].document.close();\n""    };\n""\n"    );  FLUSH_BUFFER//  PR_FREEIF(heading); !!! NEED TO I18N THIS !!!/* generate rest of html */  g += PR_snprintf(buffer+g, BUFLEN-g,"    function loadButtons(){\n""      top.frames[button_frame].document.open();\n""      top.frames[button_frame].document.write(\n""        \"<FORM name=buttons action=internal-walletPrefill-handler method=post>\" +\n""          \"<BR>\" +\n""          \"<DIV align=center>\" +\n""            \"<INPUT type=BUTTON value=OK width=80 onclick=parent.clicker(this,window.parent)>\" +\n""            \" &nbsp;&nbsp;\" +\n""            \"<INPUT type=BUTTON value=Cancel width=80 onclick=parent.clicker(this,window.parent)>\" +\n""          \"</DIV>\" +\n""          \"<INPUT type=HIDDEN name=xxxbuttonxxx>\" +\n""          \"<INPUT type=HIDDEN name=handle value="    );  FLUSH_BUFFER  /* generate remainder of html, it will go into strings->arg[2] */  g += PR_snprintf(buffer+g, BUFLEN-g,">\" +\n""          \"<INPUT TYPE=HIDDEN NAME=fillins VALUE=\\\" \\\" SIZE=-1>\" +\n""          \"<INPUT TYPE=HIDDEN NAME=list VALUE=\\\" \\\" SIZE=-1>\" +\n""        \"</FORM>\"\n""      );\n""      top.frames[button_frame].document.close();\n""    }\n""\n""    function loadFrames(){\n""      loadFillins();\n""      loadButtons();\n""    }\n""\n""    function clicker(but,win){\n""      selname = top.frames[list_frame].document.fSelectFillin;\n""      var list = top.frames[button_frame].document.buttons.list;\n""      list.value = %ld;\n""      var fillins = top.frames[button_frame].document.buttons.fillins;\n""      fillins.value = \"\";\n""      for (i=0; i<selname.length; i++) {\n""        fillins.value = fillins.value +\n""          selname.elements[i].options[selname.elements[i].selectedIndex].value + \"%s\" +\n""          selname.elements[i].options[selname.elements[i].selectedIndex].text + \"%s\";\n""      }\n"#ifndef HTMLDialogs"      var expires = new Date();\n""      expires.setTime(expires.getTime() + 1000*60*60*24*365);\n""      document.cookie = \"htmldlgs=|\" + but.value +\n""        '|list|' + list.value + '|fillins|' + fillins.value + '|' +\n""        \"; expires=\" + expires.toGMTString();\n"#endif"      top.frames[button_frame].document.buttons.xxxbuttonxxx.value = but.value;\n""      top.frames[button_frame].document.buttons.xxxbuttonxxx.name = 'button';\n""      top.frames[button_frame].document.buttons.submit();\n"#ifndef HTMLDialogs "      top.frames[list_frame].document.open();\n""      top.frames[list_frame].document.close();\n""      top.frames[button_frame].document.open();\n""      top.frames[button_frame].document.close();\n"#endif"    }\n""\n""  </SCRIPT>\n""</HEAD>\n""<FRAMESET ROWS = 25,25,*,75\n""         BORDER=0\n""         FRAMESPACING=0\n""         onLoad=loadFrames()>\n""  <FRAME SRC=about:blank\n""        NAME=index_frame\n""        SCROLLING=NO\n""        MARGINWIDTH=1\n""        MARGINHEIGHT=1\n""        NORESIZE>\n""  <FRAME SRC=about:blank\n""        NAME=title_frame\n""        SCROLLING=NO\n""        MARGINWIDTH=1\n""        MARGINHEIGHT=1\n""        NORESIZE>\n""    <FRAME SRC=about:blank\n""          NAME=list_frame\n""          SCROLLING=AUTO\n""          MARGINWIDTH=0\n""          MARGINHEIGHT=0\n""          NORESIZE>\n""  <FRAME SRC=about:blank\n""        NAME=button_frame\n""        SCROLLING=NO\n""        MARGINWIDTH=1\n""        MARGINHEIGHT=1\n""        NORESIZE>\n""</FRAMESET>\n""\n""<NOFRAMES>\n""  <BODY> <BR> </BODY>\n""</NOFRAMES>\n""</HTML>\n",    list, SEPARATOR, SEPARATOR);  FLUSH_BUFFER  /* free buffer since it is no longer needed */  XP_FREEIF(buffer);  /* put html just generated into strings->arg[0] and invoke HTML dialog */  if (buffer2) {    XP_CopyDialogString(strings, 0, buffer2);    XP_FREE(buffer2);    buffer2 = NULL;  }  XP_MakeHTMLDialog(NULL, &dialogInfo, 0, strings, NULL, PR_FALSE);  return;}