function addtoform($Xwhattoadd, Xwheretoaddform, $Xwheretoaddinput){
document.forms[Xwheretoaddform].elements[$Xwheretoaddinput].value = document.forms[Xwheretoaddform].elements[$Xwheretoaddinput].value+$Xwhattoadd+',';
}

function iniad(Xfiletosearch, Xdivtochange, Xuname, Xps)
{
if(typeof(Xuname)=="undefined"){
	Xuname = "";
	}
if(typeof(Xps)=="undefined"){
	Xps = "";
	}
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById(Xdivtochange).innerHTML = xmlHttp.responseText;
	  } else {
	  document.getElementById(Xdivtochange).innerHTML = "<div style='padding:5% 0; font-size:80%; font-weight:bold; text-align:center;'><img src='../images/loading.gif' alt='Loading' /><br />Please Wait...<div>";
	  }
    }
 $Xurl = Xfiletosearch+".php?u="+Xuname+"&p="+Xps;
  xmlHttp.open("GET",$Xurl,true);
  xmlHttp.send(null);
  }
  
function iniad_post(Xfiletosearch, Xdivtochange, Xuname, Xps)
{
if(typeof(Xuname)=="undefined"){
	Xuname = "";
	}
if(typeof(Xps)=="undefined"){
	Xps = "";
	}
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById(Xdivtochange).innerHTML = xmlHttp.responseText;
	  } else {
	  document.getElementById(Xdivtochange).innerHTML = "<div style='padding:5% 0; font-size:80%; font-weight:bold; text-align:center;'><img src='../images/loading.gif' alt='Loading' /><br />Please Wait...<div>";
	  }
    }
 $Xurl = Xfiletosearch+".php";
  xmlHttp.open("POST",$Xurl,true);
  xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlHttp.send("u="+Xuname+"&p="+Xps);
  }