
// Used from adm_user/index_bildgroesse.tpl, to let the user scale
// the image after he had loaded up an image in mit_data/index_mida_edit.tpl

var ie = document.all ? true : false;
var ns = document.layers ? true : false;
	
function move(bildbreite, bildhoehe, sollbreite, sollhoehe) {
	
	if (ie == true) {
   		mouseX = window.event.offsetX;
   		mouseY = window.event.offsetY;

   		if (bildhoehe == sollhoehe) {
			document.all["rahmen"].style.pixelLeft = mouseX;
   		}

   		if	(bildbreite == sollbreite) {
			document.all["rahmen"].style.pixelTop = mouseY - (bildhoehe + 1); 
			// bildhoehe muss subtrahiert werden, weil der Rahmen normalerweise 
			// unter dem Bild angezeigt würde; wir wollen aber von der linken oberen Ecke
			// des Bildes ausgehen; es wird noch 1 Pixel zu bildhoehe hinzuaddiert, um
			// den Abstand zwischen Bild und Rahmen auszugleichen, der bestehen würde
   		}
  	}
  	else if (ns == true) {
	}
}


function save_foto(formName, bildhoehe) {

	// same code for Internet Explorer and Netscape Navigator

	// the position of the upper left corner of the frame, relative to the image shown
	// (the image shown was resized to sollbreite/sollhoehe before)
	var upperLeftX = document.all["rahmen"].style.pixelLeft;
	
	// the value of the variable pixelTop is relative to the original postion of the 
	// frame below the image shown, so the value is negative;
	// we neglect the original distance between image and frame
	var upperLeftY = bildhoehe + document.all["rahmen"].style.pixelTop;
	
	document.forms[formName].xabstand.value = upperLeftX; 
	document.forms[formName].yabstand.value = upperLeftY;
 	
 	document.forms[formName].submit();
}
