	var client;
	var ajaxTarget;
	function createClient()
	{
		try
		{
			client = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			alert("Sorry, your browser is not AJAX-enabled!"); 
		}
	}

	function boxEvent(page, target)
	{
		var tDate = new Date();
		uVal = tDate.getTime();
		ajaxTarget = target;
		createClient();
		client.onreadystatechange = callback;
		client.open("get",page+"&x="+uVal,true);
		client.send(null);
	}

	function scheduleDList(pid, fid)
	{
		showBox("pages/schedule_d_list.php?pid="+pid+"&fid="+fid, 150, 325);
	}

	function showBox(url, h, w)
	{
		var ab = document.getElementById('actionBox');
		var abs = document.getElementById('actionBoxShadow');
		//ab.innerHTML = "<input type='button' onclick='hideBox();' value='Close' />";
		abs.style.display = 'none';
		//abs.style.top = Math.round((document.body.offsetHeight-h)/2)+'px';
		//abs.style.left = Math.round((document.body.offsetWidth-w)/2)+'px';
		abs.style.left = Math.round(((document.body.offsetWidth-w)/2)+20)+'px';
		abs.style.height = h + 'px';
		abs.style.width = w + 'px';
		ab.style.height = (h-10) + 'px';
		ab.style.width = (w-10) + 'px';
		abs.style.display='block';
		ab.focus();
		if (url != '')
			boxEvent(url, "actionBox");
	}
	
	function hideBox()
	{
		document.getElementById('actionBoxShadow').style.display = 'none';
	}

	function callback()
	{
		if (client.readyState == 4 && client.status == 200)
		{
			document.getElementById(ajaxTarget).innerHTML = client.responseText;
		}
	}
