function makeRequest(url) 
{  
	if(window.XMLHttpRequest)
	{
		request = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		request = new ActiveXObject("MSXML2.XMLHTTP");
	}
	
	sendRequest(url);
}

function sendRequest(url)
{
	request.onreadystatechange = onResponse;
	request.open("GET", url, true);
	request.send(null);
}

function checkReadyState(obj)
{
	if(obj.readyState == 4)
	{
		if(obj.status == 200)
		{
			return true;
		}
		else if(obj.status == 404)
		{
			// Add a custom message or redirect the user to another page
			if (document.getElementById('copy')) { document.getElementById('copy').innerHTML = "File not found"; }
		}
		else
		{
			if (document.getElementById('copy')) { document.getElementById('copy').innerHTML = "There was a problem retrieving the media."; }
		}
	}
	else
	{
      if (document.getElementById('copy')) { document.getElementById('copy').innerHTML = "<span style='display: block; height: 415px;'><center><img src='http://hkswomensleadershipboard.org/wlb/images/membership/loading.gif' alt='Loading data, please wait...' /></center></span>"; }
  }
}

function onResponse() 
{
	if(checkReadyState(request))
	{	
        // var rid = request.responseText.split(':')[0];        
        var rtext = request.responseText; //.split(':')[1];                            
        document.getElementById('copy').innerHTML = rtext;
	}
}
