




// window center
/*
function windowResize () {

    var WindowWidth = parseFloat( $(window).width() );
    var WrapperPosition = (WindowWidth - 710) / 2; // 800 = breite vom Wrapper

    var WindowHeight = parseFloat( $(window).height() );
    var wrapperHeight = $('#mainWrapper').height();

    if(wrapperHeight > WindowHeight) {
        WrapperPosition = WrapperPosition - 20
    }

    alert(WindowWidth);
    alert(WrapperPosition);
    


    // minimale Abstand Rechts
    if (WrapperPosition <= 20) {
        $("#header").css('margin-left', '20');
        $("#subheaderWrapper").css('margin-left', '20');
        $("#content").css('margin-left', '20');
        $("#footer").css('margin-left', '20');
    } else {
        $("#header").css('margin-left', WrapperPosition);
        $("#subheaderWrapper").css('margin-left', WrapperPosition);
        $("#content").css('margin-left', WrapperPosition);
        $("#footer").css('margin-left', WrapperPosition);
    };

}

*/




$(document).ready(function(){


    // center mainWrapper
    /*
    windowResize();

    $(window).resize(function(){
        windowResize();
    });
    */

    /* !latestClip video starter */
    /* ---------------------------------------------------------------------- */
    $('.latestClipWrapper').bind('click', function(){
        $(this).find('.playButton').click();
    });


    /* !references video starter */
    /* ---------------------------------------------------------------------- */
    $('.referencesWrapper').bind('click', function(){
        $(this).find('.playButton').click();
    });

    /* !video */
    /* ---------------------------------------------------------------------- */
    $('#videoClose a').bind('click', function(){
        $('#videoPlayer').empty();
        $('#videoWrapper').slideUp('slow');
        return false;
    });


    $('.playButton').bind('click', function(){
        youtubeid = $(this).attr('title');
        
        $('#videoWrapper').slideDown('slow', function(){

            $('#videoPlayer').html('<object width="960" height="542"><param name="movie" value="http://www.youtube.com/v/' + youtubeid + '?fs=1&autoplay=1&rel=0&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + youtubeid + '?fs=1&autoplay=1&rel=0&amp;hl=de_DE" type="application/x-shockwave-flash" wmode=”transparent” allowscriptaccess="always" allowfullscreen="true" width="960" height="542"></embed></object>');
        
        });
        
        /* !scroll to video */
        /* ---------------------------------------------------------------------- */
        var scrollPos = parseFloat( $('#header').height() ) + 44
        $('html, body').animate({
            scrollTop: scrollPos
        }, 300);
        
        return false;
    });


    $('.mf-submit').hover(function(){
        $(this).addClass('mf-submit-hover');
    },function(){
        $(this).removeClass('mf-submit-hover');
    });

});


