$(document).ready(function(){
	if (typeof(videoFirstclip) != "undefined" && videoFirstclip!="") {
		var player = flowplayer("player", {
			src: "./flv/flowplayer/flowplayer-3.1.4.swf",
			version: [9, 115],
			onFail: function() { // older versions will see a custom message
				document.getElementById("playerinfo").innerHTML = 
				"You need the latest Flash version to see MP4 movies. " + 
				"Your version is " + this.getVersion();
				}
			}, { // here is our third argument which is the Flowplayer configuration
				clip: {
					baseUrl: "http://www.jobtei.com/flv/",
					url: videoFirstclip, 
					autoPlay: videoAutoPlay,
					scaling: "fit"
				},
        canvas: { 
            //backgroundGradient: [0.2, 1.0], 
            //backgroundColor: '#dedede'
			
            backgroundImage: "url( content/img/Startbild_Videoplayer.jpg)"
            //backgroundImage: "url( http://www.google.com/intl/en_ALL/images/logo.gif)" 
        } 
				
				
			}
		);
	}

	$('a.btnFlowplayerPlay').click(function(){
		if (!$f().isPlaying()) $f().play();
	});
	$('a.btnFlowplayerPause').click(function(){
		$f().pause();
	});
	$('.btnFlowplayerPlayClip').click(function(){
		flv = $(this).attr('flv');
		$f().play(flv);
//		var arrName = $(this).attr('name').split('//');
//		$('#video_hl').empty().append(arrName[0]);
//		$('#video_text').empty().append(arrName[1]);
	});

	// initialize scrollable 
	$("div.scrollable").scrollable({ 
		size: 2
	}).mousewheel(); 
	
	// initialize tooltip 
	$(".scrollable .items img[title]").tooltip({ 
		position: "bottom center", 
		tip: '#videotip',  
		offset: [10, 0], 
		effect: 'slide' 
	}); 
});

