/**
---------------------------------------------------------------------------------------------
        EplosNET 3.0.0 PHP keretrendszer 2001-2006
        Baldaszti Zoltán - mail: baldaszti.zoltan@proaction.hu
---------------------------------------------------------------------------------------------
	Javascript DIV ablak
---------------------------------------------------------------------------------------------
*/
var active = 0;
start.zind = 9;
//mozgatás kezdete
function start(windowId){
	dragWind = document.getElementById('window'+windowId);
	y = coordsY-parseInt(dragWind.style.top);
	x = coordsX-parseInt(dragWind.style.left);
	dragWind.style.zIndex = start.zind++;
	active=1;
}
//mozgatás
function drag(e){
	coordsY = e!=null?e.pageY:event.clientY;
	coordsX = e!=null?e.pageX:event.clientX;
	if(active){
		dragWind.style.top = coordsY-y;
		dragWind.style.left = coordsX-x;
	}
}
//ablak bezárása
function closeWin(){
	dragWind.style.display='none';
}
//ablak megnyitása
function openWin(url, windowId, title, x, y, w, h){
	dragWind = document.getElementById('window'+windowId);
	if(dragWind==null){
		allWin = document.getElementById("windows");
		if(allWin==null) alert("Please insert <DIV id='windows'></DIV> in your code.");
		allWin.innerHTML+="<div id='window"+windowId+"' class='wins' style='position:absolute;top:0px;height:0px;'><table width=1 border=0 cellpadding=1 cellspacing=0 onmousedown='start(\""+windowId+"\");' class='wins'><tr class='titlebar'><td height=16 width=100% class='title' id='title"+windowId+"'>"+title+"</td><td class='title' width=16 align='right' onClick='closeWin();' style='cursor:hand;cursor:pointer;' ondragstart ='new Function(\"return false\");'>[X]</td></tr><tr><td colspan=2 style='background:white;'>"+url+"</td></tr></table></div>";
		dragWind = document.getElementById('window'+windowId);
	}
//	dragCont = document.getElementById('container'+windowId);
//	dragCont.src = url;
//	dragTitle = document.getElementById('title'+windowId);
//	dragTitle.innerHTML = title;
	dragWind.style.display = 'block';
	dragWind.style.top = y;
	dragWind.style.left = x;
//	dragWind.style.width = w;
//	dragWind.style.height = h;
	dragWind.style.zIndex = start.zind++;
}
//inicializálás
document.onmousemove = drag;
document.onmouseup = new Function("active=0");
document.onselectstart = new Function("return false");
     
