/*
Original von: http://boedesign.com/
Link zum Original: http://boedesign.com/2009/07/11/growl-for-jquery-gritter/
Angepasst von: http://www.andreasklaeui.ch/
*/

$(document).ready(function(){
		
		$('#add-sticky').click(function(){
		
			// You can have it return a unique id, this can be used to manually remove it later using
			/*
			$.gritter.remove(unique_id, { 
					fade: true,
					speed: 'fast'
				}
			);
			*/
			var unique_id = $.gritter.add({
				// (string | mandatory) the heading of the notification
				title: 'Das bin ich!',
				// (string | mandatory) the text inside the notification
				text: '<img src=http://andreasklaeui.ch/pictures/klaeui.jpg>',
				// (string | optional) the image to display on the left
				image: '',
				// (bool | optional) if you want it to fade out on its own or just sit there
				sticky: true, 
				// (int | optional) the time you want it to be alive for before fading out
				time: '' 
			});
			
			return false;
		
		});
		
		$('#add-regular').click(function(){
		
			$.gritter.add({
				// (string | mandatory) the heading of the notification
				title: 'Das bin ich!',
				// (string | mandatory) the text inside the notification
				text: '<img src=http://andreasklaeui.ch/pictures/klaeui.jpg>',
				// (string | optional) the image to display on the left
				image: '',
				// (bool | optional) if you want it to fade out on its own or just sit there
				sticky: false, 
				// (int | optional) the time you want it to be alive for before fading out
				time: '10000'
			});
			
			return false;
		
		});
		
		$('#add-without-image').click(function(){
			
			$.gritter.add({
				// (string | mandatory) the heading of the notification
				title: 'This is a notice without an image!',
				// (string | mandatory) the text inside the notification
				text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.'
			});
			
			return false;
		});
		
		$("#remove-all").click(function(){
			
			$.gritter.removeAll();
			return false;
			
		});
		
		// FORCE the notification above to be removed after 3 seconds
		/*
		setTimeout(function(){
			$.gritter.remove(unique_id, { 
					fade: true,
					speed: 'fast'
				}
			);
		}, 3000);
		*/
		
		
	});