// (c)2009 Ime Smits - All rights reserved

var winctlV = 20090425;
var winctlLastK;
var winctlLastQ;

function lxwinctl(k,q,t,w,h) {
	var x = 0;
	var y = 0;

	if(k == winctlLastK) {
		return false;
	}

	if(!w) {
		w = 320;
	}
	if(!h) {
		h = 240;
	}

	winctlLastK = k;
	winctlLastQ = q;

	if(document.lxMouseX && (document.lxMouseX>0)) {
		x = document.lxMouseX;
		y = document.lxMouseY;
	}

	var win = new Window( {className: "mac_os_x", title: t, top:x, left:y, width:w, height:h, destroyOnClose: true, recenterAuto: false});
	win.getContent().update("<div id='" + q +"'></div>");
	if(x || y) {
		win.show();
	} else {
		win.showCenter();
	}
	lxscrctl(k,q,true);
	return false;
}

	
