Ape.Element.videoteaser_sidecol = function() {
	var that 			= this,
		videos 			= [],
		current_video	= 0,
		new_current_vid = 0;
	
	/* Basics */
	this.start = function() {
		
		$(".grossansicht .close").click(function() {
			$(this).parent(".grossansicht").hide();
			$(this).parent().parent(".box_video").removeClass("box_video_abstand");
		});
		
		$('#videoteaser_'+that.random+'_play').bind('click', function() {
			
			$(this).parent().parent(".box_video").children(".grossansicht").show();
			$(this).parent().parent(".box_video").addClass("box_video_abstand");
			if(parseInt(that.videos[that.current_video].Video_ID,10) > 0){
				
				loadFlashPlayer();
				
			}else{
				$('#videoteaser_'+that.random+'_video').html(that.videos[that.current_video].HTML);
			
				var breite_neu 	= 498,
					hoehe_neu	= 420;
				
				$('#videoteaser_'+that.random+'_video object').attr('width', breite_neu);
				$('#videoteaser_'+that.random+'_video object').attr('height', hoehe_neu);
				$('#videoteaser_'+that.random+'_video object embed').attr('width', breite_neu);
				$('#videoteaser_'+that.random+'_video object embed').attr('height', hoehe_neu);
			}
						
			statistikclick();
		});
		for(var i=0; i< 4; i++){
			$('#videoteaser_'+that.random+'_select_'+i+', #videoteaser_'+that.random+'_video_'+i).bind('click', function() {
				var id = $(this).attr('id').split('_').pop();
				that.new_current_vid = id;
				that.change_video();
			});
		}
	};
	function loadFlashPlayer(){
		
		var videoID = that.videos[that.current_video].Video_ID;
		
		var playerID = that.playerID;
		var publisherID = "67005934001";
		var param_site = that.param_site;
		var param_prod = that.param_prod;
		var param_affiliate = that.param_affiliate;
		var additionalAdTargetingParams = that.videos[that.current_video].additionalAdTargetingParams;
		
		if (! window.frn046adxtra ){
			window.frn046adxtra = ""; 
		}
		var frn046enrich = (typeof window.pt027bw == 'undefined')?"&band=256"+window.frn046adxtra : "&band="+window.pt027bw+window.frn046adxtra; 
		frn046enrich = (typeof window.frn046tie == 'undefined')?"&tie=free"+frn046enrich : "&tie="+window.frn046tie+frn046enrich;
		
		
		if(additionalAdTargetingParams == ''){
			additionalAdTargetingParams = 'site='+param_site+'&affiliate='+param_affiliate+'&prod='+param_prod+'&tbl=channel'+frn046enrich;
		}else{
			additionalAdTargetingParams = additionalAdTargetingParams+frn046enrich;
		}
		
		var videoTag = '<object id="myExperienceSidecol" class="BrightcoveExperience"> ';
		videoTag += '<param name="bgcolor" value="#FFFFFF"/> ';
		videoTag += '<param name="width" value="498"/> ';
		videoTag += '<param name="height" value="420"/> ';
		videoTag += '<param name="playerID" value="'+playerID+'"/> ';
		videoTag += '<param name="publisherID" value="'+publisherID+'"/> ';
		videoTag += '<param name="isVid" value="true"/> ';
		videoTag += '<param name="isUI" value="true"/> ';
		videoTag += '<param name="wmode" value="opaque" /> ';
		videoTag += '<param name="optimizedContentLoad" value="true"/> ';
		videoTag += '<param name="@videoPlayer" value="'+videoID+'"/> ';
		videoTag += '<param name="additionalAdTargetingParams" value="'+additionalAdTargetingParams+'" /> ';
		videoTag += '<param name="flashVars" value="@videoPlayer='+videoID+'&playerID='+playerID+'&domain=embed&" />';
		videoTag += '<param name="linkBaseURL" value="'+window.location.href+'?bcpid='+playerID+'&bctid='+videoID+'" />';
		videoTag += '<embed src="http://c.brightcove.com/services/viewer/federated_f9/'+playerID+'?isVid=1&publisherID='+publisherID+'"';
			videoTag += 'bgcolor="#FFFFFF" ';
			videoTag += 'flashVars="@videoPlayer='+videoID+'&playerID='+playerID+'&domain=embed&" ';
			videoTag += 'base="http://admin.brightcove.com"   ';
			videoTag += 'name="myExperienceSidecol" ';
			videoTag += 'width="498" ';
			videoTag += 'height="420" ';
			videoTag += 'seamlesstabbing="false" ';
			videoTag += 'allowFullScreen="true" ';
			videoTag += 'swLiveConnect="true" ';
			videoTag += 'allowScriptAccess="always" ';
			videoTag += 'linkBaseURL="'+window.location.href+'?bcpid='+playerID+'&bctid='+videoID+'" ';
			videoTag += 'additionalAdTargetingParams="'+additionalAdTargetingParams+'" ';
			videoTag += 'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
		videoTag += '</embed>  ';
		videoTag += '</object>  ';
		
		$('#videoteaser_'+that.random+'_video').html(videoTag);
		
		runMobileCompatibilityScript('myExperienceSidecol', 'myExperienceSidecol_html5');
		
		brightcove.createExperiences();
		
	} 
	this.change_video = function() {
		if (that.current_video != that.new_current_vid) {	
			
			$('#videoteaser_'+that.random+'_video_'+that.current_video).removeClass('aktiv');
			$('#videoteaser_'+that.random+'_select_'+that.current_video).show();
			
			$('#videoteaser_'+that.random+'_video_'+that.new_current_vid).addClass('aktiv');
			$('#videoteaser_'+that.random+'_select_'+that.new_current_vid).hide();	
			$('#videoteaser_'+that.random+'_preview').html(that.videos[that.new_current_vid].Bild_Gross);
			$('#videoteaser_'+that.random+'_dachzeile').html(that.videos[that.new_current_vid].Dachzeile);
			$('#videoteaser_'+that.random+'_ueberschrift').html(that.videos[that.new_current_vid].Ueberschrift);
			
			that.current_video = that.new_current_vid;
			statistikclick();
		}		
	};

};
