function PhpLive(httpUrl)
{

       //Global varrible decloration for internal functions uses.
      this.httpResourceToSendTo = httpUrl;

      this.url = 'http://www.youadults.com/';

      this.httpFormName = "";

      this.httpParameters = [];

      this.httpParametersPath = [];

      this.httpParameterCount = 0;

      this.updateElement = "";

      this.stringLoadingMessage = '<div style="float:left;width:100%;text-align:center;font-size:15px;padding:20px 0px 10px 0px;font-size:10px;">  <img src="'+ this.url +'/images/loading.gif"/> <br/> Loading...  </div>';

      this.executeEvent = "";


      var that = this;

      this.ResponseText = "";

      //This function builds query strings, encodes them, and
      //sends them off to the correct page with correct POST[] information
      //varibles are declared localy for internal function use, to make the varibles private
      this.SendRequest = function()
      {
            //define new Xml Http Object
            var HttpRequest = null;   
            HttpRequest = this.GetXmlHttpObject();
            // defining update panel
            var UpdatePanel = null;
            UpdatePanel = this.updateElement;

            var httpRequestToSend = null;

            // Check for existence and declration
            if(HttpRequest != null)
            {

                  //build http post string
                  httpRequestToSend = this.BuildHttpPost().toString();

                  // remove & from http post string
                  if(httpRequestToSend.toString().substring(0,1) == "&")
                  {
                        httpRequestToSend = httpRequestToSend.substring(1,httpRequestToSend.length);
                  }

                  // load panels with loading message
                  this.ShowLoadingMessage();

                  //state calling area, what to call when state changes
                  HttpRequest.onreadystatechange = function()
                  {
                      if (HttpRequest.readyState== 4 || HttpRequest.readyState== "complete")
                       {
                          document.getElementById(UpdatePanel).innerHTML = HttpRequest.responseText;

                          that.ResponseText = HttpRequest.responseText;

                       }
                  }

                  //create reference to send to
                  HttpRequest.open("POST",this.httpResourceToSendTo,true);

                  //establish post type
                  HttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

                  HttpRequest.setRequestHeader("Content-length", httpRequestToSend.length);

                  HttpRequest.setRequestHeader("Connection", "close");

                  // send parameters from the page
                  HttpRequest.send(httpRequestToSend);


            }
            else
            {
                //warn user that they need upgrade
                alert("We are sorry, but you need to update your browser...");
            }



      }


      // showing loading message in the update panel place
      this.ShowLoadingMessage = function()
      {
          document.getElementById(this.updateElement).innerHTML = this.stringLoadingMessage;
      }

      //out all of the paremters that have been put in place, building query string
      this.BuildHttpPost = function()
      {
           var i = 0;

           var stringParameters  = "";


           for(i = 0; i < this.httpParameterCount; i++)
           {
               stringParameters = stringParameters + "&" + this.httpParameters[i] + "=" + encodeURI(this.httpParametersPath[i].value);
           }


           return stringParameters+"&ajaxstate=true"+"&"+this.executeEvent+"=1&panelname="+this.updateElement+"&random="+Math.ceil(1000*Math.random());
      }

      //add parameter to library
      this.AddParameter = function(elementID,elementPath)
      {
            this.httpParameters[this.httpParameterCount] = elementID;
            this.httpParametersPath[this.httpParameterCount] = elementPath;
            this.httpParameterCount++;
      }

      //set update panel
      this.SetUpdatePanel = function(elementID)
      {
            this.updateElement = elementID;

      }

      //set execute event, to send as post
      this.SetExecuteEvent = function(eventName)
      {
          this.executeEvent = eventName;

      }


      //trying to resolve what object should be assigned,
      //different browsers support different classes
      this.GetXmlHttpObject = function()
      {
          var HttpGateway = null;
          try
           {
               //initilize firefox, safari, opera
              HttpGateway = new XMLHttpRequest();
           }
          catch (e)
           {
                //if fails then initlize for IE 6 & 7
               try
                {
                    HttpGateway = new ActiveXObject("Msxml2.XMLHTTP");
                }
               catch (e)
                {
                    HttpGateway = new ActiveXObject("Microsoft.XMLHTTP");
                }
           }

           //return assigned gateway
           return HttpGateway;
      }


}


