/* Copyright 2008 by Marco van Hylckama Vlieg

web: http://www.i-marco.nl/weblog/
email: marco@i-marco.nl
*/
jQuery.fn.initMenu = function() {  
    return this.each(function(){
        var theMenu = $(this).get(0);
        //$('.acitem', this).hide();
        //$('li.expand > .acitem', this).show();
        //$('li.expand > .acitem', this).prev().addClass('active');
        $('li a', this).click(
            function(e) {
                e.stopImmediatePropagation();
                var theElement = $(this).next();
                var parent = this.parentNode.parentNode;
                window.location.href = this.href;                
                if(theElement.hasClass('acitem') && !theElement.is(':visible')) {         
                    $('.acitem:visible', parent).first().slideUp('normal', function() {
                        $(this).prev().removeClass('active');
                    });
                    theElement.slideDown('normal', function() {
                        $(this).prev().addClass('active');
                    });
                    return false;
                }
            }
        )
    });
};


$(document).ready(function() {
    $('.menu').initMenu();    
    $(".shapes_menu_option img").fadeTo("slow", 0.4); // This sets the opacity of the thumbs to fade down to 60% when the page loads	
	$(".shapes_menu_option img").hover(function(){
	$(this).fadeTo("550", 1.0); // This should set the opacity to 100% on hover
	},function(){
	$(this).fadeTo("550", 0.4); // This should set the opacity back to 60% on mouseout
	});
});

	
