<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onmousedown" ONEVENT="moveme_onmousedown()"/>
<!--<PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="initPosition()"/>-->
<!--<PUBLIC:ATTACH EVENT="onmousemove" ONEVENT="moveme_onmousemove()"/>-->
<PUBLIC:PROPERTY NAME="handlefor"/>
<PUBLIC:PROPERTY NAME="dontraise"/>

<SCRIPT>

///////////////////////////////////////////////////////////////////////
//     This script was designed by Erik Arvidsson for WebFX          //
//                                                                   //
//     For more info and examples see: http://webfx.eae.net          //
//     or send mail to erik@eae.net                                  //
//                                                                   //
//     Feel free to use this code as lomg as this disclaimer is      //
//     intact.                                                       //
///////////////////////////////////////////////////////////////////////



var dragobject = null;
var tx;
var ty;

function moveme_onmousedown() {
	if (handlefor != null) {
		dragobject = element.document.getElementById(handlefor);
	}
	else
		dragobject = element;

	if (dragobject == null) return;
		
	if (!dontraise) makeOnTop(dragobject);
		
	ty = window.event.clientY - getTopPos(dragobject);
	tx = window.event.clientX - getLeftPos(dragobject);
		
	window.event.returnValue = false;
	window.event.cancelBubble = true;
}

function moveme_onmouseup() {
	if(dragobject) {
		dragobject = null;
	}
}

function moveme_onmousemove() {
	if (dragobject) {
		if (window.event.clientX >= 0 && window.event.clientY >= 0) {
			dragobject.style.left = window.event.clientX - tx;
			dragobject.style.top = window.event.clientY - ty;
		}
		window.event.returnValue = false;
		window.event.cancelBubble = true;
	}
}

function getLeftPos(el) {
	if (el.currentStyle.left == "auto")
		if (el.currentStyle.position != "relative")
			return el.offsetLeft;
		else
			return 0;
	else
		return parseInt(el.currentStyle.left);

}

function getTopPos(el) {
	if (el.currentStyle.top == "auto")
		if (el.currentStyle.position != "relative")
			return el.offsetTop;
		else
			return 0;
	else
		return parseInt(el.currentStyle.top);
}

function makeOnTop(el) {
	var daiz;
	var max = 0;
	var da = element.document.all;
	
	for (var i=0; i<da.length; i++) {
		daiz = da[i].style.zIndex;
		if (daiz != "" && daiz > max)
			max = daiz;
	}
	
	el.style.zIndex = max + 1;
}

if (currentStyle.position != "absolute" && currentStyle.position != "relative")
	style.position = "relative";

style.cursor = "move";

element.document.attachEvent("onmousemove", moveme_onmousemove);
element.document.attachEvent("onmouseup", moveme_onmouseup);
</SCRIPT>
</PUBLIC:COMPONENT>