How to use method of hide() in dhtmlx windows

Hello,

I’m using dhtmlx windows in a web application. I created a window when mouse over a table,I used “onMouseover” and when mouse move out the table hide this window .

this is my code:

var dhxWins,contentWindowObj ;
function showWindows(){
dhxWins = new dhtmlXWindows();
contentWindowObj = dhxWins.createWindow(“contentwin”,60,40,450,350);
}
function destroyWindows(){
contentWindowObj.hide();
}

Now there is a problem with me. When I moved out table,IE make a mistake on bottom-left is
“contentWindowObj is null or not found object”,so I felt very upset. I want to ask manager the usage of hide() , Is initialize contentWindowObj first when I hide window ?
Like this:
var dhxWins,contentWindowObj ;
function showWindows(){
dhxWins = new dhtmlXWindows();
contentWindowObj = dhxWins.createWindow(“contentwin”,60,40,450,350);
}
function destroyWindows(){
contentWindowObj = dhxWins.createWindow(“contentwin”);
contentWindowObj.hide();
}

Is this all right ? I need your advices.
Thanks so much

Hello,

possibly it would be better to use the following check:

function destroyWindows(){
if(contentWindowObj&&contentWindowObj.hide)
contentWindowObj.hide();
}