$('#container').layout('panel','west').panel({
onExpand:function(){
onWindowResize();
},
onCollapse:function(){
onWindowResize();
}
});
function onWindowResize(){
if(timer!=null){
clearTimeout(timer);
timer=null;
}
timer=setTimeout(function(){
$("#labcontainer").layout('resize');
var width=parseFloat(container.offsetWidth);
var height=parseFloat(container.offsetHeight);
camera.aspect = width/height;
camera.updateProjectionMatrix();
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(width,height);
camera.updateMatrixWorld();
renderer.render(scene, camera);
},200);
}