function openPositionPopup(positionId)
{
	var positionText = document.getElementById('positionExplain-' + positionId).innerHTML;
	
	document.getElementById('popupDivCont').innerHTML = positionText;
	
	document.getElementById('popupDiv').style.display = 'block';
}

function closePositionPopup()
{
	document.getElementById('popupDiv').style.display = 'none';
}

function updateCheckinStatus(shiftId, checkinStatus)
{
	// alert(shiftId + ' ' + checkinStatus);
	replaceContnetAJAX('shiftStatusId_' + shiftId, '/admin/Shift_UpdateStatus.action?shiftId=' + shiftId + '&checkinStatus=' + checkinStatus + '&tm=' + (new Date()).getTime());
}



function ajaxFunction()
{
	var xmlHttp = null;

	try {    // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}	catch (e)	{    // Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
			}
		}
	}
	return xmlHttp;
}

function replaceContnetAJAX(divName, url)
{
	var xmlHttp = ajaxFunction();

	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			var divObject = document.getElementById(divName);

			divObject.innerHTML=xmlHttp.responseText;
		}
	}

	xmlHttp.open('GET', url, true);
	xmlHttp.send(null);
}
