// JavaScript Document


var xmlHttps

function addtext() {
	var newtext = document.frm_comment.comment.value;
	
	if (document.myform.placement[1].checked) {
		document.myform.outputtext.value = "";
		}
	document.myform.outputtext.value += newtext;
}

function sendData(str, sdata, sdata2)
{	
	var newtext = document.frm_comment.comment.value;
	if(newtext == '')
	{
		alert('- Please Specify a Comment');
	}
	else
	{	
		xmlHttps=GetXmlHttpObject()
		if (xmlHttps==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		var url="process.php";
		url=url+"?"+sdata+"="+str+"&"+sdata2+"="+newtext;
		url=url+"&sid="+Math.random();
		
		xmlHttps.onreadystatechange=stateChanged;
		xmlHttps.open("GET",url,true);
		xmlHttps.send(null);
		
		document.frm_comment.comment.value = '';
	}
}


function showUser(str, sdata)
{	

	xmlHttps=GetXmlHttpObject()
	if (xmlHttps==null)
 	{
 		alert ("Browser does not support HTTP Request")
 		return
 	} 
	var url="process.php";
	url=url+"?"+sdata+"="+str;
	url=url+"&sid="+Math.random();
	
	xmlHttps.onreadystatechange=stateChanged;
	xmlHttps.open("GET",url,true);
	xmlHttps.send(null);
}

function sendId(str, sender){

	location.replace('process.php?'+sender+"="+str);
	
	}

function toggle_tabs()
{
  var args = toggle_tabs.arguments.length;
  if (args < 2)
  {
    return false;
  }
  else
  {
    target = document.getElementById(toggle_tabs.arguments[0]);
    target.style.display = "";
    
    for (x = 1; x < toggle_tabs.arguments.length; x++)
    {
      target = document.getElementById(toggle_tabs.arguments[x]);
      target.style.display = "none";
    }
  }
  return false;
}


function stateChanged() 
{ 
	if(xmlHttps.readyState!=4 || xmlHttps.readyState!="complete")
	{
		document.getElementById("txtCatcher").innerHTML = "Loading...<img src='webpics/images/load.gif'>";
	}
	if (xmlHttps.readyState==4 || xmlHttps.readyState=="complete")
 	{ 
 		document.getElementById("txtCatcher").innerHTML=xmlHttps.responseText 
 	} 
}
function GetXmlHttpObject()
{
	var xmlHttps=null;
	try
 	{
 		// Firefox, Opera 8.0+, Safari
 		xmlHttps=new XMLHttpRequest();
 	}
	catch (e)
 	{
 		//Internet Explorer
 		try
  		{
  			xmlHttps=new ActiveXObject("Msxml2.XMLHTTP");
  		}
 		catch (e)
  		{
  			xmlHttps=new ActiveXObject("Microsoft.XMLHTTP");
  		}
 	}
	return xmlHttps;
}

