/* This initiates the xmlhttprequest call and also initiates the XSLTProcessor for Gecko type  browsers. The variables in the init call convey required values from the event call on the web page to the asynchronous function which makes the xmlhttprequest */

  var xmlDocument, xslStylesheet;
  var xsltProcessor = new XSLTProcessor();

/* The init function first tests for guest type as naturist to see if asynchronous call is required.  */

function init(callType,divId,xmlDoc,xslDoc){
    if (existCookie('menu_tweek')) {
	if (getCookie('menu_tweek')=='Naturist'){
	    asynchronous.call(callType,divId,xmlDoc);
	    asynchronous2.call(callType,divId,xslDoc);
	}
    }
}

function doPost(callType,url,xmlDoc){
  asynchronous3.call(callType,url,xmlDoc);
  }

  var asynchronous = new Asynchronous();
  asynchronous.complete = AsyncUpdateEvent;
  
  var asynchronous2 = new Asynchronous();
  asynchronous2.complete = AsyncUpdateEvent2;
  
  var asynchronous3 = new Asynchronous();
  asynchronous3.complete = AsyncUpdateEvent3;
  
  function AsyncUpdateEvent(status, statusText, responseText, responseXML) {
  xmlDocument = responseXML;
  }
  
  function AsyncUpdateEvent2(status, statusText, responseText, responseXML) {
  xslStylesheet = responseXML;
  xsltProcessor.importStylesheet(xslStylesheet);
  }

  function AsyncUpdateEvent3(status, statusText, responseText, responseXML) {
  }
