 /* Copyright (C) 2006-2009 by Joseph McVerry - American Coders, Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
function startup(arg, xmlForm)
{
 document.forms[0].nextButton.disabled=true

/*
try {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
   } catch (e) {
    alert("Permission UniversalBrowserRead denied.");
   }
   */
 // Obtain an XMLHttpRequest instance
  var req = newXMLHttpRequest();

  // Set the handler function to receive callback notifications
  // from the request object
  var handlerFunction = getReadyStateHandler(req, incoming);
  req.onreadystatechange = handlerFunction;

  // Open an HTTP  connection to the servlet
  // Third parameter specifies request is asynchronous.
  try{
      
      if (arg==null) {
        document.getElementById('waiter').innerHTML="<br><font size=-2 color=red>Wait</font>"
      	req.open("POST", prefix+"OBOEAJAXServlet/?nextState=startup", true);
        }
      else if (arg=='1')
      	req.open("GET", prefix+"CMS1500DE/?nextState=startup", true);
      else if (arg=='2')
      	req.open("GET", prefix+"CMS1500DE/?nextState=box0", true);
      else if (arg=='i')
      	req.open("GET", prefix+"CMS1500DEProfessional/?nextState=login", true);
      else if (arg=='p')
      	req.open("GET", prefix+"CMS1500DEProfessional/?nextState=box0", true);
      else if (arg=='P')
      	req.open("POST", prefix+"AjaxDEForm/?nextState=startup&form="+xmlForm, true);
      else if (arg == "startAtTop")
        req.open("POST", prefix+"AjaxDEForm/?nextState=startAtTop&form="+xmlForm, true);
     }
  catch (e)
    {
      alert(e)
    }


  req.setRequestHeader("Content-Type",
                       "application/x-www-form-urlencoded");


  req.send(null);
}


