 
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header
 
// Basically modified by Warner: PHPStudio.hu
// Copyright 2008
// Do not remove this header
 
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;
 
var infoboxes = new Array();
 
function ddInit(e){
	for (i in infoboxes) {
	  serial = infoboxes[i];
	  topDog=isIE ? "BODY" : "HTML";
	  whichDog=isIE ? document.all["theLayer" + serial] : document.getElementById("theLayer" + serial); 
//	  whichDog=VT_GetObj("theLayer" + serial); 
	  hotDog=isIE ? event.srcElement : e.target;
	  while (hotDog.id!="titleBar"+serial && hotDog.tagName!=topDog){
	    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
	  } 
	  if (hotDog.id=="titleBar"+serial){
	    offsetx=isIE ? event.clientX : e.pageX;
	    offsety=isIE ? event.clientY : e.pageY;
	    nowX=parseInt(whichDog.style.left);
	    nowY=parseInt(whichDog.style.top);
	    ddEnabled=true;
//	    alert(offsetx+'#'+offsety+'#'+nowX+'#'+nowY);
	    document.onmousemove=dd;
	    break;
	  }
	}
}
 
function dd(e){
  if (!ddEnabled) return;
//  alert(whichDog.style.left+'#'+whichDog.style.top);
  whichDog.style.left=(isIE ? nowX+event.clientX-offsetx : nowX+e.pageX-offsetx)+'px';
  whichDog.style.top=(isIE ? nowY+event.clientY-offsety : nowY+e.pageY-offsety)+'px';
//  alert(whichDog.style.left+'#'+whichDog.style.top);
  return false; 
}
 
function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}
 
function hideMe(whatDog){
	var serial = whatDog.id.substring(11);
	whichDog=isIE ? document.all["theLayer" + serial] : document.getElementById("theLayer" + serial);
	if(typeof(whichDog) != "undefined") {
		if (isIE||isNN) whichDog.style.visibility="hidden";
		else if (isN4) whichDog.visibility="hide";
	}
}
 
function showMe(){
	var serial = whatDog.id.substring(11);
	whichDog=isIE ? document.all["theLayer" + serial] : document.getElementById("theLayer" + serial);
	if(typeof(whichDog) != "undefined") {
		if (isIE||isNN) whichDog.style.visibility="visible";
		else if (isN4) whichDog.visibility="show";
	}
}
 
function createBox(serial, title, text, left, top, width) {
	infoboxes[infoboxes.length] = serial;
/*	if(typeof(left) == "undefined")
		left = 0;
	if(typeof(top) == "undefined")
		top = 0;
	if(typeof(width) == "undefined")
		width = 250;
		
	document.writeln('<div id="theLayer' + serial +  '" style="position:absolute;width:'+width+';left:'+left+';top:'+top+';visibility:visible">' + 
'<table border="0" width="'+width+'" style="border:1pt solid black" cellspacing="0" cellpadding="0">' + 
'<tr>' + 
'<td width="100%">' + 
'  <table border="0" style="background:#FFA020" width="100%" cellspacing="0" cellpadding="0" height="36">' + 
'  <tr>' + 
'  <td id="titleBar' + serial +  '" style="cursor:move;padding:1pt;border-bottom:1pt solid black" width="100%">' + 
'  <ilayer width="100%" onSelectStart="return false">' + 
'  <layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer' + serial +  ')" onMouseout="isHot=false">' + 
'  <!-- Doboz Neve //-->' + 
'  <b>' + title + '</b>' + 
'  </layer>' + 
'  </ilayer>' + 
'  </td>' + 
'  <td style="cursor:hand;padding:1pt;border-bottom:1pt solid black" valign="top">' + 
'  <p align="right">' + 
'  <a id="closeButton' + serial +  '" href="#" onClick="hideMe(this);return false">X</a>' + 
'  </td>' + 
'  </tr>' + 
'  <tr>' + 
'  <td width="100%" class="td" style="padding:1pt;background:white" colspan="2">' + 
'<!-- Doboz tartalma //-->' + 
'<div id="menustuff">' + 
text + 
'</div>' + 
'  </td>' + 
'  </tr>' + 
'  </table>' + 
'</td>' + 
'</tr>' + 
'</table></div>');*/
}
 
document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");
