/* 
 * Genereates the function to reset the Text in the search field or unset it
 */
function unset() {
    if(document.getElementById("search").value == "Suchen..." || document.getElementById("search").value == "Search..."){
        document.getElementById("search_t").value = document.getElementById("search").value;
        document.getElementById("search").value = "";
    }
}
function set() {
    if(document.getElementById("search").value == "") {
        document.getElementById("search").value = document.getElementById("search_t").value;
        document.getElementById("search_t").value = "";
    }
}

function linkOnBlank(obj) {
    obj.target = '_blank';
}

function initialize()
{
    var map = new GMap2(document.getElementById("map"));

    var point = new GLatLng( 51.42841, 7.67307);
    var point2 = new GLatLng( 51.514725, 7.119527);

    map.setCenter(new GLatLng(51.47200, 7.39000),10);

    // Create our "tiny" marker iconvar
    icon = new GIcon(G_DEFAULT_ICON);
    icon.image = "http://maps.google.com/mapfiles/kml/paddle/red-stars.png";
    icon.iconAnchor = new GPoint(16, 32);
    icon.iconSize = new GSize(32, 32);
    // Set up our GMarkerOptions
    markerOptions = { 
        icon:icon
    };

    var tct = new GMarker(point, markerOptions);
    var tct2 = new GMarker(point2, markerOptions);

    GEvent.addListener(tct, "click", function() {
        tct.openInfoWindowHtml('<img height="168" width="297" src="http://www.tct-tesic.com/res/Image/halle.jpg" /><br/>TCT Tesic GmbH<br/>Headquarter');
    });
    GEvent.addListener(tct2, "click", function() {
        tct2.openInfoWindowHtml('TCT Tesic GmbH<br/>Lager in Gelsenkirchen<br/>Wannerstr. 172 (Tor 1)<br/>DE-45888 Gelsenkirchen');
    });
    
    var customUI = map.getDefaultUI();
    customUI.maptypes = false;

    map.setUI(customUI);
    map.addOverlay(tct);
    map.addOverlay(tct2);

    map.setMapType(G_NORMAL_MAP);
}