    
Shadowbox.loadSkin('classic', 'js/shadowbox/skin');
Shadowbox.loadLanguage('en', 'js/shadowbox/lang');
Shadowbox.loadPlayer(['iframe'], 'js/shadowbox/player');

document.observe('dom:loaded', function(){
    Shadowbox.init();
});

function updateResponseDiv(req) {
    Spry.Utils.setInnerHTML('response_form1', req.xhRequest.responseText);
    document.getElementById('contact').reset();
}

function validateonsubmit(form) {
    if (Spry.Widget.Form.validate(form) == true){
        
        Spry.Utils.submitForm(form, updateResponseDiv);
        
    } else { }
    return false;
}


function loadMap() {
    if (GBrowserIsCompatible()) {
        
        var map = new GMap2($("map"));
        map.setMapType(G_HYBRID_MAP);
        map.removeMapType(G_SATELLITE_MAP);
        map.setCenter(new GLatLng(47.690766, 19.134571), 17);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        
        /*GEvent.addListener(map, "moveend", function() {
          var center = map.getCenter();
          document.getElementById("message").innerHTML = center.toString();
        });*/
        
        var tinyIcon = new GIcon();
        tinyIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
        tinyIcon.iconSize = new GSize(12, 20);
        tinyIcon.shadowSize = new GSize(22, 20);
        tinyIcon.iconAnchor = new GPoint(6, 20);
        tinyIcon.infoWindowAnchor = new GPoint(5, 1);
        
        markerOptions = {
          icon: tinyIcon
        };

        var point = new GLatLng(47.572911, 19.080928 );
        var marker = new GMarker(point, markerOptions);
        map.addOverlay(marker);
        
        var myHtml = "<h2>FlexiCar használtautó kereskedés</h2><br /><strong>Cím:</strong> 1044 Budapest Külső - Váci út 74.<br /><strong>Telefon/fax:</strong> 215-4902<br /><strong>Mobil:</strong> +36 (30) 9-862-952<br /><strong>E-mail:</strong> <a href='mailto:flexicar@flexicar.hu' title='Levél küldése a www.flexicar.hu-nak'>flexicar@flexicar.hu</a>; <a href='mailto:info@flexicar.hu' title='Levél küldése az info@flexicar.hu-nak'>info@flexicar.hu</a>";
        map.openInfoWindowHtml(point, myHtml);
        
    }
}

