$(document).ready(function() {
    $('#header').cycle({ slideExpr: 'span.slideshowimage' });
    $('#comprofile').validate();

    $('.tx-nemascomprofiles-pi2 .row div a').each(function(){
        height = $(this).find('img').height();
        margin = '-' + Math.round(height/2) + 'px';
        var cssProp = {
            position: 'relative'
        };
        cssProp.top = '50%';
        cssProp.marginTop = margin
        $(this).css(cssProp);
    });

    // Weil newloginbox keine leere statusmeldung generiert, sondern bei leerem String
    // den marker ausspuckt, muss hier mit JS getrickst werden...
    if($('.tx-newloginbox-pi1 .status-message').text().length == 1)
    {
        $('.tx-newloginbox-pi1 .status-message').remove();
    }
    // Felder ohne Angaben aus der Detailansicht des Unternehmens ausblenden
    $('#comp-detail tr td').each(function() {
        if($(this).text() == 'keine Angaben') {
            $(this).parent('tr').remove();
        }
    });

    // Testseite
    //
    /*
    $('.testcase .tx-nemascomprofiles-pi2').removeClass('tx-nemascomprofiles-pi2').addClass('nemasprofile');
    $(".nemasprofile").anythingSlider({
        easing: "linear",
        autoPlay: true,
        delay: 0,
        animationTime: 16000,
        buildNavigation: false,
        pauseOnHover: true,
        hashTags: false
    });
    */

    // anythingSlider für die Firmenlogos auf der Startseite
    var allElems = $('.all-companies').detach();
    //$('.tx-nemascomprofiles-pi2 ul').css({'height':'83px'});
    $('.tx-nemascomprofiles-pi2').anythingSlider({
        easing: "linear",
        autoPlay: true,
        delay: 1,
        animationTime: 3000,
        buildNavigation: false,
        pauseOnHover: true,
        hashTags: false
    });
    $('.tx-nemascomprofiles-pi2').append(allElems);


});
