/**********************************************************************
        Version: FreeRichTextEditor.com (Free AJAX Version 1.00).
        License: http://creativecommons.org/licenses/by/2.5/
        Description: Example of how to add freeAJAX into a page.
        Author: Copyright (C) 2006  Steven Ewing
**********************************************************************/
function ajaxGET(ajaxMethod, ajaxUrl, ajaxDiv, ajaxOutput, AutoJumlHREF)
{
  function ajaxObject()
  {
    if (document.all && !window.opera)
    {
      obj = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
    {
      obj = new XMLHttpRequest();
    }
  return obj;
  }


var ajaxHttp = ajaxObject();

lsLoading = '<div class="blok">'
  + '<div class="r"><b>&nbsp;&nbsp;-&nbsp; Tunggu Sebentar.... &nbsp;&nbsp;&nbsp;</b></div>'
  + '<div class="r"><img border=0  src="images/ajax/w.biru.gif"></div>'
  + '</div>';
  
lsLoading = '<table border="0"><tr>'
  + '<td><img border=0  src="images/ajax/w.biru.gif"></td>'
  + '<td>&nbsp;<font color=yellow>Tunggu sebentar...</font></td>'
  + '</tr></table>';

_SetDIV( 'idStatus', lsLoading);

timeStart = new Date();
iKoneksiJelek = 0;

e=document.getElementById(ajaxDiv);
liWarnaAsli = e.style.backgroundColor;
e.style.backgroundColor = "#FFFFee";


document.body.style.cursor = 'wait';
ajaxHttp.open(ajaxMethod, ajaxUrl);
ajaxHttp.onreadystatechange = function()
  {
    if(ajaxHttp.readyState == 4)
    {
      var ajaxResponse = ajaxHttp.responseText;


      timeStop = new Date();
      iLoadTime = timeStop.getTime() - timeStart.getTime();
      sLoadTime =  'Last LoadTime: ' + iLoadTime+'ms  &nbsp;&nbsp; ';

      _SetDIV( 'idStatus', sLoadTime);
      document.body.style.cursor = 'default';
      e.style.backgroundColor    = liWarnaAsli;


      if (ajaxOutput == "innerHTML")
      {
        document.getElementById(ajaxDiv).innerHTML = ajaxResponse;
      }
      else if (ajaxOutput == "value")
      {
        document.getElementById(ajaxDiv).value = ajaxResponse;
      }
      if (AutoJumlHREF == 'idMainContent')
        AutoJumlHREF = 'Top';
      location.href = "#" + AutoJumlHREF;
  }
}
ajaxHttp.send(null);}
