﻿// JScript 파일


var bdown = false;
var x, y;
var sElem;
var postElem;
var zIndex = 100;

function mdown(idx)
{
	var obj = document.getElementById(idx)
	if(obj == "[object]")
	{
		if(obj.className == "drag")
		{
			bdown = true;
			sElem = obj;
			if (postElem != obj)
			{
				postElem = obj;
				obj.style.zIndex = zIndex;
				zIndex++;
			}
			x = event.clientX;
			y = event.clientY;
		}
	}
	else
	{
		return false;
	}
}

function stopMove()
{
	alert("test");
	mup();
	return false;
}

function mup()
{
	if(bdown)
	{
		sElem.style.filter = "";
	}
	bdown = false;
}

function moveDocu()
{
	return false;
}

function moveimg()
{
	if(bdown)
	{
		sElem.style.filter = "alpha(opacity=30)";
		//var hideSel = document.getElementById("hideSel");
		var distX = event.clientX - x;
		var distY = event.clientY - y;
		sElem.style.pixelLeft += distX;
		sElem.style.pixelTop += distY;
		x = event.clientX;
		y = event.clientY;
		//hideSel.style.left = sElem.style.left;
		//hideSel.style.top = sElem.style.top;
		return false;
	}
}
document.onmousemove=moveimg;