/*
 * Copyright (c) 2010, Inmite s.r.o. (www.inmite.eu). All rights reserved.
 *
 * This source code can be used only for purposes specified by the given license contract
 * signed by the rightful deputy of Inmite s.r.o. This source code can be used only
 * by the owner of the license.
 *
 * Any disputes arising in respect of this agreement (license) shall be brought
 * before the Municipal Court of Prague.
 */

/*
 * Initalization script of iMap subsystem.
 *
 * This configures the iMap and can optionally initialize other stuff as well...
 */

$(document).ready(function() {
    // initialization of clearField plugin on text inputs

    var p = getUrlParams();
    if (p && p.hl) {
        currentLanguage = p.hl;
    } else {
        currentLanguage = 'cz';
    }

    IMap.init({
        // id of map DOM element
        mapElementId: 'map',

        // initial lat/lon/zoom
        lat: 49.81672,
        lng: 15.46875,
        zoom: 6,

        controls: [
//            searchControl
        ],

        overlays: [
              poslitoOverlay
        ],

        disableHistory: true,

        pickPlaceCallback: function(latlng) {
            $('#flat').val(latlng.lat());
            $('#flon').val(latlng.lng());
        }
    });

//    searchControl.initializeOutside($('#search')[0]);

    $('.side .img A').fancybox({
        overlayOpacity: 0
//        overlayShow: false
    });
});

function msgErr(str) {
    alert(str+'\n\nTry refreshing this page please.\nIf problems persits, contact us at prusvihy@inmite.eu.')
}