

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (Ext.isWebKit)) { 
	// load html5 player
} else {


	
	if(document.domain.indexOf('yellowspace')) {
		var f_key = false;
		var f_player =  "/local/flash/flowplayer/flowplayer-3.1.5.swf";
	} else {
		var f_player =  "/local/flash/flowplayer/flowplayer.commercial-3.1.5.swf";
		var f_key = '$a33cad4d3a007ed0fb8';
	}
	
	if($('player')) {
		flowplayer("player", f_player, {
		key: f_key,
		  clip:  { 
			  //scaling: 'fit',
			  autoPlay: true, 
			  autoBuffering: true,
				 onBeforeFinish: function() {
		//            play: null,
					  return false;
				 },
				onFinish: function() { 
					document.getElementById('player').style.display = 'none';
					$('topnavflashid').style.display='none';
					//document.getElementById('playerhq').style.display = 'none';
					document.getElementById('playbuthq').style.display = 'block';
					document.getElementById('playbutlq').style.display = 'block';
					/*
					//document.getElementById('stierkopf').style.visibility = 'visible';
					document.getElementById('topnavflashid').style.top = '88px';
					document.getElementById('topnavflashid').style.marginTop = '0px';
					document.getElementById('topnavflashid').style.marginLeft = '-513px';
					document.getElementById('topnavflashid').style.padding = '0px 112px';
					document.getElementById('topnavflashid').style.backgroundColor = 'transparent';
					document.getElementById('topnavflashid').style.height = '300px';
					document.getElementById('overlay').style.display = 'none';
					*/
				},  
				onStop: function() { 
					document.getElementById('player').style.display = 'none';
					$('topnavflashid').style.display='none';
					//document.getElementById('playerhq').style.display = 'none';
					document.getElementById('playbuthq').style.display = 'block';
					document.getElementById('playbutlq').style.display = 'block';
					//document.getElementById('stierkopf').style.visibility = 'visible';
					/*document.getElementById('topnavflashid').style.top = '88px';
					document.getElementById('topnavflashid').style.marginTop = '0px';
					document.getElementById('topnavflashid').style.marginLeft = '-513px';
					document.getElementById('topnavflashid').style.padding = '0px 112px';
					document.getElementById('topnavflashid').style.backgroundColor = 'transparent';
					document.getElementById('topnavflashid').style.height = '300px';
					document.getElementById('overlay').style.display = 'none';
					*/
				},
				onFullscreenExit: function() { 
					document.getElementById('player').style.display = 'none';
					$('topnavflashid').style.display='none';
					//document.getElementById('playerhq').style.display = 'none';
					document.getElementById('playbuthq').style.display = 'block';
					document.getElementById('playbutlq').style.display = 'block';
					//document.getElementById('stierkopf').style.visibility = 'visible';
					/*document.getElementById('topnavflashid').style.top = '88px';
					document.getElementById('topnavflashid').style.marginTop = '0px';
					document.getElementById('topnavflashid').style.marginLeft = '-513px';
					document.getElementById('topnavflashid').style.padding = '0px 112px';
					document.getElementById('topnavflashid').style.backgroundColor = 'transparent';
					document.getElementById('topnavflashid').style.height = '300px';
					document.getElementById('overlay').style.display = 'none';
					*/
				}
			},		
		  canvas: {
			  backgroundColor: '#000000',//"#1a1a1a",
			  backgroundGradient: 'none'
			  },
			logo: { 
				url: 'http://www.thomaskramer.com/images/logo.png', 
				top: 30, 
				right: 30, 
				opacity: 1, 
				fullscreenOnly: true, 
				displayTime: 0, 
				linkUrl: '#'
			},
			play: { 
				replayLabel: 'click or press esc to leave full screen  '
				//	url: '/images/buttons/play_not_button.png', 
				//        width: 91, 
				//        height: 91, 
				//	opacity: 0,
			},
		  plugins: {
			controls: {
			  tooltipColor: '#555555',
			  backgroundGradient: 'none',
			  bufferGradient: 'none',
			  timeBgColor: '#555555',
			  sliderGradient: 'none',
			  borderRadius: '0px',
			  buttonColor: '#d8030a',
			  backgroundColor: '#000000',//'#1a1a1a',
			  buttonOverColor: '#050505',
			  progressColor: '#eb0003',
			  progressGradient: 'medium',
			  volumeSliderColor: '#000000',
			  timeColor: '#0b0a0a',
			  tooltipTextColor: '#ffffff',
			  volumeSliderGradient: 'none',
			  bufferColor: '#000000',
			  durationColor: '#de020a',
			  sliderColor: '#000000',
			  height: 24,
			  opacity: 1.0,
			  stop:true
			}
		  }
		});
	}
	
	if($('playerhq')) {
		flowplayer("playerhq", f_player, {
		key: f_key,
		  clip:  { 
			  //scaling: 'fit',
			  autoPlay: true, 
			  autoBuffering: true,
			  play: null,
				 onBeforeFinish: function() {
					  return false;
				 },
				onFinish: function() { 
					//document.getElementById('player').style.display = 'none';
					document.getElementById('playerhq').style.display = 'none';
					$('topnavflashid').style.display='none';
					document.getElementById('playbuthq').style.display = 'block';
					document.getElementById('playbutlq').style.display = 'block';
					/*
					//document.getElementById('stierkopf').style.visibility = 'visible';
					document.getElementById('topnavflashid').style.top = '88px';
					document.getElementById('topnavflashid').style.marginTop = '0px';
					document.getElementById('topnavflashid').style.marginLeft = '-513px';
					document.getElementById('topnavflashid').style.padding = '0px 112px';
					document.getElementById('topnavflashid').style.backgroundColor = 'transparent';
					document.getElementById('topnavflashid').style.height = '300px';
					document.getElementById('overlay').style.display = 'none';
					*/
				},  
				onStop: function() { 
					//document.getElementById('player').style.display = 'none';
					document.getElementById('playerhq').style.display = 'none';
					$('topnavflashid').style.display='none';
					document.getElementById('playbuthq').style.display = 'block';
					document.getElementById('playbutlq').style.display = 'block';
					/*
					//document.getElementById('stierkopf').style.visibility = 'visible';
					document.getElementById('topnavflashid').style.top = '88px';
					document.getElementById('topnavflashid').style.marginTop = '0px';
					document.getElementById('topnavflashid').style.marginLeft = '-513px';
					document.getElementById('topnavflashid').style.padding = '0px 112px';
					document.getElementById('topnavflashid').style.backgroundColor = 'transparent';
					document.getElementById('topnavflashid').style.height = '300px';
					document.getElementById('overlay').style.display = 'none';
					*/
				},
				onFullscreenExit: function() { 
					//document.getElementById('player').style.display = 'none';
					document.getElementById('playerhq').style.display = 'none';
					$('topnavflashid').style.display='none';
					document.getElementById('playbuthq').style.display = 'block';
					document.getElementById('playbutlq').style.display = 'block';
					/*
					//document.getElementById('stierkopf').style.visibility = 'visible';
					document.getElementById('topnavflashid').style.top = '88px';
					document.getElementById('topnavflashid').style.marginTop = '0px';
					document.getElementById('topnavflashid').style.marginLeft = '-513px';
					document.getElementById('topnavflashid').style.padding = '0px 112px';
					document.getElementById('topnavflashid').style.backgroundColor = 'transparent';
					document.getElementById('topnavflashid').style.height = '300px';
					document.getElementById('overlay').style.display = 'none';
					*/
				}
			},
		  canvas: {
			  backgroundColor: "#000000",
			  backgroundGradient: 'none'
			  },
			logo: { 
				url: 'http://www.thomaskramer.com/images/logo.png', 
				top: 30, 
				right: 30, 
				opacity: 1, 
				fullscreenOnly: true, 
				displayTime: 0, 
				linkUrl: '#'
			},
		  plugins: {
			controls: {
			  tooltipColor: '#555555',
			  backgroundGradient: 'none',
			  bufferGradient: 'none',
			  timeBgColor: '#555555',
			  sliderGradient: 'none',
			  borderRadius: '0px',
			  buttonColor: '#d8030a',
			  backgroundColor: '#000000',
			  buttonOverColor: '#050505',
			  progressColor: '#eb0003',
			  progressGradient: 'medium',
			  volumeSliderColor: '#000000',
			  timeColor: '#0b0a0a',
			  tooltipTextColor: '#ffffff',
			  volumeSliderGradient: 'none',
			  bufferColor: '#000000',
			  durationColor: '#de020a',
			  sliderColor: '#000000',
			  height: 24,
			  opacity: 1.0,
			  stop:true
			}
		  }
		});
	}
	


}

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
	// not on iphone for now
} else {

	//if(typeof console == 'object') console.log('x '+ $('streamplayer').id+': %o',$('streamplayer'));

	if(document.domain.indexOf('yellowspace')) {
		var f_key = false;
		var f_player =  "/local/flash/flowplayer/flowplayer-3.1.5.swf";
	} else {
		var f_player =  "/local/flash/flowplayer/flowplayer.commercial-3.1.5.swf";
		var f_key = '$a33cad4d3a007ed0fb8';
	}
		

	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
	flowplayer("a.contentplayer", f_player, {
	key: f_key,
	  clip:  { 
		  scaling: 'fit',
		  autoPlay: true, 
		  autoBuffering: true,
		  play: null
		},
    	//log:{level:'debug'},
	  canvas: {
		  backgroundColor: "#1a1a1a",
		  backgroundGradient: 'none'
		  },
		onLoad: function(){
			//alert("player loaded");
		},	
		onStart: function(){
			//alert("player loaded");
		},			
		logo: { 
			url: 'http://www.thomaskramer.com/images/logo.png', 
			top: 30, 
			right: 30, 
			opacity: 1, 
			fullscreenOnly: true, 
			displayTime: 0, 
			linkUrl: '#'
		},
	  plugins: {
		controls: {
		  tooltipColor: '#5F747C',
		  backgroundGradient: 'none',
		  bufferGradient: 'none',
		  timeBgColor: '#555555',
		  sliderGradient: 'none',
		  borderRadius: '0px',
		  buttonColor: '#d8030a',
		  backgroundColor: '#222222',
		  buttonOverColor: '#050505',
		  progressColor: '#eb0003',
		  progressGradient: 'medium',
		  volumeSliderColor: '#000000',
		  timeColor: '#0b0a0a',
		  tooltipTextColor: '#ffffff',
		  volumeSliderGradient: 'none',
		  bufferColor: '#000000',
		  durationColor: '#de020a',
		  sliderColor: '#000000',
		  height: 24,
		  opacity: 1.0,
		  stop:true
		}
	  }
	});
	

	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	if($('streamplayer')) {
	

	
		flowplayer("streamplayer", f_player, {
		key: f_key,
		  clip:  { 
			  // This is the path to the video file or the name of the stream 
			  url:'cool.stream',
			  live: true, 
			  provider: 'rtmp'
		//        onBeforePause: function() {     
		//            return false;    
		//            }, 
			}, 
			
		/*  canvas: {
			  backgroundColor: "#1a1a1a",
			  backgroundGradient: 'none',
			  },*/
			logo: { 
				url: 'http://www.thomaskramer.com/images/logo.png', 
				top: 30, 
				right: 30, 
				opacity: 1, 
				fullscreenOnly: true, 
				displayTime: 0, 
				linkUrl: '#'
			},
		  plugins: {
			controls: {
			  tooltipColor: '#5F747C',
			  backgroundGradient: 'none',
			  bufferGradient: 'none',
			  timeBgColor: '#555555',
			  sliderGradient: 'none',
			  borderRadius: '0px',
			  buttonColor: '#d8030a',
			  backgroundColor: '#222222',
			  buttonOverColor: '#050505',
			  progressColor: '#eb0003',
			  progressGradient: 'medium',
			  volumeSliderColor: '#000000',
			  timeColor: '#0b0a0a',
			  tooltipTextColor: '#ffffff',
			  volumeSliderGradient: 'none',
			  bufferColor: '#000000',
			  durationColor: '#de020a',
			  sliderColor: '#000000',
			  height: 24,
			  opacity: 1.0,
			  all: false,   
			  play: true,  
			  stop: true,  
			  time: true,  
			  fullscreen: true,
			  // wenn Ton kommt mute+volume: true, scrubber: false
			  mute: false,  
			  volume: false,
			  scrubber: true
			},
			rtmp: {
			  // here is our rtpm plugin configuration
			  url:"/local/flash/flowplayer/flowplayer.rtmp-3.1.3.swf",
			  // netConnectionUrl defines where the streams are found 
			  netConnectionUrl: 'rtmp://qtss02.live.bytesatwork.com/rtplive'
			}
		  }
		});
	}
}