document.write('<script src="/js/prototype.js" type="text/javascript"></script>');
document.write('<script src="/js/scriptaculous.js" type="text/javascript"></script>');

window.addEventListener?window.addEventListener("load",print_ref,false):window.attachEvent("onload",print_ref);

function print_ref() {
	referenz = document.getElementsByClassName('referenz');
	for (i=0; i < referenz.length; i++) {
		handlestring = "ref";
		handlestring = handlestring.concat(i+1);
		new Draggable(referenz[i], {handle: handlestring, onEnd: dragstop});
	}
	ganzOben = i + 1;
}

function mouseover() {
	document.getElementsByTagName('body')[0].style.cursor='move';
}
function mouseout() {
	document.getElementsByTagName('body')[0].style.cursor='default';
}

function dragstop(e) {
	document.getElementsByTagName('body')[0].style.cursor='default';
	$(e).originalZ = ganzOben++;
}
