window.addEvent('domready', function(event) {

	// Object style syntax with files in same level as html document.
 	//var myLighter = new Lighter('jsCode', {altLines: 'hover'});
 	
    // Element style syntax with files inside of a folder called "js".
	$('demo1').light({
    	altLines: 'hover'
   	});
   
    $('demo2').light({altLines: 'hover'});
   
   	// Highlight all "pre" elements in a document.
//   	$$('pre.jsDemoCode').light({altLines: 'hover'});		

	$('codeOneLink').addEvent('click', function(event) {
		event.stop();
		demoCode.demoCodeOne();
	});

	$('codeTwoLink').addEvent('click', function(event) {
		event.stop();
		demoCode.demoCodeTwo();
	});

});

var demoCode = $H({
				
	demoCodeOne: function() {
	
		// First of all I create a Notimoo instance with default configuration
		if (!this.ManagerOne)
			this.managerOne = new Notimoo();
		      
		// Showing a simple notification
		this.managerOne.show({
			title: 'Онлайн магазин',
			message: 'This is a sample notitication showing how easy is to use Notimoo.'
		});
		      
		// Showing a notification that does not disappear.
		(function() {
		   this.managerOne.show({
			title: 'Онлайн магазин',
		    message: 'Информация... Затвори',
		    sticky: true
		   });
		}).delay(2000, this);
		      
		// Notification with large text.
		(function() {
		   this.managerOne.show({
			title: 'Testing notification',
			message: 'This is a notification with a long text. If the message you provide does not fit into the notification size, Notimoo magically auto resize its height so all the content is visible.'
		    });
		}).delay(4000, this);
		
	},
	
	demoCodeTwo: function() {
	
		// Now I create the manager so it will display notifications from the left bottom corner		
		if (!this.managerTwo) {
			this.managerTwo = new Notimoo({
		   		locationVType: 'bottom',
		   		locationHType: 'left'
			});	
		}		
		
		// Showing a notification with no title
		this.managerTwo.show({
		   message: 'This is a simple notification message that has no title. This can be useful in some situation when you do not need to label your notification'
		});
		
		// Showing a notification with custom width and for a shorter period of time
		(function() {
			this.managerTwo.show({
		   		title: 'Custom notification',
		   		message: 'I override some manager properties for this notification so I can show how you can configure a single one',
		   		width: 200, 
		   		visibleTime: 2500
			});	
		} ).delay(1500, this);
		
	}
	
});

