jQuery.noConflict();
var $jQwsv = jQuery;
jQuery.fn.vcenter = function () {
//	this.css("position","absolute");
//	this.css("left", ( $jQwsv(window).width() - this.width() ) / 2+$jQwsv(window).scrollLeft() + "px");
this.css("margin-top", ( $jQwsv(window).height() - this.height() ) / 2+$jQwsv(window).scrollTop() + "px"); return this;
}
$jQwsv(document).ready(function () {
$jQwsv("span[id^='videopodcast']").each(function () { $jQwsv(this).addClass('videopodcast')})
$jQwsv("span[id^='videopodcast']").click(function() { playVideo(this.id.split('videopodcast_').join('')) });
});
var vp = new SWFObject("http://www.1954fm.de/fileadmin/templates/flash/player-licensed.swf","ply","640","531","9","#FFFFFF");
var vplayer = null;
function playerReady(obj) {vplayer = document.getElementsByName(obj.id)[0];vplayer.addModelListener('STATE', 'stateMonitor');};
function stateMonitor(obj) {if(obj.newstate == 'COMPLETED') {stopVideo();}};
function stopVideo(){ $jQwsv('#video_player').remove(); $jQwsv('#video_layer').animate({opacity: 0}, function() { $jQwsv('#video_layer').remove(); } );}
function playVideo(i)
{
	video= '<div id="video_layer" onclick="stopVideo()"><div id="video_player"></div></div>'
	$jQwsv('body').prepend(video);
	$jQwsv('#video_layer').css({opacity: 0})
	$jQwsv('#video_layer').animate({opacity: 0.8})
	vp.addParam("allowfullscreen","false");
	vp.addParam("frontcolor","cc0000");
	vp.addParam("backcolor","003f89");
	vp.addParam("autostart","true");
	vp.addParam("flashvars","file=http://www.1954fm.de/fileadmin/podcast/video/2010/"+i+".flv&allowfullscreen=false&frontcolor=cc3333&backcolor=003f89&volume=80&autostart=true");
	vp.write("video_player");
	$jQwsv('#video_player').vcenter()

}
