/**********************************************
	INTEGRIO AJAX PROCESSOR
	(c) integrio business solution sdn bhd.
	Author - Pankaj Kumar, 15 sept 2009

	Unauthorised copying or distribution is
	prohibited.
	***********************************************/

function integrioAJAXProcessor(strURL,divName)
{
	var xmlHttpReq = false;
	var self = this;
	// Mozilla/Safari
	if (window.XMLHttpRequest) {
		self.xmlHttpReq = new XMLHttpRequest();
	}
	// IE
	else if (window.ActiveXObject) {
		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}
	self.xmlHttpReq.open('POST', strURL, true);
	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	self.xmlHttpReq.onreadystatechange = function() {
		if (self.xmlHttpReq.readyState == 4) {
			updatepage(self.xmlHttpReq.responseText,divName);
		}
	}
	self.xmlHttpReq.send(strURL);
}
	
function updatepage(str,divName)
	{
		document.getElementById(divName).innerHTML = str;
	}


function integrioAjaxCommunities(value)
{
	var comm = document.getElementById('communityId').value;
	//alert(comm);
	updatepage("<img src='images/loading.gif'>","schooldiv")
	strURL = "getSchools.php?id="+comm;
	integrioAJAXProcessor(strURL,"schooldiv")
}


function integrioAjaxCommMembers(value)
{
	var comm = document.getElementById('communityId').value;
	//alert(comm);
	updatepage("<img src='images/loading.gif'>","commdiv")
	strURL = "getMembers.php?id="+comm;
	integrioAJAXProcessor(strURL,"commdiv")
}

	

