//matrix.js for channel 15002 / widget 831458 / cols 3 / rows 8 
// 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://beta.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 wgElm_831458 = document.getElementById('viidoo_matrix_831458');
if (wgElm_831458) {
	// we exist!
	// hide 
	//wgElm_831458.innerHTML = 'x';
	//wgElm.style.display = 'none';
	//....
	vp_createwg();
}

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

function vp_createwg() {
	var html='<div id="widget_flash_831458" class="widget_flash" style="width: 516px;height:825px;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://beta.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://beta.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; clear:both;font-size:10px;} \
			.pages span.pageblock {border: 1px solid #888; color:#000; height: 12px; padding: 3px 3px 3px 3px;margin: 0px 4px 0px 0px;cursor: pointer;cursor:hand;}\
			.pages span.pageblock:hover {color:#D10101;text-decoration:underline;}	\
			.pages span.pageblock_disabled {border: 1px solid #888; color: #aaa; height: 12px; padding: 3px 3px 3px 3px;margin: 0px 4px 0px 0px;}\
			.pages span.pageblock_dots {border: 0px solid #888; color: #000; height: 12px; padding: 3px 3px 3px 3px;margin: 0px 4px 0px 0px;}\
			.pages span.pageblock_curpage {border: 1px solid #888; color: #aaa; height: 12px; padding: 3px 3px 3px 3px;margin: 0px 4px 0px 0px;}\
		</style>';
	
	html+='<div id="cvideos">';
	html+='<div id="76284" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/18ehjFAckfs/0.jpg\" alt=\'TEDxAMSTERDAM IN DE BAN VAN TECHNOLOGIE GURU KEVIN KELLY\' onClick=\"playVideo_831458(76284)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76284)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76284)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAMSTERDAM IN DE BAN VAN TECHNOLOGIE GURU KEVIN KELLY</div></div></div>';
html+='</div>'
html+='<div id="76521" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/GbDCKEaYa1k/0.jpg\" alt=\'TEDxAmsterdam Louise Vet: \'De Nieuwe wereld wordt beter\'\' onClick=\"playVideo_831458(76521)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76521)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76521)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam Louise Vet: \'De Nieuwe wereld wordt beter\'</div></div></div>';
html+='</div>'
html+='<div id="76519" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/HcdCqoqW5c0/0.jpg\" alt=\'TEDxAmsterdam Marcel Dicke: De knop moet om, we moeten aan de insecten.\' onClick=\"playVideo_831458(76519)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76519)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76519)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam Marcel Dicke: De knop moet om, we moeten aan de insecten.</div></div></div>';
html+='</div>'
html+='<div id="76048" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/9JzZu-vuTso/0.jpg\" alt=\'Kevin Kelly\' onClick=\"playVideo_831458(76048)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76048)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76048)\" style=\"cursor:pointer;cursor:hand;\" >Kevin Kelly</div></div></div>';
html+='</div>'
html+='<div id="76273" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/eDJosFpYpog/0.jpg\" alt=\'Interview Staatssecretaris Frans Timmermans op TEDxAmsterdam\' onClick=\"playVideo_831458(76273)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76273)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76273)\" style=\"cursor:pointer;cursor:hand;\" >Interview Staatssecretaris Frans Timmermans op TEDxAmsterdam</div></div></div>';
html+='</div>'
html+='<div id="76290" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/fZE-zVnikfk/0.jpg\" alt=\'TEDxAmsterdam Wubbo Ockels interview: ET bestaat! HD 1080P\' onClick=\"playVideo_831458(76290)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76290)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76290)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam Wubbo Ockels interview: ET bestaat! HD 1080P</div></div></div>';
html+='</div>'
html+='<div id="76272" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/0twdWfi_850/0.jpg\" alt=\'TEDxAmsterdam Prinses Mabel van Oranje pleit voor stap voor stap aanpak\' onClick=\"playVideo_831458(76272)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76272)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76272)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam Prinses Mabel van Oranje pleit voor stap voor stap aanpak</div></div></div>';
html+='</div>'
html+='<div id="76050" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/T01cIcgUQKY/0.jpg\" alt=\'Interview Gernout Erens (Wattcher)\' onClick=\"playVideo_831458(76050)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76050)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76050)\" style=\"cursor:pointer;cursor:hand;\" >Interview Gernout Erens (Wattcher)</div></div></div>';
html+='</div>'
html+='<div id="76049" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/lcFl5bPPBS8/0.jpg\" alt=\'TEDx valt voor onderzoek naar varkens\' onClick=\"playVideo_831458(76049)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76049)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76049)\" style=\"cursor:pointer;cursor:hand;\" >TEDx valt voor onderzoek naar varkens</div></div></div>';
html+='</div>'
html+='<div id="76289" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/MovaYWTfsMQ/0.jpg\" alt=\'TEDxAmsterdam Tony DiSanto: Paris Hilton een technologische hoogstandje?  HD 1080p!\' onClick=\"playVideo_831458(76289)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76289)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76289)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam Tony DiSanto: Paris Hilton een technologische hoogstandje?  HD 1080p!</div></div></div>';
html+='</div>'
html+='<div id="76288" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/Jwg3ILsE-YI/0.jpg\" alt=\'TEDXAMSTERDAM: HANS AARSMAN PLAATST DE WERELD IN EEN ANDER PERSPECTIEF\' onClick=\"playVideo_831458(76288)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76288)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76288)\" style=\"cursor:pointer;cursor:hand;\" >TEDXAMSTERDAM: HANS AARSMAN PLAATST DE WERELD IN EEN ANDER PERSPECTIEF</div></div></div>';
html+='</div>'
html+='<div id="75927" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/f6lczi7w2r0/0.jpg\" alt=\'Pleidooi tegen \' hoe dingen moeten\'\' onClick=\"playVideo_831458(75927)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(75927)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(75927)\" style=\"cursor:pointer;cursor:hand;\" >Pleidooi tegen \' hoe dingen moeten\'</div></div></div>';
html+='</div>'
html+='<div id="75928" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/FLd3RFmwBGA/0.jpg\" alt=\'Transsectoraal innoveren als sleutel tot succes\' onClick=\"playVideo_831458(75928)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(75928)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(75928)\" style=\"cursor:pointer;cursor:hand;\" >Transsectoraal innoveren als sleutel tot succes</div></div></div>';
html+='</div>'
html+='<div id="75931" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/1GaeLcdyT9Y/0.jpg\" alt=\'Jacob Gelt Dekker\' onClick=\"playVideo_831458(75931)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(75931)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(75931)\" style=\"cursor:pointer;cursor:hand;\" >Jacob Gelt Dekker</div></div></div>';
html+='</div>'
html+='<div id="76287" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/v4UAXCi0Ycw/0.jpg\" alt=\'TEDxAmsterdam 2009 BJARKE INGELS wil meer!\' onClick=\"playVideo_831458(76287)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76287)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76287)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam 2009 BJARKE INGELS wil meer!</div></div></div>';
html+='</div>'
html+='<div id="76268" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/WMr1uhj8WGs/0.jpg\" alt=\'TEDxAmsterdam: Indrukken van prominente gasten\' onClick=\"playVideo_831458(76268)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76268)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76268)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam: Indrukken van prominente gasten</div></div></div>';
html+='</div>'
html+='<div id="75932" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/DOnNkvSBc1Y/0.jpg\" alt=\'Frans Timmermans (Sociale Zaken)\' onClick=\"playVideo_831458(75932)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(75932)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(75932)\" style=\"cursor:pointer;cursor:hand;\" >Frans Timmermans (Sociale Zaken)</div></div></div>';
html+='</div>'
html+='<div id="76276" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/b6wi3ftSlFQ/0.jpg\" alt=\'Rabijn Soetendorp ontroert publiek TEDxAmsterdam\' onClick=\"playVideo_831458(76276)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76276)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76276)\" style=\"cursor:pointer;cursor:hand;\" >Rabijn Soetendorp ontroert publiek TEDxAmsterdam</div></div></div>';
html+='</div>'
html+='<div id="75933" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/GOlLp1lmruk/0.jpg\" alt=\'Interview Erik Huizer (TNO)\' onClick=\"playVideo_831458(75933)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(75933)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(75933)\" style=\"cursor:pointer;cursor:hand;\" >Interview Erik Huizer (TNO)</div></div></div>';
html+='</div>'
html+='<div id="76285" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/b_T0__birpc/0.jpg\" alt=\'TEDxAmsterdam  Round - up   Een eerste terugblik\' onClick=\"playVideo_831458(76285)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76285)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76285)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam  Round - up   Een eerste terugblik</div></div></div>';
html+='</div>'
html+='<div id="76283" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/HzpkRvuQdL4/0.jpg\" alt=\'Interview TEdxAms: Rabbijn Soetendorp over zijn emotionele voordracht\' onClick=\"playVideo_831458(76283)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76283)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76283)\" style=\"cursor:pointer;cursor:hand;\" >Interview TEdxAms: Rabbijn Soetendorp over zijn emotionele voordracht</div></div></div>';
html+='</div>'
html+='<div id="76282" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/Pvfa5l4JBqE/0.jpg\" alt=\'Prominente bezoekers over TEdxAmsterdam: Richard Krajicek\' onClick=\"playVideo_831458(76282)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76282)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76282)\" style=\"cursor:pointer;cursor:hand;\" >Prominente bezoekers over TEdxAmsterdam: Richard Krajicek</div></div></div>';
html+='</div>'
html+='<div id="76281" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/Ljd-7hr1r6g/0.jpg\" alt=\'TEDxAmsterdam Karsu Donmez: Nederland te klein voor talent Karsu Donmez\' onClick=\"playVideo_831458(76281)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76281)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76281)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam Karsu Donmez: Nederland te klein voor talent Karsu Donmez</div></div></div>';
html+='</div>'
html+='<div id="76278" style="float:left;position:relative;width:162px;height:90px;margin:5px;">';
html+='<div class=\"stdthumb\" ><div class=\"stdthumbbrd\"><img class=\"stbdimg\" src=\"http://i.ytimg.com/vi/GbDCKEaYa1k/0.jpg\" alt=\'TEDxAmsterdam Louise Vet: \'De Nieuwe wereld wordt beter\'\' onClick=\"playVideo_831458(76278)\" style=\"cursor:pointer;cursor:hand;\" /><div class=\"bigplay\" onClick=\"playVideo_831458(76278)\"></div><div class=\"inlinetitle\" onClick=\"playVideo_831458(76278)\" style=\"cursor:pointer;cursor:hand;\" >TEDxAmsterdam Louise Vet: \'De Nieuwe wereld wordt beter\'</div></div></div>';
html+='</div>'
html+='<div style="clear:both"></div>';
html+='</div>';	html+='</div>';
	wgElm_831458.innerHTML=html;
	wgElm_831458.style.display = 'block';
}


// 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_831458() {
	closevid_831458();
}

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


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



function closeVideoPlayer_831458() {
	// close screen
	closevid_831458();
	// call to flash object
	//getFlashObject("videostrip_831458").videoDeselect(0);
}


function closevid_831458() {
  el = document.getElementById('vidplayer_831458');
  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_831458(videoitem_id) {

	// close old one
	closevid_831458();

	// open new
	//var vidlist = document.getElementById(id);
	var video_div = document.createElement('div');
	var title='hello';
	video_div.id = "vidplayer_831458";
	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_831458');
	//	//var top = vp_offsetTop(wgElm_831458);
	//	//var left = vp_offsetLeft(wgElm_831458);
	//	var top = vp_offsetTop(wgFlashDiv);
	//	var left = vp_offsetLeft(wgFlashDiv);
	//
	//	// left or right
	//	if (left < document.body.clientWidth/2) {
	//		if (3==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 + 3*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://beta.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://beta.yubby.com/img/rbox/rbox5_02.png) repeat-x top;height:22px;padding:0;margin:0;"></td>\
						<td style="background:url(http://beta.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://beta.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://beta.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://beta.yubby.com/widget/playvideo/'+videoitem_id+'/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://beta.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://beta.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://beta.yubby.com/img/rbox/rbox5_08.png) repeat-x top; height:22px;padding:0;margin:0;"></td>\
						<td style="background:url(http://beta.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_831458();" style="position:absolute;top:13px;right:11px;cursor:pointer;cursor:hand;background:url(http://beta.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);
}




