function loadXMLDoc(url) {
   // Internet Explorer
   try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
   catch(e) {
	  try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
	  catch(oc) { req = null; }
   }

   // Mozailla/Safari
   if (!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); }

   // Call the processChange() function when the page has loaded
   if (req != null) {
	  req.onreadystatechange = processChange;
	  req.open("GET", url, true);
	  req.send(null);
   }
}

function processChange() {
   // The page has loaded and the HTTP status code is 200 OK
   if (req.readyState == 4 && req.status == 200) {
   	// Write the contents of this URL to the searchResult layer
	  document.getElementById("Clients").innerHTML = req.responseText;
   }
}

function actie(q) {
	loadXMLDoc('http://www.cxo-cockpit.com/ajax/xml_client_list.php?q=' + q);
	if (q == 1001) {
		setTimeout("load()",1500);
	}
}

// 
function request_content(url)
{
var arg = url;
url = "http://www.cxo-cockpit.com/ajax/ajax.Google.php?q=" + url;
var http_request = false;

if (window.XMLHttpRequest) 
{ // Mozilla, Safari,...
http_request = new XMLHttpRequest();

if (http_request.overrideMimeType) 
{
http_request.overrideMimeType('text/xml');
// See note below about this line
}
} else if (window.ActiveXObject) 
{ // IE
try 
{
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) 
{
try 
{
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}

if (!http_request) 
{
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}

http_request.onreadystatechange = function() { alertContent_title(http_request); };
http_request.open('GET', url, true);
http_request.send(null);

}


function alertContent_title(http_request) 
{
if (http_request.readyState == 4) 
{
if (http_request.status == 200) 
{
	document.getElementById("GoogleDiv").innerHTML=http_request.responseText;
}
else 
{
	//alert('Deze pagina is nog niet actief!');
}
}
}

// Check if there is content
function checkForContent(name) {
	var str	= document.getElementById("GoogleDiv").innerHTML;
	//alert(str);
	if (!str) {
		request_content(name);
	} else {
	}
}


function loadXMLDocProduct(url) {
   // Internet Explorer
   try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
   catch(e) {
	  try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
	  catch(oc) { req = null; }
   }

   // Mozailla/Safari
   if (!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); }

   // Call the processChange() function when the page has loaded
   if (req != null) {
	  req.onreadystatechange = processChangeProduct;
	  req.open("GET", url, true);
	  req.send(null);
   }
}

function processChangeProduct() {
   // The page has loaded and the HTTP status code is 200 OK
   if (req.readyState == 4 && req.status == 200) {
   	// Write the contents of this URL to the searchResult layer
	  document.getElementById("ajaxProduct").innerHTML = req.responseText;
   }
}

function productTab(q) {
	loadXMLDocProduct('http://www.cxo-cockpit.com/ajax/ajax.producttab.php?q=' + q);
	//if (q == 1001) {
		//setTimeout("load()",1500);
	//}
}
