// cPlaylist Klasse
	function cPlaylist(titel, anmut, div) {
		this.titel		= titel;          	// Titel der Playlist
		this.anmut		= anmut;           	// Style des Themas für die Playlist
		this.div		= div;			// div ID des Elements, in dem alle Listen Elemente vorhanden sind
		this.videos		= new Array();		// beinhaltet alle Videos
		
			
		this.clear = function() {
			// leert den Inhalt des Playlist divs
			$("#"+this.div).empty();
		}
		
		this.addVideo = function(video, position) {
			// Video wird oben eingefügt, wenn der Param. first ist 
			if(position == "first") {
				this.videos.unshift(video);
			}
			else {
				this.videos.push(video);
			}
		}
		
		this.playVideo = function(video_obj, div_id, disable_count) {
			
			//setzt den Reiter "Player" der horizontalen Navigation auf "ausgewählt"
			changeVertical('player_tab');
			
			// ruft die Methode setVideo der cPlayer Klasse auf, und übergibt ein Video Objekt
			portalPlayer.setVideo(video_obj, div_id, this.titel);
			
			//#2019
			if(portalPlayer.videos_played > 0 && (disable_count!=true || preroll_video && portalPlayer.videos_played > 1 && portalPlayer.preroll_var_check_cnt == 5)) video_obj.count();
			
			// Kategorie-Box hoch-sliden
			$("#kat_box").slideUp("slow");
			
			// HTML Element (div)
			var pl = document.getElementById("Playlist");
			
			// setzt die Style class aller Kind-Elemente, die sich in der Playlist befinden, auf playlist_element
			for(var i = 0; i < pl.childNodes.length; i++) {
				//IE Schreibweise
				//pl.childNodes[i].setAttribute("className", "playlist_element", 0);
				//FF Schreibweise
				//pl.childNodes[i].setAttribute("class", "playlist_element", 0);
				
				// funktioniert in beiden Browsern
				var attr = document.createAttribute("class");
				attr.nodeValue = "playlist_element";
				pl.childNodes[i].setAttributeNode(attr);
				
				var attr2 = document.createAttribute("name");
				attr2.nodeValue = "";
				pl.childNodes[i].setAttributeNode(attr2);
			}
			
			// dann wird die Style class des angeklicktes Elements geändert
				//IE Schreibweise
				//pl.childNodes[div_id].setAttribute("className", "playlist_element_selected", 0);
				//FF Schreibweise
				//pl.childNodes[div_id].setAttribute("class", "playlist_element_selected", 0);
			
				// funktioniert in beiden Browsern
				var class_attr = document.createAttribute("class");
				class_attr.nodeValue = "playlist_element_selected";
				pl.childNodes[div_id].setAttributeNode(class_attr);
				
				var name_attr = document.createAttribute("name");
				name_attr.nodeValue = "selected";
				pl.childNodes[div_id].setAttributeNode(name_attr);
				
				
		}
		
		this.changeElementStyle = function(div, event) {
			var attr = document.createAttribute("class");
			if(event == "over") {
				attr.nodeValue = "playlist_element_selected";
				div.setAttributeNode(attr);
			} 
			if(event == "out") {
				node = div.getAttribute("name");
				//alert(node);
				if(node != "selected") {
					attr.nodeValue = "playlist_element";
					
					div.setAttributeNode(attr);
				}
			}
		}
		
		this.show = function(div) {
			// erzeugt alle DIV Container innerhalb der Playlist
			for(var i = 0; i < this.videos.length; i++) {

				var global_kmdig_target_count				=  this.videos[i].mediaDigg;
				var global_kmdig_target_id				=  this.videos[i].mediaId;
				var global_kmdig_votingpoints				=  this.videos[i].votingPoints;
				var global_kmdig_unique_string				= 'kmdig_' + global_kmdig_target_package + '_' + global_kmdig_target_id; //unique string
                        	
				
				//document.getElementById('video_titel').innerHTML = this.videos[i].linkName;
				//document.getElementById('video_description').innerHTML = this.videos[i].mediaDescription;
				//document.getElementById('video_diggs').innerHTML = this.videos[i].linkId;
				
			
								
				var html = '<div class="playlist_element" onmouseover="playList.changeElementStyle(this, \'over\')" onmouseout="playList.changeElementStyle(this, \'out\')">';
					html += '<div name="left_div" style="position: absolute; left:7px; top:7px; width:120px; height:82px; ">';
						html += '<a href="javascript:playList.playVideo(playList.videos['+i+'], '+i+');"><img src="' + this.videos[i].linkAnmodpic32 + '" border="0" width="120" height="80"></a>';
					html += '</div>';
					html += '<div name="right_div" style="position: absolute; left:136px; top:7px; width:183px; height:82px;">';
						html += '<div style="position: absolute; left:0px; top:0px; width:183px; font-family:Trebuchet MS,Verdana,Arial,Helvetica; font-weight:bold; font-size:12px;">';
							html += this.videos[i].linkVorleger;
						html += '</div>';
						html += '<div style="position: absolute; left:0px; top:20px; width:183px; height:41px; font-family:Verdana,Arial,Helvetica,Trebuchet MS; font-size:10px; overflow:hidden">';
							html += this.videos[i].linkAnreisser;
						html += '</div>';
						html += '<div style="position: absolute; width:183px; height:21px; left:0px; top:60px; font-family:Verdana,Arial,Helvetica,Trebuchet MS; font-size:9px; color:#999999;">';
							html += '<div style="position: relative; width:21px; height:21px; float:left;">';
								html += '<a href="javascript:playList.playVideo(playList.videos['+i+'], '+i+');"><img src="'+global_image_path+'gfx/button_play.png" border="0"></a>';
							html += '</div>';
							html += '<div style="position: relative; height:9px; left:3px; top:4px; float:left">';
								html += this.videos[i].mediaVideoTime;
							html += '</div>';
							html += '<div id="'+global_kmdig_unique_string+'_diggs" style="position: absolute; visibility:hidden;">'+global_kmdig_target_count+'</div>';
							//html += '<div id="'+global_kmdig_unique_string+'_diggs_points" style="position: absolute; visibility:hidden;">'+global_kmdig_votingpoints+'</div>';
							html += '<div id="'+global_kmdig_unique_string+'_diggs_average" name="'+global_kmdig_unique_string+'_diggs_average" style="position: relative; height:9px; left:5px; top:-3px; float:left"></div>';
							/*html += '<div style="position: relative; width:20px; height:100%; float:left">';
								html += '<img src="http://www.krone.at/hps/client/krone/layout/kmprog/anmut/all/kmdiggs/zustimmen.gif">';
							html += '</div>';*/
							//html += '<div style="position: relative; width:100px; height:100%;left:3px; top:4px; float:left">';
							//	html += '<div style="float:left">&nbsp;|&nbsp;</div><div id="'+global_kmdig_unique_string+'_diggs_list" style="float:left;">'+global_kmdig_target_count+'</div>&nbsp;Stimmen';
							//html += '</div>';
						html += '</div>';
					html += '</div>';
				html += '</div>';
				
				// aus dem String ein HTML Element "erzeugen"
				var elem = $(html);
				
				// Element in den Playlist Container einfügen
				$(elem).appendTo(div);
				
				//var avg = getAveragePoints(global_kmdig_unique_string+"_diggs", global_kmdig_unique_string+"_diggs_points");
				var avg = getAveragePoints(this.videos[i].mediaDigg, this.videos[i].votingPoints);
				
				// wenn bewerten erlaubt
				if(this.videos[i].linkVideodiggs == true) {
					// DIV mit den Sternen neu befüllen
					var div_elements = document.getElementsByName(global_kmdig_unique_string+'_diggs_average');
					$(div_elements).rater('none.file', {maxvalue:global_voting_maxval, style: 'basic', curvalue:avg, obj:i, allowTextSet:false, object_id:global_kmdig_target_id});
				}
			}
		// jScrollPane initialisieren
		//$("#Playlist").jScrollPane();
		}		
	}
