obj = null;

document.onmousemove = updateDIV;

function updateDIV(e) {
        x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
        y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
        if (obj != null) {
                obj.style.left = (x + 20) + "px";
                obj.style.top  = (y - 40) + "px";
        }
}

function showDIV(id) {
        obj = document.getElementById(id);
        obj.style.display = "block"
}

function hideDIV() {
        obj.style.display = "none";
}

function detailopen(url,w,h,t,l) {
	detail = window.open(url,'detailopen','width='+w+',height='+h+',top=40,top='+t+',left='+l+',resizeable=yes');
	detail.focus();
}


function calendar(name,session,ohnejahr) {
	neu = window.open("run/calendar.php?ohnejahr="+ohnejahr+"&formular=0&inputfeld="+name+"&session="+session+"&altesdatum="+eval('document.formular.'+name+'.value') ,"calendar",'width=300,height=300');
	neu.focus();
}

function submitter(aktion) {
	document.formular.aktion.value = aktion;
	document.formular.yoffset.value = yoffset;
	document.formular.submit();
}

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;    

var yoffset = -10;
var top = 250;
	
function init(_yoffset) {
	
	if ( _yoffset > 0 ) {
		
		scrollTo(0,_yoffset+top);
		
	}

	if ( ie4 ) { window.setInterval("setDiv_ie()",50) }
	if ( ns4 ) { window.setInterval("setDiv_ns()",50) }
	if ( ns6 ) { window.setInterval("setDiv_ns6()",50) };
	
}

function setDiv_ns() {
	if(window.pageYOffset != yoffset) {
		window.document.toolbar.top = window.pageYOffset+top;
	}
	yoffset = window.pageYOffset;
}

function setDiv_ns6() {
	if(window.pageYOffset != yoffset) {
		document.getElementById(['toolbar']).style.top = window.pageYOffset+top;
	}
	yoffset = window.pageYOffset;
}

function setDiv_ie() {
	if(parseInt(document.body.scrollTop) != yoffset) {
		alert(document.all.tags("div")["toolbar"].style.top);
		document.all.tags("div")["toolbar"].style.top = document.body.scrollTop+top;
	}
	yoffset = parseInt(document.body.scrollTop);
}

function randomNumber(max) {
	return Math.ceil(Math.random() * max)
}


// JavaScript Document
function showprint() {
	isprint=document.getElementById("printer");
	if(!isprint){
		return;
	}
	document.getElementById("printer").style.display = 'block';
	document.getElementById("printer").onclick=function Druck() 
	{
		window.print();
		return false;
	}
}



window.onload=showprint;
