<!--  // AJAX for mapping results
function showlistingusingajax(id)
{
var xmlHttp;

try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  ajaxGood=true;
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    ajaxGood=true;
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      ajaxGood=true;
      }
    catch (e)
      {
          // use qs to return content
          // if we return true, then the link will be followed by non js browsers and SEO.

          return true;
      }
    }
  }

  // if we are here, then we have a valid xmlHttp object and we can use Ajax to serve the content.
document.getElementById('listingdisplay').innerHTML = "<h2>Getting Listing...<? echo $_SESSION[logged_in]; ?></h2>";

xmlHttp.onreadystatechange=function() {
    if(xmlHttp.readyState==4) {
      // document.myForm.time.value=xmlHttp.responseText;
      rv = xmlHttp.responseText;
      // rv = xmlHttp.responsHTML;
      var elem = document.getElementById("listingdisplay");
      elem.innerHTML = rv;
      //  replaceHtml(elem,rv);
      // alert(document.getElementById('listingdisplay').innerHTML);
    }
}

// alert ("QS to use: ajaxpagedetail.php?section="+section+"&cat="+cat );
// xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
// xmlHttp.open("GET","listing_display.php?id="+id,true);
    var url = "listing_display.php?id="+id+"&cacherequest="+Math.random();
// alert(url);
    xmlHttp.open("GET",url,true);

    xmlHttp.setRequestHeader("Content-Type", "text/xhtml");
    xmlHttp.send(null);
    // by returning false, the original click of the link will not be followed..
    // return false;
} // end of doAjax


function replaceHtml2(el,html) {
    alert(html);
    if (el.innerText) {
        alert("in ie");
        var adiv = document.createElement("div");
        adiv.innerHTML = html;
        // document.getElementById("test").appendChild(newdiv)
        el.appendChild(adiv);
        //document.all.listingdisplay.appendChild(adiv);
    } else {
        // this is ff
        alert("in ff");
        el.innerHTML = html;
    }

    alert(el.innerHTML);
    return;
}

function replaceHtml(el, html) {
/*
    html='<div id="listing_top_row" style="color: blue;">';
    html+='    <div id="picturebox2" style="width: 320px;">';
    html+='         <img id="mainpic" name="mainpic" src="http://nh.agentave.com/nopic.jpg" alt="Listing Picture"  />';
    html+='         <div id="thumbs" style="width: 306px; margin-left: 10px;">Thumbs Here';
    html+='</div>';
    html+='<div style="clear: both;"></div>';
    html+='<h1>After the thumbs</h1>';
    html+='</div> <!-- picturebox -->';
    html+='<div style="clear: both;"></div>';
    html+='<div><!-- listing_top_row -->';
*/
alert(html);
    var newEl = oldEl.cloneNode(false);
    newEl.innerHTML = html;
    oldEl.parentNode.replaceChild(newEl, oldEl);
    /* Since we just removed the old element from the DOM, return a reference
    to the new element, which can be used to restore variable references. */
    return newEl;
};

function showtext() {
    var t = document.getElementById("listingdisplay");
    var thetext = t.innerHTML;
    // t.innerHTML = thetext;
    alert ("T: " + thetext);
    return
}