     var xAxis = 0;
    var yAxis = 0;
    function callDetails(e,text){
      if(document.all)
       e = event;
       xAxis = e.clientX;
       yAxis = e.clientY;
   
       var x = getDetails(text);
     
       }
	
    function showMemberDistrict(name, district){
	
	
        
	var obj = document.getElementById('ajax_tooltip');
       
	var obj2 = document.getElementById('ajax_tooltip_content');
       
	obj2.innerHTML = name + "<br/>"+ district;
	obj.style.display = 'block';
       	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)
        st=0; 
        
	var leftPos = xAxis - 100;
	if(leftPos<0)
              leftPos = 0;
	obj.style.left = leftPos + 'px';
	obj.style.top = yAxis - obj.offsetHeight -1 + st + 'px';
  }
    
  function newXMLHttpRequest() {

  var xmlreq = false;

  if (window.XMLHttpRequest) {

    // Create XMLHttpRequest object in non-Microsoft browsers
    xmlreq = new XMLHttpRequest();

  } else if (window.ActiveXObject) {

    // Create XMLHttpRequest via MS ActiveX
    try {
      // Try to create XMLHttpRequest in later versions
      // of Internet Explorer

      xmlreq = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e1) {

      // Failed to create required ActiveXObject

      try {
        // Try version supported by older versions
        // of Internet Explorer

        xmlreq = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (e2) {

        // Unable to create an XMLHttpRequest with ActiveX
      }
    }
  }

  return xmlreq;
}

function getDetails(memberName) {
  
  // Obtain an XMLHttpRequest instance
  var req = newXMLHttpRequest();
 //alert("created the xmlrequest object");
  // Set the handler function to receive callback notifications
  // from the request object
  var handlerFunction = getReadyStateHandler(req, updateBlock);
  req.onreadystatechange = handlerFunction;
  
  // Open an HTTP POST connection to the shopping cart servlet.
  // Third parameter specifies request is asynchronous.
  req.open("POST", "am", true);
  //alert( "after posting");
  // Specify that the body of the request contains form data
  req.setRequestHeader("Content-Type", 
                       "application/x-www-form-urlencoded");

  // Send form encoded data stating that I want to add the 
  // specified item to the cart.
  req.send("memberName="+memberName+"");
}

/*
 * Returns a function that waits for the specified XMLHttpRequest
 * to complete, then passes its XML response
 * to the given handler function.
 * req - The XMLHttpRequest whose state is changing
 * responseXmlHandler - Function to pass the XML response to
 */
function getReadyStateHandler(req, responseXmlHandler) {

  // Return an anonymous function that listens to the 
  // XMLHttpRequest instance
  return function () {

    // If the request's status is "complete"
    if (req.readyState == 4) {
      
      // Check that a successful server response was received
      if (req.status == 200) {

        // Pass the XML payload of the response to the 
        // handler function
        responseXmlHandler(req.responseXML);

      } else {

        // An HTTP problem has occurred
        alert("HTTP error: "+req.status);
      }
    }
  }
}

function updateBlock(memberDetailsXML) {
           
             //alert( "inside Update Block");
             var xmlroot = memberDetailsXML.getElementsByTagName("members")[0];
            //alert("after getting xmlroot");
              var members = xmlroot.getElementsByTagName("member");
            // alert(" after getting members");
            // for (var i = 0 ; i < members.length ; i++) {
                var member = members[0];
                var name = member.getElementsByTagName("member-name")[0].firstChild.nodeValue;
                var typeInd = member.getElementsByTagName("type-ind")[0].firstChild.nodeValue;
                var district = member.getElementsByTagName("district")[0].firstChild.nodeValue;
                 // var li = document.createElement("li");
                  //li.appendChild(document.createTextNode(name+" represents District # "+district));
                 var distText = " represents District # "+ district;
                  //alert( s);
                  showMemberDistrict(name,distText);
               
           // }
}
function hideAjaxToolTip()
{
	document.getElementById('ajax_tooltip').style.display = 'none';
	
}
    
    
    function showhide(id){
      
              if (window.document.getElementById(id)){
              
                obj = window.document.getElementById(id);
                       if (obj.style.display == "none"){
                       obj.style.display = "";
                     } else {
                          obj.style.display = "none";
                     } 
               }
             }
             
    function toggleMoreInfo(id1, id2 ){
               
               if (window.document.getElementById(id1)){
                obj = window.document.getElementById(id1);
               
                       if (obj.style.display == "none"){
                       obj.style.display = "";
                       } else {
                          obj.style.display = "none";
                      } 
                    
               }
               
               if (window.document.getElementById(id2)){
                obj2 = window.document.getElementById(id2);
                       if (obj2.style.display == "none"){
                       obj2.style.display = "";
                     } else {
                          obj2.style.display = "none";
                     } 
               }
            
        }
    
    
    function setSearchValue(countyName){
       
         document.myForm.county.value=countyName;
         
	 document.myForm.submit();
    }
    
    function setMemberValue(memberName){
         document.memberForm.memberName.value=memberName;
        
	 document.memberForm.submit();
    }
    
    function displayCountyName(countyName){
    
      document.displayForm.search.value=countyName;
    }
    
    function displayNull(){
      document.displayForm.search.value="";
    }
    
    
/************************************************************************************************************
Ajax dynamic list
Copyright (C) September 2005  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com
	
************************************************************************************************************/	
function showToolTip(e,text){
	if(document.all)e = event;
	
	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = text;
	obj.style.display = 'block';
       	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
	var leftPos = e.clientX - 100;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos + 'px';
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';
}

function showToolTip(e,text1,text2){
	if(document.all)e = event;
	
	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
        // obj2.innerHTML =  text1 + '<br/>' +text2 + " Complaints  " ;
        obj2.innerHTML =  text1 + '<br/>' ;
        obj.style.display = 'block';
       	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
	var leftPos = e.clientX - 100;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos + 'px';
	obj.style.top = e.clientY - obj.offsetHeight - 5 + st + 'px';
}	

function hideToolTip()
{
	document.getElementById('bubble_tooltip').style.display = 'none';
	
}

 function toggleMapDiv(id){
      
              if (window.document.getElementById(id)){
                obj = window.document.getElementById(id);
                       if (obj.style.display == "none"){
                       obj.style.display = "";
                     } else {
                          obj.style.display = "none";
                     } 
               }
             }

/************************************************************
 *****************End of Script from dhtml goodies************
 *************************************************************/
 
 
