    var icon;
    var iconsm;
    var homeicon;
    var map;
    var panorama;       
    var WhoChanged = 0;
    var WhatChanged = 0;
    var WhereChanged = 0;
    var AdCounter = 0;
    var geocoder;
    var infowindow;

    var firstrun;
    firstrun = 1;

    var firstrunMap;
    firstrunMap = 1;
    var resizeTimeoutId;
                    	
   function GUnload() {
        var bannertimer = setInterval("changeBanner()", bPause);
        clearInterval(bannertimer);
    }

    var addEvent = function (elem, type, eventHandle) {
        if (elem == null || elem == undefined) return;
        if (elem.addEventListener) {
            elem.addEventListener(type, eventHandle, false);
        } else if (elem.attachEvent) {
            elem.attachEvent("on" + type, eventHandle);
        }
    };

    addEvent(window, "resize", function () {
            window.clearTimeout(resizeTimeoutId);
            resizeTimeoutId = window.setTimeout('mapFixResize();', 200);
                                            });

    //This function adds the Google bits to the page    

    function load() {
       
        init();
        // Hide Goggle X button after 1 sec on new bubble load
        setTimeout('HideGoogleClose', 1000);
  
        if (noResults == 'true') {
         setTimeout("showcontent('noresultsfound', 0)",200);
        }
      init();
      var start = new google.maps.LatLng(mcLat, mcLong);
      var myOptions = {
          zoom: mZoom,
          center: start,
          mapTypeId: google.maps.MapTypeId.ROADMAP
      };

      map = new google.maps.Map(document.getElementById("map"), myOptions);
      infowindow = new google.maps.InfoWindow;

      icon = new google.maps.MarkerImage('/Includes/ASPX/GetDirectoryImage.aspx?ImageType=LargeTarget&MaxWidth=50&MaxHeight=50',
            new google.maps.Size(41, 42),
            new google.maps.Point(0, 0),
            new google.maps.Point(20, 21));

      iconsm = new google.maps.MarkerImage('/Includes/ASPX/GetDirectoryImage.aspx?ImageType=SmallTarget&MaxWidth=50&MaxHeight=50',
            new google.maps.Size(26, 26),
            new google.maps.Point(0, 0),
            new google.maps.Point(13, 13));

      homeicon = new google.maps.MarkerImage('flag.png',
            new google.maps.Size(30, 30),
            new google.maps.Point(0, 0),
            new google.maps.Point(3, 27));

      // set the geocoder variable which can be referrenced as the map
      geocoder = new google.maps.Geocoder();
      // Add markers
      setListingMarkers();
      // Set panorma (street view) variable
      panorama = map.getStreetView();
      panorama.setPosition(start);
      panorama.setPov({ heading: 265, zoom: 1, pitch: 0 });
    }

    function toggleStreetView(sLat, sLong) {
      var point = new google.maps.LatLng(sLat, sLong);
      panorama.setPosition(point);
      var toggle = panorama.getVisible();
      if (toggle == false) {
        panorama.setVisible(true);
      } else {
        panorama.setVisible(false);
      }
    }
        
      var TagsShown = 1;
      var ListingsShown = 1;
      var FullMap = 1;

      var lastlistingid;
      var address;
      
      lastlistingid = 0
     
      // Browser sniffer
      var ua,an,ie,mac,win,ns,ns6,ge,unx;
      ua  = navigator.userAgent;
      an  = navigator.appName;
      ie  = ua.indexOf('MSIE')>=0;
      mac = ua.indexOf('Mac')>=0;
      win = ua.indexOf('Windows')>=0;
      unx = ua.indexOf('Unix')>=0;
      ns  = an.indexOf('Netscape')>=0;
      ns6 = ua.indexOf('Netscape6')>=0;
      ge  = ua.indexOf('Gecko')>=0;


      // Javascript for displaying the banner ads for the business directory. AH
      function bannerAd(AdID, type, href, alt, imgID, half) {
	      this.AdID  = AdID;
	      this.type  = type;
	      this.href  = href;
	      this.alt   = alt;
	      this.imgID = imgID;
	      this.half  = half;
	      //this.strTag = strTag;
      }

      function swfClicked(theId) {
        var bannerId;
        for(bannerId = 0; bannerId < maxAdCount; bannerId++) {
          if (adList[bannerId].imgID == theId.substring(1)) {
            //var load = window.open(adList[bannerId].href)
            var load = window.open("/Public/BannerAdCounter.aspx?BannerAdID=" + adList[bannerId].AdID)
            break;
          }
        }
      }
      
      function fcnRouteCallback(theCoords) {
//       alert(theCoords);
       document.getElementById('from').value = theCoords;
       generateRoute();
      }
      
      function directionsMode(listingName, coOrds){
        document.getElementById('directions').style.display = 'block';
        document.getElementById('svPanel').style.display = 'block';
        document.getElementById('progressBorder').style.display = 'block';
        document.getElementById('ddinterface').style.display = 'block';
        document.getElementById('normalinterface').style.display = 'none';
        document.getElementById('ITo').innerHTML = listingName;
        document.getElementById('to').value = coOrds;
//        fcnResize();
      }
      

    function email(url)
      {window.open(url,"EMailWindow","width=530,height=450,top=0,left=0")}
	  // This function uses commands that are only compatible with MSIE 4+, NN6+. (innerHTML)
      // We need to test this page with different browsers and modify accordingly.
      
      function outputBanner(adCounter) {
          var newBannerHTML = "";
          var width;
          
          if (adList[adCounter].half) {
           width=232;
          } else {
           width=468;
         }
          
          switch(adList[adCounter].type) {
	        // Image BannerAds...
	        case "jpg" :
	        case "gif":
	        case "png":
	          if (adList[adCounter].href != "#") newBannerHTML += "<a status=\"" + adList[adCounter].alt + "\" href=\"/Public/BannerAdCounter.aspx?BannerAdID=" + adList[adCounter].AdID + "\" target=_blank>"
	          newBannerHTML += "<img src=/includes/ImageStream/BannerAd.aspx?ID="+ adList[adCounter].imgID +" width=" + width + " style=margin-bottom:4px; height=60 border=0 alt=\""+ adList[adCounter].alt +"\">"
	          if(adList[adCounter].href != "#") newBannerHTML += "</a>"
	          break;
	        case "swf" :
                    newBannerHTML = "<object type=\"application/x-shockwave-flash\" data=\"/includes/ImageStream/BannerAd.aspx?ID=" + adList[adCounter].AdID + "\" id=\"flashBannerAd\" width=" + width + " style=\"margin-bottom:4px;\" height=60>"
                    newBannerHTML += "<param name=\"movie\" value=\"/includes/ImageStream/BannerAd.aspx?ID=" + adList[adCounter].imgID + "\">"
                    newBannerHTML += "</object>"
	            break;
	        default : newBannerHTML = "<b>Error:</b> BannerAD type ( <b>"+ adList[adCounter].type +"</b> ) is not recognised"
	      }
	      return newBannerHTML;
      }

      function changeBanner() {
	      var newBannerHTML = "";
	      var width;
	      var secondId;
	      var gotOne = -1;
	      var adCounter = 0;

	      if(adCounter == maxAdCount) adCounter = 0;
	      secondId = adCounter + 1;

	      if (maxAdCount > 0) {
	          if (adList[adCounter].half) {
	              newBannerHTML = outputBanner(adCounter);
	              //loop through remainder of ads to find a second one
	              for (secondId = adCounter + 1; secondId < maxAdCount; secondId++) {
	                  if (adList[secondId].half) {
	                      if (gotOne < 0) {
	                          //preferably not same ad
	                          if (!(adList[secondId].imgID == adList[adCounter].imgID)) {
	                              gotOne = secondId;
	                          }
	                      }
	                  }
	              }
	              if (gotOne < 0) {
	                  for (secondId = 0; secondId < maxAdCount; secondId++) {
	                      if (adList[secondId].half) {
	                          if (gotOne < 0) {
	                              //preferably not same ad
	                              if (!(adList[secondId].imgID == adList[adCounter].imgID)) {
	                                  gotOne = secondId;
	                              }
	                          }
	                      }
	                  }
	              }
	              if (gotOne < 0) {
	                  for (secondId = 0; secondId < maxAdCount; secondId++) {
	                      if (adList[secondId].half) {
	                          if (gotOne < 0) {
	                              gotOne = secondId;
	                          }
	                      }
	                  }
	              }
	              newBannerHTML = newBannerHTML + "<img src=\"spacer.gif\" width=4 height=2>" + outputBanner(gotOne);
	          } else {
	              newBannerHTML = outputBanner(adCounter);
	          }

	          // Change the banner code..
	          document.getElementById("placeHolder").innerHTML = newBannerHTML;
	          // Increase the counter
	          adCounter++;
	      }
      }

      function init() {
        var bannertimer = setInterval("changeBanner()", bPause);
        if (maxAdCount > 0) {
	        changeBanner();
	        //setInterval("changeBanner()", <%'= Pause %>);
	      }
      }
       
 
    function fcnTest() {
     var centerlatlng = map.getCenter(); 
//     alert('lat: ' + centerlatlng.lat() + ', lng:' + centerlatlng.lng());
    }


   

    function beforeSubmit() {
      var GeocoderResult;
      var TheResult;

      if (WhoChanged == 0) { document.getElementById('who').value = '' }
      if (WhereChanged == 0) { document.getElementById('where').value = '' }
      if (WhatChanged == 0) { document.getElementById('what').value = '' }

      if (document.getElementById('who').value != '') 
      {
        var str = document.getElementById('who').value;
        document.getElementById('who').value = str.replace("'", "-");
        document.getElementById('specialChar').value = 'yes' ;
      }
       
       if (document.getElementById('where').value == '') {
          var latLng = map.getCenter();
          geocoder.geocode({ 'latLng': latLng }, runTheResult);
        TheResult = false;
      } else {
        geocoder.geocode({ 'latLng': map.getCenter() }, fcnSetCountry);
        TheResult  = true;
      }
      if (!TheResult) return TheResult;
      //document.search.submit();
    }
    
    function hideMessageDiv()
    {
        document.getElementById('MessageDiv').style.display='none';
        document.getElementById("OverseaDivMessage").style.display='none';
    }

    function runTheResult(theresult) {
      if (undefined != theresult[0].formatted_address) {
            //The map is centre'd overland - OK to go
          document.getElementById('where').value = theresult[0].formatted_address;
          document.getElementById('lat').value = theresult[0].geometry.location.lat();
          document.getElementById('lng').value = theresult[0].geometry.location.lng();
          document.search.submit();
        } else {
          //The map is centre'd oversea - (theresult.Placemark[0]) is undefined and gives an error.
          //Either give a message
          //document.getElementById("OverseaDivMessage").style.display='block';
          //Or move the map
          document.getElementById('where').value = "Preston";
          document.getElementById('lat').value = '53.7564846';
          document.getElementById('lng').value = '-2.7088698';
          // every time a tag is clicked then increment the tags stats
          document.getElementById('tagClouds').value = 'yes';
    
          document.search.submit();
        }
      }

      function fcnSetCountry(theresult) {
          if (undefined != theresult[0].formatted_address) {
          //The map is centre'd overland - OK to go
              var strCountry = theresult[0].formatted_address
          var arrAddress = strCountry.split(', ');
          arrAddress.reverse();
          strCountry = arrAddress[0];
          document.getElementById('txtCountry').value = strCountry;
          document.getElementById('lat').value = theresult[0].geometry.location.lat();
          document.getElementById('lng').value = theresult[0].geometry.location.lng();
          document.search.submit();
        }
      }
    
    function getAddress(overlay, latlng) {
      if (latlng != null) {
        address = latlng;
        geocoder.geocode({ 'latLng': latlng }, showAddress);
      }
    }


    function showcontent(thepage, ListingID) {
        document.getElementById('overlayframe').src = 'InfoFrame.aspx?page=' + thepage + '&ListingID=' + ListingID;
    }
	
    // new bubble - BubbleLayoutID, BubbleWidth and BubbleHeigth
	function showbubble(BubbleLayoutID, ListingID, dblLat, dblLong, BHeight, BWidth) {
	    
        if (!(sWhere == '')) {
	        if (lastlistingid != 0) {
	            document.getElementById('listing' + lastlistingid).style.backgroundColor = ''
	            document.getElementById('listing' + lastlistingid).style.backgroundImage = ''
	            document.getElementById('listing' + lastlistingid).style.backgroundRepeat = 'no-repeat'
	        }

	        document.getElementById('listing' + ListingID).style.backgroundImage = ''
	        lastlistingid = ListingID
	    }
	    document.getElementById('bubblediv').style.width = BWidth + "px";
	    document.getElementById('bubbleif').width = BWidth;
	    document.getElementById('bubbleif').height = BHeight;
	    document.getElementById('bubbleif').style.backgroundColor = '#000000'

	    document.getElementById('bubbleif').src = 'Bubble/bubble' + BubbleLayoutID + '.aspx?ListingID=' + ListingID
	    element = document.getElementById('bubblediv')
	    element = element.cloneNode(true)
	    element.style.display = 'block';
	    var bubbleContents = element.innerHTML;
	    var myLatLng = new google.maps.LatLng(dblLat, dblLong);
	    infowindow.content = bubbleContents;
	    infowindow.position = myLatLng;
	    //var infowindow = new google.maps.InfoWindow({
	    //    content: bubbleContents,
	    //    position: myLatLng
	    //});
	    infowindow.open(map);
	}
	
	function clickTag(strTag) {
	  document.getElementById('who').value = '';
	  document.getElementById('what').value = strTag;
      // every time a tag is clicked then increment the tags stats
	  document.getElementById('tagClouds').value = 'yes';
    
	  if (document.getElementById('where').value.substring(0,3) == 'e.g'){document.getElementById('where').value = ''};
	  if (!(document.getElementById('where').value == '')) {
	      document.getElementById('tagClouds').value = 'yes';
	      document.getElementById("search").submit();
	  } else {
	    //alert(runTheResult);
	  geocoder.geocode({ 'latLng': map.getCenter() }, runTheResult);  
	  }
	}
	
	function changeColor(color, ID) 
	{
		document.getElementById(ID).style.backgroundColor = color;
	}
	
	function bannerTag(whatTag)
	{ 
	    whatTag = whatTag.replace('#space#', ' ');
	    document.getElementById('what').value = whatTag;	    
	    document.getElementById('who').value = '';
	    document.getElementById('where').value = '';
	    geocoder.geocode({ 'latLng': map.getCenter() }, runTheResult);
	}

	function fcnSelectAccreditationImages() {
	  var i = 0; var random;

	  while (i < ImageIDs.length) {
	    random = fcnGetRand(ImageIDs.length);
	    if (ImageIDs[random] != "selectedalready") {
	      document.getElementById("AccredImage" + i).src = "/Includes/ASPX/GetImage.aspx?Imagetype=Accreditation&ImageID=" + ImageIDs[random] + "&MaxHeight=100&MaxWidth=300";
	      document.getElementById("AccredImage" + i).title = ImageAltText[random];
        ImageIDs[random] = "selectedalready";
	      i++;
	    }
	  }

	  //reset array back to its original state
	  i = 0;
	  while (i < ImageIDs.length) {
	    ImageIDs[i] = OrigImageIDs[i];
	    i++;
	  }
	}

	function fcnGetRand(intMax) {
	  return Math.floor(Math.random() * intMax);
	}

	function bannerAdList(){}

	var adList = new bannerAdList();

	// All the new Javascript Functions for new bubble 
	
    // Use this function to redirect to customercontactus.aspx page
	function OpenContactIFrame(WhichIcon, ListingID) {
	    // need to increment the statistics first using counter page and then redirect to the appropriate page using URLtoredirect Param
	    parent.location.href = "counter.aspx?icon=" + WhichIcon + "&listingID=" + ListingID;


	}

	// Lannie has provided this function to display a2phone
	function a2Phone(SiteGUID, ListingID) {
	    var url = 'http://www.a2voip.com/a2webphone/showphone.html?ListingID=' + ListingID + '|SiteGUID=' + SiteGUID;
	    var width = 300;
	    var height = 400;
	    var left = (screen.width - width) / 2;
	    var top = (screen.height - height) / 2;
	    var params = 'width=' + width + ', height=' + height;
	    params += ', top=' + top + ', left=' + left;
	    params += ', directories=no';
	    params += ', location=no';
	    params += ', menubar=no';
	    params += ', resizable=no';
	    params += ', scrollbars=no';
	    params += ', status=no';
	    params += ', toolbar=no';
	    newwin = window.open(url, 'a2phone_po', params);
	    if (window.focus) { newwin.focus() }
	    return false;
	}

	// function to Close the bubble using our close button
	function CloseBubble() {
	    var cb;
	    // Loop through the images to find the google bubble X button
	    for (i = 0; i < window.document.images.length; i++) {
	        if (window.document.images[i].src.search('iw_close.gif') > 0) {
	            cb = window.document.images[i];
	        }
	    }

	    if (document.createEvent) { // this is for firefox and other browser
	        var evt = document.createEvent("MouseEvents");
	        evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
	        var canceled = !cb.dispatchEvent(evt);
	    } // end if 
	    else if (document.createEventObject) { //this is only for IE
	        var evt = document.createEventObject();
	        var canceled = !cb.fireEvent('onclick', evt)
	    } // end if

	} // end function

    // Hide the google orginial x button
	function HideGoogleClose() {
	    // Loop through the images to find the google bubble X button
	    for (i = 0; i < window.document.images.length; i++) {
	        if (window.document.images[i].src.search('iw_close.gif') > 0) {
	            window.document.images[i].style.display = 'none';
	        }
	    }

	}
	// new bubble JS functions finishes here
	function newmarker_clicked(marker) {
	    if (marker) {
	        if (marker.popupid) {
	            //if listing panel is there
	            if (lastlistingid != 0 && document.getElementById("listing" + lastlistingid)) {
	                document.getElementById("listing" + lastlistingid).style.backgroundColor = ""
	                document.getElementById("listing" + lastlistingid).style.backgroundImage = "url(\'/Includes/ASPX/GetDirectoryImage.aspx?ImageType=BGTarget&MaxWidth=30&MaxHeight=30\')"
	                document.getElementById("listing" + lastlistingid).style.backgroundRepeat = "no-repeat";
	            }
	            //if listing panel is there and visible
	            if (document.getElementById("listing" + marker.popupid)) {
	                document.getElementById("listing" + marker.popupid).style.backgroundColor = "#" + strColour10;
                    document.getElementById("listing" + marker.popupid).style.backgroundImage = ""
	                document.getElementById("listing" + marker.popupid).scrollIntoView(false)
	            }

	            var BLayoutID = marker.bubbleid;
	            var BLayoutW = marker.bubbleW;
	            var BLayoutH
	            BLayoutH = marker.bubbleH;
	            // Add this code to show new bubble **************************
	            showbubble(BLayoutID, marker.popupid, marker.position.lat(), marker.position.lng(), BLayoutH, BLayoutW)
   
	        }
	    }
	}


	function fcnGetNewMapHeightRezize() {
	    var D = document;
	    var val = 0;
	    if (document.all) {
	        val = D.documentElement.offsetHeight - 114;
	    } else {
	        val = D.documentElement.clientHeight - 110;
	    }
	    return val;
	}

	function mapFixResize() {
	    if (FullMap == 0) {
	        document.getElementById("maincontent").style.bottom = "0px";
	        document.getElementById("mapdiv").style.height = "100%";
	        document.getElementById("mapdiv").style.bottom = "0px";
	    }
	    google.maps.event.trigger(map, "resize");
	}

	function fcnShowHideTags() {
	    if (TagsShown == 1) {
	        // hide left panel and make map bigger	 
	        document.getElementById("shtags").style.left = "0px";
	        document.getElementById("TagsDIV").style.width = "0px";
	        document.getElementById("mapdiv").style.left = "11px";
	        document.getElementById("showhidetags").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=ShowTag&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        TagsShown = 0;
	        setTimeout("mapFixResize()", 200);
	    } else {
	        // show left panel and make map smaller	 
	        document.getElementById("showhidetags").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=HideTag&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        document.getElementById("shtags").style.left = "275px";
	        document.getElementById("TagsDIV").style.width = "275px";
	        document.getElementById("mapdiv").style.left = "286px";
	        TagsShown = 1;
	        setTimeout("mapFixResize()", 200);
	    }
	}

	function fcnShowHideListings() {
	    if (ListingsShown == 1) {
	        // hide right panel and make map bigger
	        document.getElementById("shlistings").style.right = "2px";
	        document.getElementById("ListingsDIV").style.width = "0px";
	        document.getElementById("mapdiv").style.right = "11px";
	        document.getElementById("showhidelistings").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=ShowListing&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        ListingsShown = 0;
	        setTimeout("mapFixResize()", 200);
	    } else {
	        // show right panel and make map smaller
	        document.getElementById("showhidelistings").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=HideListing&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        document.getElementById("shlistings").style.right = "285px";
	        document.getElementById("ListingsDIV").style.width = "285px";
	        document.getElementById("mapdiv").style.right = "296px";
	        ListingsShown = 1;
	        setTimeout("mapFixResize()", 200);
	    }
	}


	function listingmousein(target) {
	    document.getElementById(target.id).style.backgroundColor = "#" + strColour10;
	    document.getElementById(target.id).style.backgroundImage = "url(\'/Includes/ASPX/GetDirectoryImage.aspx?ImageType=BGTarget&MaxWidth=30&MaxHeight=30\')";
	    document.getElementById(target.id).style.backgroundRepeat = "no-repeat";
	}

	function listingmouseout(target) {
	    if (target.id == "listing" + lastlistingid) {
	        //listing was selected 
	        document.getElementById(target.id).style.backgroundColor = "";
	        document.getElementById(target.id).style.backgroundImage = "";
	        document.getElementById(target.id).style.backgroundRepeat = "no-repeat";
	    } else {
	        //listing wasn"t selected
	        document.getElementById(target.id).style.backgroundColor = "";
	        document.getElementById(target.id).style.backgroundImage = "";
	        document.getElementById(target.id).style.backgroundRepeat = "no-repeat";
	    }
	}

	function marker_clicked(marker) {
	    if (marker) {
	        if (marker.popupid) {
	            //if listing panel is there
	            if (lastlistingid != 0 && document.getElementById("listing" + lastlistingid)) {
	                document.getElementById("listing" + lastlistingid).style.backgroundColor = ""
	                document.getElementById("listing" + lastlistingid).style.backgroundImage = "url(\'/Includes/ASPX/GetDirectoryImage.aspx?ImageType=BGTarget&MaxWidth=30&MaxHeight=30\')"
	                document.getElementById("listing" + lastlistingid).style.backgroundRepeat = "no-repeat";
	            }
	            //if listing panel is there and visible
	            if (document.getElementById("listing" + marker.popupid)) {
	                document.getElementById("listing" + marker.popupid).style.backgroundColor = "#" + strColour10;
	                document.getElementById("listing" + marker.popupid).style.backgroundImage = ""
	                document.getElementById("listing" + marker.popupid).scrollIntoView(false)
	            }

	            var BLayoutID = marker.bubbleid;
	            var BLayoutW = marker.bubbleW;
	            var BLayoutH
	            BLayoutH = marker.bubbleH;
	            // Add this code to show new bubble **************************
	            showbubble(BLayoutID, marker.popupid, marker.position.lat, marker.position.lng, BLayoutH, BLayoutW)

	            //**********************************************************************
	        }
	    }
	}

	function fcnFullScreenMap() {
	    if (FullMap == 1) {
	        // hide right panel and make map bigger
	        document.getElementById("header").style.display = "none";
	        document.getElementById("maincontent").style.top = "0px";
	        document.getElementById("shlistings").style.right = "2px";
	        document.getElementById("ListingsDIV").style.width = "0px";
	        document.getElementById("showhidelistings").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=ShowListing&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        document.getElementById("mapdiv").style.left = "11px";
	        document.getElementById("mapdiv").style.right = "11px";
	        document.getElementById("shtags").style.left = "0px";
	        document.getElementById("TagsDIV").style.width = "0px";
	        document.getElementById("showhidetags").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=ShowTag&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        document.getElementById("maincontent").style.bottom = "0px";
	        document.getElementById("footer").style.display = "none";
            document.getElementById("mapdiv").style.height = "100%";
            document.getElementById("mapdiv").style.bottom = "0px";
	        FullMap = 0;
	        setTimeout("mapFixResize()", 200);
	    } else {
	        // show right panel and make map smaller
	        document.getElementById("header").style.display = "block";
	        document.getElementById("maincontent").style.top = "69px";
	        document.getElementById("shlistings").style.right = "2px";
	        document.getElementById("ListingsDIV").style.width = "0px";
	        document.getElementById("showhidelistings").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=HideListing&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        document.getElementById("mapdiv").style.left = "286px";
	        document.getElementById("mapdiv").style.right = "11px";
	        document.getElementById("shtags").style.left = "275px";
	        document.getElementById("TagsDIV").style.width = "275px";
	        document.getElementById("showhidetags").src = "/Includes/ASPX/ImageGen.aspx?ImgType=Directory&DirectoryType=HideTag&width=10&height=93&HexFront=" + strColour2 + "&HexBack=" + strColour3 + "&Trans=true";
	        document.getElementById("maincontent").style.bottom = "40px";
	        document.getElementById("footer").style.display = "block";
            document.getElementById("mapdiv").style.height = "";
            document.getElementById("mapdiv").style.bottom = "";
	        FullMap = 1;
	        setTimeout("mapFixResize()", 200);
	    }
	}

	// New Listing report popover for Listing Comparison piece

	function fcnChangeClassListingOver(objDivID) {
	  document.getElementById("clc_row" + objDivID).className = 'clc_row_hover';
  }

  function fcnChangeClassListingOut(objDivID) {
    document.getElementById("clc_row" + objDivID).className = 'clc_row';
  }
