﻿window.onresize = Resize;
var map = null;
var mapWidth = null;
var mapHeight = null;
var control;

function Resize()
{
    var mapDiv = document.getElementById("hartaverde");
	var loadDiv = document.getElementById("loadDiv");
	var infoDiv = document.getElementById("infoDiv");
	var infoDivW = document.getElementById("infoDiv").style.width;
	var loginDiv = document.getElementById("loginDiv");
	var cautaDiv = document.getElementById("cautaDiv");
	//var footDiv = document.getElementById("footer");
	var windowWidth = document.body.clientWidth;
    var windowHeight = document.body.clientHeight;
	if (infoDivW=="0px" || infoDivW==0) {
    mapWidth = windowWidth - 360;
	mapDiv.style.left = "370px";
	} else {
	mapWidth = windowWidth - 690;
	mapDiv.style.left = "700px";
	}
    mapHeight = windowHeight  - 128;
    mapDiv.style.width = mapWidth + "px";
    mapDiv.style.height = mapHeight + "px";
	loadDiv.style.width = mapWidth + "px";
    loadDiv.style.height = mapHeight + "px";
	infoDiv.style.height = mapHeight-17 + "px";	
	cautaDiv.style.height = mapHeight-17 + "px";
	loginDiv.style.height = mapHeight + "px";
    //ctrlDiv.style.height = (windowHeight - 60) + "px";
	if(map != null && map != undefined) {
    map.Resize(mapWidth, mapHeight);
	}
}

function ascundeDiv(div) {
	if (div=="infoDiv") {
	var div = document.getElementById(div);
    div.style.display="none";
	div.style.width = "0px";
    div.style.display="none";
	Resize();
	} else {
  var div = document.getElementById(div);
  div.style.display="none";
	}
}

            