window.addEvent('domready', function(){
	var el = $$('#nav li.off'),
        color = el.getStyle('backgroundColor');

    $$('#nav li.off').addEvents({
        mouseenter: function(){
            // We set the cursor to pointer so users know they can click this region
            this.setStyle('cursor','pointer');

            // Change background color on mouseover
            this.morph({
    	        'background-color': '#CCDDAA',
                'background-image': 'url(images/arrow.jpg)', //Background image
                'background-repeat': 'no-repeat',
                'background-position': [0, 520], //image will move from left to right - Values are in pixels.
		'color': '#000'
            });
		},
        mouseleave: function(){
            // Morphes back to the original style
            this.morph({
		'color': '#99AA66',
                'background-image': 'none',
                'background-color': '#FFF'
            });
        }
    });


    //We retrieve the link location (href) and assign it to LI to make the whole region clickable
    var link = $$('#nav li 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({
                'border': '1px solid #eee',
                'background-image': 'none',
                'background-color': '#fff'
            });
        });
    });
});

