var teststring



/////////////////////////////////////////////
function showstaffmain(staffid)
{
	document.getElementById("staffmainbody").innerHTML="<img src='http://www.commonwealthchapel.com/loading.gif'>"
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="showstaffmain.asp"
	url=url+"?sid="+Math.random()
	url=url+"&staffid="+staffid
	xmlHttp.onreadystatechange=stateChangedshowstaffmain
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChangedshowstaffmain() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("staffmainbody").innerHTML=xmlHttp.responseText
	} 
}
///////////////////////

/////////////////////////////////////////////
function addnewstaffnow()
{
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="doaddnewstaff.asp"
	url=url+"?sid="+Math.random()
	url=url+"&staffname="+document.getElementById("staffname").value
	document.getElementById("addnewstaff").innerHTML="<img src='http://www.commonwealthchapel.com/loading.gif'>"
	xmlHttp.onreadystatechange=stateChangedaddnewstaffnow
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChangedaddnewstaffnow() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		window.location = "http://www.commonwealthchapel.com/admin/staffedit.asp"
	} 
}
///////////////////////

/////////////////////////////////////////////
function deletepicture(staffid)
{
	teststring = staffid
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="dodeletestaffpicture.asp"
	url=url+"?sid="+Math.random()
	url=url+"&picture="+document.getElementById("picture").value
	xmlHttp.onreadystatechange=stateChangeddeletepicture
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChangeddeletepicture() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		showstaffmember(teststring)
	} 
}
///////////////////////

/////////////////////////////////////////////
function showpicture()
{
document.getElementById("staffpicture").innerHTML="<img src='../staff/pictures/"+document.getElementById("picture").value+"'>"
} 


/////////////////////////////////////////

/////////////////////////////////////////////
function deletestaff(staffid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="dodeletestaff.asp"
	url=url+"?sid="+Math.random()
	url=url+"&staffid="+staffid
	xmlHttp.onreadystatechange=stateChangeddeletestaff
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChangeddeletestaff() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		window.location = "http://www.commonwealthchapel.com/admin/staffedit.asp"
	} 
}
///////////////////////
function GetXmlHttpObject()
{ 
	var objXMLHttp=null
		if (window.XMLHttpRequest)
		{
		objXMLHttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
	return objXMLHttp
} 

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) /2 -100;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

