function logoRotator() {
    $('#logo-rotator img').css('margin-left', '0px').animate({"marginLeft": "-=6850px"}, 60000, function() {
    logoRotator();
    // Animation complete.
  });

};

function donotload() {
    alert('donotload');
    return false;
};

$('document').ready(function() {
    $('#content-menu ul').addClass('sf-menu');
    $('#content-menu ul li:last a').append('<div class="corner"></div>');
  
  logoTop = $('.vnav-container').offset().top - 42;

        logoRotator();


    $('.download-eval').click(function() {
        correct = true;

        $('#download-form input.required').each(function(i) {
            if ($('#download-form input.required').eq(i).val()) {

            } else {
                correct = false;
            };
        });
        if (correct) {
            //alert('Your download will begin shortly.');
            // BEGIN DOWNLOAD!
            document.downloadform.submit();
            
        } else {
            alert('Please fill in all required fields. Thank you.');
        };
        return false;
    });




    $('ul.sf-menu > li > a').append('<div class="separator"></div>');
    $('ul').each(function() {
        $(this).find('li:first').addClass('first');
        $(this).find('li:last').addClass('last');
        
    });
    $('ul.sf-menu').each(function() {
        $(this).find('li.first a:first').append('<div class="corner"></div>');
        $(this).find('li.last a:first').append('<div class="corner"></div>');    
    });    

    
        $('.panorama .tab').hide();
        $('.panorama .tab-1').show();
    $('.panorama ul.nav a').click(function () {
        $('.panorama .tab').fadeOut(0);
        $('.panorama .tab.' + $(this).attr('name')).fadeIn(0);
    });


    $('.tabs > div').hide();
    $('.tabs .tab-1').show();
    $('.tabs .nav li:eq(0)').addClass('active');
    $('.tabs .nav a').click(function () {
        $('.tabs > div').hide();
        $('.tabs').find('.' + $(this).attr('name')).show();
        $(this).parent().addClass('active').siblings().removeClass('active');
    });
    
    
    
    $(window).scroll(function() {
        var y = $(window).scrollTop();
        if (y >= logoTop) {
            $('.vnav-container').addClass('fixed');
        } else {
            $('.vnav-container').removeClass('fixed');
        };
    });
    
    $('#keynote .tab').each(function(i) {
        $(this).addClass('tab-' + i);
        $('#keynote .nav').append('<li><a href="#keynote" count="'+i+'" class="item-'+i+'" name="tab-'+i+'">'+ (i + 1) +'</a></li>');
    });
    
    $('#keynote .tab').hide();
    $('#keynote .tab:eq(0)').addClass('active').show();
    $('#keynote .nav').each(function() {
        $(this).children('li:eq(0)').addClass('active');
    });

    
    $('#keynote .nav a').click(function() {
        menuItem = $(this).attr('count');
        which = '#keynote .nav .item-' + menuItem;
        $('#keynote .nav li').removeClass('active');
        $(which).parent().addClass('active');
        which = '#keynote .'+ $(this).attr('name');
        $('#keynote .tab').removeClass('active').hide();
        $(which).addClass('active').show();
        //return false;
    });    
    
    $('.vnav .current').append('<div class="bg-box"></div>');
    
    $('.img-floater').hide();
    $('.doc-examples a').click(function() {
        whichImg = $(this).attr('class');
        $('.img-floater').html('<img src="../WeceemFiles/_ROOT/Image/' + whichImg + '.jpg" />');
        $('.img-floater').fadeIn(500);
        return false;
    });
    $('.img-floater').click(function() {
        $(this).fadeOut(500);
        return false;
    });
    
    
});
