jQuery.fn.mediaplayer = function() {


    if($(this).size() <= 0){
        return this;
    }

	var img_arr = this.find("img")
	if(img_arr.length > 0){
        var preview = img_arr.eq(0);
        var src = preview.attr("src");
        this.empty();
        this.css(
            "background", "url("+ src +") no-repeat center center",
            "background-size", "100%"
            )

	}


    this.flowplayer({src: "/flash/flowplayer/flowplayer-3.1.3.swf", wmode: "transparent" }, {

			clip: {
				autoPlay: false,
				autoBuffering: false
			},
			plugins: {
				audio: {
					url: '/flash/flowplayer/flowplayer.audio-3.1.2.swf'
				} ,


				controls: {

					buttonColor: '#ff1010',
					timeColor: '#f15062',
					timeBgColor: '#555555',
					volumeSliderColor: '#ffffff',
					bufferGradient: [0.4, 0.6, 1.0],
					buttonOverColor: '#ff0000',
					tooltipTextColor: '#ffffff',
					sliderColor: '#950918',
					tooltipColor: '#5F747C',
					sliderGradient: [0.4, 0.6, 1.0],
					backgroundColor: '#000000',
					backgroundGradient: [1.0, 0.6, 0.4],
					volumeSliderGradient: [0.4, 0.6, 1.0],
					borderRadius: '0px',
					progressColor: '#f9152f',
					durationColor: '#ffffff',
					bufferColor: '#bb7c83',
					progressGradient: [0.4, 0.6, 1.0],
					height: 24,
					opacity: 1

				}
			}
		});


  return this;
};


jQuery(document).ready(
function(){

    $('#navigation').css({'display' : 'none'});
    setTimeout(
        function(){
            $('#navigation').show('drop',500);
            }
            ,1500);

        $("#admin_menu").click(function(){
            $(this).next().slideToggle('medium');}
            );

        $("#media").mediaplayer();


}

);

