﻿var PrintPreview = {
    showPrintWindow: function(t_windowId) {
        g_kartController.hideGlobe();
        
        var t_boundingbox = g_kartController.getMap().getBoundingBox();
        var t_POITypes = g_mapLayersController.getPoiController().getPOITypesNames();
        var t_WMSLayers = g_mapLayersController.getCheckedWmsLayerIds();
        
        var printWindow = $find(t_windowId);
        
        var url = "/System/Friluft/PrintPage/" + g_kartController.getCustomerId() + "?themeId=" + 
                    g_kartController.getThemeId() + "&layerIds=" + t_WMSLayers + "&left=" + t_boundingbox.left + 
                    "&right=" + t_boundingbox.right + "&bottom=" + t_boundingbox.bottom + "&top=" + t_boundingbox.top + 
                    "&scheme=" + g_kartController.getMap().getMapStyle() + "&poi=" + t_POITypes;
        
        printWindow.setUrl(encodeURI(url));
        printWindow.show();
    }
}
