/**
 * Stellt die Funktionalitaet f�r die Einblendung eines Overlay-Splash-Screens zur Verfuegung,
 * analog zu Lightbox.
 * 
 * Vorraussetzung sind die Prototype- und Scriptaculous-Bibliotheken
 * 
 * scriptaculous >= 1.5
 * 
 * 09/08/07 tim.schroder@e-7.com
 * 
 * (c) Elephant Seven GmbH Nord
 * 
 */
 
if(typeof Effect=="undefined") {
	throw("Please install prototype and scriptaculous properly!");	
}

var E7overlay = Class.create();

E7overlay.prototype = {
	
	initialize: function(boxcontent) {
		new Insertion.Top($$('body')[0], '<div id="e7overlayContainer" style="display:none;"</div>');
		new Insertion.Top($('e7overlayContainer'), '<div id="e7overlay" style="display:none;"</div>');
		new Insertion.Bottom($('e7overlayContainer'), '<div id="e7overlayContent">'+boxcontent+'</div>');
	},
	
	setOverlaySize: function(){
	    if (window.innerHeight && window.scrollMaxY)
	    {
	      yScroll = window.innerHeight + window.scrollMaxY;
	    }
	    else if (document.body.scrollHeight > document.body.offsetHeight)
	    { // all but Explorer Mac
	      yScroll = document.body.scrollHeight;
	    }
	    else
	    { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
	      yScroll = document.body.offsetHeight;
	    }
	    $("e7overlay").style['height'] = yScroll +"px";
		$("e7overlayContainer").style['height'] = yScroll +"px";
	},
	
	appear: function(){
		$('e7overlayContainer').toggle();
		new Effect.Appear('e7overlay', { from: 0, to: 0.7, duration: 0.9 });
	},
	
	appearSlow: function(){
		$('e7overlayContainer').toggle();
		new Effect.Appear('e7overlay', { from: 0, to: 0.7, duration: 1.5 });
	},
	
	hide: function(){
		new Effect.Fade('e7overlay');
		new Effect.Fade('e7overlayContent');
		$('e7overlayContainer').toggle();
	}	
}



