"base is null" error when initializating Layout

I have this html

 <div id="projekt" style="position: relative; width: 90%;height:400px;"/>

and this JS

 var layouts = new Array();
 layouts["projekt"] = new dhtmlXLayoutObject("projekt", "1C", "dhx_skyblue");

and the error base is null in dhtmlxlayout.js on this

function dhtmlXLayoutPanel(){};functio... 18, "cpanel_collapsed_height": 18}, 

What’s could be the problem here ?

Try to call layout initialization on body onload. Probably the container doesn´t exist when dhtmlXLayoutObject called.