jQuery.noConflict();
/*
window.addEvent('domready',function() {
    $('top-navigation-sub').setStyle('visibility','hidden')
    $('link-leistungen').addEvent('mouseenter',function(){
        $('top-navigation-sub').setStyle('visibility','visible');    
    });
});
*/
(function($){
    /************* jQuery Code Start *************/
    $.tools.validator.localize('de',{
        '*': 'ungültiger Wert',
        ':email': 'ungültige E-Mail',
        ':number': 'ungültige Zahl',
        ':url': 'ungültige URL',
        '[max]': 'Bitte einen Wert kleiner $1 eingeben',
        '[min]': 'Bitte einen Wert größer $1 eingeben',
        '[required]': 'Dieses Feld ist erforderlich',
        '[type=range]': 'Der Wert muss zwischen $1 und $2 liegen'
    });
    $.tools.validator.fn('[type=range]',{
        'en': 'Value must be between $1 and $2',
        'de': 'Der Wert muss zwischen $1 und $2 liegen'
    },
        function(element, value){
            var min = parseInt(element.attr('data-start'),10) || 0 ,
                max = parseInt(element.attr('data-end'),10) || 0;
            value = parseInt(value,10) || 0;
            return value >= min && value <= max ? true : [min, max];
        }
    );
    
    $.tools.validator.fn('select',{
        'de': 'Bitte wählen Sie einen Veranstaltungsort'
    },
        function(element, value){
            return element.attr('selectedIndex') > 0;
        }
    );

    /** document ready **/
    $(document).ready(function(){
        var timer, 
            topNavSub = $('#top-navigation-sub');
        var fadeOut = function() {
            topNavSub.delay(500).fadeOut(200);
        }
        $('#top-navigation-sub').hide();
        $('#link-leistungen').bind('mouseenter',function(){
            topNavSub.stop(true, true)
            topNavSub.fadeIn(500);
        });
        $('#link-leistungen').bind('mouseleave',function(){
            topNavSub.stop(true, true)
            fadeOut();
        });
        topNavSub.bind('mouseleave',function(){
            topNavSub.stop(true, true)
            fadeOut();
        });
        topNavSub.bind('mouseenter',function(){
            topNavSub.stop(true, true)
            topNavSub.fadeIn(500);   
        });
    }); // document ready
    
    
    /************* jQuery Code Ende **************/
    
})(jQuery);
