﻿function WindowResizer()
{
}

WindowResizer.prototype = {

    onWindowResize: function()
    {
        var ctrlwidth = $("#controls").width();
        var ctrlheight = $("#mapcontrols").height();
        var correctionFactor = 0;
        var compwidth = $(window).width() - ctrlwidth - correctionFactor;
        var compheight = $(window).height() - ctrlheight;

        $("#gContainer").width(compwidth + "px");
        $("#sContainer").width(compwidth + "px");
        $("#sContainer").height(compheight + "px");

        $("#tabs").height(compheight - 10 + "px");
        $("#accordionContainer").height(compheight - 285 + "px");

        if (currentMap == "Google" && dialog == false)
        {
            this.show3D_Map();
        }
    },

    show3D_Map: function()
    {
        $("#sContainer").hide();

        Canvas3D.style.width = $("#gMap").width() + "px";
        Canvas3D.style.height = $("#gMap").height() - 25 + "px";
        var ff = $("#controls").width();
        Canvas3D.style.top = 25 + "px";
        Canvas3D.style.left = ff + "px";
    },

    hide3D_Map: function()
    {
        $("#sContainer").show();
        Canvas3D.style.left = "-5000px";
        Canvas3D.style.top = "0px";
    },

    dialogFrame: function()
    {
        var compwidth = $(window).width() - 20;
        var compheight = $(window).height()- 20;
        var dialogSize = compwidth + "," + compheight;

        return (dialogSize);
    },

    hide2DMap: function()
    {
        $("#sContainer").hide();
    },

    show2DMap: function()
    {
        $("#sContainer").show();
    }



};
