$(document).ready(function(){		
    $('.navigation-text').each(function(){
        if($(this).height() > 30){
            $(this).css('line-height', '18px');
        }
    });
    
    $('#navigation ul li ul').hide();	
    $('#navigation ul li a').click(function() {
        var checkElement = $(this).next();
        if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
            return false;
        }
            
        if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
            $('#navigation ul ul:visible').delay(100).slideUp('normal');
            checkElement.delay(100).slideDown('normal');
            
            $('#navigation ul li a').removeClass('selected');
            $(this).addClass('selected');
            
            return false;
        }
    });
    
    $('#navigation ul li .selected').next('ul').show();
    
    // Homepage Carousel - jquery cycle plugin
    $('#imagewrapper').cycle({
        fx: 'fade'
    });       
});
