$(document).ready(function() {

    var activated = '';
    $(".amenuitem a.main").mouseover(function() {
        var item = $(this).parent().attr('id');
        if (item != activated) {
            $(this).parent().find('div.popup').animate({
                top:0
            }, 400);
            $(this).addClass('active');
            $(this).parent().find('div.popup div.textcnt').fadeIn(1200);
            activated = item;
        } else {

        }
    });
    $(".amenuitem").mouseleave(function() {
        $('div.popup', this).animate({
            top:269
        }, 400);
        $('a.main', this).removeClass('active');
        $('div.popup div.textcnt', this).css('display', 'none');
        activated = '';
    });
    $("#slider").slider({
        prevButton: "prevbutton",
        nextButton: "nextbutton"
    });
    var slimage = '';
//     $('#slider ul li a').mouseover(function() {
//         if ($(this).attr('class') != slimage) {
//             $('#console').html('start: '+$(this).attr('class'));
//             slimage = $(this).attr('class');
//             var pos = $(this).position();
//             var elm = $('<div>')
//                             .attr('id', 'slidertextopened')
//                             .css('left', '0')
//                             .css('top', '13')
//                             .html($(this).find('span').html());
//             $(this).append($(elm));
//         } else {
//         }
//     }).mouseleave(function() {
//         slimage = '';
//         $('#slidertextopened').remove();
//     });
});

