// JavaScript Document
var xmlHttp

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

function showUser(str, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/userDetails.php";
url=url+"?user="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function showGroup(str, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/groupDetails.php";
url=url+"?group="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function printreport(reportname, reportaddress, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../reports/printReport.php";
url=url+"?rn="+reportname;
url=url+"&ra="+reportaddress;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function getreport(reporttype, reportnum, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../reports/";
url=url+reporttype;
url=url+"report";
url=url+reportnum;
url=url+".php";

xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function addUser(u, p, vp, ag, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/adduser.php";
url=url+"?u="+u;
url=url+"&p="+p;
url=url+"&vp="+vp;
url=url+"&ag="+ag;
url=url+"&controlID="+controlID;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function addGroup(ti, nn, pn,vpn, agn, u, p, vp, ag, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/addgroup.php";
url=url+"?nn="+nn;
url=url+"&pn="+pn;
url=url+"&vpn="+vpn;
url=url+"&agn="+agn;
url=url+"&ti="+ti;
url=url+"&u="+u;
url=url+"&p="+p;
url=url+"&vp="+vp;
url=url+"&ag="+ag;
url=url+"&controlID="+controlID;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function arRole(user, role, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/arRoles.php";
url=url+"?user="+user;
url=url+"&role="+role;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function arGroup(user, group, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/arGroups.php";
url=url+"?user="+user;
url=url+"&group="+group;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText; 	      
		}     
	};     
xmlHttp.open("GET",url,true);
xmlHttp.send(null);		
}

function arUser(group, user, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/arUsers.php";
url=url+"?group="+group;
url=url+"&user="+user;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText; 	      
		}     
	};     
xmlHttp.open("GET",url,true);
xmlHttp.send(null);		
}

function ugHelp(helpcode, controlID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/ugHelp.php";
url=url+"?helpcode="+helpcode;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlID).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function argReportList(user, control, pc, controlIDb)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/argReportList.php";
url=url+"?user="+user;
url=url+"&control="+control;
url=url+"&pc="+pc;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(controlIDb).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function disableEnableAccount(action, user, name, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/deAccount.php";
url=url+"?user="+user;
url=url+"&action="+action;
url=url+"&name="+name;
url=url+"&control="+control;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function updateUsers(control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/updateUsers.php";
url=url+"?control="+control;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function deleteUsers(ug, user, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../usersGroups/deleteUsers.php";
url=url+"?control="+control;
url=url+"&user="+user;
url=url+"&ug="+ug;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function changePage(conn, db, tablename, column, condition, topvalue, setsize, orderby, specialactions, page, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../"+page;
url=url+"?conn="+conn;
url=url+"&db="+db;
url=url+"&tablename="+tablename;
url=url+"&column="+column;
url=url+"&condition="+condition;
url=url+"&topvalue="+topvalue;
url=url+"&setsize="+setsize;
url=url+"&orderby="+orderby;
url=url+"&specialactions="+specialactions;
url=url+"&control="+control;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function changeRPP(report, rpp, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../reports/changeResultsPerPage.php";
url=url+"?report="+report;
url=url+"&rpp="+rpp;
url=url+"&control="+control;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;        
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function changeSetting(setval, val)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../profile/changeSetting.php";
url=url+"?setval="+setval;
url=url+"&val="+val;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			       
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function updateSessionSetting(setting)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../profile/updateSessionSetting.php";
url=url+"?setting="+setting;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			       
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function addmessage(type, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../messaging/addmessage.php";
url=url+"?type="+type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function insertmessage(t, p, e, v, d, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../messaging/insertmessage.php";
url=url+"?t="+t;
url=url+"&p="+p;
url=url+"&e="+e;
url=url+"&v="+v;
url=url+"&d="+d;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function changeMonth(mon, year, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../calendar/changeMonth.php";
url=url+"?mon="+mon;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function addNewEvent(day, mon, year, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../calendar/addNewEvent.php";
url=url+"?day="+day;
url=url+"&mon="+mon;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function editEvent(eid, day, mon, year, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../calendar/editEvent.php";
url=url+"?eid="+eid;
url=url+"&day="+day;
url=url+"&mon="+mon;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function deleteEvent(eid, day, mon, year, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../calendar/deleteEvent.php";
url=url+"?eid="+eid;
url=url+"&day="+day;
url=url+"&mon="+mon;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function saveEvent(user, sdate, edate, stime, etime, allday, loc, subj, desc, allavail, day, month, year, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../calendar/saveEvent.php";
url=url+"?user="+user;
url=url+"&sdate="+sdate;
url=url+"&edate="+edate;
url=url+"&stime="+stime;
url=url+"&etime="+etime;
url=url+"&allday="+allday;
url=url+"&loc="+loc;
url=url+"&subj="+subj;
url=url+"&desc="+desc;
url=url+"&allavail="+allavail;
url=url+"&day="+day;
url=url+"&month="+month;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function updateCalendarSessionSetting(sesvar, val, day, mon, year, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../calendar/updateSessionSetting.php";
url=url+"?sesvar="+sesvar;
url=url+"&val="+val;
url=url+"&day="+day;
url=url+"&mon="+mon;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function viewCalDay(day, mon, year, stime, etime, control)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../calendar/viewCalDay.php";
url=url+"?day="+day;
url=url+"&mon="+mon;
url=url+"&year="+year;
url=url+"&stime="+stime;
url=url+"&etime="+etime;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=xmlHttp.onreadystatechange=function()
	{     
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{             
			document.getElementById(control).innerHTML=xmlHttp.responseText;
		}     
	};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
