
function clienCallback(ModuleName, params,URL)
{
	if (fnTrim(ModuleName) == "")
	   return "";
	//alert(ModuleName);
	var date = new Date();
	var time = date.getMilliseconds();

	

	var AjaxServerPageName = URL;

	var pageUrl = AjaxServerPageName + "?callback=true&ModuleName="+ModuleName+"&params="+ params +"&time=" + time;
	//alert(pageUrl);
	// Initialize the XmlHttp object
	try
	{
		
		//Mozilla Browsers
		xmlRequest = new XMLHttpRequest();

		
	} 
	catch (e)
	{
		try
		{
			//IE
			xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch (e)
		{
			//Something else that won't work with this code...
			xmlRequest=false;
		}
	 }
	  
	// Post our XmlRequest and get our desired string
	xmlRequest.open("GET", pageUrl, false);
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	alert(xmlRequest.status);
	xmlRequest.send(null);
	
	return xmlRequest;
}

function fnGetNewsAndEvents(NewsEvents,spName,URL)	
{
	//alert(PendingFees)
	//alert(spName)
	//return
	var xml = clienCallback("NEWSEVENTS", spName,URL);
	var Models = xml.responseText;
	
	
	//alert(Models);
	if(Models != "")
	{
		//NewsEvents.innerHTML = Models;
		document.getElementById('newsevents').innerHTML = Models;

		return true;
	}
	else
	{
		
		//return false;
	}
}



//function $(mid)
//{
	//alert(mid)
//	return document.getElementById(mid);
//}


function fnTrim(str) 
{
	//Match spaces at beginning and end of text and replace with null strings
	return str.replace(/^\s+/,'').replace(/\s+$/,'');
}
