var whichArea = "";

function fnHeaderLogin()
{ 
xmlHttp=GetXmlHttpObjectMain()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
whichArea="login";
var url="/functions/header.php"
url=url+"?specialRequest=loginForm"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedAuth 
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}



function fnLoginAuth()
{ 
xmlHttp=GetXmlHttpObjectMain()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
whichArea="login";
var frmUserName=document.getElementById("frmUserName").value
var frmPassword=document.getElementById("frmPassword").value
var url="/functions/header.php"
url=url+"?specialRequest=loginAuth"
url=url+"&frmUserName="+frmUserName
url=url+"&frmPassword="+frmPassword
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedAuth 
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}



function fnHeaderLogout()
{ 
xmlHttp=GetXmlHttpObjectMain()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
whichArea="logout";
var url="/functions/header.php"
url=url+"?specialRequest=logout"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedAuth 
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}




function fnDispPictsWithCaptionEdit()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//alert ("fn disp picts with caption edit");
var url="/functions/pictsdisp.php"
url=url+"?function=showPictsAfterAuth"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}

/*
var c=0;
var t;
function fnAthiestQuoteLoop(){
//	fnNowPlaying();
	fnAthiestQuote();
	c=c+1;
	t=setTimeout("fnAthiestQuoteLoop()",15000);
}



function fnAthiestQuote(){ 
xmlHttp=GetXmlHttpObjectMain()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
whichArea="athiestQuote"
var url="/functions/footerFunctions.php"
url=url+"?area=athiestQuote"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedAuth 
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}
*/


var c=0;
var t;
function fnFooterBarLoop(){
	fnFooterBar();
	c=c+1;
	t=setTimeout("fnFooterBarLoop()",30000);
}



function fnFooterBar(){ 
xmlHttp=GetXmlHttpObjectMain()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
whichArea="footerBar"
//var url="/functions/footerFunctions.php"
var url="/functions/header.php"
//url=url+"?area=footerBar"
url=url+"?specialRequest=footerBar"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedAuth 
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}







function stateChangedAuth(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById(whichArea).innerHTML=xmlHttp.responseText 
	} 
}




function GetXmlHttpObjectMain(){
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;
}