function getHTTPObject() {
    if (typeof XMLHttpRequest != 'undefined') {
	return new XMLHttpRequest();
    }
    try {
	return new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
	try {
	    return new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e) {}
    }
    return false;
}

var xmlhttp = getHTTPObject();

function serveerGet(template, target, action, parentcontentid, contentid, indicator){
	
	/* 
	this function requires the following parameters:
		template = name of frontside template
		target = target div for serveer content
		action = action to be taken such as mail, post, etc.
		parentcontentid = serveer parentContentID
		contentid = serveer contentID
		indicator = show loading graphic true / false
	*/
	
	// clear old content
	if(indicator)
	{
		document.getElementById(target).innerHTML = "<img src='components/images/loading.gif' alt='' style='margin-top: 10px; margin-left: 10px;'/>";
	}
	
	// get new content through serveerConnector.php
	xmlhttp.open("GET", "serveerConnector.php?template="+template+"&action="+action+"&parentcontentid="+parentcontentid+"&contentid="+contentid, true);
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4){
				response = xmlhttp.responseText;
				document.getElementById(target).innerHTML = response;
				/* if a dhtml script is used it needs to be initialised here (dynamic drive, mootools, etc) */
				if(template=='media'){
					//new Lightbox();
					//Lightbox.updateImageList();
				}
				
		}
	}
	xmlhttp.send(null);	
}
