//-handle.js-------------------------------------------------------
function WindowHandle_MouseMove(){
	var target;
	var w, h;
	try {
		if (this.targetId == "empty"){
			return false;
		}
		target = document.getElementById (this.targetId);
		target.style.zIndex = 1000;
		if (this.type == "move"){
			target.style.left = event.clientX - this.dragDx;
			target.style.top = event.clientY - this.dragDy;
		}else if (this.type == "resize"){
	//			target.style.left = parseInt (this.dragDx);
	//			target.style.top = parseInt (this.dragDy);
			w = event.clientX - parseInt (this.dragDx);
			h = event.clientY - parseInt (this.dragDy);
			if (w > 80 && h > 60){
				target.style.width = event.clientX - parseInt (this.dragDx);
				target.style.height = event.clientY - parseInt (this.dragDy);
			}
		}
		return true;
	}catch (err){
		this.targetId = "empty";
		location.reload ();
		return false;
	}
}
function WindowHandle_MouseDrop(){
	var target;
	try {
		if (this.targetId == "empty"){
			return false;
		}
		target = document.getElementById (this.targetId);
		if (target.mouseout == 1){
			if (this.type == "move"){
				//alert ();
			}else if (this.type == "resize"){
				//alert ();
			}
			this.targetId = 'empty'; 
			this.dragDx = 0; 
			this.dragDy = 0; 
		}
		return true;
	}catch (err){
		this.targetId = "empty";
		location.reload ();
		return false;
	}
}
function WindowHandle(){
	this.targetId = "empty";
	this.dragDx = 0;
	this.dragDy = 0;
	this.dragIndex = 0;
	this.type = "move";
	this.handleMouseMove = WindowHandle_MouseMove;
	this.handleMouseDrop = WindowHandle_MouseDrop;
}
//----------------------------------------------------------------