	
		
		var videoEceId;
		var videoEceUrl;
		var videoEcePubId;
		var videoEceSecId;
		var videoEceTitle;
		var videoMfId;
		var videoPlayInt;
		var videoPlayTimeoutInt;
		var videoDartIds;
		var videoDartTimeoutInt;
		
		function startVideo( p_eceId, p_eceUrl, p_ecePubId, p_eceSecId, p_eceTitle, p_mfId ) {
			videoEceId = p_eceId;
			videoEceUrl = p_eceUrl;
			videoEcePubId = p_ecePubId;
			videoEceSecId = p_eceSecId;
			videoEceTitle = p_eceTitle;
			videoMfId = p_mfId;
	
			
			
			// Init DART callback
			initDartCallback();
			
			var bannerFrame = document.getElementById("videoBannerFrame");
			bannerFrame.src = staticDir + "/flashvideo/dartpos1.html";
			
			var bumperFrame = document.getElementById("videoBumperFrame");
			bumperFrame.src = staticDir + "/flashvideo/dartpos2.html";
			
			var closerFrame = document.getElementById("videoCloserFrame");
			closerFrame.src = staticDir + "/flashvideo/dartpos3.html";
			
			// Overall timeout
//videoPlayTimeoutInt = setTimeout("closePlayer()", 15000);
		}
		
		
		function initDartCallback() {
			videoDartIds = new Array();
			videoDartTimeoutInt = setTimeout("dartTimeout()", 2000);
		}
		
		function dartCallback(p_adid) {
			videoDartIds.push(p_adid);
			if (videoDartIds.length >= 3) {
				if (videoDartTimeoutInt) {
					clearTimeout(videoDartTimeoutInt);
					videoDartTimeoutInt = null;
				}
				playVideo();
			}
		}
		
		function dartTimeout() {
			if (videoDartTimeoutInt) {
				clearTimeout(videoDartTimeoutInt);
				videoDartTimeoutInt = null;
			}
			playVideo();
		}
		
		function playVideo() {
			var playlistUrl = "http://videocms.wegener.nl/cms/wegenerplaylist.php?clipid=" + videoMfId;
			for (var i = 0; i < videoDartIds.length; i++) {
				playlistUrl += "&" + videoDartIds[i];
			}
			videoPlayInt = setTimeout("doPlayVideo('" + playlistUrl + "')", 50);
		}
		
		function doPlayVideo(url) {
			videoPlayInt = null;
			var player = document.getElementById("mediaplayer");
			
			if (player.playClipList) {
				if (videoPlayTimeoutInt) {
					clearTimeout(videoPlayTimeoutInt);
					videoPlayTimeoutInt = null;
				}
				player.playClipList( url, videoEceUrl, videoEceId );
			}
			else {
				videoPlayInt = setTimeout("doPlayVideo('" + url + "')", 50);
			}
		}
		

		function logClipStarted( properties ) {
			if (properties.playlistitem == "clip") {
				var statsUrl = eaeLoggerUrl;
				if (statsUrl.substr(0, 7) != "http://") {
					if (statsUrl.substr(0, 1) != "/") statsUrl = "/" + statsUrl;
				}
				statsUrl += "?";
				statsUrl += "rt=1&";
				statsUrl += "objId=" + videoEceId + "&";
				statsUrl += "url=" + escape(videoEceUrl) + "&";
				statsUrl += "type=video&";
				statsUrl += "pubId=" + videoEcePubId + "&";
				statsUrl += "ctxId=" + videoEceSecId + "&";
				statsUrl += "cat=&";
				statsUrl += "meta=&";
				statsUrl += "title=" + escape(videoEceTitle) + "&";

				var now = new Date();
				statsUrl += "ord=" + now.getTime();
				
				var statsImg = document.getElementById("videoStatsImg");
				statsImg.src = statsUrl;
			}
		}
		
