﻿window.addEvent('domready', function() {	
			
	slideShow = new SlideShow ($("slide"), {
		delay : 4000, 
		duration : 1000, 
		onInitialize : function () {
			this.start();
			},
		onMouseOver : function () {
			this.stop();
			},
		onMouseOut : function () {
			this.play();
			}
		
		}).play();

		
    var myPages = $$('.page');
    var myBubbles = $$('.bubble');
    
    myBubbles.setStyle('opacity', 0);
    $('bubbleWrap').setStyle('visibility','visible')
    
    myPages.each(function(el, i) {
        el.set('morph', {link : 'cancel'});
        
        el.addEvents({
            'mouseenter': function() {
                myBubbles[i].morph({
                    'opacity' : 1,
                    'width' : '245px'
                });
            },
            'mouseleave' : function() {
                myBubbles[i].morph({
                    'opacity' : 0,
                    'width' : '0px'
                });
            }   
        });
    });
});




