
function Notifier(container)
{
	var me=this;
	
	this.idCounter=0;
	this.UI=container;
	
}

Notifier.prototype.addNotification=function(message, level)
{
	var me=this;
	var notId=this.idCounter++;
	if (typeof(level) === 'undefinded') level='info';
	var template=$('<div class="'+level+'">'+message+'</div>');
	template.attr('id','notification'+notId);
	template.css('display','none');
	var myTimeout=setTimeout(function(){
		me.delNotification(notId);
	},8000);
	this.UI.append(template);
	template.show('fade');
}

Notifier.prototype.delNotification=function(notId)
{
	$('#notification'+notId).hide('fade');
}

Notifier.prototype.addGameNotification=function(gid,name)
{
	//var html='<a href="/game/'+gid+'" target="_blank">Du bist bei "'+name+'" dran</a>';
	var html='<a href="http://www.karopapier.de/showmap.php?GID='+gid+'">Du bist bei "'+name+'" dran</a>';
	this.addNotification(html,"notify");
}

Notifier.prototype.addMovedNotification=function(gid,name, movedId, movedLogin, nextId, nextLogin)
{
	//var html='<a href="/game/'+gid+'">Du bist bei "'+name+'" dran</a>';
	var html='Bei <a href="http://www.karopapier.de/showmap.php?GID='+gid+'" target="_blank">"'+name+'"</a> hat '+movedLogin+' gerade gezogen und jetzt ist '+nextLogin+' dran';
	this.addNotification(html,"info");
}

