function initializePlayer(m4vfile, posterFile) {
    $(document).ready(function () {
        $("#movie").jPlayer({
            ready: function () {
                $(this).jPlayer("setMedia", {
                    m4v: m4vfile,
                    poster: posterFile
                });
            },
            play: function () {
                $(".referenz p").hide();
            },
            pause: function () {
                $(".referenz p").show();
            },
            swfPath: "js",
            supplied: "m4v",
            volume: 1,
            preload: "auto"
        });
    });
}

$(document).ready(function () {   
    $('.hover a').hover(function () {
        $(this).children('img').css('opacity', '1').css('filter','alpha(opacity=100)');
        $(this).children('.playMovie').css('opacity', '1').css('filter','alpha(opacity=100)');
    }, function() {
        $(this).children('img').css('opacity', '0.4').css('filter','alpha(opacity=40)');
        $(this).children('.playMovie').css('opacity', '0.6').css('filter','alpha(opacity=60)');
    });
	
    $('.referenz p').each(function () {
        if($.browser.msie)
        {
            $(this).hide();
        }
        else
        {
            $(this).height($(this).height()).hide();
        }
    });
	
    $('.referenz').hover(function (e) {
        $('.referenz p').each(function () {
            $(this).stop(true, true).animate({
                width: "toggle"
                }, 1000);
        });
    });
    
    if($('#map_canvas'))
    {
        var geocoder;
        var map;
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(53.68586, 10.016730000000052);
        var myOptions = {
            zoom: 13,
            disableDefaultUI: true,
            center: latlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
        var marker = new google.maps.Marker({
            map: map,
            position: latlng,
            title: "APR GmbH bei Google Maps zeigen"
        });

        google.maps.event.addListener(marker, 'click', function() {
            window.open("http://maps.google.com/maps?f=q&source=s_q&hl=de&geocode=&q=53.68586,+10.016730000000052&aq=&sll=53.68586,10.01673&sspn=0.009188,0.023625&ie=UTF8&ll=53.686021,10.01672&spn=0.00887,0.023625&z=16&iwloc=r0");
        });
    }
});
