//solo.js for channel 20602 / widget 453459 / WxH: 240x208 / 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_453459= new Array();	// channelvideo's
var curvid_453459=0;			// first video
var cpvideo_453459=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_453459 = document.getElementById('viidoo_solo_453459');
if (wgElm_453459) {
	vp_createwg();
}

pgstats.addcollect('chid','20602');
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_453459" class="widget_flash v69resetstyle" style="width: 240px;height:208px;overflow:hidden; border: 1px solid #DDDDDD;font-family:Trebuchet MS,Lucida Sans Unicode,Lucida Grande,Lucida Sans,Tahoma,Geneva,Arial,helvetica,sans-serif">';

	cvids_453459.push({vid:97726, thumb: 'http://ak2.static.dailymotion.com/static/video/324/879/19978423:jpeg_preview_large.jpg?20100216040156', title: 'Authentic Value: Being Known in e-Patient Communities', desc: '\&quot;e-Patient Dave\&quot; deBronkart presents on October 26, 2009 at the e-Patient Connections Conference in Philadelphia.-- How he became an e-patient, beat cancer and earned the \u201ce-Patient Dave\u201d moniker-- The patient of the future-- His special message for Novartis-- Be real. Contribute value. Be known.SAVE THE DATES: e-Patient Connections 2010!======================================The conference that generated all the buzz last year will return to the Philadelphia Hyatt Bellevue from September 27-29, 2010. Make sure to sign-up for all the updates at http://www.epatient2010.com.'});
	cvids_453459.push({vid:97735, thumb: 'http://ats.vimeo.com/194/042/19404272_640.jpg', title: 'Clay Shirky Keynote - Health 2.0 SF 2008', desc: ''});
	cvids_453459.push({vid:97728, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/459/501/45950110_640.jpg', title: 'Dave deBronkart is \"e-Patient Dave\"', desc: 'Dave deBronkart, Co-Chairman of the Society of Participatory Medicine provides some unique insight in to the patient\'s approach to digital media and healthcare.'});
	cvids_453459.push({vid:97715, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/649/093/6490937_640.jpg', title: 'Interview Maarten Lens-FitzGerald', desc: 'Interviewed by Bertalan Mesk\u00f3 of Scienceroll.com at the Zorg 2.0 Spring 2009 conference Nijmegen of Acute Zorgregio Oost'});
	cvids_453459.push({vid:97716, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/950/946/9509462_640.jpg', title: '4. Zorg20 Event Spring 2009 | Keynote Bas Bloem', desc: ''});
	cvids_453459.push({vid:97717, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/755/661/7556612_640.jpg', title: '5. Zorg20 Event Spring 2009 | Keynote Jan Kremer', desc: ''});
	cvids_453459.push({vid:97718, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/924/809/9248097_640.jpg', title: '7. Zorg20 Event Spring 2009 | Launch AcuteZorg.nl', desc: 'Toelichting en achtergronden bij AcuteZorg.nl'});
	cvids_453459.push({vid:97727, thumb: 'http://i.ytimg.com/vi/B7ZrWSmQxcU/0.jpg', title: 'e-Patient Revolution', desc: 'For the first time in history, more people are searching the Internet for health information than asking doctors. Digital health consumers, known as e-patients, are now empowered, equipped, engaged, educated and connected to others electronically. E-Patient Connections 2009 is the one conference you need to attend to make sense of the radical changes taking place in health marketing. Spend two days in October--get breakthrough results for a year. For more information visit: epatient2009.com Sources blog.kruresearch.com'});
	cvids_453459.push({vid:97729, thumb: 'http://i.ytimg.com/vi/vrH20zRea0w/0.jpg', title: 'Johnson \& Johnson on YouTube', desc: 'Rob Halper, Director of Video Communication at Johnson \& Johnson presents on October 26, 2009 at the e-Patient Connections Conference in Philadelphia. - Whos Watching youtube? Everybody. - Health searches and views on youtube - Metrics, metrics, metrics - Two-way interaction with viewers - Selling the idea internally and overcoming obstacles SAVE THE DATES: e-Patient Connections 2010! ====================================== The conference that generated all the buzz last year will return to the Philadelphia Hyatt Bellevue from September 27-29, 2010. Make sure to sign-up for all the updates at www.epatient2010.com.'});
	cvids_453459.push({vid:97730, thumb: 'http://i.ytimg.com/vi/KRq4xRpQZHo/0.jpg', title: 'Lisa Salberg on the role of patient advocacy', desc: 'I caught up with Lisa Salberg of the Hypertrophic Cardiomyopathy Association (HCMA) at last week\'s HCM international symposium in Minneapolis and here\'s what she had to say about the importance of patient advocacy.'});
	cvids_453459.push({vid:97731, thumb: 'http://ak2.static.dailymotion.com/static/video/300/017/19710003:jpeg_preview_large.jpg?20100216000923', title: 'How J\&J Joined the Twittersphere', desc: 'Presented by Marc Monseau on October 27, 2009 at the e-Patient Connections Conference in Philadelphia. http://www.epatient2009.com-- How to establish legal and regulatory \u201cguard rails\u201d-- The importance of an online personality-- How did a 120 year old conservative company become a Twitter innovator?SAVE THE DATES: e-Patient Connections 2010!======================================The conference that generated all the buzz last year will return to the Philadelphia Hyatt Bellevue from September 27-29, 2010. Make sure to sign-up for all the updates at http://www.epatient2010.com.'});
	cvids_453459.push({vid:97714, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/750/667/7506671_640.jpg', title: '2. Zorg20 Event Spring 2009 | Keynote Maarten Lens-FitzGerald', desc: 'Zorg 2.0 vanuit het perspectief van een pati\u00ebnt.\n\n'});
	cvids_453459.push({vid:97725, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/195/668/19566832_640.jpg', title: 'Building a Movement in an Interconnected World: A Conversation with Jacqueline Novogratz (Part 3)', desc: 'Part 3 of the Jacqueline Novogratz\'s talk at The Paley Center for Media on June 8th 2009.\n\nIn the face of global poverty that affects more than four billion lives, can one person make a difference? According to Jacqueline Novogratz\u2014founder and CEO of Acumen Fund, a nonprofit venture capital firm dedicated to bringing affordable and sustainable health care, water, energy, and housing to people who lack access to such critical goods and services\u2014the answer is yes, if that one person builds a committed tribe around their cause. Innovative approaches to poverty require equally innovative approaches to communicating the message and spreading the word. \n\nNovogratz discusses the challenges of leveraging social media networks to transform how people think about\u2014and act on\u2014problems of poverty.'});
	cvids_453459.push({vid:97732, thumb: 'http://ak2.static.dailymotion.com/static/video/006/750/20057600:jpeg_preview_large.jpg?20100216141756', title: 'A Tale of Two e-Patients - Pecha Kucha', desc: 'Dr. Val Jones\u2019 very moving pecha kucha limerick, \u201cTale of Two ePatients\&quot; as presented at the 2009 e-Patient Connections Conference in Philadelphia on October 27, 2009.Shows the right and wrong way to be an empowered patient.'});
	cvids_453459.push({vid:97733, thumb: 'http://i.ytimg.com/vi/A_0FgRKsqqU/0.jpg', title: 'Clay Shirky on New Book \"Here Comes Everybody\"', desc: 'Clay Shirky, author of the just released \"Here Comes Everybody: The Power of Organizing Without Organizations\" speaking at Harvard Law School\'s Austin Hall on Feb. 28,2008 hosted by the Berkman Center for Internet and Society at Harvard Law School'});
	cvids_453459.push({vid:97712, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/259/234/25923481_640.jpg', title: 'Dutch Health 2.0 Challenge 2009', desc: 'Healthcare faces a considerable challenge given: more demand for care, fewer people and higher quality. This demands for innovation.\nTherefore, not only one answer is needed, but a couple of solutions are needful. Do you want to participate in creating one? Then corporate on the First Dutch Open Health 2.0 Challenge.\n \nIn this challenge several teams compete to create in four days  from 12 till 16 October - the best solutions for the categories Social Health Innovations and Technical Health Innovations.\nThe kickoff takes place on 12 October at Reshape2009: www.reshape2009.com . A high level jury will judge all assignments and will distribute the Dutch Health 2.0 Challenge Award 2009 on 16 October at the First International E-Mental Health Summit in Amsterdam: www.ementalhealthsummit.com\n \nFor more information about the Challenge, how to participate, the rules and prizes: www.health20challenge.com \n \nJoin the competition, sign up and win the Challenge!\n \nHeleen Riper, Trimbos Institute\nLucien Engelen, UMC St. Radboud\nRemco Hoogendijk, Health Valley\n \n\ufffc'});
	cvids_453459.push({vid:97713, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/390/397/39039767_640.jpg', title: 'New Years Wish 2.010 @zorg20', desc: 'I Wish the both of us a boost into more Participatory Healthcare in the year 2.010'});
	cvids_453459.push({vid:84373, thumb: 'http://i.ytimg.com/vi/Stzyt2zbZeI/0.jpg', title: 'interview Lee Aase Mayo Clinic (@leeaase)', desc: 'Syndication Manager talks to Lucien Engelen (@zorg20) , Health 2.0 Ambassador Radboud University Nijmegen Medical Centre. The Netherlands. Lee had been keynoting on his REshape conference www.reshape2009.com '});
	cvids_453459.push({vid:97710, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/435/933/43593347_640.jpg', title: 'ReShape 2009', desc: 'Sfeerimpressie van ReShape 2009 op 12 en 13 oktober in het Triavium te Nijmegen'});
	cvids_453459.push({vid:84381, thumb: 'http://i.ytimg.com/vi/gzT7MfNS16s/0.jpg', title: 'Pathologie in het UMC St Radboud', desc: 'De trailer is van een film die we gemaakt hebben om het werk van een patholoog te laten zien. In de trailer komen korte elementen voor, van het nemen van weefselmonsters, de verwerking op het laboratorium de evaluatie door een patholoog, het gebruik van nieuwe technologie en het overleg dat over resultaten plaatsvindt.'});
	cvids_453459.push({vid:84374, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/342/837/34283752_640.jpg', title: 'Presentatie over de rol van internet binnen de Zorg', desc: 'Presentatie over de rol van internet binnen de Zorg\n \n\nLucien Engelen\nhttp://nl.linkedin.com/in/lucienengelen \nTwitter http://www.twitter.com/zorg20'});
	cvids_453459.push({vid:84375, thumb: 'http://i.ytimg.com/vi/0YaEFEodjQM/0.jpg', title: 'Dutch Health 2 0 Challenge www.health20challenge.com', desc: '.com . A high level jury will judge all assignments and will distribute the Dutch Health 2.0 Challenge Award 2009 on 16 October at the First International E-Mental Health Summit in Amsterdam: ementalhealthsummit.com For more information about the Challenge, how to participate, the rules and prizes: health20challenge.com Join the competition, sign up and win the Challenge! Heleen Riper, Trimbos Institute Lucien Engelen, UMC St. Radboud Remco Hoogendijk, Health Valley ... \"health 20 zorg 20 ...'});
	cvids_453459.push({vid:84376, thumb: 'http://i.ytimg.com/vi/xx2cwu1B3Bw/0.jpg', title: 'Internet en de Zorg', desc: ') te gaan geven. U kunt eventueel nog kijken op www.zorg20.nl waar binnenkort een online community ingericht zal worden over dit onderwerp. Of op www.reshape2009.com over de congresreeks in dit kader. Suggesties, opmerkingen en/of idee\u00ebn : lucien.engelen@zorg20.nl Noot : deze info is samengesteld uit diverse bronnen waarbij eventuele rechten daar blijven liggen. Sommigen daarvan zijn niet meer te achterhalen. Mochten wij inbreuk doen op enig recht, verzoeken wij u ons dit te melden, ...'});
	cvids_453459.push({vid:97711, thumb: 'http://images.vimeo.com/26/11/90/261190689/261190689_640.jpg', title: 'Untitled', desc: ''});
	cvids_453459.push({vid:84378, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/918/384/9183848_640.jpg', title: 'Zorg20-Event Interview : MijnMedicijn.nl | Wendela Wessels', desc: 'At the Zorg 2.0 Spring 2009 conference Nijmegen of Acute Zorgregio Oost'});
	cvids_453459.push({vid:84377, thumb: 'http://i.ytimg.com/vi/k69hr3qmLbs/0.jpg', title: 'Healthcare and internet in the Netherlands', desc: 'This video has been made to inform and inspire about the possibilities and challenges the internet and social media are offering to help in changing healthcare into Participatory Healthcare. It was used as opening video for Reshape 2009 (www.reshape2009.com/en) , The Netherlands in Dutch. Suggestions, remarks or ideas : lucien.engelen@azo.nl '});
	cvids_453459.push({vid:84379, thumb: 'http://u.omroep.nl/n/a/2009-10/Logoeenvandaag.jpg', title: 'E\u00e9nVandaag - 2009-10-19', desc: 'Nieuws en actualiteiten<br /> - Actualiteiten. -Rechtbank Amsterdam verklaart DSB failliet. De rechtbank van Amsterdam heeft DSB Bank maandagochtend om negen uur failliet verklaard. Vrijdag gaf de rechtbank DSB nog een weekend de tijd om overeenstemming te bereiken met een Amerikaanse overnamekandidaat. Per direct komen daardoor 1700 mensen op de straat te staan. -De toekomst van de zorg. Artsen en andere zorgverleners moeten meer gebruik maken van internet, blijkt uit steeds meer adviezen. Maar is dat de manier om de zorg in de toekomst te verbeteren? Gaat de kwaliteit omhoog en krimpen de wachtlijsten? Uit eerste initiatieven blijkt dat in ieder geval de pati\u00ebnt het wel ziet zitten. In E\u00e9nVandaag een bezoek aan het UMC St. Radboud in Nijmegen, dat pioniert met verschillende manieren van moderne zorgverlening. -Een jaar EenVandaag Index. Een jaar geleden begon EenVandaag met de EenVandaag Index, een aandelenmandje met een waarde van 1000 euro. Experts hebben ons de afgelopen periode geadviseerd over wat we moesten kopen, maar vooral, wat zou instorten en we zo snel mogelijk van de hand moesten doen. Hoe is het ons vergaan? Een terugblik.omroep.nl TROS AVRO'});
	cvids_453459.push({vid:84383, thumb: 'http://i.ytimg.com/vi/I61ZYDN2geQ/0.jpg', title: 'De Survivaltips van Morritz Lentelink', desc: 'De Survivaltips van Morritz Lentelink voor het verblijf in het UMC St. Radboud. Hoe overleef ik het ziekenhuis, met 3 tips. '});
	cvids_453459.push({vid:84380, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/368/645/36864511_640.jpg', title: 'UMC Radboud in Nijmegen', desc: ''});
	cvids_453459.push({vid:84384, thumb: 'http://i.ytimg.com/vi/MJb5Jvt0aVg/0.jpg', title: 'Health Bridge', desc: 'Health Bridge: Huisarts en specialist werken virtueel samen aan betere zorg. Health Bridge slaat een virtuele brug tussen de eerstelijnszorg in de regio Nijmegen en de tweedelijnszorg in het UMC St Radboud. Per videoverbinding organiseren huisarts en specialist een consult. Beide behandelaars zitten - met de pati\u00ebnt - op hetzelfde moment achter de computer, zijn zichtbaar voor elkaar en communiceren met elkaar \u00e9n met de pati\u00ebnt. Health Bridge is een Nijmeegs initiatief om met behulp ...'});
	cvids_453459.push({vid:97720, thumb: 'http://ats.vimeo.com/483/359/48335937_640.jpg', title: 'Het UMC ST Radboud.', desc: 'Gedreven door kennis, bewogen door mensen.'});
	cvids_453459.push({vid:97721, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/484/354/48435478_640.jpg', title: 'Affording Health Care', desc: 'The ZocDoc interns went on a mission to find out just how much health care costs, and what you can do to afford it.'});
	cvids_453459.push({vid:97722, thumb: 'http://i.ytimg.com/vi/qLeNGykRAvU/0.jpg', title: 'Social Media in Healthcare', desc: 'interesting facts and figures describing the way social media and new media are changing the health care industry. for more info, please go to www.q1productions.com'});
	cvids_453459.push({vid:97723, thumb: 'http://i.ytimg.com/vi/5oo_4wT0B_E/0.jpg', title: 'HOME #21 - \"The Ease of Social Media Marketing (Part 2)\"', desc: 'In part two of this interview, Lee Aase, manager of syndication and social media for the Mayo Clinic speaks with Chris Boyer, author of www.hospitalonlinemarketing.com, about his 35 thesis for social media, how the adoption of social media is transforming healthcare by providing patients and healthcare providers with opportunities to dialogue and listen to one another, and also describes his blog Social Media University Global.'});
	cvids_453459.push({vid:97734, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/701/348/7013482_640.jpg', title: 'Clay Shirky at Gel 2008', desc: 'Social networking thinker Clay Shirky talks about the transformations in corporations and society brought about by the spread of networked communications. His book Here Comes Everybody covers similar themes.'});
	cvids_453459.push({vid:97724, thumb: 'http://ak2.static.dailymotion.com/static/video/125/490/20094521:jpeg_preview_large.jpg?20100216054219', title: 'e-Patient Revolution', desc: 'For the first time in history, more people are searching the Internet for health information than asking doctors. Digital health consumers, known as e-patients, are now empowered, equipped, engaged, educated and connected to others electronically.'});
	cvids_453459.push({vid:97736, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/733/497/7334977_640.jpg', title: '1. Zorg20 Event Spring 2009 | Aanleiding \& doel', desc: 'At the Zorg 2.0 Spring conference Nijmegen of Acute Zorgregio Oost 2009'});
	cvids_453459.push({vid:97737, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/787/227/7872270_640.jpg', title: '3. Zorg20 Event Spring 2009 | Keynote Marcel Heldoorn NPCF', desc: 'Zorg 2.0 vanuit perspectief van patientengroepering'});
	cvids_453459.push({vid:97738, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/811/653/8116537_640.jpg', title: '6. Zorg20 Event Spring 2009 | Keynote Marco Derksen', desc: ''});
html+='<div class="v69resetstyle" id="thumb_453459" style="width:240px;height:182px;background-color:#FFFFFF;position:relative;">';
html+=vidthumbhtml_453459(curvid_453459);
html+='</div>';
	html +='<div class="v69resetstyle" style="height:26px;width:240px;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_453459();"><span style="color:#888;"></div>';
	html +='<img style="position:absolute;left:106px;top:0px;height:25px;z-index:5;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/dikp_v1/img/project/dik/logo.png" onclick="location.href=vidplayurl_453459();">';
		html +='<img onclick="showmatrix_453459(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_453459" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);"/>';
		html +='<img onclick="playprev_453459();" style="position:absolute;left:164px;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_453459" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstop_453459();" style="position:absolute;left:164px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconstop24.png" title="stop"  													id="pgstop_453459"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstart_453459();" style="position:absolute;left:188px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconplay24.png" title="afspelen"  									id="pgplay_453459"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	// start is now a toggle
	html +='<img onclick="playstartstop_453459();" style="position:absolute;left:188px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.dik.nl//img/widget/solo/iconplay24.png" title="afspelen"  									id="pgplay_453459"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='<img onclick="playnext_453459();" style="position:absolute;left:212px;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_453459"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='</div>';
	html+='</div>';
	html+='<iframe src="http://www.dik.nl/util/ustat" width="0" height="0" border="no" frameborder="0"  style="border:0; visibility: hidden;"></iframe>';
	wgElm_453459.innerHTML=html;
	wgElm_453459.style.display = 'block';
		updAllButState(); 
}

function playnext_453459() {
	if (curvid_453459 < cvids_453459.length -1 ) {
		curvid_453459++;
		if (cpvideo_453459)
			playstart_453459();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_453459');
			thumbdiv.innerHTML=vidthumbhtml_453459(curvid_453459);
		}
	}
	updAllButState();
}
function playprev_453459() {
	if (curvid_453459 >0 ) {
		curvid_453459--;
		if (cpvideo_453459)
			playstart_453459();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_453459');
			thumbdiv.innerHTML=vidthumbhtml_453459(curvid_453459);
		}
	}
	updAllButState();
}

function playstart_453459(vnr) {
	closepopup_453459();	// close popup (if open)
	if (vnr==null)
		vnr=curvid_453459;
	else
		curvid_453459=vnr;	// set the current
	var thumbdiv=document.getElementById('thumb_453459');
	thumbdiv.style.background='#FFF url(http://incdn.s3.amazonaws.com/dikp_v1/img/spinner32.gif) no-repeat 90px 61px';
	thumbdiv.innerHTML='<iframe name="playerframe" class="playerframe" src="http://www.dik.nl/widget/playvideo/'+cvids_453459[vnr].vid+'/240/182/L/W" width="240" height="182" frameborder="0" scrolling="no" allowtransparency="true"></iframe>';
	cpvideo_453459=true;
	updAllButState();
}

function playstop_453459() {
	cpvideo_453459=false;
	var thumbdiv=document.getElementById('thumb_453459');
	thumbdiv.style.background='#FFF';
	thumbdiv.innerHTML=vidthumbhtml_453459(curvid_453459);
	updAllButState();
}

function playstartstop_453459() {
	if (cpvideo_453459) 
		playstop_453459();
	else
		playstart_453459();
}

function vidthumbhtml_453459(vnr) {
	var html='';
	html+='<div class="v69resetstyle" style="width:230px;height:144px; overflow:hidden; position:absolute;left:5px;top:5px;">';
html+='<img src="'+cvids_453459[vnr].thumb+'" style="width:230px;height:173px;top:-14px;position:relative;">';
html+='</div>';
html+='<div class="v69resetstyle" style="width:220px;height:23px;position:absolute;left:5px;top:149px;background-color:#AAA;padding:5px;"><div class="v69resetstyle" style="overflow:hidden;height:27px;width:220px;"><div class="v69resetstyle" style="margin: 1px 3px; white-space: nowrap; font-size:12px;line-height:12px;color:#555555;">'+htmlspecialchars(cvids_453459[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_453459[vnr].desc)+'">'+htmlspecialchars(cvids_453459[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_453459.length)+'</div></div></div>';
html+='<div class="v69resetstyle" style="position: absolute; width:72px;height:72px;top:55px;left:84px;z-index:200;cursor:pointer;cursor:hand;background:url(http://www.dik.nl/img/media_play72.png) no-repeat;" onClick="playstart_453459();"></div>';
	return html;
}

function vidthumbhtmlSmall_453459(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_453459('+vnr+')" title="'+htmlspecialchars(cvids_453459[vnr].desc)+'" src="'+cvids_453459[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://incdn.s3.amazonaws.com/dikp_v1/img/media_play24.png) no-repeat;" onclick="playstart_453459('+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_453459[vnr].title)+'</div>';
			html+='</div>';
		html+='</div>';
	html+='</div>';
	return html;
}

// cp 1..npages
function paginationhtml_453459(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_453459('+(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_453459('+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_453459('+(cp+1)+');">Next &#187;</span>';
	else
		html+='<span class="pageblock_disabled">Next &#187;</span>';
	html+='</div>';
	return html;
}

function vidplayurl_453459(vnr) {
	if (vnr==null)
		vnr=curvid_453459;
	return 'http://www.dik.nl/channel/player/20602/'+cvids_453459[vnr].vid;
}

//------------------------------------ button handlers --------------------------------------
function stButImg(oBut) {
	if (oBut.id == 'pgnext_453459') { 
		if (curvid_453459 >= cvids_453459.length -1 ) 
			oBut.src = imgNext_d.src;
		else
			oBut.src= butnext_mousein ? imgNext_ov.src : imgNext_ou.src;
	}
	if (oBut.id == 'pgprev_453459') { 
		if (curvid_453459==0 ) 
			oBut.src = imgPrev_d.src;
		else
			oBut.src= butprev_mousein ? imgPrev_ov.src : imgPrev_ou.src;
	}
	if (oBut.id == 'pgplay_453459') { 
		if (cpvideo_453459) 	// 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_453459') { 
	// 	if (!cpvideo_453459 ) 	// currently NOT playing
	// 		oBut.src = imgStop_ov.src;
	// 	else
	// 		oBut.src= butstop_mousein ? imgStop_ov.src : imgStop_ou.src;
	// }
	if (oBut.id == 'pgmatrix_453459') { 
		oBut.src= butmatrix_mousein ? imgMatrix_ov.src : imgMatrix_ou.src;
	}
}

function oMouEv(oBut,mouseIn) {
	
	if (oBut.id == 'pgnext_453459') 
		butnext_mousein=mouseIn;
	if (oBut.id == 'pgprev_453459') 
		butprev_mousein=mouseIn;
	if (oBut.id == 'pgplay_453459') 
		butplay_mousein=mouseIn;
	// if (oBut.id == 'pgstop_453459') 
	// 	butstop_mousein=mouseIn;
	if (oBut.id == 'pgmatrix_453459') 
		butmatrix_mousein=mouseIn;
	stButImg(oBut);
}

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

	el = document.getElementById('pgprev_453459');
	if (el) 
		stButImg(el); // update prevbutton state
		
	el = document.getElementById('pgplay_453459');
	if (el) 
		stButImg(el); // update prevbutton state
		
	// el = document.getElementById('pgstop_453459');
	// if (el) 
	// 	stButImg(el); // update prevbutton state

	el = document.getElementById('pgmatrix_453459');
	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_453459() {
  el = document.getElementById('ipopup_453459');
  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_453459(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_453459');
	var html='';
	for (var i=(matrix_curpg-1)*16,cv=0;i<cvids_453459.length && cv<16;i++) {
		html+=  vidthumbhtmlSmall_453459(i);
		cv++;
	}
	html+=  '<div class="v69resetstyle" style="clear:both;"></div>';
	if (matrix_npages>1) {
		html+=  '<div  class="v69resetstyle" style="margin:10px 0px">'+paginationhtml_453459(matrix_curpg, matrix_npages)+'</div>';
	}

	mxs.innerHTML=html;
}

function showmatrix_453459() {
	// close old one
	closepopup_453459();

	matrix_npages= Math.ceil(cvids_453459.length / 16);
	
	// open new
	var popup_div = document.createElement('div');
	var title='matrix';
	popup_div.id = "ipopup_453459";
	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_453459();" 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;">zorg20</div>';
	vid_html+=	'<div class="v69resetstyle" style="margin:30px 10px 10px 10px;" id="mxs_453459">';
	// for (var i=0,cv=0;i<cvids_453459.length && cv<16;i++) { 
	// 		vid_html+=  vidthumbhtmlSmall_453459(i);
	// 		cv++;
	// 	}
	// 	vid_html+=  '<div style="clear:both;"></div>';
	// 
	// 	if (matrix_npages>1) {
	// 		vid_html+=  '<div style="margin:10px 0px">'+paginationhtml_453459(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_453459(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 + '"';
}




