window.addEvent('domready', function(){
	var el = $$('.box1'),
        color = el.getStyle('backgroundColor');

    $$('.box1').addEvents({
        mouseenter: function(){


            // Change background color on mouseover
            this.morph({
    	        'background-color': '#FDF7F7'
        
            });
		},
        mouseleave: function(){
            // Morphes back to the original style
            this.morph({
                backgroundColor: color
            });
        }
    });


    //We retrieve the link location (href) and assign it to LI to make the whole region clickable
    var link = $$('.box1 a');
    link.each(function(element) {
        element.getParent().addEvent('click', function(){
            window.location = element.get('href');
            // on click, background color and border will turn to a different color
            this.morph({
                'background-image': 'none',
                'color': '#BA0000'
            });
        });
    });
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    var el = $$('.box2'),
        color = el.getStyle('backgroundColor');

    $$('.box2').addEvents({
        mouseenter: function(){


            // Change background color on mouseover
            this.morph({
    	        'background-color': '#FDF7F7'
        
            });
		},
        mouseleave: function(){
            // Morphes back to the original style
            this.morph({
                backgroundColor: color
            });
        }
    });


    //We retrieve the link location (href) and assign it to LI to make the whole region clickable
    var link = $$('.box2 a');
    link.each(function(element) {
        element.getParent().addEvent('click', function(){
            window.location = element.get('href');
            // on click, background color and border will turn to a different color
            this.morph({
                'background-image': 'none',
                'color': '#BA0000'
            });
        });
    });
    
    
    
    
    
    
    
    
    
    
    
});
