
var ftID = "";

function newSort(sortItem)
{
	document.reSort.sortBy.value = sortItem;
	document.reSort.submit();
}

function openDept(dpid,qqtr)
{
	open("deptinfo.html?dptid="+dpid+"&qtr="+qqtr,"Department_Info","toolbar=no,scrollbars=yes,resizable=yes,status=no,width=650,height=650");
}

function ftShow(secID,hors)
{
	if(hors)
	{
		var temp = document.getElementById(secID);
		temp.style.visibility = "visible";
	}
	else
	{
		var temp = document.getElementById(secID);
		temp.style.visibility = "hidden";
	}
}

function yrShow(secID,yr)
{
    var temp = document.getElementById(secID);
    var UpdateContent =  yr;
    temp.innerHTML = UpdateContent;
}

function handleContentFt() 
{
	if (ftnte.readyState == 4) 
	{
		if (ftnte.responseText.indexOf('invalid') == -1) 
		{
			if(ftnte.status == 200)
			{	
				var sectionID = ftID;				
				var domObject = document.getElementById(sectionID);				
				var UpdateContent =  ftnte.responseText;
				domObject.innerHTML = UpdateContent;
               
                ftShow(ftID,1);
			}
		}
		else
		{
			alert("Problem with data:\n" + ftnte.statusText);
		}	
	}
}

function updateFootSection(ftRec,qtr)
{
    ftID = ftRec;
	var ftURL = "ftSelected.php?frec="+ftRec+"&qtr="+qtr;
	ftnte.open("GET", ftURL, true);
	ftnte.onreadystatechange = handleContentFt;
	ftnte.send(null);
}

function getHTTPObject() 
{
	var txthttp;  

	try
	{ 
        var txthttp = new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{var txthttp = new ActiveXObject("Microsoft.XMLHTTP");	}
		catch (e)
		{return false;	}
	}

  return txthttp;
}

var ftnte = getHTTPObject(); 


