//solo.js for channel 23821 / widget 9519 / WxH: 258x224 / skin: clean / vid: 0 / autoplay: N / matrix: Y 
// 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.dik.nl/',	// 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_9519= new Array();	// channelvideo's
var curvid_9519=0;			// first video
var cpvideo_9519=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 matrix_curpg=1;
var matrix_npages=1;


var butnext_mousein=false;
var butprev_mousein=false;
var butplay_mousein=false;
var butstop_mousein=false;
var butmatrix_mousein=false;

var imgNext_ov = new Image;
var imgNext_ou = new Image;
var imgNext_d  = new Image;
imgNext_ov.src="http://www.dik.nl//img/widget/solo/iconnext24ov.png";
imgNext_ou.src="http://www.dik.nl//img/widget/solo/iconnext24.png";
imgNext_d.src ="http://www.dik.nl//img/widget/solo/iconnext24d.png";

var imgPrev_ov = new Image;
var imgPrev_ou = new Image;
var imgPrev_d  = new Image;
imgPrev_ov.src="http://www.dik.nl//img/widget/solo/iconprev24ov.png";
imgPrev_ou.src="http://www.dik.nl//img/widget/solo/iconprev24.png";
imgPrev_d.src ="http://www.dik.nl//img/widget/solo/iconprev24d.png";

var imgPlay_ov = new Image;
var imgPlay_ou = new Image;
var imgPlay_d  = new Image;
imgPlay_ov.src="http://www.dik.nl//img/widget/solo/iconplay24ov.png";
imgPlay_ou.src="http://www.dik.nl//img/widget/solo/iconplay24.png";
imgPlay_d.src ="http://www.dik.nl//img/widget/solo/iconplay24d.png";

var imgStop_ov = new Image;
var imgStop_ou = new Image;
var imgStop_d  = new Image;
imgStop_ov.src="http://www.dik.nl//img/widget/solo/iconstop24ov.png";
imgStop_ou.src="http://www.dik.nl//img/widget/solo/iconstop24.png";
imgStop_d.src ="http://www.dik.nl//img/widget/solo/iconstop24d.png";

var imgMatrix_ov = new Image;
var imgMatrix_ou = new Image;
var imgMatrix_d  = new Image;
imgMatrix_ov.src="http://www.dik.nl//img/widget/solo/iconmatrix24ov.png";
imgMatrix_ou.src="http://www.dik.nl//img/widget/solo/iconmatrix24.png";
imgMatrix_d.src ="http://www.dik.nl//img/widget/solo/iconmatrix24d.png";

var wgElm_9519 = document.getElementById('viidoo_solo_9519');
if (wgElm_9519) {
	vp_createwg();
}

pgstats.addcollect('chid','23821');
pgstats.addcollect('hit','embed');
pgstats.addcollect('widget','solo');
pgstats.xPageHit();

function vp_createwg() {
	// silly IE needs BR
	var html='<br style="display:none;"/><style type="text/css">	\
				.v69resetstyle	{ -moz-box-sizing: content-box !important; } \
				</style>';
	html+='<div id="widget_flash_9519" class="widget_flash v69resetstyle" style="width: 258px;height:224px;overflow:hidden; border: 1px solid #DDDDDD;font-family:Trebuchet MS,Lucida Sans Unicode,Lucida Grande,Lucida Sans,Tahoma,Geneva,Arial,helvetica,sans-serif">';

	cvids_9519.push({vid:111952, thumb: 'http://i.ytimg.com/vi/Oc3menDPFs4/0.jpg', title: 'D66 TV-spot 2010', desc: 'De nieuwe D66-spot voor de zendtijd politieke partijen'});
	cvids_9519.push({vid:111951, thumb: 'http://i.ytimg.com/vi/E9psUiQmIrk/0.jpg', title: 'Wie wil met wie?', desc: 'Videoblog Alexander Pechtold, 31 mei 2010. Hij gaat in op het debat dat is ontstaan over de te vormen coalitie na 9 juni'});
	cvids_9519.push({vid:93507, thumb: 'http://i.ytimg.com/vi/wxO2hIoScpE/0.jpg', title: 'D66 Campagne-spot Hans van Mierlo 1966', desc: 'De allereerste reclamespot van D66 werd als zeer revolutionair gezien, door het feit dat Hans van Mierlo de kijker (kiezer) direct aankeek en aansprak'});
	cvids_9519.push({vid:98638, thumb: 'http://i.ytimg.com/vi/1SXkGvHZ-U4/0.jpg', title: 'D66 voor Amsterdam Anders JA', desc: 'D66 voor Amsterdam'});
	cvids_9519.push({vid:99020, thumb: 'http://i.ytimg.com/vi/gJz4H9sJXv8/0.jpg', title: 'Bustourdag 12 Amsterdam', desc: 'Op een regenachtige zondag reed de D66 bus naar Amsterdam. Daar flyerde Alexander Pechtold samen met D66 Amsterdam lijsttrekker Ageeth Telleman door het centrum.'});
	cvids_9519.push({vid:99019, thumb: 'http://i.ytimg.com/vi/9UzrOzpEE44/0.jpg', title: 'Stem 3 maart D66, Boris van der Ham-lijstduwer', desc: 'Op 3 maart zijn er gemeenteraadsverkiezingen. D66-Kamerlid Boris van der Ham is lijstduwer voor D66-Amsterdam. Als hij voldoende voorkeurstemmen krijgt dan is hij beschikbaar om duoraadslid te worden (een soort steunraadslid) en zal zo ook het woord kunnen voeren in de Amsterdamse gemeenteraad. Een voorkeurstem heeft dus zin. Zowel vanuit Den Haag als Amsterdam zal hij knokken voor een vrijzinniger Amsterdam! Onderwijs, werk, wonen en vrijheid.. het kan anders. Stem op 3 maart D66. Boris van der Ham, nummer 30 voor de centrale stad (en stadsdeel West)'});
	cvids_9519.push({vid:98965, thumb: 'http://a.images.blip.tv/Vincente-D66AgeethTillemanAlexanderPechtoldInAmsterdam671-864.jpg', title: 'Ageeth \&amp; Alexander Pechtold D66 in Amsterdam', desc: 'Ageeth Telleman presenteerde welke ideen uit de tientallen huiskamer bijeenkomst kwamen en waarom ze relevant zijn. Alexander Pechtold vertelde waarom hij deze ideeen waardeerde, hoe de huiskamer bijeenkomsten dankzij het CDA zijn ontstaan en hoe ze in D66 floreren. Dit was op 28 februari de laatste grote bijeenkomst van D66 voor de verkiezingen.'});
	cvids_9519.push({vid:99729, thumb: 'http://i.ytimg.com/vi/udBJe-EBgek/0.jpg', title: 'Ahu Sahin: Correcte overheid', desc: 'Goed beleid voor de stad. Het is de primaire taak van een gemeenteraadslid er voor zorg te dragen dat goed beleid wordt gemaakt voor de stad ahu correcte overheid'});
	cvids_9519.push({vid:98430, thumb: 'http://i.ytimg.com/vi/cfZreiXZkgo/0.jpg', title: 'Boris van der Ham, Lijstduwer D66  Amsterdam', desc: 'Boris is lijstduwer en Amsterdammer. Wat vind hij dat er anders moet in Amsterdam? Over ondernemersschap, onderwijs, grote projecten, verhouding 2e kamer/stad'});
	cvids_9519.push({vid:99727, thumb: 'http://i.ytimg.com/vi/jY3tLin9mvs/0.jpg', title: '3 maart Stemmen', desc: 'Gewoon doen... Dus stemmen! Stemmen \"3 maart\" Ahu Sahin Amsterdam D66 (lijst 6 nr: 4)'});
	cvids_9519.push({vid:98966, thumb: 'http://i.ytimg.com/vi/t7JIjMuNiYI/0.jpg', title: 'I Got A Feeling - Black Eyed Peas Lyrics (HQ) Free Download', desc: ''});
	cvids_9519.push({vid:98428, thumb: 'http://i.ytimg.com/vi/1SXkGvHZ-U4/0.jpg', title: 'D66 voor Amsterdam Anders JA', desc: 'D66 voor Amsterdam'});
	cvids_9519.push({vid:97414, thumb: 'http://i.ytimg.com/vi/--70YOTLrBE/0.jpg', title: 'd66 Amsterdam Nachtleven Ja ', desc: '.'});
	cvids_9519.push({vid:99728, thumb: 'http://i.ytimg.com/vi/30jjSXCqJ2Y/0.jpg', title: 'Ahu Sahin: Ondernemerschap', desc: 'Ruimte voor banen, ambitie, ondernemen en ondernemers \"ahu ondernemers\" \"Ruimte voor banen\" ambitie'});
	cvids_9519.push({vid:97993, thumb: 'http://i.ytimg.com/vi/3j73FLmgKSo/0.jpg', title: 'Ahu Sahin Gay Ja Nachtleven Ja', desc: '.'});
	cvids_9519.push({vid:97415, thumb: 'http://i.ytimg.com/vi/QodBeL7gZ6c/0.jpg', title: 'Duncan Stutterheim Nachtburgemeester', desc: '.'});
	cvids_9519.push({vid:99023, thumb: 'http://i.ytimg.com/vi/VOBnV4zewMc/0.jpg', title: 'Ageeth Telleman - D66', desc: 'www.ima-gin.com Mede mogelijk gemaakt door Pakhuis Zwijger. IMA-GIN is a concept development organization. We are aware of our own responsibility within our society. The focus lies on idea generation for new concepts, projects and events. We also support our partners in their day to day business of building, developing, maintaining and producing cultural projects on an international level. Our range of activities is as broad as needs to be, but tends to focus around three main clusters: events, production support and concept development. Due to their combination of backgrounds, networks and experience, most of their work brings together the worlds of Art, media design and entertainment. The initiative of Jameelah Wahoui\u00e9, who\'s vision is to improve the world as best we can. The company was founded in 2007 by highly motivated professionals from the worlds of cultural education, music \& dance and media development. Our international network of professionals, are all sharing IMA-gin\'s vision. IMA-GIN is derived from the word \"imagine\" for imagination has no limit and anything is possible.'});
	cvids_9519.push({vid:99022, thumb: 'http://i.ytimg.com/vi/OpiM6-1Ns1Q/0.jpg', title: 'd66techofficefinalversion.mp4', desc: 'Over de online campagne van D66 Amsterdam gemaakt door Wieske Ebben van het D66 Technology team. Zie verder op d66amsterdam.nl/technology'});
	cvids_9519.push({vid:99021, thumb: 'http://i.ytimg.com/vi/iVlbPCV6g2c/0.jpg', title: 'D66AmsterdamPPPavond', desc: 'D66 Amsterdam projectie'});
	cvids_9519.push({vid:97996, thumb: 'http://i.ytimg.com/vi/J4PrccPm1J8/0.jpg', title: ' Jan Paternotte na progay debat ', desc: '.'});
	cvids_9519.push({vid:98636, thumb: 'http://i.ytimg.com/vi/lj_Umn0S83o/0.jpg', title: 'VIDEO: Chat with @sebastiaancapel of @d66amsterdam 2grab ...', desc: 'More info about Seb at his site bit.ly If you\'d like to vote for more Seb in the City, then next Wednesday, March 3rd, get yourself to a polling station and vote for D66: number 7. More information on the Democrats66 in Amsterdam at d66amsterdam.nl #AT5 #in #at5 #in Share your adventures realtime with your friends moby.to'});
	cvids_9519.push({vid:97995, thumb: 'http://i.ytimg.com/vi/0FfBUiUxASw/0.jpg', title: 'Alexander Hammelburg Gay Ja', desc: '. '});
	cvids_9519.push({vid:97994, thumb: 'http://i.ytimg.com/vi/gZP-AVgPQ6s/0.jpg', title: 'Thijs over Nachtleven Ja ', desc: ' . '});
	cvids_9519.push({vid:93475, thumb: 'http://i.ytimg.com/vi/sQTtpE18q78/0.jpg', title: 'Ageeth Telleman plakt 1e poster ', desc: '.'});
	cvids_9519.push({vid:93506, thumb: 'http://i.ytimg.com/vi/jbd9epYkZH4/0.jpg', title: 'ivar Manuel - D66 Amsterdam Zeeburgereiland', desc: 'Ivar Manuel, fractievoorzitter van D66 in de Amsterdamse gemeenteraad. Mijn ambitie: kwalitatief goede woningen voor iedereen in Amsterdam. I'});
	cvids_9519.push({vid:93515, thumb: 'http://i.ytimg.com/vi/_2BT4HfGR2o/0.jpg', title: 'Lijstduwer Boris van der Ham', desc: '.'});
	cvids_9519.push({vid:97429, thumb: 'http://i.ytimg.com/vi/0FfBUiUxASw/0.jpg', title: 'Alexander Hammelburg Gay Ja', desc: '.'});
	cvids_9519.push({vid:94785, thumb: 'http://i.ytimg.com/vi/GaCL3UyHVvg/0.jpg', title: 'Ahu Sahin over IMC Weekendschool ', desc: '.'});
	cvids_9519.push({vid:93470, thumb: 'http://i.ytimg.com/vi/T5V-HAjZ7vY/0.jpg', title: 'Jan Paternotte - D66 Amsterdam', desc: '\n\nJan Paternotte, kandidaat D66 Amsterdam over zijn keuze voor D66, onderwijs etc.'});
	cvids_9519.push({vid:93505, thumb: 'http://i.ytimg.com/vi/2T1-vn9kn34/0.jpg', title: 'ivarwestrand', desc: 'Ivar Manuel, fractievoorzitter van D66 in de Amsterdamse gemeenteraad . Groenscheggen die de stad insteken, ze zijn uniek voor Amsterdam. Hier kunnen kinderen kennismaken met het boerenbedrijf, dat moeten we koesteren. '});
	cvids_9519.push({vid:93517, thumb: 'http://i.ytimg.com/vi/EXFn7uRYncg/0.jpg', title: 'Alexander Pechtold over Amsterdam ', desc: 'Alexander Pechtold werd ge\u00efnterviewd door Anne Breure.Zij vroeg hem naar zijn persoonlijke motivatie om lid van D66 te worden. Pechtold was te gast bij de campagne kick-off van D66 Amsterdam in Hotel Arena op 9 januari 2010'});
	cvids_9519.push({vid:93502, thumb: 'http://i.ytimg.com/vi/uSLq6qvxVsM/0.jpg', title: 'Sebastiaan Capel kandidaat gemeenteraad D66 Amsterdam.MOV', desc: 'Anne Breure ondervraagt Sebastiaan Capel over zijn motivatie om kandidaat gemeenteraad D66 Amsterdam te worden.'});
	cvids_9519.push({vid:94784, thumb: 'http://i.ytimg.com/vi/uGNNwipf_ig/0.jpg', title: 'Ahu Sahin D66 : Goed onderwijs voor elk kind in Amsterdam (1)', desc: 'OCO Onderwijsdebat met oa Ahu Sahin Kandidaat raadslid D66 Amsterdam. Onderwerpen voor dit debat zijn: onderwijskwaliteit, onderwijsaanbod, keuzevrijheid en segregatie.'});
	cvids_9519.push({vid:93472, thumb: 'http://i.ytimg.com/vi/vGT_gebaXWo/0.jpg', title: 'Floris Kreiken, kandidaat D66 Amsterdam over studenten, jongeren, kroegen en leven in Amsterdam', desc: 'Floris Kreiken, kandidaat D66 Amsterdam over studenten, jongeren, kroegen en leven in Amsterdam'});
	cvids_9519.push({vid:93471, thumb: 'http://i.ytimg.com/vi/nM_ujTP1dWI/0.jpg', title: 'Marjo Visser - D66 Amsterdam', desc: 'Marjo Visser kandidaat D66 Amsterdam over de woningmarkt'});
	cvids_9519.push({vid:93503, thumb: 'http://i.ytimg.com/vi/mXc61dGvP4o/0.jpg', title: 'Melanie van de Horst Vz Jonge Democraten Amsterdam', desc: 'Melanie wordt door Anne geinterviewed. Zij doet niet veel voor D66 maar heel veel voor  de Jonge Democraten waar zij voorzitter is. Wat gaan de jonge democraten doen tijdens de verkiezingen?'});
	cvids_9519.push({vid:93510, thumb: 'http://i.ytimg.com/vi/LiAsxmQ8hzc/0.jpg', title: 'D66 Amsterdam Centrum - Gerrit brunink', desc: 'Gerrit is de lijstrekker van D66 Amsterdam Centrum '});
	cvids_9519.push({vid:93508, thumb: 'http://i.ytimg.com/vi/IvoaONaeSuI/0.jpg', title: 'D66 Amsterdam Oost- Jeroen van Spijk', desc: 'Lijsttrekker Jeroen van Spijk over faciliteiten op ijburg met name voor jongeren'});
	cvids_9519.push({vid:93504, thumb: 'http://i.ytimg.com/vi/BOcf3mPCsbk/0.jpg', title: 'D66 Amsterdam Zuid ', desc: 'Alexander Scholtes lijsttrekker  Amsterdam Zuid! Waar staat Alexander voor?'});
	cvids_9519.push({vid:93512, thumb: 'http://i.ytimg.com/vi/i1x03PkySZw/0.jpg', title: 'D66-OZO Mart van de Wiel  ', desc: 'Mart van de Wiel. Alles over zijn mening over Zuidoost, de lijstverbinding, de grote problemen en de plannen van D66-OZO'});
	cvids_9519.push({vid:93516, thumb: 'http://i.ytimg.com/vi/tfu8lQBoRnE/0.jpg', title: 'Zoe Kwint lijsttrekker Noord', desc: 'Wat drijft haar?'});
	cvids_9519.push({vid:93511, thumb: 'http://i.ytimg.com/vi/DDEIzkNoA6A/0.jpg', title: 'D66 Amsterdam West - Ingeborg Baltussen', desc: 'Waar staat Ingeborg voor?  Lijsttrekker in West!'});
	cvids_9519.push({vid:93518, thumb: 'http://i.ytimg.com/vi/DqGztZP-tSU/0.jpg', title: 'D66 Amsterdam Petra Hoogerwerf', desc: 'Petra is momenteel lid van de gemeenteraad Amsterdam.'});
	cvids_9519.push({vid:93514, thumb: 'http://i.ytimg.com/vi/2tuzkW2Whac/0.jpg', title: 'met Boris van der Ham op stap', desc: 'Met politicus Boris van der Ham op Stap in Amsterdam, waar hij een en ander uitlegt over de politiek in Nederland.'});
	cvids_9519.push({vid:93500, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/362/574/36257488_640.jpg', title: 'Dutch Democrats 66 parliamentarian, Boris van der Ham MP, proposes amendments to Netherlands cannabis laws; Sept,2009', desc: 'THE EUROPEAN PARLIAMENT COMMITTEE on PETITIONS-Dec 01, 2009\nHEALTH 9. No. 590/2008 by N.M.M. (Amsterdamse-Ier) concerning the carrying of medicines by travellers in Europe. CM - PE 420.013 FdR 766642\nVIDEO of Session on EuroParl TV |http://bit.ly/4vEn8k\n SKIP to 16hr:05min:05sec \n\nas follows:\nREAD HERE THE LEGISLATIVE NOTA:\nhttp://www.d66.nl/d66nl/document/initiatiefnota_medicinale_cannabis/f=/vi91hvfx537d.pdf\n\nSEE HERE the original Press Release on this issue (Sept 2009):\nhttp://www.d66.nl/d66nl/nieuws/20090925/d66_presenteert_initiatiefnota?ctx=vghpm7u9vdea\n\nLetter delivered by petitioner to EuroParl (Comt\u00e9 PETi) Dec 01 2009, RE: HEALTH 9. No. 590/2008\n-\nBoris van der Ham MP, Binnenhof 1A\nDen Haag, The Netherlands - 1 December 2009\n\nRegarding: The medical use of cannabis\n\nDear Sir/Madam,\n\nToday the second part of the 2980th Council session of the European Union will take place. Health items will be addressed under the chair of Ms Maria Larsson and Mr G\u00f6ran H\u00e4gglund.  http://bit.ly/7Lqqdl\n\nI would like to take this opportunity to inform you about my initiative as a Member of Parliament in the Netherlands regarding the use of medical cannabis. In March 2003 a change of the Dutch law on controlled substances took effect. It included regulations for applications regarding the cultivation of Cannabis Sativa for medicinal purposes. \"Bureau Medicinale Cannabis\" (BMC), the Office of Medicinal Cannabis of the Dutch Health Ministry, acts as a government agency as determined by Article 23 and 28 of the United Nations Single Convention on Narcotic Drugs of 1961 as amended by the 1972 Protocol.\n\nBMC provides pharmacies with medicinal cannabis, so that patients can obtain it with a doctor\'s prescription. Doctors in the Netherlands are now permitted to prescribe cannabis to treat chronic pain, nausea and loss of appetite in cancer and HIV patients, to alleviate spasm pain for MS patients, and to reduce physical and verbal tics in people suffering from Tourette\'s Syndrome. The Dutch Ministry of health confirms that the scientific evidence justifies the use of medical cannabis for certain patients, as does, among others, the American Medical Association.\n\nAt this moment three varieties of cannabis, Bedrocan, Bedrobinol and Bediol, can be prescribed in the Netherlands. I want to double or triple the amount of varieties that can be prescribed, since differences in the chemical composition of cannabis varieties produce different effects in human beings. I also wish for a total refund for all patients relying on medical cannabis. Within a few months, the Dutch parliament will discuss these matters.\n\nI hope I have informed you sufficiently about the situation in the Netherlands.\n\nYours Faithfully,\n\nBoris van der Ham MP\nThe Netherlands Parliament\nDemocrats 66\n---\nToegankelijker medicinale cannabis\nKamerstuk, 20 november 2009 GMT-CB-U-2964361 \nFull Details Parliamentary initiative available at Ministry of Health, Wellbeing \& Sport website: \nhttp://www.minvws.nl/kamerstukken/gmt/2009/toegankelijker-medicinale-cannabis.asp\n-\nSECOND CHAMBER of the STATES\' GENERAL-ASSEMBLY\n32 159 Toegankelijker medicinale cannabis\nNr. 3 BRIEF VAN DE MINISTER VAN VOLKSGEZONDHEID, WELZIJN EN\nSPORT\n http://parlis.nl/pdf/kamerstukken/KST137615.pdf \n\n-  @Borisham  -  @D66  - @d66amsterdam -  \n'});
	cvids_9519.push({vid:93499, thumb: 'http://i.ytimg.com/vi/lNHLjq-G2WE/0.jpg', title: 'Roze Kerstmarkt, D66 Amsterdam', desc: 'D66 voerde campagne op de Roze Kerstmarkt (Reguliersdwarsstraat). D66 komt al jarenlang op voor holebi\'s in en buiten Amsterdam.'});
	cvids_9519.push({vid:93509, thumb: 'http://i.ytimg.com/vi/BQX7kNSYzbw/0.jpg', title: 'D66 Amsterdam Noord Zo\u00eb Kwint ', desc: 'www.myewall.nl/d66'});
	cvids_9519.push({vid:93501, thumb: 'http://i.ytimg.com/vi/JYpG1-sM1HA/0.jpg', title: '2000e lid D66 Amsterdam', desc: 'Na het 15.000e landelijke lid kon de Amsterdamse afdeling van D66 zijn 2000e lid verwelkomen in Artis. Op een dag vol campagneactiviteiten in het kader van de Europese verkiezingen namen partijvoorzitter Ingrid van Engelshoven en de Amsterdamse fractievoorzitter Ivar Manuel het nieuwe lid mee tijdens een werkbezoek in Artis. Bekijk hier het verslag!'});
	cvids_9519.push({vid:93474, thumb: 'http://i.ytimg.com/vi/sQTtpE18q78/0.jpg', title: 'Ageeth Telleman Posters', desc: 'Posters plakken op het Mr. Visserplein.'});
	cvids_9519.push({vid:93468, thumb: 'http://i.ytimg.com/vi/3zQ93diHRGY/0.jpg', title: 'D66 Amsterdam Rene van Veen', desc: 'Ren\u00e9 van Veen over D66, Amsterdam, Jordaan en Horeca'});
	cvids_9519.push({vid:93473, thumb: 'http://i.ytimg.com/vi/R7knhQddPgA/0.jpg', title: 'D66 Amsterdam Oost - Tanya Sancisi', desc: 'Tanya Sancisi D66 Amsterdam Oost over ontsluiting van ijburg nu.'});
html+='<div class="v69resetstyle" id="thumb_9519" style="width:258px;height:198px;background-color:#FFFFFF;position:relative;">';
html+=vidthumbhtml_9519(curvid_9519);
html+='</div>';
	html +='<div class="v69resetstyle" style="height:26px;width:258px;position:relative;background-color:#FFFFFF;">';
	html +='<div class="v69resetstyle" style="position:absolute;left:35px;top:3px;color:#444;font-size:11px;line-height:10px;cursor:pointer;width:185px;height:20px;overflow:hidden;" onclick="location.href=vidplayurl_9519();"><span style="color:#888;"></div>';
	html +='<img style="position:absolute;left:124px;top:0px;height:25px;z-index:5;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl/img/project/dik/logo.png" onclick="location.href=vidplayurl_9519();">';
		html +='<img onclick="showmatrix_9519(0);" style="position:absolute;left:5px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconmatrix24.png" title="overzicht van alle videos"  	id="pgmatrix_9519" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);"/>';
		html +='<img onclick="playprev_9519();" style="position:absolute;left:182px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconprev24.png" title="ga naar de vorige video in het kanaal"  		id="pgprev_9519" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstop_9519();" style="position:absolute;left:182px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconstop24.png" title="stop"  													id="pgstop_9519"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstart_9519();" style="position:absolute;left:206px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconplay24.png" title="afspelen"  									id="pgplay_9519"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	// start is now a toggle
	html +='<img onclick="playstartstop_9519();" style="position:absolute;left:206px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconplay24.png" title="afspelen"  									id="pgplay_9519"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='<img onclick="playnext_9519();" style="position:absolute;left:230px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconnext24.png" title="ga naar de volgende video in het kanaal"  	id="pgnext_9519"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='</div>';
	html+='</div>';
	wgElm_9519.innerHTML=html;
	wgElm_9519.style.display = 'block';
		updAllButState(); 
}

function playnext_9519() {
	if (curvid_9519 < cvids_9519.length -1 ) {
		curvid_9519++;
		if (cpvideo_9519)
			playstart_9519();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_9519');
			thumbdiv.innerHTML=vidthumbhtml_9519(curvid_9519);
		}
	}
	updAllButState();
}
function playprev_9519() {
	if (curvid_9519 >0 ) {
		curvid_9519--;
		if (cpvideo_9519)
			playstart_9519();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_9519');
			thumbdiv.innerHTML=vidthumbhtml_9519(curvid_9519);
		}
	}
	updAllButState();
}

function playstart_9519(vnr) {
	closepopup_9519();	// close popup (if open)
	if (vnr==null)
		vnr=curvid_9519;
	else
		curvid_9519=vnr;	// set the current
	var thumbdiv=document.getElementById('thumb_9519');
	thumbdiv.style.background='#FFF url(http://www.dik.nl/img/spinner32.gif) no-repeat 99px 69px';
	thumbdiv.innerHTML='<iframe name="playerframe" class="playerframe" src="http://www.dik.nl/widget/playvideo/'+cvids_9519[vnr].vid+'/258/198/L/W" width="258" height="198" frameborder="0" scrolling="no" allowtransparency="true"></iframe>';
	cpvideo_9519=true;
	updAllButState();
}

function playstop_9519() {
	cpvideo_9519=false;
	var thumbdiv=document.getElementById('thumb_9519');
	thumbdiv.style.background='#FFF';
	thumbdiv.innerHTML=vidthumbhtml_9519(curvid_9519);
	updAllButState();
}

function playstartstop_9519() {
	if (cpvideo_9519) 
		playstop_9519();
	else
		playstart_9519();
}

function vidthumbhtml_9519(vnr) {
	var html='';
	html+='<div class="v69resetstyle" style="width:248px;height:155px; overflow:hidden; position:absolute;left:5px;top:5px;">';
html+='<img src="'+cvids_9519[vnr].thumb+'" style="width:248px;height:186px;top:-16px;position:relative;">';
html+='</div>';
html+='<div class="v69resetstyle" style="width:238px;height:28px;position:absolute;left:5px;top:160px;background-color:#AAA;padding:5px;"><div class="v69resetstyle" style="overflow:hidden;height:27px;width:238px;"><div class="v69resetstyle" style="margin: 1px 3px; white-space: nowrap; font-size:12px;line-height:12px;color:#555555;">'+htmlspecialchars(cvids_9519[vnr].title)+'</div><div class="v69resetstyle" style="margin: 1px 5px; font-size:11px;line-height:11px;color:#ffffff;overflow:hidden;height:40px;"  title="'+htmlspecialchars(cvids_9519[vnr].desc)+'">'+htmlspecialchars(cvids_9519[vnr].desc)+'</div><div class="v69resetstyle" style="padding: 3px 5px; letter-spacing:1px; background-color: #aaa; color: white; position: absolute; right: 0px; top: -14px; font-size: 10px;">'+(vnr+1)+'/'+(cvids_9519.length)+'</div></div></div>';
html+='<div class="v69resetstyle" style="position: absolute; width:72px;height:72px;top:63px;left:93px;z-index:200;cursor:pointer;cursor:hand;background:url(http://www.dik.nl/img/media_play72.png) no-repeat;" onClick="playstart_9519();"></div>';
	return html;
}

function vidthumbhtmlSmall_9519(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="playstart_9519('+vnr+')" title="'+htmlspecialchars(cvids_9519[vnr].desc)+'" src="'+cvids_9519[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.dik.nl/img/media_play24.png) no-repeat;" onclick="playstart_9519('+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_773417(15893)" >'+htmlspecialchars(cvids_9519[vnr].title)+'</div>';
			html+='</div>';
		html+='</div>';
	html+='</div>';
	return html;
}

// cp 1..npages
function paginationhtml_9519(cp,npages) {
	if (npages<=1)
		return '';	// empty if no pagination..
	var html='';
	html+='<div class="pages v69resetstyle">';
	if (cp>1) {
		// we CAN prev!
		html+= '<span class="pageblock" onclick="gotopage_9519('+(cp-1)+');">&#171; Previous</span>';
	}
	else {
		html+= '<span class="pageblock_disabled">&#171; Previous</span>';
	}
	// 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+='<span class="pageblock_curpage"><b>'+lpage+'</b></span>';
			else
				html+='<span class="pageblock" onclick="gotopage_9519('+lpage+');">'+lpage+'</span>';
		}
		else {
			// no printing.. buttt maybe we need to dot
			if ( !dotted ) {
				html+='<span class="pageblock_dots">&nbsp;...&nbsp;</span>';
				dotted = true;
			}
		}
	}
		
	// Next page - Link
	if ( cp<npages )
		html+='<span class="pageblock" onclick="gotopage_9519('+(cp+1)+');">Next &#187;</span>';
	else
		html+='<span class="pageblock_disabled">Next &#187;</span>';
	html+='</div>';
	return html;
}

function vidplayurl_9519(vnr) {
	if (vnr==null)
		vnr=curvid_9519;
	return 'http://www.dik.nl/channel/player/23821/'+cvids_9519[vnr].vid;
}

//------------------------------------ button handlers --------------------------------------
function stButImg(oBut) {
	if (oBut.id == 'pgnext_9519') { 
		if (curvid_9519 >= cvids_9519.length -1 ) 
			oBut.src = imgNext_d.src;
		else
			oBut.src= butnext_mousein ? imgNext_ov.src : imgNext_ou.src;
	}
	if (oBut.id == 'pgprev_9519') { 
		if (curvid_9519==0 ) 
			oBut.src = imgPrev_d.src;
		else
			oBut.src= butprev_mousein ? imgPrev_ov.src : imgPrev_ou.src;
	}
	if (oBut.id == 'pgplay_9519') { 
		if (cpvideo_9519) 	// we are currently playing
			oBut.src = butplay_mousein ? imgStop_ov.src : imgStop_ou.src;
		else
			oBut.src= butplay_mousein ? imgPlay_ov.src : imgPlay_ou.src;
	}
	// if (oBut.id == 'pgstop_9519') { 
	// 	if (!cpvideo_9519 ) 	// currently NOT playing
	// 		oBut.src = imgStop_ov.src;
	// 	else
	// 		oBut.src= butstop_mousein ? imgStop_ov.src : imgStop_ou.src;
	// }
	if (oBut.id == 'pgmatrix_9519') { 
		oBut.src= butmatrix_mousein ? imgMatrix_ov.src : imgMatrix_ou.src;
	}
}

function oMouEv(oBut,mouseIn) {
	
	if (oBut.id == 'pgnext_9519') 
		butnext_mousein=mouseIn;
	if (oBut.id == 'pgprev_9519') 
		butprev_mousein=mouseIn;
	if (oBut.id == 'pgplay_9519') 
		butplay_mousein=mouseIn;
	// if (oBut.id == 'pgstop_9519') 
	// 	butstop_mousein=mouseIn;
	if (oBut.id == 'pgmatrix_9519') 
		butmatrix_mousein=mouseIn;
	stButImg(oBut);
}

function updAllButState() {
	el = document.getElementById('pgnext_9519');
	if (el) 
		stButImg(el); // update nextbutton state

	el = document.getElementById('pgprev_9519');
	if (el) 
		stButImg(el); // update prevbutton state
		
	el = document.getElementById('pgplay_9519');
	if (el) 
		stButImg(el); // update prevbutton state
		
	// el = document.getElementById('pgstop_9519');
	// if (el) 
	// 	stButImg(el); // update prevbutton state

	el = document.getElementById('pgmatrix_9519');
	if (el) 
		stButImg(el); // update prevbutton state
}

//------------------------------------ other stuff -------------
// 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;
}


function closepopup_9519() {
  el = document.getElementById('ipopup_9519');
  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 gotopage_9519(pg) {
	if (pg<1)
		pg=1;
	if (matrix_npages<1)
		matrix_npages=1;
	if (pg>matrix_npages) 
		pg=matrix_npages;
		
	matrix_curpg=pg;
	var mxs=document.getElementById('mxs_9519');
	var html='';
	for (var i=(matrix_curpg-1)*16,cv=0;i<cvids_9519.length && cv<16;i++) {
		html+=  vidthumbhtmlSmall_9519(i);
		cv++;
	}
	html+=  '<div class="v69resetstyle" style="clear:both;"></div>';
	if (matrix_npages>1) {
		html+=  '<div  class="v69resetstyle" style="margin:10px 0px">'+paginationhtml_9519(matrix_curpg, matrix_npages)+'</div>';
	}

	mxs.innerHTML=html;
}

function showmatrix_9519() {
	// close old one
	closepopup_9519();

	matrix_npages= Math.ceil(cvids_9519.length / 16);
	
	// open new
	var popup_div = document.createElement('div');
	var title='matrix';
	popup_div.id = "ipopup_9519";
	popup_div.style.position = 'absolute';
	popup_div.style.border = 'none';
	popup_div.className = "v69resetstyle";

	var base_width=172*4+25;

	var base_height=100*4+30+10+4;
	if (matrix_npages>1) 
		base_height+=30;
	popup_div.style.width = base_width+'px';
	popup_div.style.height = base_height+'px';
	popup_div.style.fontFamily='Trebuchet MS,Lucida Sans Unicode,Lucida Grande,Lucida Sans,Tahoma,Geneva,Arial,helvetica,sans-serif';
	popup_div.style.zIndex = '10000';

	// CENTER SCREEN
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	var popup_top = arrayPageScroll[1] + ((arrayPageSize[3] -base_height) / 2);
	var popup_left = arrayPageScroll[0] +((arrayPageSize[0] - base_width) / 2);
	if (popup_top<0)
		popup_top=0;
	if (popup_left<0)
		popup_left=0;
	popup_div.style.position = 'absolute';
	popup_div.style.top = popup_top + 'px';
	popup_div.style.left = popup_left + 'px';


	
	var vid_html='';
	vid_html+='<div class="v69resetstyle" style="padding:0px;position:relative;border:2px #CCC solid;background-color:white;width:'+(base_width-4)+'px;height:'+(base_height-4)+'px;">';
	vid_html+='<br style="display:none;"/><style type="text/css">	\
		.pages {padding:2px 0 2px 8px; margin:0; clear:both;font-size:12px;} \
			.pages span.pageblock {border: 1px solid #888; color:#000; height: 12px; padding: 3px 6px;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 6px;margin: 0px 4px 0px 0px;}\
			.pages span.pageblock_dots {border: 0px solid #888; color: #000; height: 12px; padding: 3px 6px;margin: 0px 4px 0px 0px;}\
			.pages span.pageblock_curpage {border: 1px solid #888; color: #aaa; height: 12px; padding: 3px 6px;margin: 0px 4px 0px 0px;}\
		</style>';
	vid_html+=	'<div class="v69resetstyle" onclick="closepopup_9519();" style="position:absolute;top:7px;right:8px;cursor:pointer;cursor:hand;background:url(http://www.dik.nl/img/icon_bw_close22.png) no-repeat;width:24px;height:24px;z-index:10000;"></div>';
	vid_html+=	'<div class="v69resetstyle" style="position:absolute;top:8px;left:15px;color:#888;font-size:15px;overflow:hidden;width:'+(base_width-50)+'px;">D66 Amsterdam</div>';
	vid_html+=	'<div class="v69resetstyle" style="margin:30px 10px 10px 10px;" id="mxs_9519">';
	// for (var i=0,cv=0;i<cvids_9519.length && cv<16;i++) { 
	// 		vid_html+=  vidthumbhtmlSmall_9519(i);
	// 		cv++;
	// 	}
	// 	vid_html+=  '<div style="clear:both;"></div>';
	// 
	// 	if (matrix_npages>1) {
	// 		vid_html+=  '<div style="margin:10px 0px">'+paginationhtml_9519(matrix_curpg, matrix_npages)+'</div>';
	// 	}
	vid_html+=	'</div>';
	vid_html+=  '<div class="v69resetstyle" style="clear:both;"></div>';
	vid_html+='</div>';
					
	popup_div.innerHTML=vid_html;
	document.body.appendChild(popup_div);
	gotopage_9519(matrix_curpg);
}

// utf8 to string conversions
var escapable = /[\\\"\x00-\x1f\x7f-\uffff]/g,
    meta = {    // table of character substitutions
        '\b': '\\b',
        '\t': '\\t',
        '\n': '\\n',
        '\f': '\\f',
        '\r': '\\r',
        '"' : '\\"',
        '\\': '\\\\'
    };

function utf8quote(string) {
	// If the string contains no control characters, no quote characters, and no
	// backslash characters, then we can safely slap some quotes around it.
	// Otherwise we must also replace the offending characters with safe escape
	// sequences.

    escapable.lastIndex = 0;
    return escapable.test(string) ?
        '"' + string.replace(escapable, function (a) {
            var c = meta[a];
            return typeof c === 'string' ? c :
                '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
        }) + '"' :
        '"' + string + '"';
}



