function submit_comment(sitePath){
// the ajax submission
// first set the parameters
var theform = document.getElementById("pageform");
var params = "";
for (elem = 0;elem<theform.length;elem=elem+1){
	params = params + theform.elements[elem].name + "=" + encodeURIComponent(theform.elements[elem].value) + "&"
}
params = params.substring(0, params.length - 1)
// create xmlHttp object
  var http;
  try
  {    
	// Firefox, Opera 8.0+, Safari    
	http = new XMLHttpRequest();    
  }
  catch (e)
  {    
	// Internet Explorer    
	try
      	{      
	http = new ActiveXObject("Msxml2.XMLHTTP");      }
    	catch (e)
      	{       try
       		{
		http = new ActiveXObject("Microsoft.XMLHTTP");        }
      		catch (e)
        	{
        	alert("Your browser does not support AJAX!");        
		return false;
        }
      }
    }
// use this for all ajax pages to create the xmlHttp object

http.onreadystatechange = function() {//Call a function when the state changes.
  		if(http.readyState == 4 && http.status == 200)
			{
    			document.getElementById("send_comment").innerHTML = http.responseText
			}
		else	{
			document.getElementById("send_comment").innerHTML = '<image src="' + sitePath + 'images/processing.gif" border="0">'
			}
}
http.open("POST", sitePath + "ajax/post_comment.asp", true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(params);
}

function submit_message(p_for, sitePath){
// the ajax submission
// first set the parameters
var theform = document.getElementById("pageform");
var params = "";
for (elem = 0;elem<theform.length;elem=elem+1){
	params = params + theform.elements[elem].name + "=" + encodeURIComponent(theform.elements[elem].value) + "&"
}
params = params.substring(0, params.length - 1)
// create xmlHttp object
  var http;
  try
  {    
	// Firefox, Opera 8.0+, Safari    
	http = new XMLHttpRequest();    
  }
  catch (e)
  {    
	// Internet Explorer    
	try
      	{      
	http = new ActiveXObject("Msxml2.XMLHTTP");      }
    	catch (e)
      	{       try
       		{
		http = new ActiveXObject("Microsoft.XMLHTTP");        }
      		catch (e)
        	{
        	alert("Your browser does not support AJAX!");        
		return false;
        }
      }
    }
// use this for all ajax pages to create the xmlHttp object

http.onreadystatechange = function() {//Call a function when the state changes.
  		if(http.readyState == 4 && http.status == 200)
			{
    			document.getElementById("msg_"+p_for).innerHTML = http.responseText
			}
		else	{
			document.getElementById("msg_"+p_for).innerHTML = '<image src="' + sitePath + 'images/processing.gif" border="0">'
			}
}
http.open("POST", sitePath + "ajax/post_message.asp?p_for=" + p_for, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(params);
}

function submit_poll(sitePath){
// the ajax submission
// first set the parameters
var theform = document.getElementById("pageform");
var params = "";
for (elem = 0;elem<theform.length;elem=elem+1){
	if (theform.elements[elem].name != "poll")
		params = params + theform.elements[elem].name + "=" + encodeURIComponent(theform.elements[elem].value) + "&"
	else
		if (theform.elements[elem].checked)
			params = params + theform.elements[elem].name + "=" + encodeURIComponent(theform.elements[elem].value) + "&"
}

params = params.substring(0, params.length - 1)
// create xmlHttp object
  var http;
  try
  {    
	// Firefox, Opera 8.0+, Safari    
	http = new XMLHttpRequest();    
  }
  catch (e)
  {    
	// Internet Explorer    
	try
      	{      
	http = new ActiveXObject("Msxml2.XMLHTTP");      }
    	catch (e)
      	{       try
       		{
		http = new ActiveXObject("Microsoft.XMLHTTP");        }
      		catch (e)
        	{
        	alert("Your browser does not support AJAX!");        
		return false;
        }
      }
    }
// use this for all ajax pages to create the xmlHttp object

http.onreadystatechange = function() {//Call a function when the state changes.
  		if(http.readyState == 4 && http.status == 200)
			{
    			document.getElementById("poll").innerHTML = http.responseText
			}
		else	{
			document.getElementById("poll").innerHTML = '<image src="' + sitePath + 'images/processing.gif" border="0">'
			}
}
http.open("POST", sitePath + "ajax/post_poll.asp", true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(params);
}


function get_messages(p_for, sitePath){
// the ajax submission
// first set the parameters
var theform = document.getElementById("pageform");
var params = "";
for (elem = 0;elem<theform.length;elem=elem+1){
	params = params + theform.elements[elem].name + "=" + encodeURIComponent(theform.elements[elem].value) + "&"
}
params = params.substring(0, params.length - 1)
// create xmlHttp object
  var http;
  try
  {    
	// Firefox, Opera 8.0+, Safari    
	http = new XMLHttpRequest();    
  }
  catch (e)
  {    
	// Internet Explorer    
	try
      	{      
	http = new ActiveXObject("Msxml2.XMLHTTP");      }
    	catch (e)
      	{       try
       		{
		http = new ActiveXObject("Microsoft.XMLHTTP");        }
      		catch (e)
        	{
        	alert("Your browser does not support AJAX!");        
		return false;
        }
      }
    }
// use this for all ajax pages to create the xmlHttp object

http.onreadystatechange = function() {//Call a function when the state changes.
  		if(http.readyState == 4 && http.status == 200)
			{
    			document.getElementById("msg_"+p_for).innerHTML = http.responseText
			}
		else	{
			document.getElementById("msg_"+p_for).innerHTML = '<image src="' + sitePath + 'images/processing.gif" border="0">'
			}
}
http.open("POST", sitePath + "ajax/get_messages.asp?p_for=" + p_for, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(params);
}

function get_confessions(p_div, p_category, p_order, sitePath){
// create xmlHttp object
  var http;
  try
  {    
	// Firefox, Opera 8.0+, Safari    
	http = new XMLHttpRequest();    
  }
  catch (e)
  {    
	// Internet Explorer    
	try
      	{      
	http = new ActiveXObject("Msxml2.XMLHTTP");      }
    	catch (e)
      	{       try
       		{
		http = new ActiveXObject("Microsoft.XMLHTTP");        }
      		catch (e)
        	{
        	alert("Your browser does not support AJAX!");        
		return false;
        }
      }
    }
// use this for all ajax pages to create the xmlHttp object

http.onreadystatechange = function() {//Call a function when the state changes.
  		if(http.readyState == 4 && http.status == 200)
			{
    			document.getElementById(p_div).innerHTML = http.responseText
			}
		else	{
			document.getElementById(p_div).innerHTML = '<image src="' + sitePath + 'images/processing.gif" border="0">'
			}
}
http.open("GET", sitePath + "ajax/get_confessions.asp?div=" + p_div + "&ord=" + p_order + "&ctg=" + p_category, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Connection", "close");
http.send(null);
}
