function closeLightBox(){
	document.getElementById("div_shadow").style.display = "none";
	document.getElementById("div_lightbox").style.display = "none";
}

function get(url,target){
	new Ajax.Request(url, {
	  onSuccess: function(transport) {
		  document.getElementById(target).innerHTML = transport.responseText;
	  }
	});
}

function showLightbox(width,height,url){
	// Show shadow
	if($("div_shadow").getStyle('display') == 'none')
		$("div_shadow").setStyle({display: "block"});	
	
	$("div_lightbox").setStyle({width: width+"px"});
	$("div_lightbox").setStyle({height: height+"px"});
	$("div_lightbox").setStyle({marginLeft: -(width/2)+"px"});
	$("div_lightbox").setStyle({marginTop: -(height/2)+"px"});
	
	// Show lightbox
	if($("div_lightbox").getStyle('display') == 'none')
		$("div_lightbox").setStyle({display: "block"});	
	document.getElementById("div_lightbox").innerHTML = '';
	
	get(url,'div_lightbox');
}

function showTipbox(text){
	$("kalenderDiv").setStyle({display: "block"});
	$("kalenderDiv").update(text);
	
	Event.observe(document.body, 'mousemove', placeTipBox);
	
}

function placeTipBox(event){
	$("kalenderDiv").setStyle({marginTop: (Event.pointerY(event)-10)+"px", marginLeft: (Event.pointerX(event)+10)+"px"});
}

function hideTipbox(){
	Event.stopObserving(document.body, 'mousemove', placeTipBox);
	$("kalenderDiv").setStyle({display: "none"});
}


function printImg(id) {
  pwin = window.open(document.getElementById(id).src,"_blank");
  pwin.onload = function () {
	  	window.print();
		pwin.close();
	  }
}

