window.onload = function(){
    load();
}
var map = null;
var geocoder = null;
var input = [
{
    "info":"arvato systems North America, Inc. [Headquarter]<br>Contact: <a id = \"contact_us_link\" href=\"content/contact_us\" class=\"links\"/>Frank Zimmermann</a><br>1700 Broadway, 26th Floor<br>New York, NY 10019",
    "lng":"-73.982485",
    "lat":"40.7640604"
},
{
    "info":"arvato systems North America, Inc.<br>Contact: <a href= \"content/contact_us\" class=\"links\">Ulrich Schueler</a><br>150 York Street<br>Suite 1900<br>Toronto, ON M5H 3S5",
    "lng":"-79.3841225",
    "lat":"43.6492388"

},
{
    "info":"arvato systems UK & Ireland Ltd.<br>Contact: <a href= \"content/contact_us\" class=\"links\">Oliver Becker</a><br>6th floor<br>33-34 Alfred Place<br>London<br>WC1E 7DP",
    "lng":"-0.1326886",
    "lat":"51.5201309"
},
{
    "info":"arvato systems UK & Ireland Ltd.<br>Contact: <a href= \"content/contact_us\" class=\"links\">Andew Cox</a><br>Unit 24 Crystal Drive<br>c/o arvato services UK<br>Warley<br>West Midlands<br>B66 1QG",
    "lng":"-1.995111",
    "lat":"52.504041"
},
{
    "info":"arvato systems GmbH [Headquarter]<br>P. O. Box 180<br>An der Autobahn 18<br>D-33311 Guetersloh<br>Tel: +49 (0) 5241/ 80-80 888<br>Fax: +49 (0) 5241/ 80-80 666",
    "lng":"8.440236",
    "lat":"51.881928"
},
{
    "info":"arvato systems Hungary Kft.<br>Contact: <a href= \"content/contact_us\" class=\"links\">László Boros</a><br>Ráby Mátyás u. 26.<br>1038 Budapest",
    "lng":"19.0427134",
    "lat":"47.5923564"
},
{
    "info":"arvato systems Shanghai Ltd.<br>Contact: <a href= \"content/contact_us\" class=\"links\">Henry Guo</a><br>162, Luo Xiu Road<br>200231 Shanghai",
    "lng":"121.4759159",
    "lat":"31.2243531"
},
{
    "info":"arvato systems [Thailand] Ltd.<br>Contact: <a href= \"content/contact_us\" class=\"links\">Henrik Toftum</a><br>195 Empire Tower, 24th Floor<br>Park Wing, South Sathorn<br>Yannawa, Sathorn,<br>Bangkok 10120,<br>Thailand",
    "lng":"100.5313752",
    "lat":"13.7228882"
},
{
    "info":"arvato systems Malaysia Sdn. Bhd.<br>Contact: <a href= \"content/contact_us\" class=\"links\">Henrik Toftum</a><br>Level 25, Menara IMC, No.8, Jalan Sultan Ismail<br>50250 Kuala Lumpur,<br>Malaysia",
    "lng":"101.7061188",
    "lat":"3.1507379"
},
{
    "info":"arvato systems Singapore Pte Ltd.<br>Contact: <a href= \"content/contact_us\" class=\"links\">Henrik Toftum</a><<br>4 Shenton Way, #15 SGX Centre Tower 2<br>Singapore 068807",
    "lng":"103.8498862",
    "lat":"1.279113"
},
{
    "info":"arvato systems GmbH <br>Rheinstrasse 99<br>D-76532 Baden-Baden<br>Tel.: +49 (0) 7221/ 5040 4640<br>Fax: +49 (0) 5241/ 80 641203",
    "lng":"8.2162011",
    "lat":"48.7785918"
},
{
    "info":"arvato systems GmbH<br>Neusser Str. 65<br>D-40219 Duesseldorf<br>Tel.: +49 (0) 211/ 586 877-0<br>Fax: +49 (0) 211/ 586 877-33",
    "lng":"9.9922366",
    "lat":"53.5440791"
},
{
    "info":"S4M - Solutions for Media GmbH<br>Am Coloneum 3<br>D-50829 Cologne<br>Tel.: +49 (0) 221/ 28 555-0<br>Fax: +49 (0) 221/ 28 555-210",
    "lng":"6.8937685",
    "lat":"50.9872214"
},
{
    "info":"arvato systems GmbH<br>Neumarkter Str. 28<br>D-81673 Munich<br>Tel.: +49 (0) 89/ 41 36-80 80<br>arvato systems Technologies GmbH<br>Neumarkter Str. 28<br>D-81673 Munich<br>Tel.: +49 (0) 89/ 41 36-82 01<br>Fax: +49 (0) 89/ 41 36-82 09",
    "lng":"6.7638297",
    "lat":"51.2149727"
},
{
    "info":"arvato systems Technologies GmbH<br>Joachim-Jungius-Str. 9<br>D-18059 Rostock<br>Tel.: +49 (0) 381/ 440 353-30<br>Fax: +49 (0) 381/ 440 353-33",
    "lng":"12.1168315",
    "lat":"54.0750655"
},
{
    "info":"arvato systems GmbH<br>Kreuzberger Ring 19<br>D-65205 Wiesbaden<br>Tel.: +49 (0) 5241/ 80-88269<br>Fax: +49 (0) 5241/ 80-688269",
    "lng":"8.2902967",
    "lat":"50.0540963"
},
{
    "info":"arvato systems Technologies GmbH<br>Olympiastrasse 1<br>D-26419 Wilhelmshaven<br>Tel.: +49 (0) 4421/ 97 89 79<br>Fax: +49 (0) 4421/ 92 89 64",
    "lng":"8.0306983",
    "lat":"53.5267443"
}
];

var baseIcon = new GIcon(G_DEFAULT_ICON);
//        baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
//        baseIcon.iconSize = new GSize(25, 25);
//        baseIcon.shadowSize = new GSize(37, 34);
//        baseIcon.iconAnchor = new GPoint(9, 34);
//        baseIcon.infoWindowAnchor = new GPoint(9, 2);

var arvatoIcon = new GIcon(baseIcon);
arvatoIcon.image = "images/blue.png";

function load() {
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(40.7640604,0), 2);
        var crossLayer = new GTileLayer(new GCopyrightCollection(""), 0, 15);
        crossLayer.getTileUrl =  function(tile, zoom) {
            return "images/tile_crosshairs.png";
        }
        crossLayer.isPng = function() {
            return true;
        }
        // Create a new map type incorporating the tile layer
        var layerTerCross = [ G_PHYSICAL_MAP.getTileLayers()[0],
        crossLayer ];
        var mtTerCross = new GMapType(layerTerCross,
            G_PHYSICAL_MAP.getProjection(), "Ter+");

        map.addMapType(G_PHYSICAL_MAP);
        map.addMapType(mtTerCross);
        var mapControl = new GHierarchicalMapTypeControl();

        mapControl.clearRelationships();
        mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", false);
        mapControl.addRelationship(G_PHYSICAL_MAP, mtTerCross, "Crosshairs");


        map.addControl(mapControl);
        map.addControl(new GLargeMapControl());
        for(var i in input){
            showAddress(input[i],i);
        }
    }
    function showAddress(address,i) {
        var point = new GPoint(address["lng"],address["lat"]);
        var marker = new GMarker(point);
        map.addOverlay(marker);
        GEvent.addListener(marker,"click",function(){
            marker.openInfoWindowHtml("<p class=\"storyfont\" style=\"color:#3d75ae;\">"+address["info"]+"</p>");
        })
    }
}