//CALENDAR


//Calender PopUp
function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 

            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}



function showRollOver(obj, e, html){
	if(obj.childNodes[1].firstChild){
		var html ='';	
		var j = 1;
		var k=1;
		var tmp = getPosition(e);
		var yCor = 480;
		var xCor = 215;	
		//IE6 fun
		if(navigator.appVersion.match("MSIE 6")){
			xCor = 0;	
			yCor = 0;
		}
		if (navigator.userAgent.indexOf("MSIE")!=-1)
			j = 0; //Gecko Bug for DOM
		var troot = obj.parentNode.parentNode.parentNode.childNodes[j].childNodes[j].childNodes[j];	

		for(var i=0; i<obj.childNodes[1].getElementsByTagName('span').length; i++){
				v = obj.childNodes[1].getElementsByTagName('span')[i];
				if(v.className != 'default_categoryheader_bullet' && v.firstChild.nodeValue != null){
					if(k%2){
						html += '<p style="padding-top:6px;"><span style="color:#7f7f7f; font-size:10px">'+obj.childNodes[0].childNodes[0].childNodes[0].firstChild.nodeValue+'. ';
						html += troot.firstChild.firstChild.nodeValue+' ';
						html += troot.childNodes[2].firstChild.nodeValue+', ';								
						html+= v.firstChild.nodeValue+' Uhr</span><br/>';
					}else{
						html+= v.firstChild.nodeValue+'</p>';
					}
					k++;
				}
		}
		if (!e) e = window.event;
		el = document.getElementById('eventBubbleContent');
		el.innerHTML =html;
		document.getElementById('eventBubble').style.top = (tmp.y-yCor-k*14)+"px";
		document.getElementById('eventBubble').style.left= tmp.x-xCor-(document.documentElement.clientWidth - 960)/2+"px"; //CSS position problem, caused by centered content-window
		document.getElementById('eventBubble').style.display = "block";
	}		
}

function fixDate() {
	for(var i=0; i<document.getElementsByTagName('th').length; i++){
		v = document.getElementsByTagName('th')[i];
		if (v.className == 'sideback') {
			var str = v.firstChild.href;
			
			var t = str.split("/"); 
			v.childNodes[2].innerHTML = t[t.length - 1].substring(0,4);	 
		}
	}	
}

function hideRollOver(obj){
	if(obj.childNodes[1].firstChild){
		el = document.getElementById('eventBubble');
		el.style.display = "none";
	}
}

