//matrix.js for channel 4185 / widget 845131 / cols 4 / rows 12 / skin clean 
// Widget standard js for yubby
// NOT based on prototype or jquery - cause it must be lightweight and cant interfere with host

/**
 *	htmlspecialchars - like its php counterpart
 *	@author rvw
 *	@since 08-03-2010 12:19
 */
function htmlspecialchars(string) {
	string = string.toString();
	string = string.replace(/&/g, '&amp;');    
	string = string.replace(/</g, '&lt;').replace(/>/g, '&gt;');
	string = string.replace(/"/g, '&quot;');
	// single quote.. string = string.replace(/'/g, '&#039;');
	return string;
}

//------------ tween.js ----------------------
function Delegate() {}
Delegate.create = function (o, f) {
	var a = new Array() ;
	var l = arguments.length ;
	for(var i = 2 ; i < l ; i++) a[i - 2] = arguments[i] ;
	return function() {
		var aP = [].concat(arguments, a) ;
		f.apply(o, aP);
	}
}

Tween = function(obj, prop, func, begin, finish, duration, suffixe){
	this.init(obj, prop, func, begin, finish, duration, suffixe)
}
var t = Tween.prototype;

t.obj = new Object();
t.prop='';
t.func = function (t, b, c, d) { return c*t/d + b; };
t.begin = 0;
t.change = 0;
t.prevTime = 0;
t.prevPos = 0;
t.looping = false;
t._duration = 0;
t._time = 0;
t._pos = 0;
t._position = 0;
t._startTime = 0;
t._finish = 0;
t.name = '';
t.suffixe = '';
t._listeners = new Array();	
t.setTime = function(t){
	this.prevTime = this._time;
	if (t > this.getDuration()) {
		if (this.looping) {
			this.rewind (t - this._duration);
			this.update();
			this.broadcastMessage('onMotionLooped',{target:this,type:'onMotionLooped'});
		} else {
			this._time = this._duration;
			this.update();
			this.stop();
			this.broadcastMessage('onMotionFinished',{target:this,type:'onMotionFinished'});
		}
	} else if (t < 0) {
		this.rewind();
		this.update();
	} else {
		this._time = t;
		this.update();
	}
}
t.getTime = function(){
	return this._time;
}
t.setDuration = function(d){
	this._duration = (d == null || d <= 0) ? 100000 : d;
}
t.getDuration = function(){
	return this._duration;
}
t.setPosition = function(p){
	this.prevPos = this._pos;
	var a = this.suffixe != '' ? this.suffixe : '';
	this.obj[this.prop] = Math.round(p) + a;
	this._pos = p;
	this.broadcastMessage('onMotionChanged',{target:this,type:'onMotionChanged'});
}
t.getPosition = function(t){
	if (t == undefined) t = this._time;
	return this.func(t, this.begin, this.change, this._duration);
};
t.setFinish = function(f){
	this.change = f - this.begin;
};
t.geFinish = function(){
	return this.begin + this.change;
};
t.init = function(obj, prop, func, begin, finish, duration, suffixe){
	if (!arguments.length) return;
	this._listeners = new Array();
	this.addListener(this);
	if(suffixe) this.suffixe = suffixe;
	this.obj = obj;
	this.prop = prop;
	this.begin = begin;
	this._pos = begin;
	this.setDuration(duration);
	if (func!=null && func!='') {
		this.func = func;
	}
	this.setFinish(finish);
}
t.start = function(){
	this.rewind();
	this.startEnterFrame();
	this.broadcastMessage('onMotionStarted',{target:this,type:'onMotionStarted'});
	//alert('in');
}
t.rewind = function(t){
	this.stop();
	this._time = (t == undefined) ? 0 : t;
	this.fixTime();
	this.update();
}
t.fforward = function(){
	this._time = this._duration;
	this.fixTime();
	this.update();
}
t.update = function(){
	this.setPosition(this.getPosition(this._time));
	}
t.startEnterFrame = function(){
	this.stopEnterFrame();
	this.isPlaying = true;
	this.onEnterFrame();
}
t.onEnterFrame = function(){
	if(this.isPlaying) {
		this.nextFrame();
		setTimeout(Delegate.create(this, this.onEnterFrame), 0);
	}
}
t.nextFrame = function(){
	this.setTime((this.getTimer() - this._startTime) / 1000);
	}
t.stop = function(){
	this.stopEnterFrame();
	this.broadcastMessage('onMotionStopped',{target:this,type:'onMotionStopped'});
}
t.stopEnterFrame = function(){
	this.isPlaying = false;
}

t.continueTo = function(finish, duration){
	this.begin = this._pos;
	this.setFinish(finish);
	if (this._duration != undefined)
		this.setDuration(duration);
	this.start();
}
t.resume = function(){
	this.fixTime();
	this.startEnterFrame();
	this.broadcastMessage('onMotionResumed',{target:this,type:'onMotionResumed'});
}
t.yoyo = function (){
	this.continueTo(this.begin,this._time);
}

t.addListener = function(o){
	this.removeListener (o);
	return this._listeners.push(o);
}
t.removeListener = function(o){
	var a = this._listeners;	
	var i = a.length;
	while (i--) {
		if (a[i] == o) {
			a.splice (i, 1);
			return true;
		}
	}
	return false;
}
t.broadcastMessage = function(){
	var arr = new Array();
	for(var i = 0; i < arguments.length; i++){
		arr.push(arguments[i])
	}
	var e = arr.shift();
	var a = this._listeners;
	var l = a.length;
	for (var i=0; i<l; i++){
		if(a[i][e])
		a[i][e].apply(a[i], arr);
	}
}
t.fixTime = function(){
	this._startTime = this.getTimer() - this._time * 1000;
}
t.getTimer = function(){
	return new Date().getTime() - this._time;
}
Tween.backEaseIn = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*(t/=d)*t*((s+1)*t - s) + b;
}
Tween.backEaseOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
}
Tween.backEaseInOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158; 
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
Tween.elasticEaseIn = function(t,b,c,d,a,p){
		if (t==0) return b;  
		if ((t/=d)==1) return b+c;  
		if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) {
			a=c; var s=p/4;
		}
		else 
			var s = p/(2*Math.PI) * Math.asin (c/a);
		
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	
}
Tween.elasticEaseOut = function (t,b,c,d,a,p){
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
	}
Tween.elasticEaseInOut = function (t,b,c,d,a,p){
	if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) var p=d*(.3*1.5);
	if (!a || a < Math.abs(c)) {var a=c; var s=p/4; }
	else var s = p/(2*Math.PI) * Math.asin (c/a);
	if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
}

Tween.bounceEaseOut = function(t,b,c,d){
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
}
Tween.bounceEaseIn = function(t,b,c,d){
	return c - Tween.bounceEaseOut (d-t, 0, c, d) + b;
	}
Tween.bounceEaseInOut = function(t,b,c,d){
	if (t < d/2) return Tween.bounceEaseIn (t*2, 0, c, d) * .5 + b;
	else return Tween.bounceEaseOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}

Tween.regularEaseIn = function(t,b,c,d){
	return c*(t/=d)*t + b;
	}
Tween.regularEaseOut = function(t,b,c,d){
	return -c *(t/=d)*(t-2) + b;
	}

Tween.regularEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t + b;
	return -c/2 * ((--t)*(t-2) - 1) + b;
	}
Tween.strongEaseIn = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}
Tween.strongEaseOut = function(t,b,c,d){
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
	return c/2*((t-=2)*t*t*t*t + 2) + b;
	}

//======= end tween.js
// pgstats - poor mans page statistics.. 
// NOT based on prototype or jquery - cause it must be lightweight

// // get our script src, to know our baseurl so we can call home
// var pgstatsScriptSource = (function(scripts) {
//     var scripts = document.getElementsByTagName('script'),
//         script = scripts[scripts.length - 1];	// at ths very moment, we are the last script guaranteed
// 
//     if (script.getAttribute.length !== undefined) {
//         return script.src
//     }
// 
//     return script.getAttribute('src', -1)
// }());

var pgstats= {
	browser: navigator.userAgent,
	uid: '',
	scr: screen.width.toString()+'x'+screen.height.toString(),
	url: document.URL,
	referrer: document.referrer,
	ecollect: {},
	baseurl: 'http://www.yubby.com/',	// pgstatsScriptSource.substr(0,pgstatsScriptSource.lastIndexOf('/pgstats/')),
	init: function() {
		if (!(this.uid=this.readCookie('pgstats'))) {
			this.uid= Math.round(Math.random() * 2147483647).toString();
			this.uid+= Math.round(Math.random() * 2147483647).toString();
			this.createCookie('pgstats',this.uid,365*2);
		}
	}, 
	xPageHit: function () {
		var xhReq=this.createXMLHttpRequest();
		if (!xhReq)
			return 'ERR:xhReq';	// forget it..
		if (!this.baseurl)
			return 'ERR:baseurl';	// forget it..
		xhReq.open('get',this.baseurl+'pgstats/tick?'+this.collectInfo(),true);
		// xhReq.onreadystatechange = function() {
		//     if (xhReq.readyState != 4)  { return; }
		//     var serverResponse = xhReq.responseText;
		//     alert(serverResponse);
		// };
		xhReq.send();
		return 'OK';
	},
	collectInfo: function() {
		var rv;
		rv='ts=' + new Date().getTime();
		//rv+='&br='+this.encURI(this.browser);
		rv+='&uid='+this.uid;
		rv+='&url='+this.encURI(this.url);
		rv+='&refer='+this.encURI(this.referrer);
		//rv+='&ssrc='+this.encURI(this.baseurl);
		rv+='&scr='+this.scr;
		for (i in this.ecollect) {
			rv+='&'+i+'='+this.encURI(this.ecollect[i]);
		}

		return rv;
	},
	addcollect: function(key,val) {
		this.ecollect[key]=val;
	},
	//------- helper functions ----------
	createCookie: function (name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	},
	readCookie: function(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	},
	eraseCookie: function(name) {
		createCookie(name,"",-1);
	},
	encURI: function(url) {
		//return encodeURIComponent(url);	// forgets to encode a lot of chars. Useless
		var s = escape(url);	// this is the most complete one, however forgets to encode star, slash, @ and +
		s = s.replace(/\*/g,"%2A");
		s = s.replace(/\//g,"%2F");
		s = s.replace(/\@/g,"%40");
		s = s.replace(/\+/g,"%2B");
		return s;
	},
	createXMLHttpRequest: function() {
  		try { return new XMLHttpRequest(); } catch(e) {}
		try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
		try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}
		return null;
	}
}
pgstats.init();
//pgstats.addcollect('vid','234234');
//pgstats.xPageHit();
var isIE = /MSIE ((5\.5)|[6])/.test(navigator.userAgent) && navigator.platform == "Win32";

var cvids_845131= new Array();	// channelvideo's
var curvid_845131=0;			// first video
var cpvideo_845131=false;		// false=thumb, true=video

// in IE, you need to declare these before the vp_createwg is called, otherwise they do not exist in the onclick context
var matrix845131_curpg=1;
var matrix845131_npages=1;
var matrix845131_itemspp=48;

var wgElm_845131 = document.getElementById('viidoo_matrix_845131');
if (wgElm_845131) {
	// we exist!
	// hide 
	//wgElm_845131.innerHTML = 'x';
	//wgElm.style.display = 'none';
	//....
	vp_createwg();
}

pgstats.addcollect('chid','4185');
pgstats.addcollect('hit','embed');
pgstats.addcollect('widget','matrix');
pgstats.xPageHit();

function vp_createwg() {
	var html='<div id="widget_flash_845131" class="widget_flash" style="width: 688px;height:1230px;overflow:hidden; border: 0px solid #DDDDDD;font-family:Trebuchet MS,Lucida Sans Unicode,Lucida Grande,Lucida Sans,Tahoma,Geneva,Arial,helvetica,sans-serif">';
	//html+='<link rel="stylesheet" href="http://www.yubby.com/css/main.css" type="text/css" media="screen" title="x" charset="utf-8" />';
	// silly IE needs a br before style element
	html+='<br style="display:none;"/><style type="text/css">	\
		.stdthumb {width:160px;max-height:122px;background:#f6f6f6;margin:0 auto 6px auto;overflow:hidden;position:relative;}	\
		.stdthumbbrd {width:156px;height:86px;background:#cccccc;border:2px solid #dedede;overflow:hidden;position:relative;}	\
		.stdthumbbrd .stbdimg {position:absolute;width:160px;height:119px;top:-20px;left:0;}	\
		.stdthumbbrd .smallroundaction	{position: absolute; width:24px;height:24px;z-index:200;cursor:pointer;cursor:hand;}	\
		.stdthumbbrd .bigplay	{position: absolute; width:24px;height:24px;top:28px;left:68px;z-index:200;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/media_play24.png) no-repeat;} \
		.stdthumbbrd .inlinetitle 	{position: absolute; bottom: 0px; left: 0px;width:156px;height:15px;z-index:200;background-color:#dedede;color:#000000;font-size:11px;overflow:hidden;white-space: nowrap;padding:2px 5px 2px 3px;filter: alpha(opacity=80);filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80);-moz-opacity: 0.80; opacity: 0.80;} \
		.stdthumbbrd .thumbavatar	{position: absolute; top: 2px; left:2px;z-index:300;} 	\
		.pages {padding:2px 0 2px 8px; margin:0; height:clear:both;font-size:12px;	line-height:14px; -moz-user-select: none;-khtml-user-select: none; user-select: none;} \
			.pages div.pageblock {float:left;border: 1px solid #888; color:#000; height: 14px; padding: 3px 6px 3px 6px; margin: 0px 4px 0px 0px;cursor: pointer;cursor:hand;}\
			.pages div.pageblock:hover {color:#D10101;text-decoration:underline;}	\
			.pages div.pageblock_disabled {float:left;border: 1px solid #888; color: #aaa; height: 14px; padding: 3px 6px 3px 6px;margin: 0px 4px 0px 0px;}\
			.pages div.pageblock_dots {float:left; border: 0px solid #888; color: #000; height: 14px; padding: 3px 6px 3px 6px;margin: 0px 4px 0px 0px;}\
			.pages div.pageblock_curpage {float:left; border: 1px solid #888; color: #aaa; height: 14px; padding: 3px 6px 3px 6px;margin: 0px 4px 0px 0px;}\
		</style>';
		cvids_845131.push({vid:58465, thumb: 'http://a.images.blip.tv/Gleonhard-ANewCulturalEconomyGerdLeonhardFuturistAtArsElectronica836-155.jpg', title: 'A new cultural economy: Gerd Leonhard, Futurist, at Ars Electronica 2008', desc: '\n\nFuturist Gerd Leonhard on the Future of Copyright, Content, Artists \& Fans, Part of the 2008 Ars Electronica Symposium  Details here: http://www.mediafuturist.com/2008/09/a-new-cultural.html  and  here: http://www.mediafuturist.com/2008/11/crowd-sourced-v.html\n\n'});
	cvids_845131.push({vid:69292, thumb: 'http://a.images.blip.tv/Gleonhard-FuturetalksInterviewWithFuturistGerdLeonhard157-619.jpg', title: 'Futuretalks: Interview with Futurist Gerd Leonhard', desc: '\n\nFrom IT/Media Conversations : http://tinyurl.com/5w6l8f  Auguts 2007 50 minutesOn The Future of Media: Gerd Leonhard expands on the key topics introduced in his first book \"The Future of Music\" while escalating the debate out of the music realm and into media at large. He addresses the single most important issue underlying many debates about the future of media: who controls what, why, when, and where, and how can digital content still generate revenues when most of the traditional ways of controlling its flow ( i.e., distribution) are no longer available. Interviewed by Ralph Simon \n\n'});
	cvids_845131.push({vid:69301, thumb: 'http://ak2.static.dailymotion.com/static/video/294/371/6173492:jpeg_preview_large.jpg?20071205170503', title: 'Future Talks: Communication and Conversation', desc: 'Glen Hiemstra (futurist.com) and Gerd Leonhard (mediafuturist.com) speak with Ralph Simon about the future of communication and conversation in this episode of the Future Talks series on the Media Conversations channel of The Conversations Network.'});
	cvids_845131.push({vid:69313, thumb: 'http://i.ytimg.com/vi/Ql7BsmUeogM/0.jpg', title: 'Mobile Monday Amsterdam Futurist Gerd Leonhard: Mobile Content Futures (Part 1)', desc: 'This is part 1 of Gerd Leonhard\'s presentation at Mobile Monday in Amsterdam, March 30, 2009. Gerd talks about where mobile Media \& Entertainment is going, the trend towards open platforms and collaborative ecosystems, the need for filters and curators, advertising 2.0, the digital music flat rate, and much more. See the details and PDF at my blog tinyurl.com and here www.mobilemonday.nl'});
	cvids_845131.push({vid:69314, thumb: 'http://i.ytimg.com/vi/uAvaTKU0gbU/0.jpg', title: 'Discussion on DRM: Gerd Leonhard at the Commonwealth Club', desc: 'Excerpts from a panel called \"Digital Rights and Wrongs\", March 2007 at the Commonwealth Club in San Francisco, Filmed by Fora.tv - a good summary of discussions around the good old subject of DRM (Digital Rights Management). Gerd Leonhard (that\'s me ;), Ted Cohen, Richard French, and others. My favorite bottom-line: DRM creates non-compliance. Go to www.fora.tv for the whole session.'});
	cvids_845131.push({vid:69315, thumb: 'http://i.ytimg.com/vi/hJvGFqrLrkg/0.jpg', title: 'Effie Seminars Greece 2008 - Gerd Leonhard', desc: 'Effie Seminars Greece 2008 - Gerd Leonhard'});
	cvids_845131.push({vid:69317, thumb: 'http://i.ytimg.com/vi/vzAf7pU7_FU/0.jpg', title: 'Penny For Your Thought - Gerd Leonhard', desc: 'Challenge your assumptions'});
	cvids_845131.push({vid:69320, thumb: 'http://i.ytimg.com/vi/iom-yqIXBV0/0.jpg', title: 'Gerd Leonhard op NPOX08 (deel 7)', desc: 'Gerd Leonhard (Swi) is Media Futurist. Volgens hem zijn we slechts 1 a 2 jaar verwijderd van een generatie die \u00b4af en toe online\u00b4 is, naar een generatie die \u00b4nooit meer off-line\u00b4 is. In zijn verhaal the end of control and the people formerly known as Consumers, laat hij zien wat de gevolgen zijn van deze verschuiving op het gebied van economie, cultuur en media en wat de trends en uitdagingen zijn voor de toekomst.'});
	cvids_845131.push({vid:58463, thumb: 'http://a.images.blip.tv/Gleonhard-FuturetalksInterviewWithFuturistGerdLeonhard157-619.jpg', title: 'Futuretalks: Interview with Futurist Gerd Leonhard', desc: '\n\nFrom IT/Media Conversations : http://tinyurl.com/5w6l8f  Auguts 2007 50 minutesOn The Future of Media: Gerd Leonhard expands on the key topics introduced in his first book \"The Future of Music\" while escalating the debate out of the music realm and into media at large. He addresses the single most important issue underlying many debates about the future of media: who controls what, why, when, and where, and how can digital content still generate revenues when most of the traditional ways of controlling its flow ( i.e., distribution) are no longer available. Interviewed by Ralph Simon \n\n'});
	cvids_845131.push({vid:69300, thumb: 'http://a.images.blip.tv/Gleonhard-GerdLeonhardAtPicnic08Music20AndTheNewMusicEconomy879-479.jpg', title: 'Gerd Leonhard at Picnic 08: Music 2.0 and the New Music Economy', desc: '\n\nI had the pleasure of speaking at the annual PICNIC conference in Amsterdam, on September 25, 2008, on the topic of \"A New Music Ecosystem- Future Models for Music Creation, Distribution, Marketing and Selling\". The details: \"The music industry is changing. Artists and developers everywhere are working on new ways of connecting fans and bands and developing new businesses along the way. In this PICNIC Special, the future of the music industry will be presented by keynote speaker and Media Futurist Gerd Leonhard, followed by four exciting case studies from start-ups and artists. Hosted by the Music Center the Netherlands, the afternoon will be moderated by the most passionate Dutch new media \& music lover, Erwin Blom.\"   This was a fun event, and Erwin did a great job hosting it, the only drawback being that it was somewhat a bit on the sidelines of this really super-interesting conference, and it also felt a bit like the real \'action\' is no longer anywhere close to the digital music turf. For me, the most interesting 2 companies that presented after I did \'my thing\' were Twones and TribeofNoise.  Check them out. Below is  the link to the PDF with most of my presentation (8 MB, 42 pages) gerd_leonhard_new_music_economy_at_picnic_2008_ams.pdf  Download the Music2.0 book here... btw;)The video was shot and encoded by Hessel van Oorschot, CEO of TribeofNoise, credit is also given to http://www.evideo.tv  Thanks Hessel! \n\n'});
	cvids_845131.push({vid:69307, thumb: 'http://a.images.blip.tv/Gleonhard-TheFutureOfMusicMediaGerdLeonhardAtPlugg2009665-106.jpg', title: 'The Future of Music \& Media: Gerd Leonhard at Plugg 2009', desc: '\n\nFuturist Gerd Leonhard presents his vision on The Future of Music \& Media at the Plugg 2009 Conference, addressing topics such as copyright vs usage right, the flat rate for digital music, convergence, mobility, the new digital content economy, advertising 2.0, compensation not control, and much more. Details at http://tinyurl.com/d9ew4a  Plugg 2009 was a great event - lots of great speakers and conversations; one of the best conferences I\'ve been to in the past 9 months. Here is the PDF with my presentation; this deck actually includes some slides that I was not able to actually show due to timing constraints: Future of Media Gerd Leonhard @ Plugg 2009 PDF 15MBYou can use #plugg to find twitter updates on Plugg (btw I\'m @gleonhard). If you liked my talk at Plugg, please feel free to connect with me:  *but be sure to mention the Plugg connection. Thanks. Check out another ~30 slideshare decks here, videos are here (Blip.tv - download to iPod, too). If that\'s not enough to keep you busy for a while... here is more Free Content from me;)\n\n'});
	cvids_845131.push({vid:69318, thumb: 'http://a.images.blip.tv/Whereisitgoing-WiiGWithTwitterGlenHiemstraGerdLeonhardAnswerYourTweet194.png', title: 'WiiG with Twitter: Glen Hiemstra \& Gerd Leonhard answer your tweeted questions', desc: '\nWe (Futurist Glen Hiemstra and Media Futurist Gerd Leonhard) recently started a brand-new project entitled Where Is It Going (WiiG). The concept is simple: we are taking questions from anyone, via Twitter, on any future-related topic, and we will record 5-8 minute long videos of Glen and myself attempting to answer as many questions as we can, on a weekly basis. We will also add a few other futurists from our network once we have solved a few technical issues. We have also started discussions with a potential partner that will help us with producing better videos -stay tuned. This is how you can participate in WhereIsItGoing (WiiG):Be sure to follow @gleonhard and @glenhiemstra on TwitterTweet your futuristic questions to us, anytime, but be sure to use the hashtag #wiig (this way we can find your questions via Twitter Search, no matter if you addressed them to us or not)If you want your tweets to be included on the live video of the twitter stream (#wiig) please be sure to tweet at 9 am PST / 12 noon EST / 6pm CET /12 midnight Singapore, and follow the live tweets via twitter search; we will publish the finished video on WhereIsItGoing.com soon afterwards. We will be on the tweet streams for at least 20 minutes.\n'});
	cvids_845131.push({vid:69321, thumb: 'http://i.ytimg.com/vi/abTxVRjiADk/0.jpg', title: 'Future Talks: The Long Tail', desc: 'Glen Hiemstra (futurist.com) and Gerd Leonhard (mediafuturist.com) speak with host Ralph Simon about the future of the long tail in this episode of the Future Talks series on the Media Conversations channel of The Conversations Network. ... future talks gerd leonhard glen hiemstra media conversations entertainment networkfuture network long tail '});
	cvids_845131.push({vid:69322, thumb: 'http://i.ytimg.com/vi/dBFWNrKNDHY/0.jpg', title: 'Gerd Leonhard', desc: ''});
	cvids_845131.push({vid:58461, thumb: 'http://i.ytimg.com/vi/aUrj7CJ0CUs/0.jpg', title: 'Gerd Leonhard Tech Talk at Google London', desc: 'Gerd Leonhard is a Music \& Media Futurist, Author, Speaker, Advisor, and Digital Media Entrepreneur. The Wall Street Journal calls Gerd one of the leading media futurists in the world. He is the Co-Author of the influential book \"The Future of Music\" (2005, Berklee Press), as well as the author of \"Music2.0\" (released 2/2008 www.music20book.com), and of \"Open is King - The Future of Media beyond Control\" (late 2008).'});
	cvids_845131.push({vid:69296, thumb: 'http://www.yubby.com/util/fetchurl?http%3A%2F%2F1.gvt0.com%2FThumbnailServer2%3Fapp%3Dvss%26contentid%3De4d578aaf20d4571%26offsetms%3D340000%26itag%3Dw160%26hl%3Dnl%26sigh%3Ddr03qaMhVEnLmlxVMlDm8tKYLQU', title: ' Media Futurist Keynote at Canadian Music Week 2007: End of Control', desc: 'This is part 1 of Gerd\&#39;s Keynote at Canadian Music Week 2007, in Toronto, Canada, Gerd speaks on The Future of Music, recorded at Canadian ...'});
	cvids_845131.push({vid:69297, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/298/904/29890402_640.jpg', title: 'PICNIC \'09: The Future of Social Media with Gerd Leonhard', desc: 'Media guru Gerd Leonhard shares his vision of the future of social media. His presentation delves into the world of social broadcasting and explores the changing landscape of consumer communications.\n\nPICNIC \'09 - Amsterdam\nSeptember 23-25, 2009'});
	cvids_845131.push({vid:69309, thumb: 'http://i.ytimg.com/vi/73uM-rzwSUQ/0.jpg', title: 'Gerd Leonhard at CMW, Part 4', desc: 'Music \& Media Futurist Gerd Leonhard\'s Keynote Speech at CMW, 9 March 2007, Part 4 of 4.'});
	cvids_845131.push({vid:69319, thumb: 'http://i.ytimg.com/vi/RjEUICrbpIM/0.jpg', title: 'Video Mediapark Jaarcongres 2009 The future of media Gerd Leonhard', desc: 'The future of media door Gerd Leonhard. Video Gerd Leonhard verteld over de nieuwste ontwikkelingen en toekomst voor media. Data is de nieuwe olie'});
	cvids_845131.push({vid:69324, thumb: 'http://i.ytimg.com/vi/1Xoc9MaCOlU/0.jpg', title: 'what does the future hold3', desc: 'gerd leonhard interview ... gerd leonhard media futurist web 2.0 rostant advertising seminar '});
	cvids_845131.push({vid:69302, thumb: 'http://images.vimeo.com/49/05/12/49051208/49051208_200x150.jpg', title: 'MIDEM 2008: Interview de Gerd LEONHARD - Auteur de \"The Futur of Music\"', desc: 'Interview\u00e9 par Sylvie K, Gerd Leonard est LE sp\u00e9cialiste de la \"Music 2.0\" aux US. Ils nous donnent son avis sur ce qui se passent actuellement sur le march\u00e9...\nSon sentiment sur le music business\nLes difficult\u00e9s entre les diffuseurs et les producteurs et pourquoi ils n\'arrivent pas encore \u00e0 travailler main dans la main\nFacebook n\'est pas pr\u00e9sent au MIDEM contrairement \u00e0 iLike\nLe message qu\'il veut faire passer aux professionnels de la musique\nQuels acteurs vont dispara\u00eetre en 2008?\n'});
	cvids_845131.push({vid:69311, thumb: 'http://a.images.blip.tv/Gleonhard-PennyForYourThoughtsGerdLeonhardChallengeYourAssumptions853-442.jpg', title: 'Penny for your Thoughts: Gerd Leonhard: Challenge your assumptions', desc: '\nProduced by Freedom Lab in Amsterdam (see http://tinyurl.com/dxcxu8) this is nice video that juxtaposes some sound bytes from an interview with me with some cool graphics, ticker-text animations, and illustrations. Topics: mostly about media and the future of content. Distribution is no longer a business for media companies. Why Open Licensing is so important. The move from selling copies to selling access - how will that be monetized? How will content be curated, recommended and then... monetized by the Creators? See more details at http://www.mediafuturist.com/content_20/ \n'});
	cvids_845131.push({vid:69312, thumb: 'http://a.images.blip.tv/Gleonhard-ProtectingOurContentTheFutureOfArtistsAudiencesPart3365-533.jpg', title: 'Protecting our Content? The Future of Artists \& Audiences (Part 3)', desc: '\n\nPart 3 of an edited version of my presentation for the Scottish Arts Council in Edinburgh, October 22, 2008   This event, Partnerships 2.0, set out to explore how to develop audiences for the arts, film and the wider creative industries by maximising (Web 2.0) technology and new partnerships. This part is focusing on the issue of protecting content. Special thanks to the Scottish Arts Council for making a great video - and for inviting me! \n\n'});
	cvids_845131.push({vid:58468, thumb: 'http://ak2.static.dailymotion.com/static/video/175/162/6261571:jpeg_preview_large.jpg?20071211043554', title: 'Future Talks: The Long Tail', desc: 'Glen Hiemstra (futurist.com) and Gerd Leonhard (mediafuturist.com) speak with host Ralph Simon about the future of the long tail in this episode of the Future Talks series on the Media Conversations channel of The Conversations Network.'});
	cvids_845131.push({vid:69299, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/952/983/9529839_640.jpg', title: 'Mobile Content Futures_Gerd Leonhard at Mobile Monday, Amsterdam...', desc: 'Pay close attention as our friend Gerd Leonard looks at the telecom industry and how it relates to digital media going forward. Very exhilarating.\n\n- DigitalN8tive '});
	cvids_845131.push({vid:69316, thumb: 'http://a.images.blip.tv/EComm-TheFutureOfContentTelecomsFlatRateContentBundlesAndSo235-64-212.jpg', title: 'The Future of Content \& Telecoms (Gerd Leonhard)', desc: '\nCorresponding Slides:http://www.slideshare.net/eCommConf/gerd-leonhards-presentation-at-ecomm-2009 Subscribe to Blog:http://eCommMedia.com/blog \n'});
	cvids_845131.push({vid:58460, thumb: 'http://a.images.blip.tv/Gleonhard-CompensationNotControlTheFutureOfMusicGerdLeonhardsKey250-962.jpg', title: 'Compensation not Control - the Future of Music! Gerd Leonhard\'s Keynote at MidemNet 2009', desc: '\n\nThis is the official video of my presentation and speech at the annual MidemNet event in Cannes / France, on January 17, 2009. The topics: why the music industry needs to license the Internet just like it has licensed Radio (i.e. with a collective license), why criminalizing the users \& fans will not work - and why those efforts should be re-directed in creating a new, Music 2.0 ecosystem that actually produces revenues, where those new revenues will come from, and how the music flat rate - music like water - would work. See my blog for more details and the PDF of this presentation. The MidemNet blog is hereMy free book, Music 2.0, is here, btw.\n\n'});
	cvids_845131.push({vid:58467, thumb: 'http://images.vimeo.com/49/05/12/49051208/49051208_200x150.jpg', title: 'MIDEM 2008: Interview de Gerd LEONHARD - Auteur de \"The Futur of Music\"', desc: 'Interview\u00e9 par Sylvie K, Gerd Leonard est LE sp\u00e9cialiste de la \"Music 2.0\" aux US. Ils nous donnent son avis sur ce qui se passent actuellement sur le march\u00e9...\nSon sentiment sur le music business\nLes difficult\u00e9s entre les diffuseurs et les producteurs et pourquoi ils n\'arrivent pas encore \u00e0 travailler main dans la main\nFacebook n\'est pas pr\u00e9sent au MIDEM contrairement \u00e0 iLike\nLe message qu\'il veut faire passer aux professionnels de la musique\nQuels acteurs vont dispara\u00eetre en 2008?\n'});
	cvids_845131.push({vid:69290, thumb: 'http://i.ytimg.com/vi/aUrj7CJ0CUs/0.jpg', title: 'Gerd Leonhard Tech Talk at Google London', desc: 'Gerd Leonhard is a Music \& Media Futurist, Author, Speaker, Advisor, and Digital Media Entrepreneur. The Wall Street Journal calls Gerd one of the leading media futurists in the world. He is the Co-Author of the influential book \"The Future of Music\" (2005, Berklee Press), as well as the author of \"Music2.0\" (released 2/2008 www.music20book.com), and of \"Open is King - The Future of Media beyond Control\" (late 2008).'});
	cvids_845131.push({vid:69298, thumb: 'http://ak2.static.dailymotion.com/static/video/175/162/6261571:jpeg_preview_large.jpg?20071211043554', title: 'Future Talks: The Long Tail', desc: 'Glen Hiemstra (futurist.com) and Gerd Leonhard (mediafuturist.com) speak with host Ralph Simon about the future of the long tail in this episode of the Future Talks series on the Media Conversations channel of The Conversations Network.'});
	cvids_845131.push({vid:69303, thumb: 'http://a.images.blip.tv/Gleonhard-MobileContentFuturesGerdLeonhardAtMobileMondayAmsterdam126-175.jpg', title: 'Mobile Content Futures: Gerd Leonhard at Mobile Monday Amsterdam', desc: '\n\nDownload Mobile Content Future Gerd Leonhard Momo Amsterdam Public 15 MB PDFEvent details here. Twitter back-channel here. Some predictions: the next 18 months \u2022 Twitter will reach 50 Million + Users \u2022 Facebook will become the default social utility - and the biggest global Content Broadcaster \u2022 Google will double it\u2019s Advertising revenues \u2022 The RIAA and the IFPI will run out of cash \u2022 Telecoms will get flat-rate content licenses \u2022 Skype will re-emerge as content player \n\n'});
	cvids_845131.push({vid:69304, thumb: 'http://ak2.static.dailymotion.com/static/video/846/714/5417648:jpeg_preview_large.jpg?20071016170024', title: 'Future Talks: Media Megatrends', desc: 'Glen Hiemstra and Gerd Leonhard talk about the important megatrends that are shaping the future of media.  They discuss a number of topics, including user generated content and media, globalization, access versus ownership, copyright versus usage right, the digital natives, the net generation and the aging of the baby boomers, the growth in wireless broadband and mobility, convergence, the decline of the hit culture, the rise of the ubiquity paradigm and much more.'});
	cvids_845131.push({vid:69305, thumb: 'http://s4.mcstatic.com/thumb/3082459/11101893/4/catalog_item5/0/1/future_conferences_will_be_open_gerd_leonhard.jpg', title: 'Future Conferences Will Be Open - Gerd Leonhard', desc: 'http://tinyurl.com/future-of-conferences - Media futurist Gerd Leonhard preaches a new open format for conferences to remove the separation between presenterd and audienced. Live events will follow a bottom-down approach and be more participatory.  Distributed by Tubemogul.'});
	cvids_845131.push({vid:69308, thumb: 'http://i.ytimg.com/vi/Dak3qBE3kQ0/0.jpg', title: 'Interview with Gerd Leonhard at PICNIC 2009', desc: 'www.ejc.net Gerd Leonhard is a media futurist, blogger, digerati, writer, speaker and advisor. He has spent over twenty-five years in the technology and entertainment industries, both in the US as well as in Europe, and recently in Asia. Gerd writes about the impact that new technologies have on content and the media industry. The Wall Street Journal calls Gerd \u02bbone of the leading Media Futurists in the World\u02bc. He is the Co-Author of the influential book \u02bbThe Future of Music\u02bc (2005, Berklee ...'});
	cvids_845131.push({vid:69310, thumb: 'http://i.ytimg.com/vi/sEbVhgJAeGU/0.jpg', title: 'Gerd Leonhard Music \& Media Futurist Interview', desc: 'Arirang TV interviews Gerd Leonhard, Seoul / Korea, September 2006, on The Future of Music (in English)'});
	cvids_845131.push({vid:58466, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/377/021/3770211_640.jpg', title: 'The Future - Gerd Leonhard Tech Talk at Google London', desc: 'Topics: \"The Media Industry is in total upheaval due to the Internet - it took a lot longer than anticipated but it\'s now even more disruptive than we ever imagined. New and rapidly emerging cultural practices fueled by technology are erupting all around us: creators and users are both going direct (and overlap, too!),  \'Feels like Free\' has become the standard for music and video, complete fragmentation of audiences threatens many incumbent media business models, and Search now is Media.  And finally, the Social Web may be alleviating the need for advertising as we knew it: brands can now pull the people formerly known as consumers with ads that are or feel like content, \'meet\' and befriend users directly and engage them rather than enrage them with meaningless banners or TV spots. What would a web-native media ecosystem look like, and what will this mean for Marketing, Branding and Advertising?  In a world where listening to / watching anything equals copying, downloading or receiving content, where access replaces ownership, how will content creators generate revenues? Is \'Control\' over media needed in order to monetize it, and if not, what are the alternatives? Will everything be free, wholly supported by Advertising and Up-selling?'});
	cvids_845131.push({vid:69295, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/435/282/4352826_640.jpg', title: 'The Future Of Music And Media', desc: 'Gerd Leonhard, Media Futurist - Author \& Futurist'});
	cvids_845131.push({vid:69306, thumb: 'http://ak2.static.dailymotion.com/static/video/303/027/5720303:jpeg_preview_large.jpg?20071106142056', title: 'Future Talks: The Future of Advertising', desc: 'Glen and Gerd discuss how online advertising will continue to grow in the future. They review some possible ways to do this, including how Google is already working to better get the advertiser\'s message across to the user.'});
	cvids_845131.push({vid:58469, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/435/282/4352826_640.jpg', title: 'The Future Of Music And Media', desc: 'Gerd Leonhard, Media Futurist - Author \& Futurist'});
	cvids_845131.push({vid:69293, thumb: 'http://l.yimg.com/a/i/us/sch/cn/v/v4/w396/1532105_320_240.jpeg?x=100\&y=70\&sig=ngy3paMBs6rxXxdt69hgTQ--', title: 'Future Talks: Entertainment and Media', desc: 'Glen Hiemstra (futurist.com) and Gerd Leonhard (mediafuturist.com) speak with host Ralph Simon about the future of entertainment and media in this episode of the...'});
	cvids_845131.push({vid:58462, thumb: 'http://l.yimg.com/a/i/us/sch/cn/v/v3/w767/1310689_100_70.jpeg', title: 'Future Talks: Media Megatrends', desc: 'Glen Hiemstra and Gerd Leonhard talk about the important megatrends that are shaping the future of media.  They discuss a number of topics, including user generated...'});
	cvids_845131.push({vid:69323, thumb: 'http://i.ytimg.com/vi/sKNpUdTzpYE/0.jpg', title: 'Protecting Content? The Future of Artists \& Audiences', desc: 'Edinburgh, October 22, 2008 This event, Partnerships 2.0, set out to explore how to develop audiences for the arts, film and the wider creative industries by maximising (Web 2.0) technology and new partnerships. This part is focusing on the issue of protecting content. Special thanks to the Scottish Arts Council for making a great video - and for inviting me! ... gerd leonhard arts council media privacy future longtail engagement conversation futurist futurism end of control web20 media20 ...'});
	cvids_845131.push({vid:58464, thumb: 'http://i.ytimg.com/vi/YMN6Ib1MpdY/0.jpg', title: 'The Future of Music and Media Gerd Leonhard at Plugg 2009 Part 1', desc: 'Futurist Gerd Leonhard presents his vision on The Future of Music \& Media at the Plugg 2009 Conference, addressing topics such as copyright vs usage right, the flat rate for digital music, convergence, mobility, the new digital content economy, advertising 2.0, compensation not control, and much more. This is part 1. Details at tinyurl.com'});
	cvids_845131.push({vid:58470, thumb: 'http://a.images.blip.tv/Gleonhard-MobileContentFuturesGerdLeonhardAtMobileMondayAmsterdam126-175.jpg', title: 'Mobile Content Futures: Gerd Leonhard at Mobile Monday Amsterdam', desc: '\n\nDownload Mobile Content Future Gerd Leonhard Momo Amsterdam Public 15 MB PDFEvent details here. Twitter back-channel here. Some predictions: the next 18 months \u2022 Twitter will reach 50 Million + Users \u2022 Facebook will become the default social utility - and the biggest global Content Broadcaster \u2022 Google will double it\u2019s Advertising revenues \u2022 The RIAA and the IFPI will run out of cash \u2022 Telecoms will get flat-rate content licenses \u2022 Skype will re-emerge as content player \n\n'});
	cvids_845131.push({vid:69294, thumb: 'http://a.images.blip.tv/Gleonhard-ANewCulturalEconomyGerdLeonhardFuturistAtArsElectronica836-155.jpg', title: 'A new cultural economy: Gerd Leonhard, Futurist, at Ars Electronica 2008', desc: '\n\nFuturist Gerd Leonhard on the Future of Copyright, Content, Artists \& Fans, Part of the 2008 Ars Electronica Symposium  Details here: http://www.mediafuturist.com/2008/09/a-new-cultural.html  and  here: http://www.mediafuturist.com/2008/11/crowd-sourced-v.html\n\n'});
	cvids_845131.push({vid:69291, thumb: 'http://a.images.blip.tv/Gleonhard-CompensationNotControlTheFutureOfMusicGerdLeonhardsKey250-962.jpg', title: 'Compensation not Control - the Future of Music! Gerd Leonhard\'s Keynote at MidemNet 2009', desc: '\n\nThis is the official video of my presentation and speech at the annual MidemNet event in Cannes / France, on January 17, 2009. The topics: why the music industry needs to license the Internet just like it has licensed Radio (i.e. with a collective license), why criminalizing the users \& fans will not work - and why those efforts should be re-directed in creating a new, Music 2.0 ecosystem that actually produces revenues, where those new revenues will come from, and how the music flat rate - music like water - would work. See my blog for more details and the PDF of this presentation. The MidemNet blog is hereMy free book, Music 2.0, is here, btw.\n\n'});
	html+='<div id="cvideos845131">';
	html+='</div>';	// widget_flash
	
	wgElm_845131.innerHTML=html;
	wgElm_845131.style.display = 'block';
	gotopage_845131(matrix845131_curpg);	// 1
}


// find absolute top loc of object
function vp_offsetTop(obj) {
    curtop = 0;
    if (obj.offsetParent) {
    curtop = obj.offsetTop
    while (obj = obj.offsetParent) {
      curtop += obj.offsetTop
    }
  }
  return curtop;
}

function vp_offsetLeft(obj) {
  curtop = 0;
  if (obj.offsetParent) {
    curtop = obj.offsetLeft;
    while (obj = obj.offsetParent) {
      curtop += obj.offsetLeft;
    }
  }
  return curtop;
}

// flash jscalls

// stop video
function stopVideo_845131() {
	closevid_845131();
}

// show hoverevent
function showVideoInfo(videoitem_id) {
	// alert('Show some information for ' + videoitem_id + '.');
}


function hideVideoInfo() {
	// alert('hide');
}



function closeVideoPlayer_845131() {
	// close screen
	closevid_845131();
	// call to flash object
	//getFlashObject("videostrip_845131").videoDeselect(0);
}


function closevid_845131() {
  el = document.getElementById('vidplayer_845131');
  if (el) {
    el.parentNode.removeChild(el);
  } 
}

//
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}



function playVideo_845131(videoitem_id) {

	// close old one
	closevid_845131();

	// open new
	//var vidlist = document.getElementById(id);
	var video_div = document.createElement('div');
	var title='hello';
	video_div.id = "vidplayer_845131";
	video_div.style.position = 'absolute';
	video_div.style.border = 'none';
	var base_width=400;
	var base_height=300;
	var calc_width	= (base_width+2*17+10);
	var calc_height	= (base_height+16+2*22);
	
	video_div.style.width = calc_width+'px';
	video_div.style.height = calc_height+'px';
	video_div.style.zIndex = '10000';
	//video_div.style.border = "5px solid #cccccc";
	
	//
	//	var wgFlashDiv=document.getElementById('widget_flash_845131');
	//	//var top = vp_offsetTop(wgElm_845131);
	//	//var left = vp_offsetLeft(wgElm_845131);
	//	var top = vp_offsetTop(wgFlashDiv);
	//	var left = vp_offsetLeft(wgFlashDiv);
	//
	//	// left or right
	//	if (left < document.body.clientWidth/2) {
	//		if (4==1) {
	//			video_left = left + 172;	// one column play right from strip
	//			top = top - 3;
	//		}
	//		else {
	//			video_left = left + 40; // multicolum play inside strip
	//			top=top+40;
	//		}
	//	} else {
	//		// widget is at the right
	//		video_left = left + 4*172 - 40 - 402 - 2*17 ; // 402 plus borders 2x17 
	//	}

	//alert('video_left='+video_left+' top='+top);
	//video_div.style.top = top + 'px';
	//video_div.style.left = video_left + 'px';
	// CENTER SCREEN
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	var video_top = arrayPageScroll[1] + ((arrayPageSize[3] -calc_height) / 2);
	var video_left = arrayPageScroll[0] +((arrayPageSize[0] - calc_width) / 2);
	if (video_top<0)
		video_top=0;
	if (video_left<0)
		video_left=0;
	video_div.style.position = 'absolute';
	video_div.style.top = video_top + 'px';
	video_div.style.left = video_left + 'px';

	 
	var vid_html = '<div style="padding:0px 5px 0px 5px;position:relative;">\
					<table cellspacing=0 cellpadding=0 border=0 style="margin:0px auto; background:transparant;width:100%;table-layout:fixed;position:relative;z-index:0">\
					<tr><td style="background:url(http://www.yubby.com/img/rbox/rbox5_01.png) no-repeat left top;padding:0;margin:0;width: 17px;height:22px;"></td>\
						<td style="background:url(http://www.yubby.com/img/rbox/rbox5_02.png) repeat-x top;height:22px;padding:0;margin:0;"></td>\
						<td style="background:url(http://www.yubby.com/img/rbox/rbox5_03.png) no-repeat left top;width: 17px;height:22px;padding:0;margin:0;"></td></tr>\
					<tr><td style="background:url(http://www.yubby.com/img/rbox/rbox5_04.png) no-repeat left top;width: 17px;background-color:#FFF;max-height:54px;padding:0;margin:0;" height=54 >\
					</td>\
					<td style="background:url(http://www.yubby.com/img/rbox/rbox5_05.png) repeat-x top;background-color:#fff; overflow:hidden;padding:0;margin:0;">\
					<div style="color:#DDDDDD;position:relative;border:1px solid transparent;overflow:hidden;height:318px;width:400px;background-color:transparent;padding:0;margin:0;">';
	vid_html +='<iframe name="playerframe" class="playerframe"	src = "http://www.yubby.com/widget/playvideo/'+cvids_845131[videoitem_id].vid+'/402/318/S/W" width="100%" height="100%" frameborder=0 scrolling="no" allowtransparency="true"></iframe>';
	vid_html +=		'<div style="clear:both;"></div></div>\
					</td><td style="background:url(http://www.yubby.com/img/rbox/rbox5_06.png) no-repeat left top; 	width: 17px;  	background-color:#FFF;padding:0;margin:0;"></td></tr>\
					<tr><td style="background:url(http://www.yubby.com/img/rbox/rbox5_07.png) no-repeat left top;width: 17px;height:22px;padding:0;margin:0;"></td>\
						<td style="background:url(http://www.yubby.com/img/rbox/rbox5_08.png) repeat-x top; height:22px;padding:0;margin:0;"></td>\
						<td style="background:url(http://www.yubby.com/img/rbox/rbox5_09.png) no-repeat left top;width:17px;height:22px;padding:0;margin:0;"></td></tr>\
					</table>\
					<div onclick="closeVideoPlayer_845131();" style="position:absolute;top:13px;right:11px;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/icon_bw_close22.png) no-repeat;width:24px;height:24px;z-index:10000;"></div>\
					</div>';
					
	video_div.innerHTML=vid_html;
	document.body.appendChild(video_div);
}

//----------------------------------------- pagination -------------------------------------

function initpage_845131() {
	//alert('cvids='+(cvids_845131.length).toString()+'itemspp='+matrix845131_itemspp);
	matrix845131_npages= Math.ceil(cvids_845131.length / matrix845131_itemspp);
}

function gotopage_845131(pg) {
		
	//if (!matrix845131_npages)
	initpage_845131();
	
	if (pg<1)
		pg=1;
	if (pg>matrix845131_npages)
		pg=matrix845131_npages;
		
	oldpg=matrix845131_curpg;
	matrix845131_curpg=pg;
	var mxs=document.getElementById('cvideos845131');
	var html='';
	for (var i=(matrix845131_curpg-1)*matrix845131_itemspp,cv=0;i<cvids_845131.length && cv<matrix845131_itemspp;i++) {
		html+=  vidthumbhtmlSmall_845131(i);
		cv++;
	}
	html+=  '<div class="v69resetstyle" style="clear:both;"></div>';
	
			if (matrix845131_npages>1) {
			html+=  '<div  class="v69resetstyle" style="margin:1px 0px">'+paginationhtml_845131(matrix845131_curpg, matrix845131_npages)+'</div>';
		}
	
	mxs.innerHTML=html;
}

function vidthumbhtmlSmall_845131(vnr) {
	var html='';
	html='';
	html+='<div class="v69resetstyle" style="margin: 5px; float: left; position: relative; width: 162px; height: 90px;">';
		html+='<div  class="v69resetstyle" style="width:160px;max-height:122px;background:#f6f6f6;margin:0 auto 6px auto;overflow:hidden;position:relative;">';
			html+='<div  class="v69resetstyle" style="width:156px;height:86px;background:#cccccc;border:2px solid #dedede;overflow:hidden;position:relative;">';
				html+='<img style="position:absolute;width:160px;height:119px;top:-20px;left:0;cursor: pointer;" onclick="playVideo_845131('+vnr+')" title="'+htmlspecialchars(cvids_845131[vnr].desc)+'" src="'+cvids_845131[vnr].thumb+'" />';
				html+='<div class="v69resetstyle" style="position: absolute; width:24px;height:24px;top:28px;left:68px;z-index:200;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/media_play24.png) no-repeat;" onclick="playVideo_845131('+vnr+')"></div>';
				html+='<div class="v69resetstyle" style="position: absolute; bottom: 0px; left: 0px;width:156px;height:15px;z-index:200;background-color:#dedede;color:#000000;font-size:11px;overflow:hidden;white-space: nowrap;padding:2px 5px 2px 3px;filter: alpha(opacity=80);filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80);-moz-opacity: 0.80; opacity: 0.80;cursor: pointer;" onclick="playVideo_845131('+vnr+')" >'+htmlspecialchars(cvids_845131[vnr].title)+'</div>';
			html+='</div>';
		html+='</div>';
	html+='</div>';
	return html;
}

//-----------------------------------------------------------------------
// cp 1..npages
function paginationhtml_845131(cp,npages) {
	if (npages<=1)
		return '';	// empty if no pagination..
	var html='';
	html+='<div class="pages v69resetstyle">';
	if (cp>1) {
		// we CAN prev! beter ltlt ipv &#171; 
		html+= '<div class="pageblock" onclick="gotopage_845131('+(cp-1)+');">&lt;&lt; Previous</div>';
	}
	else {
		html+= '<div class="pageblock_disabled">&lt;&lt; Previous</div>';
	}
			// Available pages - Link
		var lpage = 1;
		var cpageSur = 2;
		var dotted = false;
		for (var lpage=1;lpage<=npages;lpage++) {
			// 1-2...8-9-[10]-11-12....58-59 
			if ( lpage<=2 || (lpage>=cp-4 && lpage<=cp+4) || lpage>=npages-1) {
				dotted = false;	// we need to dot afterwards
				if (lpage == cp )
					html+='<div class="pageblock_curpage"><b>'+lpage+'</b></div>';
				else
					html+='<div class="pageblock" onclick="gotopage_845131('+lpage+');">'+lpage+'</div>';
			}
			else {
				// no printing.. buttt maybe we need to dot
				if ( !dotted ) {
					html+='<div class="pageblock_dots">&nbsp;...&nbsp;</div>';
					dotted = true;
				}
			}
		}
		
	// Next page - Link
	// beter gtgt ipv &#187;
	if ( cp<npages )
		html+='<div class="pageblock" onclick="gotopage_845131('+(cp+1)+');">Next &gt;&gt;</div>';
	else
		html+='<div class="pageblock_disabled">Next &gt;&gt;</div>';
	html+='</div>';
	return html;
}



