/*
Author: Dirk Ammelburger
Date: 23.01.08
Dependencies: jquery.js Library

dimScreen(): Puts a transparent Layer over all the Content. 
unDimScreen(): Removes the Layer over all the Content, automagic attached with a click-event to the layer itself ;)

*/


//$(document).ready (function() {

	//jQuery("<div id='dimer'></div>").appendTo(document.body);
/*	$('#dimer').css({
		'width': "100%", 
		'height': $(document).height(), 
		'position': 'absolute',
		'top': 0,
		'left': 0,
		'background-color': '#000',
		'opacity': 0.0,
		'z-index': 10000,
		'display': 'none'
	});
*/
//	$('#dimer').click( function() {
		//unDimScreen();
//	});
//});

function dimScreen(callback) {

	$('#dimer').css("opacity", 0.0);
	$('#dimer').css('width', $(document).width());
	$('#dimer').show();
	$('#dimer').animate({
		"opacity": 0.9},
		1000,
		function () {
			if(typeof callback == 'function') callback();
		}
	);
	
	return false;
}

function unDimScreen() {

	$("#dimer").animate({
		"opacity": 0.0},
		1000,
		function () {
			$('#dimer').hide();
		}
	);
		
	
	return false;
}

function unDimScreenCallback(callback) {

	$("#dimer").animate({
		"opacity": 0.0},
		1000,
		function () {
			$('#dimer').hide();
			if(typeof callback == 'function') callback();
		}
	);
		
	
	return false;
}