/*
*  License Information:
*  -------------------------------------------------------
*  Author: Jay Hargis (2005)
*
*  This program is free software; you can redistribute it and/or modify it under
*  the terms of the GNU General Public License as published by the Free Software
*  Foundation; either version 2 of the License, or (at your option) any later
*  version.
*
*  This program 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 General Public License for more details.
*
*  You should have received a copy of the GNU General Public License along with
*  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
*  Place, Suite 330, Boston, MA 02111-1307 USA
*/
  // Build a param string and issue callback -----------------------------------------------------+>
  //function prepareCallback(param1, param2, param3, param4) {
  function prepareCallback(param1) {
    // Use date/time to create unique url calls to avoid caches across page loads
    d = new Date(); now = d.getTime();
    //alert('lib/ajax/server.php?aid=' + param1 + '&aantal=' + param2 + '&r=' + now + '&huurkoop=' + param3+ '&p=' + param4);
    //performCallback('zlib/ajax/server.php?aid=' + param1 + '&aantal=' + param2 + '&r=' + now + '&zhuurkoop=' + param3 + '&p=' + param4);
    performCallback('zlib/ajax/server.php?aid=' + param1);
  }
  function prepareCallback_gerst(param1, param2, param3, param4) {
    // Use date/time to create unique url calls to avoid caches across page loads
    d = new Date(); now = d.getTime();
    //alert('lib/ajax/server.php?aid=' + param1 + '&aantal=' + param2 + '&r=' + now + '&huurkoop=' + param3+ '&p=' + param4);
    performCallback('lib/ajax/server_gerst.php?aid=' + param1 + '&aantal=' + param2 + '&r=' + now + '&zhuurkoop=' + param3 + '&p=' + param4);
  }
  // What to do when a callback is in progress and another callback is issued --------------------+>
  function callbackBusyAction() {
    alert("Loading...Just a moment");
  }
  // What to do if callback times out ------------------------------------------------------------+>
  function timeoutAction () {
    alert('A request was timed out. Taking too long');
    //document.cats.catid.disabled = false;
    //document.cats.subcatid.disabled = true;
    //document.cats.submit();
  }
  // Perform any operations just prior to callback is issued -------------------------------------+>
  function performOnCallback() {
    //document.cats.subcatid.length = 0;
    //document.cats.subcatid.disabled = false;
    var loadtxt = "Loading...Please Wait";
    var myNewOption = new Option(loadtxt, "0");
  	//document.totals.online_korting.disabled = false;
  	//document.totals.online_korting.value = 0;
    //document.cats.catid.disabled = true;

  
    //document.totals.totx1.disabled = false;
    //document.totals.totx1.value = 0;

  }
  // Perform any operations just prior to deserialization ----------------------------------------+>
  function peformOnDeserialize() {
    //document.cats.subcatid.disabled = true;
    //document.totals.totx1.disabled = true;
  	//document.totals.online_korting.disabled = true;
  }
  // Handle the returned data in global array (arr) ----------------------------------------------+>
  function parseReturnData() {
    
  	////document.cats.subcatid.length = 0;
    ////var x = 0;
    ////for (var key in arr) {
    ////  var subname = arr[key];
    ////  var myNewOption = new Option(subname, key);
    ////  document.cats.subcatid.options[x] = myNewOption;
    ////  x++;
    ////}
    ////document.cats.catid.disabled = false;
    ////document.cats.subcatid.disabled = false;
  //  if (document.cats.catid.options[0].value == '') { document.cats.catid.options[0] = null; }
  //  if (document.cats.catid2.options[0].value == '') { document.cats.catid2.options[0] = null; }
  
  //alert('arr: '+arr);
  //  for (var key in arr) {
  //   var subname = arr[key];
	//  alert('subname: '+subname);
	//  document.totals.totx1.value = subname;
    //}

  //alert('totx1: '+document.totals.totx1.value);
 	
  	var testvalue = arr[0]; 
  
  	//if (testvalue == '18isset') {
  	//	alert ('18isset done');
  	//}

  }

