var Loader = function (Options) {
	
	this.Container = false;
	this.Loader = false;
	this.Grey = false;
	this.Speed = "slow";
	this.LoadingText = "Laden...";
	
	var Me = this;
	$.each(Options, function (Key, Item) {
		Me[Key] = Item;
	});
	
	this.Activate = function () {
		
		//Make grey
		if (!this.Grey) {
			this.Container.append('<div id="grey">&nbsp;</div>');
			this.Grey = $('#grey');
			this.Grey.css('height', this.Container.css('height'));
			this.Grey.css('width', this.Container.css('width'));
		}
		
		//Make loader
		if (!this.Loader) {
			this.Container.append('<div id="loader">' + this.LoadingText + '</div>');
			this.Loader = $('#loader');
		}
		
		this.Grey.css('opacity', 0);
		this.Grey.css('display', 'none');
		this.Loader.css('display', 'none');
	};
	
	this.Show = function () {		
		this.Loader.css('display', 'block');
		this.Loader.fadeIn(this.Speed);
		this.Grey.css('display', 'block');
		this.Grey.fadeTo(this.Speed, 0.6);
	};
	
	this.Hide = function () {		
		this.Loader.fadeOut(this.Speed, function () { $(this).css('display', 'none'); });
		this.Grey.fadeOut(this.Speed, function () { $(this).css('display', 'none'); });
	};
	
	return this;
}