/**
* Framework
*
* @version		1.0
*
* @license		GNU Lesser General Public License
* @author		Gerrit Böttcher <gerrit.boettcher [at] gmail.com>
* @copyright	2009 fresh frames GmbH & Co. KG <http://www.freshframes.com>
*/

var Framework = new Class({
    
    Implements: Events ,

	initialize: function() {
		
		this.notification = new Roar({
			position: 'upperRight',
            container: 'content_txt',
            onShow: function( item ) {
                freshFramework.clearCalendar();
            }
		});
		
		this.calendar = new Roar({
			position: 'upperLeft',
			duration: 0, 
			container: 'content_txt',
			onShow: function( item ) {
				item.store('roar:offset'); // offset loeschen da wir nur immer 1 roar haben
				
				//wir wollen nur 1 anzeigen alle anderen verschwinden automatisch beim oeffnen des naechsten.
				
				if ( freshFramework.calendar.items.length > 1 ) {
					for ( i = 0; i < (freshFramework.calendar.items.length - 1); i++) {
						this.remove( freshFramework.calendar.items[i] );
					} 
				}
				
			}
		});

	},
	clearCalendar: function() {
		if ( this.calendar.items.length > 0 ) {
			this.calendar.remove( this.calendar.items[0] );
			if ( this.calendar.items.length > 0 ) this.clearCalendar();
		}
	}	
});

