//*****************************
//AJAX Specific Functions
//*****************************
function process_ajax_link_tracking()
{
  if (ajax_request.readyState == 4)
    {
      // only if "OK"
      if (ajax_request.status == 200)
        {
          if(ajax_request.responseText != "")
            {
            }
        }
      else {
        //alert("There was a problem retrieving data:<br />"+ajax_request.statusText);
      }
    }
}

//Start ajax by calling this function
function track_link(the_url, title, current_page, pos_x, pos_y)
{
  initialize_ajax();
  client_height = get_client_height();
  client_width = get_client_width();
  scroll_y = get_scroll_y();

  var url="ancillary/ajax_link_tracking.php";
  url += "?pos_x="+pos_x;
  url += "&pos_y="+pos_y;
  url += "&client_height="+client_height;
  url += "&client_width="+client_width;
  url += "&scroll_y="+scroll_y;
  url += "&title="+url_encode(title);
  url += "&url="+url_encode(the_url);
  url += "&current_page="+url_encode(current_page);
  if(ajax_request!=null) {
    ajax_request.onreadystatechange = process_ajax_link_tracking;
    ajax_request.open("GET", url, true);
    ajax_request.send(null);
  }
}
