<!--

/**
 * Enthält JavaScript-Funktionen für Drag and Drop-Funktionalität
 * @author	$Author: SEBER-RIDER $
 * @version	$Revision: 38 $
 * @date	$Date: 2010-12-28 16:00:34 +0100 (Di, 28. Dez 2010) $
 */


oElement				 = null;

/**
 * Die Funktion löst den Drag and Drop-Vorgang aus
 * @param	oEvent			object		Das Event;					Standard: ---;			Status: obligatorisch;
 * @param	oTargetElement		object		Das Element, das bewegt werden soll;		Standard: ---;			Status: obligatorisch;
 */
function Dad(oEvent, oTargetElement) {
	if (!oEvent) {
		oEvent			 = window.event;
	}

	oElement			 = oTargetElement;

	oElement.onmousemove		 = DadMove;
	oElement.onmouseup		 = DadStop;

	iMousePositionX			 = oEvent.clientX;
	iMousePositionY			 = oEvent.clientY;
	iBoxPositionX			 = oElement.offsetLeft;
	iBoxPositionY			 = oElement.offsetTop;
	iTouchPositionX			 = iMousePositionX - iBoxPositionX;
	iTouchPositionY			 = iMousePositionY - iBoxPositionY;
}

/**
 * Die Funktion bewegt das gewünschte Element
 * @param	oEvent			object		Das Event;					Standard: ---;			Status: obligatorisch;
 */
function DadMove(oEvent) {
	if (!oEvent) {
		oEvent			 = window.event;
	}

	oElement.style.top		 = oEvent.clientY - iTouchPositionY + 'px';
	oElement.style.left		 = oEvent.clientX - iTouchPositionX + 'px';
}

/**
 * Die Funktion hebt den Drag and Drop-Vorgang auf
 */
function DadStop() {
	oElement.onmousemove		 = null;
	oElement.onmousedown		 = null;
	oElement.onmouseup		 = null;
}

/**
 * Die Funktion löst die Vergröerungsfunktion für ein Element aus
 * @param	oEvent			object		Das Event;					Standard: ---;			Status: obligatorisch;
 * @param	oTargetElement		object		Das Element, das bewegt werden soll;		Standard: ---;			Status: obligatorisch;
 */
function SizeMe(oEvent, oTargetElement) {
	if (!oEvent) {
		oEvent			 = window.event;
	}

	oElement			 = oTargetElement;

	oElement.onmousemove		 = SizeMeMove;
	oElement.onmouseup		 = SizeMeStop;

	iMousePositionX			 = oEvent.clientX;
	iMousePositionY			 = oEvent.clientY;
	iBoxWidth			 = oElement.offsetWidth;
	iBoxHeight			 = oElement.offsetHeight;
	iTouchPositionX			 = iMousePositionX - iBoxWidth;
	iTouchPositionY			 = iMousePositionY - iBoxHeight;
}

/**
 * Die Funktion vergrößert das gewünschte Element
 * @param	oEvent			object		Das Event;					Standard: ---;			Status: obligatorisch;
 */
function SizeMeMove(oEvent) {
	if (!oEvent) {
		oEvent			 = window.event;
	}

	oElement.style.height		 = oEvent.clientY - iTouchPositionY + 'px';
	oElement.style.width		 = oEvent.clientX - iTouchPositionX + 'px';
}

/**
 * Die Funktion hebt den Vergrößerungsvorgang auf
 */
function SizeMeStop() {
	oElement.onmousemove		 = null;
	oElement.onmousedown		 = null;
	oElement.onmouseup		 = null;
}

//-->
