
//<![CDATA[
var map

 function Mapload() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
          map.addControl(new GLargeMapControl());
          map.addControl(new GScaleControl());
          map.addControl(new GMapTypeControl());
          map.setCenter(new GLatLng(40.913513,-98.920898), 4);
          
         
         addArcades();
      }
    }


    

    function createMarker(point, innerHTML) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
            var sb 
            marker.openInfoWindowHtml(innerHTML);
        });
        return marker;
      }
      
     function addArcade(lat,lng,name,address,city,state,zip,website,email,phone,notes,threadid)
          { 
        var point = new GLatLng(lat,lng);
        var iHTML = new StringBuilder();
        
        var gURL = escape(address + " " + city + ", " + state + " " + zip)
        
        iHTML.append("<b>" + name + "</b><br/>");
        iHTML.append(address + "<br/>");
        iHTML.append(city + ", " + state + " " + zip + "<br/>");
        iHTML.appendIf(website,"Website: <a href=\"http://" + website + "\" target=\"_blank\">" + website + "</a><br/>");
        iHTML.appendIf(email,"Email: <a href=\"mailto:" + email + "\">" + email + "</a><br/>");
        iHTML.appendIf(phone,"Phone: " + phone + "<br/>"); 
        iHTML.appendIf(notes,"<br/>" + notes + "<br/>");
        iHTML.appendIf(threadid,"<br/><a href=\"http://www.pinballpost.com/default.aspx?g=posts&t=" + threadid + "\">View Photos, Reviews and More Information Here</a><br/>");
        
        iHTML.append("<br/><font size=1><i>Information Incorrect?  <a href=\"contactus.aspx\">Report It</a></i> | <a href=\"http://maps.google.com/maps?q='" + gURL + "\" target=\"_blank\">Open in Google Maps</a></font><br/><br/>");
        map.addOverlay(createMarker(point, iHTML.toString()));
     }   
   

   
    //]]>


//START: String Builder Routines

// Initializes a new instance of the StringBuilder class
// and appends the given value if supplied
function StringBuilder(value)
{
    this.strings = new Array("");
    this.append(value);
}

// Appends the given value to the end of this instance.
StringBuilder.prototype.append = function (value)
{
    if (value)
    {
        this.strings.push(value);
    }
}


// Appends the given value to the end of this instance.
StringBuilder.prototype.appendIf = function (value, text)
{
    if (value)
    {
        this.strings.push(text);
    }
}

// Clears the string buffer
StringBuilder.prototype.clear = function ()
{
    this.strings.length = 1;
}

// Converts this instance to a String.
StringBuilder.prototype.toString = function ()
{
    return this.strings.join("");
}

//END: String Builder Routines
