// absoluteproaudio.ajax.js 
// Contains the javascript functions called when an ajax object is required. 
// Alasdair J. Gow - Feb 2010 

var url;

function ajax( identifier, action )
{
  switch ( action ) {
    case "show":
      url="ajaxshow.php";
      break;
	
    case "hide":
      url="ajaxhide.php";
      break;

    default:
      break;
  }
  var xmlhttp;
  xmlhttp=GetXmlHttpObject();
  if (xmlhttp==null) {
    alert ("Browser does not support HTTP Request");
    return;
  }
  urlAssignVariables(identifier);
  url=url+"&sid="+Math.random();
  xmlhttp.open("GET",url,false);
  xmlhttp.send(null);
  document.getElementById(identifier).innerHTML=xmlhttp.responseText;
//   alert(url); // Debug code. Displays the URL being called.
}

function ajaxMenu( menuitem, show )
{
  var xmlhttp;
  xmlhttp=GetXmlHttpObject();
  if (xmlhttp==null) {
    alert ("Browser does not support HTTP Request");
    return;
  }
  url = "ajaxmenu.php?source="+menuitem+"&&show="+show;
//     alert(url); // Debug code. Displays the URL being called.
  xmlhttp.open("GET",url,false);
  xmlhttp.send(null);
  document.getElementById(menuitem).innerHTML=xmlhttp.responseText;
}

function GetXmlHttpObject()
{
  if (window.XMLHttpRequest) {
    // code for IE7+, Firefox, Chrome, Opera, Safari
    return new XMLHttpRequest();
  }
  if (window.ActiveXObject) {
    // code for IE6, IE5
    return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
