window.addEvent('domready', function(){
	if($$('.com-menu') != null){
		// Create variables (in this case two arrays) representing our bubbles and pages
		var myPages = $$('.link');
		var myBubbles = $$('.bubble');
		
		// Set bubbles opacity to zero so they're hidden initially and toggle visibility on for their container	
		myBubbles.setStyle('opacity', 0);
		$('bubbleWrap').setStyle('visibility','visible');
		
		// Add our events to the pages
		myPages.each(function(el, i) {
			el.set('morph', {link : 'cancel'});
			
			el.addEvents({
				'mouseenter': function() {
					myBubbles[i].morph({
						'opacity' : 1,
						'margin-top' : '-15px'
					});
				},
				'mouseleave' : function() {
					myBubbles[i].morph({
						'opacity' : 0,
						'margin-top' : 0
					});
				}	
			});
		});
	}
	if($$('.home-tools') != null){
		// Create variables (in this case two arrays) representing our bubbles and pages
		var myPages2 = $$('.link-2');
		var myBubbles2 = $$('.bubble-2');
		
		// Set bubbles opacity to zero so they're hidden initially and toggle visibility on for their container	
		myBubbles2.setStyle('opacity', 0);
		$('bubbleWrap-2').setStyle('visibility','visible');
		
		// Add our events to the pages
		myPages2.each(function(el, i) {
			el.set('morph', {link : 'cancel'});
			
			el.addEvents({
				'mouseenter': function() {
					myBubbles2[i].morph({
						'opacity' : 1,
						'margin-left' : '-15px'
					});
				},
				'mouseleave' : function() {
					myBubbles2[i].morph({
						'opacity' : 0,
						'margin-left' : 0
					});
				}	
			});
		});
	}
	if ($('news-ticker') != null) {
		var news = new noobSlide({
			box: $('news-ticker'),
			mode:'vertical',
			size:188,
			items: $$('#news-ticker ul'),
			handles: $$('.nav span'),
			addButtons: {
				next: $$('.nav .down'),
				previous: $$('.nav .top')
			}
		});
	}
	if($$('.slideshow') != null){
		if ($('pictures') != null) {
			var slideshow = new BarackSlideshow('showmenu', 'pictures', 'loading', {
				transition: 'fade',
				auto: true,
				autostart: true,
				autointerval: 5000,
				tween: 10000
			});
		}
	}	
});
