How to get the popup calendar's width and height

Hi All,

i am working on Dhtmlx calendar with image. when i click on the image calendar pop up is opening and selected date is displaying on the text box. But there are 2 questions :
1、how to get the popup calendar’s width and height? As i want to auto calculate the position of the popup calendar with JavaScript;

2、when i click on the image calendar pop up is opening ,but how to make the popup calendar hide when i click on other place (such as the next textbox) of the page?

here are my JS and Html code:

Hi,

how to get the popup calendar’s width and height?

var cont = document.getElementById(“calendarStart”);
var width = cont.offsetWidth;
var height = cont.offsetHeight;

how to make the popup calendar hide when i click on other place

you may set document body “onclick” handler or listener:

document.body.onclick = function(e){
calendar.hide();
}