  var playertype="";
  var ObjPlayer="";
  var AudioPlaying=0;
  var actuellflashplaypos=0;
  var actuellflashduration=0;
  var flashplayerstate="";
  var ObjItem="";
  var activeExtension="";
  var selectedItemText="";
  var preSelectedBVideo="";
  var activeFeedId="";
  var activePlayingCFeedId=0;
  var activePlayingFeedId=0;
  var activePlayingMessageId=0;
  var activePlayingExtension="";
  var savedFeedView=false;
  var smallmenuplayerflag=false;
  var customerFlagPlayer="";
  var videocalcHeight=0;
  
  
  
 document.onkeyup = playerkeypress;       
 function playerkeypress()
 {

   var KeyID = event.keyCode;
	//alert(KeyID);
   try{
   	moveTimeScroller=0;
	calcProcent();
	scrollerPos=-1;
   }catch(e){}
   switch(KeyID){
   		case 80:
   			try{ObjPlayer.sendEvent('PLAY');}catch(e){}
   		break;
   }
  }
  //var actuelplayingvideotime=0;
	function loadMediumPlayer(ObjCont,StrData,IntRatio,customerFlag){
		var ArrData = StrData.split(",");
		var FileExt = ArrData[2];
		if(IntRatio==0)IntRatio=1.5334;
		videocalcHeight=parseInt(390/IntRatio);
		//alert(videocalcHeight);

		FileExt = FileExt.replace("'","").replace("'","");
		activeExtension =FileExt;
		
		//Reposition playercontainer and for myuploads
		if(activePlayingMessageId!=ArrData[1] || ArrData[0].indexOf("customer")!=-1){
			try{document.getElementById("audioplayercontent").innerHTML="";}catch(E){}
			try{document.getElementById("playercontainerFixed").innerHTML="";}catch(E){}
		}
		document.getElementById("playercontainerFixed").style.top=319;
		document.getElementById("playercontainerFixed").style.left=250;	
		
		videoplayersize="m";
	  audiolink="javascript:return false";

			//new Playerdesign
			if(customerFlag==1){
			  customerFlagPlayer=1;
			  var videoheightbalancer=0;
			  if(activeExtension==".m4v" || activeExtension==".mp4" || activeExtension==".mov" || activeExtension==".flv"){
			  	videoheightbalancer=videocalcHeight;
			  }
			  //document.getElementById("playercontainerFixed").innerHTML= flashPlayerContent("/podcast/"+ArrData[0]+"/"+ArrData[1]+FileExt,"");
			  ObjCont.innerHTML=
			  			  '<div id="flashpic" style="z-index:50;position:relative;margin-left:5px;top:25px;width:390px;height:'+(videocalcHeight)+'px;_height:'+(videocalcHeight)+'px;background-color:#FFFFFF"></div>' +
						  '<div id="playercontainer" style="background-color:#;margin-top:-'+(videocalcHeight-videoheightbalancer-20)+'px;_margin-top:-'+(videocalcHeight-videoheightbalancer-20)+'px;width:402px;height:'+(videocalcHeight+5)+'px;background-Image:url(../tmpl/default/images/playerbackground_top.png);">' +
				          '<div style="font-size:2px" id="playerdetail">'+flashPlayerContent("/podcast/"+ArrData[0]+"/"+ArrData[1]+FileExt,"")+'</div>' +
				          '<div   style="font-size:2px;margin-top:0px;_margin-top:-18px;z-index:150"><div style="display:none"  onclick="playFeed(document.getElementById(\'playerbutton\'),document.getElementById(\'playerdetail\'),'+StrData+',0,\'\')" style="width:380;height:250px;font-size:2px;margin-left:12px;margin-top:0px;_margin-top:18px;background-image:url(../tmpl/default/images/video_play.jpg);cursor:pointer"></div>' +
				          '</div>' +
									'</div>' +
				          '<div id="playercontrols" style="padding-top:10px;width:402px;height:41px;margin-left:1px;margin-top:-1px;background-Image:url(../tmpl/default/images/playerbackground_bottom.png);background-repeat:no-repeat">' +
						      '<div id="playerbutton" onclick="ObjPlayer.sendEvent(\'PLAY\');" style="margin-left:10px;_margin-left:10px;width:16px;height:17px;background-Image:url(../tmpl/default/images/playbutton.png);background-repeat:no-repeat"></div>' +
				          '<div id="playertimebarback" style="font-size:2px;margin-left:40px;margin-top:-20px;width:259px;height:4px;background-Image:url(../tmpl/default/images/playertimebar.png)" onclick="setPlayerPos(this)"><div onclick="setPlayerPos(this)" id="playertimebarbuffer" style="z-index:700;width:0%;height:4px;background-color:#AAAAAA;font-size:2px"></div><div onclick="setPlayerPos(this)" id="playertimebar" style="z-index:800;margin-top:-4px;width:0%;height:4px;background-color:#31a6d4;font-size:2px"></div></div>' +
				          '<div id="videoplaytime" style="position:absolute;_position:fixed;margin-top:3px;color:#FFFFFF;font-size:10px;margin-left:40px;_margin-left:40px;width:180px;height:4px">00:00:00 | 00:00:00</div>' +
				          '<div id="playertimescroller" onMouseDown="scrollPlayer(this)" onMouseUp="stoptimescrolling()" style="float:left;margin-top:-6px;_margin-top:-28px;cursor:pointer;font-size:1px;height:12px;width:14px;background-image:url(./../tmpl/default/images/playerpoint.png);background-repeat:no-repeat;margin-left:30px;"></div>' +				          
				          '</div>';
			}else{
				//alert(ArrData[0]);
			  if(activePlayingMessageId!=ArrData[1] || ArrData[0].indexOf("customer")!=-1){
			  	document.getElementById("playercontainerFixed").innerHTML= flashPlayerContent("/podcast/"+ArrData[0]+"/"+ArrData[1]+FileExt,"");
			  }
			  ObjCont.innerHTML=
									'<div id="playercontainer" style="margin-top:29px;_margin-top:8px;width:402px;height:'+(videocalcHeight+5)+'px;background-Image:url(./tmpl/default/images/playerbackground_top.png);">' +
				          '<div style="font-size:2px" id="playerdetail"></div>' +
				          '<div  id="flashpic" style="font-size:2px;margin-top:0px;_margin-top:-18px"><div style="display:none"  onclick="playFeed(document.getElementById(\'playerbutton\'),document.getElementById(\'playerdetail\'),'+StrData+',0,\'\')" style="width:380;height:250px;font-size:2px;margin-left:12px;margin-top:0px;_margin-top:18px;background-image:url(/tmpl/default/images/video_play.jpg);cursor:pointer"></div>' +
				          '</div>' +
									'</div>' +
				          '<div id="playercontrols" style="padding-top:10px;width:402px;height:41px;margin-left:1px;margin-top:-1px;background-Image:url(./tmpl/default/images/playerbackground_bottom.png);background-repeat:no-repeat">' +
						      '<div id="playerbutton" onclick="document.getElementById(\'videoplayer\').sendEvent(\'PLAY\');" style="margin-left:10px;_margin-left:10px;width:16px;height:17px;background-Image:url(./tmpl/default/images/playbutton.png);background-repeat:no-repeat"></div>' +
				          '<div id="playertimebarback" style="font-size:2px;margin-left:40px;margin-top:-20px;width:259px;height:4px;background-Image:url(./tmpl/default/images/playertimebar.png)" onclick="setPlayerPos(this)"><div onclick="setPlayerPos(this)" id="playertimebarbuffer" style="z-index:700;width:0%;height:4px;background-color:#AAAAAA;font-size:2px"></div><div onclick="setPlayerPos(this)" id="playertimebar" style="z-index:800;margin-top:-4px;width:0%;height:4px;background-color:#31a6d4;font-size:2px"></div></div>' +
				          '<div id="videoplaytime" style="position:absolute;_position:fixed;margin-top:3px;color:#FFFFFF;font-size:10px;margin-left:40px;_margin-left:40px;width:180px;height:4px">00:00:00 | 00:00:00</div>' +
				          '<div id="playertimescroller" onMouseDown="scrollPlayer(this)" onMouseUp="stoptimescrolling()" style="float:left;margin-top:-6px;_margin-top:-28px;cursor:pointer;font-size:1px;height:12px;width:14px;background-image:url(./tmpl/default/images/playerpoint.png);background-repeat:no-repeat;margin-left:30px;"></div>' +
				          '</div>';
			  if(activePlayingMessageId==ArrData[1]){
			  	if(activeExtension==".m4v" || activeExtension==".mp4" || activeExtension==".mov" || activeExtension==".flv"){
			  		ObjPlayer.width=390;
					ObjPlayer.height=videocalcHeight;	
				}
				ObjItem = document.getElementById("playerbutton");
				try{ObjItem.style.backgroundImage=document.getElementById("playerbutton_1").style.backgroundImage}catch(E){};
				try{document.getElementById('playertimebar').style.width=document.getElementById('playertimebar_1').style.width;}catch(e){}
				try{document.getElementById('playertimescroller').style.marginLeft=(document.getElementById('playertimebar').offsetWidth+30)+"px";}catch(E){};
				try{document.getElementById('videoplaytime').innerHTML=document.getElementById('videoplaytime_1').innerHTML;}catch(e){}
			  }
		    }
			///
			if(activeExtension!=".m4v" && activeExtension!=".mp4" && activeExtension!=".mov" && activeExtension!=".flv"){		
				var baseCustomerPath="./";
				if(customerFlag==1){
					baseCustomerPath="./../";
				}        
				if(BrowserDetect.browser != 'Firefox'){
					if(BrowserDetect.browser != 'Opera'){
						var intFlagHeight=0;
						if(customerFlag==1){
							intFlagHeight=-15;
						}else{
							intFlagHeight=5;
						}
						document.getElementById('flashpic').innerHTML=''+
							'<div style="font-size:1;height:5px;_height:3px"></div>' +
							'<object style="z-index:150;margin-left:12px;_margin-top:'+intFlagHeight+'px;width:380;height:250px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="380" height="250" id="intro" align="middle">' +
							'<param name="allowScriptAccess" value="sameDomain" />' +
							'<param name="allowFullScreen" value="false" />' +
							'<param name="movie" value="'+baseCustomerPath+'tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed wmode="transparent" style="z-index:150;margin-left:12px;_margin-top:-6px;width:380;height:250px" src="'+baseCustomerPath+'tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" quality="high" bgcolor="#ffffff" width="380" height="250" name="intro" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
							'</object>';
						}else{
							
							document.getElementById('flashpic').innerHTML=''+
								'<div style="font-size:1;height:2px;_height:3px"></div>' +
								'<object style="margin-top:10px;margin-left:-10px;width:380;height:250px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="380" height="250" id="intro" align="middle">' +
								'<param name="allowScriptAccess" value="sameDomain" />' +
								'<param name="allowFullScreen" value="false" />' +
								'<param name="movie" value="'+baseCustomerPath+'tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed wmode="transparent" style="margin-left:22px;width:380;height:250px" src="'+baseCustomerPath+'tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" quality="high" bgcolor="#ffffff" width="380" height="250" name="intro" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
								'</object>';							
						}
				}else{
					 document.getElementById('flashpic').innerHTML=''+
						'<div style="font-size:1;height:18px;_height:3px"></div>' +
						'<object style="margin-left:6px;margin-top:-15px;width:380;height:250px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="380" height="250" id="intro" align="middle">' +
						'<param name="allowScriptAccess" value="sameDomain" />' +
						'<param name="allowFullScreen" value="false" />' +
						'<param name="movie" value="'+baseCustomerPath+'tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed wmode="transparent" style="margin-left:6px;margin-top:-15px;width:380;height:250px" src="'+baseCustomerPath+'tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" quality="high" bgcolor="#ffffff" width="380" height="250" name="intro" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
						'</object>';
				}
				if(customerFlag==1){
					try{document.getElementById('flashpic').style.backgroundColor="#FFFFFF"}catch(e){}
				}
			}else{
				try{document.getElementById('flashpic').style.backgroundColor=""}catch(e){}
			}
			
			

			
			
			///Save FeedView

			activePlayingCFeedId=ArrData[3];
			activePlayingFeedId=ArrData[0];
			activePlayingMessageId=ArrData[1];
			activePlayingExtension=FileExt;
			//actuelplayingvideotime=0;
			savedFeedView=false;
			smallmenuplayerflag=false
			
						
			///kill small mediaplayer and try to start new one
				//document.getElementById("videoplayersmallcont").innerHTML="";
				document.getElementById("videoplayersmallcont").style.display="none";
				//document.getElementById("playhistorycontrols_1").style.display="";
				if(activeExtension!=".m4v" && activeExtension!=".mp4" && activeExtension!=".mov" && activeExtension!=".flv"){
				}else{
					try{document.getElementById('flashpic').style.display="none"}catch(e){}
					checkbigvideoplayer();
				}
			/////

	}
	
	function loadMediumPlayerURL(ObjCont,StrURL,FileExt){
		videocalcHeight=260;
		activeExtension =FileExt;
//'<div style="font-size:2px" id="playerdetail">'+ flashPlayerContent("/podcast/"+ArrData[0]+"/"+ArrData[1]+FileExt,"")+'</div>' +			
		
		videoplayersize="m";
	  audiolink="javascript:return false";

			//new Playerdesign
			/*
			ObjCont.innerHTML=
						  '<div id="playercontainer" style="margin-top:29px;_margin-top:8px;width:402px;height:264px;background-Image:url(./tmpl/default/images/playerbackground_top.png);">' +
				          '<div style="font-size:2px;" id="playerdetail">'+ flashPlayerContent(StrURL)+'</div>' +
				          '<div  id="flashpic" style="font-size:2px;margin-top:0px;_margin-top:-18px"><div style="display:none"  onclick="playFeed(document.getElementById(\'playerbutton\'),document.getElementById(\'playerdetail\'),0,0,\''+FileExt+'\',0,0,\'\')" style="width:380;height:250px;font-size:2px;margin-left:12px;margin-top:0px;_margin-top:18px;background-image:url(/tmpl/default/images/video_play.jpg);cursor:pointer"></div>' +
				          '</div>' +
									'</div>' +
				          '<div id="playercontrols" style="padding-top:10px;width:402px;height:41px;margin-left:1px;margin-top:-1px;background-Image:url(./tmpl/default/images/playerbackground_bottom.png);background-repeat:no-repeat">' +
						      '<div id="playerbutton" onclick="ObjPlayer.sendEvent(\'PLAY\');" style="margin-left:10px;_margin-left:10px;width:16px;height:17px;background-Image:url(./tmpl/default/images/playbutton.png);background-repeat:no-repeat"></div>' +
				          '<div style="font-size:2px;margin-left:40px;margin-top:-20px;width:259px;height:4px;background-Image:url(./tmpl/default/images/playertimebar.png)" onclick="setPlayerPos(this)"><div onclick="setPlayerPos(this)" id="playertimebarbuffer" style="z-index:700;width:0%;height:4px;background-color:#AAAAAA;font-size:2px"></div><div onclick="setPlayerPos(this)" id="playertimebar" style="z-index:800;margin-top:-4px;width:0%;height:4px;background-color:#31a6d4;font-size:2px"></div></div>' +
				          '<div id="videoplaytime" style="color:#FFFFFF;font-size:10px;margin-left:40px;_margin-left:40px;width:110px;height:4px">00:00:00 | 00:00:00</div>' +
				          '</div>';*/
			///
			videocalcHeight=parseInt(390/1.777777778);
		  ObjCont.innerHTML=
					'<div id="playercontainer" style="margin-top:29px;_margin-top:8px;width:402px;height:'+(videocalcHeight+5)+'px;background-Image:url(./tmpl/default/images/playerbackground_top.png);">' +
          '<div style="font-size:2px" id="playerdetail">'+ flashPlayerContent(StrURL)+'</div>' +
          '<div  id="flashpic" style="font-size:2px;margin-top:0px;_margin-top:-18px"><div style="display:none"  onclick="playFeed(document.getElementById(\'playerbutton\'),document.getElementById(\'playerdetail\'),0,0,\''+FileExt+'\',0,0,\'\')" style="width:380;height:250px;font-size:2px;margin-left:12px;margin-top:0px;_margin-top:18px;background-image:url(/tmpl/default/images/video_play.jpg);cursor:pointer"></div>' +
          '</div>' +
					'</div>' +
          '<div id="playercontrols" style="padding-top:10px;width:402px;height:41px;margin-left:1px;margin-top:-1px;background-Image:url(./tmpl/default/images/playerbackground_bottom.png);background-repeat:no-repeat">' +
		      '<div id="playerbutton" onclick="ObjPlayer.sendEvent(\'PLAY\');" style="margin-left:10px;_margin-left:10px;width:16px;height:17px;background-Image:url(./tmpl/default/images/playbutton.png);background-repeat:no-repeat"></div>' +
          '<div id="playertimebarback" style="font-size:2px;margin-left:40px;margin-top:-20px;width:259px;height:4px;background-Image:url(./tmpl/default/images/playertimebar.png)" onclick="setPlayerPos(this)"><div onclick="setPlayerPos(this)" id="playertimebarbuffer" style="z-index:700;width:0%;height:4px;background-color:#AAAAAA;font-size:2px"></div><div onclick="setPlayerPos(this)" id="playertimebar" style="z-index:800;margin-top:-4px;width:0%;height:4px;background-color:#31a6d4;font-size:2px"></div></div>' +
          '<div id="videoplaytime" style="position:absolute;_position:fixed;margin-top:3px;color:#FFFFFF;font-size:10px;margin-left:40px;_margin-left:40px;width:180px;height:4px">00:00:00 | 00:00:00</div>' +
          '<div id="playertimescroller" onMouseDown="scrollPlayer(this)" onMouseUp="stoptimescrolling()" style="float:left;margin-top:-6px;_margin-top:-28px;cursor:pointer;font-size:1px;height:12px;width:14px;background-image:url(./tmpl/default/images/playerpoint.png);background-repeat:no-repeat;margin-left:30px;"></div>' +
          '</div>';
			if(activeExtension!=".m4v" && activeExtension!=".mp4" && activeExtension!=".mov" && activeExtension!=".flv"){		          
				if(BrowserDetect.browser != 'Firefox'){
					if(BrowserDetect.browser != 'Opera'){
						document.getElementById('flashpic').innerHTML=''+
							'<div style="font-size:1;height:2px;_height:3px"></div>' +
							'<object style="margin-left:12px;_margin-top:5px;width:380;height:250px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="380" height="250" id="intro" align="middle">' +
							'<param name="allowScriptAccess" value="sameDomain" />' +
							'<param name="allowFullScreen" value="false" />' +
							'<param name="movie" value="./tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed wmode="transparent" style="margin-left:12px;_margin-top:-6px;width:380;height:250px" src="./tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" quality="high" bgcolor="#ffffff" width="380" height="250" name="intro" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
							'</object>';
						}else{
							document.getElementById('flashpic').innerHTML=''+
								'<div style="font-size:1;height:2px;_height:3px"></div>' +
								'<object style="margin-top:10px;margin-left:-10px;width:380;height:250px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="380" height="250" id="intro" align="middle">' +
								'<param name="allowScriptAccess" value="sameDomain" />' +
								'<param name="allowFullScreen" value="false" />' +
								'<param name="movie" value="./tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed wmode="transparent" style="margin-left:22px;width:380;height:250px" src="./tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" quality="high" bgcolor="#ffffff" width="380" height="250" name="intro" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
								'</object>';							
						}
				}else{
					 document.getElementById('flashpic').innerHTML=''+
						'<div style="font-size:1;height:18px;_height:3px"></div>' +
						'<object style="margin-left:6px;margin-top:-15px;width:380;height:250px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="380" height="250" id="intro" align="middle">' +
						'<param name="allowScriptAccess" value="sameDomain" />' +
						'<param name="allowFullScreen" value="false" />' +
						'<param name="movie" value="./tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed wmode="transparent" style="margin-left:6px;margin-top:-15px;width:380;height:250px" src="./tmpl/default/flash/audio_file/audio_file.swf?FeedId='+ArrData[3]+'" quality="high" bgcolor="#ffffff" width="380" height="250" name="intro" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
						'</object>';
				}
			}
	}
	var tutorialplayerContainerId="";
	function loadTutorialPerURL(ObjContId,StrURL){
	//alert("S");
		document.getElementById("feedempfoverBackTutorial").style.display="";
		tutorialplayerContainerId=ObjContId;
		var StrFireFoxId='';
		var StrId='';
		if(BrowserDetect.browser == 'Firefox' || BrowserDetect.browser == 'Opera'){
			StrFireFoxId='id="tutorialPlayer"';
			StrId='';
		}else{
			StrFireFoxId='';
		    StrId='id="tutorialPlayer"';
		}
		var dataplayer= '<object '+StrId+' width="704" height="400" style="z-index:800;margin-left:0px;margin-top:0px" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">'+
									'<param name="src" value="./lib/player/player.swf" />' +
								    '<param name="flashvars" value="screencolor=000000&stretching=exactfit&file='+StrURL+'&quality=true&autostart=true&controlbar=none&icons=true&bufferlength=1" />' +
								    '<param name="width" value="704" />' +
								    '<param name="height" value="400" />' +
								    '<param name="allowscriptaccess" value="always" />' +
								    '<param name="allowfullscreen" value="true" />' +
								    '<param name="wmode" value="transparent" />' +
									'<embed wmode="transparent" style="z-index:800;margin-left:0px;margin-top:0px" '+ 
									StrFireFoxId+
									'src="./lib/player/player.swf" '+ 
									'flashvars=screencolor=000000&stretching=exactfit&file='+StrURL+'&quality=true&autostart=true&controlbar=none&icons=true&bufferlength=1" '+
									'width="704" '+
									'height="400" '+
									'allowscriptaccess="always" '+
									'allowfullscreen="true" '+
									'/></object><input type="hidden" value="0" id="bufferstat">';
									//alert(dataplayer);
		document.getElementById(ObjContId).innerHTML= dataplayer;
		
		//document.getElementById("tutorialPlayer").addModelListener("STATE","getTutorialPlayerState");
	}
	
	function getTutorialPlayerState(ObjState){
		try{
			if(ObjState.newstate=="COMPLETED"){
				//alert("fertig");
				/*try{
					document.getElementById(tutorialplayerContainerId).innerHTML="";
					document.getElementById(tutorialplayerContainerId).style.display="";
					document.getElementById("header").style.display="";
					document.getElementById("header_tutorial").style.display="none";
					document.getElementById("bottom_language").style.display="";
					document.getElementById("bottom").style.display="";
					document.getElementById("registerContainer").style.display="";
					document.getElementById("navigationStartContainer").style.display="";
					document.getElementById("content_bottomEdge").style.display="";
				}catch(e){}*/
				try{document.getElementById("feedempfoverBackTutorial").style.display="none";}catch(E){}
				
				var anr=getUrlValue('ar');
				var nname=getUrlValue('nname');
				var lang=getUrlValue('lg');
				var emailad=getUrlValue('email');
				var vname=getUrlValue('vname');
				
				if(anr==""){
					location='index.php';
				}else{
					location='index.php?t=true&vname='+vname+'&ar='+anr+'&nname='+nname+'&lg='+lang+'&email='+emailad;
				}
			}
		}catch(e){
		}
	
	}
	
	function playFeed(ObjItemInit,ObjContainer,IntFeedId,IntMessageId,StrFileExtension,IntCFeedId,IntDirect,FeedURL,IntRatio){
		//alert(IntRatio);
		if(IntRatio==0 || IntRatio=="")IntRatio=1.5334;
		if(videoplayersize=="m"){
			try{document.getElementById('firsthistory').src="./feedicons/"+IntCFeedId+"_big_r.jpg"}catch(E){};
			try{document.getElementById('firsthistory').onclick=function(){setHistoryUrl("histloc=details&CFeedId="+IntCFeedId+"&FeedId="+IntFeedId+"&MessageIdAjax="+IntMessageId+"&Extension="+StrFileExtension+"&RatioVar="+IntRatio)};}catch(E){};
			loadMediumPlayer(document.getElementById('playerinternalcont'),IntFeedId+","+IntMessageId+",'"+StrFileExtension+"',"+IntCFeedId,IntRatio,customerFlagPlayer);
		}else{
			document.getElementById("flashpic").innerHTML="";
			document.getElementById("playercontroldisplay").style.display="";
			ObjContainer.innerHTML = flashPlayerContent(FeedURL,"");
		}
	}
	
	function checkbigvideoplayer(){
		if(document.getElementById("detailplayerflag")==null && smallmenuplayerflag==false){
				try{
					if(activePlayingExtension!=".m4v" && activePlayingExtension!=".mp4" && activePlayingExtension!=".mov" && activePlayingExtension!=".flv"){
					}else{
						smallmenuplayerflag=true;
						document.getElementById("videoplayersmallcont").style.display="";
						document.getElementById("videoplayer").style.marginTop=4;
						document.getElementById("playercontainerFixed").style.left=16;
						document.getElementById("videoplayer").width=186;
						document.getElementById("videoplayer").height=110;
					}
					//document.getElementById("playhistorycontrols_1").style.display="none";
					//activeExtension =activePlayingExtension;
					//document.getElementById("videoplayersmallcont").innerHTML=flashPlayerContent("/podcast/"+activePlayingFeedId+"/"+activePlayingMessageId+activePlayingExtension,"",1);
					//alert(actuelplayingvideotime);
				}catch(E){}
		}else{
				if(smallmenuplayerflag==false){
					if(activeExtension==".m4v" || activeExtension==".mp4" || activeExtension==".mov" || activeExtension==".flv"){
						document.getElementById("videoplayer").width=390;
						document.getElementById("videoplayer").height=videocalcHeight;
					}
				}
		}
		if(BrowserDetect.browser != 'Explorer'){
			if(document.getElementById("searchbar").style.display=="none" && document.getElementById("headerview").style.display=="none"){
				if(document.getElementById("personalfeedflag")!=null || document.getElementById("detailplayerflag")==null){
					if(document.getElementById("playercontainerFixed").style.top!=158)document.getElementById("playercontainerFixed").style.top=158;
				}else{
					if(document.getElementById("playercontainerFixed").style.top!=255){document.getElementById("playercontainerFixed").style.top=255};
				}
			}
			if(document.getElementById("searchbar").style.display=="none" && document.getElementById("detailplayerflag")==null && document.getElementById("headerview").style.display!="none" && document.getElementById("playercontainerFixed").style.top!=223)document.getElementById("playercontainerFixed").style.top=223;
			if(document.getElementById("searchbar").style.display!="none" && document.getElementById("headerview").style.display=="none" && document.getElementById("playercontainerFixed").style.top!=235)document.getElementById("playercontainerFixed").style.top=235;
			if(document.getElementById("searchbar").style.display!="none" && document.getElementById("detailplayerflag")==null && document.getElementById("headerview").style.display!="none" && document.getElementById("playercontainerFixed").style.top!=300)document.getElementById("playercontainerFixed").style.top=300;
		}else{
			if(document.getElementById("searchbar").style.display=="none" && document.getElementById("headerview").style.display=="none"){
				if(document.getElementById("personalfeedflag")!=null || document.getElementById("detailplayerflag")==null){
					if(document.getElementById("playercontainerFixed").style.top!=42)document.getElementById("playercontainerFixed").style.top=36;
				}else{
					if(document.getElementById("playercontainerFixed").style.top!=255){document.getElementById("playercontainerFixed").style.top=135};
				}
			}
			//if(document.getElementById("searchbar").style.display=="none" && document.getElementById("headerview").style.display=="none" && document.getElementById("playercontainerFixed").style.top!=42)document.getElementById("playercontainerFixed").style.top=42;
			if(document.getElementById("searchbar").style.display=="none" && document.getElementById("detailplayerflag")==null && document.getElementById("headerview").style.display!="none" && document.getElementById("playercontainerFixed").style.top!=118)document.getElementById("playercontainerFixed").style.top=118;
			if(document.getElementById("searchbar").style.display!="none" && document.getElementById("headerview").style.display=="none" && document.getElementById("playercontainerFixed").style.top!=117)document.getElementById("playercontainerFixed").style.top=117;
			if(document.getElementById("searchbar").style.display!="none" && document.getElementById("detailplayerflag")==null && document.getElementById("headerview").style.display!="none" && document.getElementById("playercontainerFixed").style.top!=190)document.getElementById("playercontainerFixed").style.top=190;	
		}
		//if(smallmenuplayerflag==false){
			setTimeout("checkbigvideoplayer()",50);
		//}
	}
	
	function flashPlayerContent(Murl,audiolink){
		
		var IntTop=0;
		var IntLeft=0;
		var IntWidth=0;
		var IntHeight=0;
		var StrId="";
		var StrFireFoxId="";
		var StrDomainName="http://78.46.34.110:8080";
		//var smallPlayerStart="";
		//////S3 Redirection
		if(Murl.indexOf("customer")==-1 && Murl.indexOf("http://")==-1){
			var tempFile = Murl.split("/");
			Murl =tempFile[3];
			StrDomainName="http://yasssu.com.s3.amazonaws.com/";
			//alert(StrDomainName+Murl);
		}
		////////
		
		///////direct redirection
		var IntPlayerURLType=0;
		if(Murl.indexOf("http://")!=-1){
			StrDomainName="";
			IntPlayerURLType=1;
			//alert(StrDomainName+Murl);
		}
		
		
		//////
	
		if(BrowserDetect.browser == 'Firefox' || BrowserDetect.browser == 'Opera'){
			if(activeExtension==".flv" || activeExtension==".m4v" || activeExtension==".mp4" || activeExtension==".mov"){
					IntTop=5;
					if((BrowserDetect.browser == 'Firefox' || BrowserDetect.browser == 'Opera') && IntPlayerURLType==1){
						IntLeft=3;
					}else{
						if(customerFlagPlayer==0){
							IntLeft=13;
						}else{
							IntLeft=3;
						}
					}
					if(Murl.indexOf("customer")!=-1){
						IntTop+=30;
					}
			}else{
				IntTop=2;
				IntLeft=2;
			}
			StrId ="";
			IntWidth=2;
			IntHeight=2;
			StrFireFoxId='id="videoplayer"'
		}else{
				IntTop=4;
				IntLeft=6;
				StrId ='id="videoplayer"';
				if(Murl.indexOf("customer")!=-1){
					if(BrowserDetect.browser != 'Explorer'){
						IntTop+=32;
					}else{
						IntTop+=38;
					}
				}
			StrFireFoxId=''
		}
		if(BrowserDetect.browser == 'Explorer'){
			document.getElementById("playercontainerFixed").style.top=224;
			document.getElementById("playercontainerFixed").style.left=249;
		}
		if(activeExtension==".m4v" || activeExtension==".mp4" || activeExtension==".mov" || activeExtension==".flv"){
				IntWidth=390;
				IntHeight=videocalcHeight;
		}else{
			IntWidth=1;
			IntHeight=1;
		}
		if(videoplayersize=="l"){
			if(Murl.indexOf("small")!=-1){
				IntLeft=155;
				if(BrowserDetect.browser != 'Explorer'){
					IntTop=97;
				}else{
					IntTop=87;
				}
				IntWidth=300;
				IntHeight=169;
			}
			else if(Murl.indexOf("middle")!=-1){
				IntLeft=70;
				if(BrowserDetect.browser != 'Explorer'){
					IntTop=47;
				}else{
					IntTop=37;
				}
				IntWidth=480;
				IntHeight=270;
			}else{
				IntLeft=35;
				if(BrowserDetect.browser != 'Explorer'){
					IntTop=30;
				}else{
					IntTop=10;
				}
				IntWidth=541;
				IntHeight=304;
			}
			StrDomainName="";
		}
		playertype="fl";
		var StrSound="";
		
		///Testing

		///
		
		if(Murl.indexOf(".MP3")!=-1 || Murl.indexOf(".M4A")!=-1 || Murl.indexOf(".mp3")!=-1 || Murl.indexOf(".m4a")!=-1)StrSound='&type=sound';
		
		//alert(StrDomainName+Murl);
		var dataplayer= '<object '+StrId+' width="'+IntWidth+'" height="'+IntHeight+'" style="z-index:800;margin-left:'+IntLeft+'px;margin-top:'+IntTop+'px" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">'+
										'<param name="src" value="./lib/player/player.swf" />' +
								    '<param name="flashvars" value="plugins=shortcuts-1&screencolor=FFFFFF&stretching=exactfit&file='+StrDomainName+Murl+'&quality=true&autostart=true&controlbar=none&displayclick=fullscreen&icons=true&bufferlength=1'+StrSound+'" />' +
								    '<param name="width" value="'+IntWidth+'" />' +
								    '<param name="height" value="'+IntHeight+'" />' +
								    '<param name="allowscriptaccess" value="always" />' +
								    '<param name="allowfullscreen" value="true" />' +
								    '<param name="wmode" value="transparent" />' +
										'<embed wmode="transparent" style="z-index:800;margin-left:'+IntLeft+'px;margin-top:'+IntTop+'px" '+ 
										StrFireFoxId+
									  'src="./lib/player/player.swf" '+ 
									  'flashvars=plugins=shortcuts-1&screencolor=FFFFFF&stretching=exactfit&file='+StrDomainName+Murl+'&quality=true&autostart=true&controlbar=none&displayclick=fullscreen&icons=true&bufferlength=1'+StrSound+'" '+
									  'width="'+IntWidth+'" '+
									  'height="'+IntHeight+'" '+
									  'allowscriptaccess="always" '+
									  'allowfullscreen="true" '+
									  '/></object><input type="hidden" value="0" id="bufferstat">';
		/*testing*/					  
		if(activeExtension.indexOf(".mp3")!=-1){
			document.getElementById('audioplayercontent').innerHTML=dataplayer;
			return "";
		}else{
			document.getElementById('audioplayercontent').innerHTML="";
			//document.getElementById('videoplayersmallplayercontent').innerHTML=dataplayer;
		}
		/*testing*/
		return dataplayer;
	}
	
		/////////////////////FlasplayerData
	
	function playerReady(thePlayer) {
		//alert("rr");
		try{
			document.getElementById("tutorialPlayer").addModelListener("STATE","getTutorialPlayerState");
		}catch(e){
		
		}
		ObjItem = document.getElementById("playerbutton");
		ObjPlayer = document.getElementById("videoplayer");
		ObjPlayer.addModelListener("LOADED","bufferflashStatus");
		ObjPlayer.addModelListener("TIME","getPlayerPos");
		ObjPlayer.addViewListener("FULLSCREEN","getFullScreen");
		ObjPlayer.addModelListener("STATE","getPlayerState");
		setPlayHistoryStopButton();
		if(customerFlagPlayer==1){
			ObjItem.style.backgroundImage="url(../tmpl/default/images/stopbutton.png)";
		}else{
			ObjItem.style.backgroundImage="url(./tmpl/default/images/stopbutton.png)";
		}
 		ObjItem.style.width=24;
 		ObjItem.style.height=23;
  }
  
  function getFullScreen(e){
  	document.getElementById("playerbutton").focus();
  }
  
  function setPlayHistoryStopButton(){
  	try{
  			if(customerFlagPlayer==1){
	  			document.getElementById("playerbutton_1").style.backgroundImage="url(../tmpl/default/images/stopbutton.png)";
	 		}else{
	 			document.getElementById("playerbutton_1").style.backgroundImage="url(./tmpl/default/images/stopbutton.png)";
	 		}
	 		document.getElementById("playerbutton_1").style.width=24;
	 		document.getElementById("playerbutton_1").style.height=23;
	 	}catch(E){}
  }
  
  function setPlayHistoryPlayButton(){
  	try{
  			if(customerFlagPlayer==1){
	  			document.getElementById("playerbutton_1").style.backgroundImage="url(../tmpl/default/images/playbutton.png)";
	  		}else{
	  			document.getElementById("playerbutton_1").style.backgroundImage="url(./tmpl/default/images/playbutton.png)";
	  		}
	 		document.getElementById("playerbutton_1").style.width=20;
	 		document.getElementById("playerbutton_1").style.height=23;
 		}catch(E){}
  }
  
  function getPlayerState(ObjState){
  	flashplayerstate = ObjState.newstate;
	try{
		if(ObjState.newstate=="COMPLETED"){
				setPlayHistoryPlayButton();
			  ObjItem.style.width=20;
    		ObjItem.style.height=23;
    		if(customerFlagPlayer==1){
    			ObjItem.style.backgroundImage="url(../tmpl/default/images/playbutton.png)";
    		}else{
    			ObjItem.style.backgroundImage="url(./tmpl/default/images/playbutton.png)";
    		}
		}

		if(ObjState.newstate=="PAUSED"){
			  setPlayHistoryPlayButton();
    		ObjItem.style.width=20;
    		ObjItem.style.height=23;
    		if(customerFlagPlayer==1){
    			ObjItem.style.backgroundImage="url(../tmpl/default/images/playbutton.png)";
    		}else{
    			ObjItem.style.backgroundImage="url(./tmpl/default/images/playbutton.png)";
    		}
		}else if(ObjState.newstate=="PLAYING"){
			  setPlayHistoryStopButton();
			  	if(customerFlagPlayer==1){
					ObjItem.style.backgroundImage="url(../tmpl/default/images/stopbutton.png)";
				}else{
					ObjItem.style.backgroundImage="url(./tmpl/default/images/stopbutton.png)";
				}
		 		ObjItem.style.width=24;
  	 		ObjItem.style.height=23;
		}
	  }catch(e){}
	}
  
  function bufferflashStatus(ObjBuffer) { 
		//		alert(ObjBuffer.loaded);
		document.getElementById("bufferstat").value=parseInt(((ObjBuffer.loaded*100)/ObjBuffer.total));

		if(parseInt(((ObjBuffer.loaded*100)/ObjBuffer.total))!=0){
			try{document.getElementById('playertimebarbuffer').style.width=parseInt(((ObjBuffer.loaded*100)/ObjBuffer.total))+"%";}catch(E){}
			try{document.getElementById('playertimebarbuffer_1').style.width=parseInt(((ObjBuffer.loaded*100)/ObjBuffer.total))+"%";}catch(E){}
			if(parseInt(((ObjBuffer.loaded*100)/ObjBuffer.total)) <= 3){
				try{document.getElementById('videoplaytime').innerHTML="Buffering: "+parseInt(((ObjBuffer.loaded*100)/ObjBuffer.total))+"%";}catch(E){}
				try{document.getElementById('videoplaytime_1').innerHTML="Buffering: "+parseInt(((ObjBuffer.loaded*100)/ObjBuffer.total))+"%";}catch(E){}
			}
		}
	}
	
	function getPlayerPos(ObjPos) { 
		//if(ObjPos.position>0){
		//		actuelplayingvideotime=ObjPos.position;
		//}
		if(actuellflashduration!=ObjPos.duration){
			actuellflashduration =  ObjPos.duration;
			actuellflashplaypos = ObjPos.position;
		}
		var videoPlayerPosProcent=((ObjPos.position*100)/ObjPos.duration);
		try{document.getElementById('playertimebar').style.width=videoPlayerPosProcent+"%";}catch(E){}
		try{
			if(getScrollerState()==0){
				var playertimebarbackwidth=parseInt(document.getElementById("playertimebarback").style.width);
				document.getElementById('playertimescroller').style.marginLeft=(Math.round((videoPlayerPosProcent/100)*playertimebarbackwidth)+30)+"px";
			}
		}catch(E){}
		try{
			var playertimebarbackwidthsmall=parseInt(document.getElementById("playertimebarback_1").style.width)-8;
			document.getElementById('playertimescroller_1').style.marginLeft=(Math.round((videoPlayerPosProcent/100)*playertimebarbackwidthsmall)+30)+"px";
		}catch(E){}
		try{document.getElementById('playertimebar_1').style.width=((ObjPos.position*100)/ObjPos.duration)+"%";}catch(E){}
		try{
			if(parseInt(document.getElementById("bufferstat").value) > 0){
				if(activeExtension==".m4v" || activeExtension==".mp4" || activeExtension==".mov" || activeExtension==".flv"){
					if(smallmenuplayerflag==false){
						ObjPlayer.width=390;
						ObjPlayer.height=videocalcHeight;
					}
					
					document.getElementById('flashpic').innerHTML="";
				}
			}
		}catch(E){}
		if(parseInt(document.getElementById("bufferstat").value) > 2){
			
			try{document.getElementById('videoplaytime').innerHTML=changetoSecond(ObjPos.position)+" | "+changetoSecond(ObjPos.duration) + " (" + document.getElementById("bufferstat").value +"%" + ")";}catch(E){}
			try{document.getElementById('videoplaytime_1').innerHTML=changetoSecond(ObjPos.position)+" | "+changetoSecond(ObjPos.duration) + " (" + document.getElementById("bufferstat").value +"%" + ")";}catch(E){}
			
			//Save Views
			try{
				if(ObjPos.position>2 && savedFeedView==false){
					//try{document.getElementById('videoplayer').sendEvent('SEEK', 3600);}catch(e){alert(e)}
					savedFeedView=true;
					if(customerFlagPlayer!=1){
						customerfolder="./";
					}else{
						customerfolder="../";
					}
					$.post(customerfolder+"class/feed/overviewrequest.class.php?saveFeedViews=true&date="+Date(),		
				 	{ 
							id:activePlayingCFeedId,
							MessageId:activePlayingMessageId
					} ,function(data){
						//alert(data);
					});
				}
			}catch(E){}
		}
	}
	
	function getVideoX( oElement )
	{
		var iReturnValue = 0;
		while( oElement != null ) {
			iReturnValue += oElement.offsetLeft;
			oElement = oElement.offsetParent;
		}
		return iReturnValue;
	}
	
	function setPlayerPos(ObjSetter){
		var IntLeft = getVideoX( ObjSetter );
		var IntLength = IntMouseLeft-IntLeft;
		var IntPercent =(IntLength*100)/(ObjSetter.style.width.substr(0,ObjSetter.style.width.length-2));
		
		if(IntPercent<=100){
		  	if(parseInt(document.getElementById("bufferstat").value)>=IntPercent){
		  		var ActuelPos =Math.round((IntPercent*actuellflashduration)/100);
		  		document.getElementById('videoplayer').sendEvent('SEEK', ActuelPos)
		  	}
  	}
	}
	
	function reset_loadedMessageId(){
		loadedMessageId="";
		selectedItemText="";
	}
	
	function setPlayBorder(objitem){
		if(selectedItemText != objitem.id){
			try{objitem.parentNode.parentNode.style.backgroundColor="#e6f3fd";}catch(E){}
			try{document.getElementById("mText"+objitem.id).style.display="";}catch(E){}
			try{if(selectedItemText!="")document.getElementById("mText"+selectedItemText).style.display="none";}catch(E){}
			if(preSelectedBVideo==""){
			}else{
				try{
					preSelectedBVideo.parentNode.parentNode.style.backgroundColor="";
					preSelectedBVideo.parentNode.parentNode.style.borderBottom="1px #c4c4c4 solid";
					preSelectedBVideo="";
				}catch(E){}
			}
			try{
				preSelectedBVideo = objitem;
				selectedItemText = objitem.id;
			}catch(E){}
		}else{
			
		}
	}
	
	function changetoSecond(IntSecond){
        i = 0;
        s = Math.floor(IntSecond);
        m = 0;
        h = 0;
        m1 = 0;
        s1 = 0;
           if (s > 59) {
              m = Math.floor(s/60);
              s = s-m*60;
              }
           if (m > 59) {
              h = Math.floor(m/60);
              m = m-h*60;
             }
           if (s < 10) {
              s = "0"+s;
              }
           if (m < 10) {
              m = "0"+m;
              }
           bx = h+":"+m+":"+s;
           return bx;
 }
 
 //Change to player
 
function playDetailBigOver(objF){
   if(AudioPlaying==0){
		objF.style.backgroundImage="url(./images/play_over.png)";
   }
}


function playDetailBigOut(objF){
	if(AudioPlaying==0){
		objF.style.backgroundImage="url(./images/play.png)";
  }
}

//Diese Funktion dient dazu den PlayButton
//ueber den Feed Image anzuzeigen
//sie wird bei mouseover laden


function changeToPlayer(objImg){
		objImg.src='./tmpl/default/images/player_play.png';
}

//Diese Funktion dient dazu den	
//Playbutton zu loeschen und wieder das normale
//Image anzuzeigen das filter wird deshalb geloescht
//weil ein png fix fuer den IE 6 zum Einsatz kommt
//dieser zeigt transparente pngs an und muss daher 
//separat geloescht werden
//sie wird bei mouseout laden

function changeToImage(objImg){
	if(objImg.src.indexOf('player_play.png')!=-1 || objImg.style.filter!=""){
		objImg.src="./tmpl/default/images/blank.gif";
		objImg.style.filter="";
	}
}
