
    function Graveyard_getURL()
    {
		return '/graveyard/?id=' + this._id;
    } 

    function Graveyard_getHTML()
    {
		var url = '/graveyard/?id=' + this._id;

		var html = '<div class="map_popup">';
		html +=   '<div class="minibanner">';
		html +=   '<a target="_blank" href="/">GRAVEYARDS.COM</a><br>';
		html +=   '<span class="minibanner_title">' + this._name + '</span>';
		html +=   '</div>';

        if (this._image && this._image!='0')
        {
			html+= '<div class="map_popup_picturebox">' + 
				   '<a target="_blank" href="'+url+'">' + 
				   '<img width=300 src="' + this._image + '" />' + 
				   '<br clear="all">VIEW DETAILS</a><br>' +  
			       '</div>';
        } else {
			html += '<div class="map_popup_emptybox">' + 
			'<a target="_blank" class="brightlink" href="'+url+'">' +
            'View Details...</a></hr>';
   
            html += "<p>Approx location: " + this._maparea + "</p>";
 
			html += '<p>Photo not available; I apparently have ' +
            'not visited this site.  Can you ';
            html += '<a target="_blank" href="' + url + '&amp;cmd=photo-help">submit a photo?</a></p>';

			html += '</div>';
        } 
        html += '<div class="minicoords"><b>Coordinates:</b> &nbsp; &nbsp; ' +
            this._latitude + ', ' + this._longitude + '</div>';
		html += '</div>';
        return html;
    } 

    function Graveyard_setPosition(lat_dec, lon_dec, bounds)
    {
        this._latitude = lat_dec;
        this._longitude = lon_dec;
    }

    function Graveyard_addToMap(map, bounds)
    {
        if (this._latitude && this._longitude)
        {
		    this._point = new GLatLng(this._latitude, this._longitude);
		    if (bounds)
		    {
			    bounds.extend(this._point);
		    }

   		    this._marker = createMarker(this._point, this.getIcon(), this._name, this.getHTML());
	        map.addOverlay(this._marker);
            return this._marker;
        } else {
            alert("cannot add to map: lat or lon is 0");
            return 0;
        } 
    }

    function Graveyard_setStatus(st)
    {
        this._status = st;
    }

    function Graveyard_getIcon()
    {   
        if (this._status >= 8 )
            return iconCache['green'];
        if (this._image != '' && this._image != 0)
            return iconCache['blue'];
        return iconCache['red'];
    } 

    function Graveyard_setImage(img)
    {
        this._image = img; 
    }

    function Graveyard(id, name, maparea)    // CONSTRUCTOR
    {
        this._id = id;
        this._name = name;
        this._latitude = 0;
        this._longitude = 0;
        this._point = 0;
        this._marker = 0;
        this._status = 0;   // unvisited
        this._image = 0;    // none.
        this._maparea = maparea;

        this.getURL = Graveyard_getURL; 
        this.getHTML = Graveyard_getHTML;
        this.getIcon = Graveyard_getIcon;
        this.setPosition = Graveyard_setPosition;
        this.addToMap = Graveyard_addToMap;
        this.setImage = Graveyard_setImage;
        this.setStatus = Graveyard_setStatus;
    } 

