//chart2.js for channel 7291 / widget 607 / WxH: 550x375 / skin: clean / vid: 0 / autoplay: N / shareicon: Y 
// 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();
// 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
var isIE = /MSIE ((5\.5)|[6])/.test(navigator.userAgent) && navigator.platform == "Win32";

var cvids_607= new Array();	// channelvideo's
var curvid_607=0;			// first video
var cpvideo_607=false;		// false=thumb, true=video

var matrix_curpg=1;
var matrix_npages=0;
var matrix_itemspp=3;	// 16
var tweenflip=0;
var tween1=null;
var tween2=null;

var butnext_mousein=false;
var butprev_mousein=false;
var img1_ov = new Image;
var img1_ou = new Image;
var img1_d  = new Image;
var img2_ov = new Image;
var img2_ou = new Image;
var img2_d  = new Image;
img1_ov.src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconprev24ov.png";
img1_ou.src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconprev24.png";
img1_d.src ="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconprev24d.png";
img2_ov.src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconnext24ov.png";
img2_ou.src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconnext24.png";
img2_d.src ="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconnext24d.png";

var wgElm_607 = document.getElementById('viidoo_chart2_607');
if (wgElm_607) {
	vp_createwg();
}

pgstats.addcollect('chid','7291');
pgstats.addcollect('hit','embed');
pgstats.addcollect('widget','chart2');
pgstats.xPageHit();

function vp_createwg() {
	var html='<div id="widget_flash_607" class="widget_flash" style="width: 550px;height:375px;overflow:hidden; margin:0;padding:0;border:0px solid #DDDDDD;background:#fff;position:relative;font-family:Arial,helvetica,sans-serif">';
	html+='<div style="margin:0px;">';
	cvids_607.push({vid:58288, thumb: 'http://i.ytimg.com/vi/OrgahSUbVRk/0.jpg', title: 'Chad Vader Breaks the Internet', desc: 'Chad, in an attempt to force blogworld to accept him, breaks the internet. He contacts 3 famous new media experts to help him out. See Chad Vader at Blog World (and Matt and Aaron) and watch episode 9 before it hits the internet. And we\'ll sign your shirt or your ass or whatever you want signed. Register at www.blogworldexpo.com and get your tickets and we\'ll see you in Las Vegas, man. Get twizzled www.twitter.com www.twitter.com'});
	cvids_607.push({vid:58268, thumb: 'http://i.ytimg.com/vi/4wGR4-SeuJ0/0.jpg', title: 'Chad Vader S1 Ep1: A Galaxy Not So Far Away', desc: 'Follow our tweets - www.twitter.com www.twitter.com GET CHAD DVDS OR T-SHIRTS - Visit www.blamesociety.net - Chad, Aaron, and Matt did a funny commentary track you watch along with the movie Star Wars: A New Hope. Go here-- www.rifftrax.com Life is hard when you\'re Darth Vader\'s less-talented, less-charismatic younger brother and you manage a grocery store. CHAD VADER: Starring: Chad - Aaron Yonda Clint/Voice of Chad - Matt Sloan Tony - Asa Derks Randy - Brad Knight monkeybusinessinstitute ...'});
	cvids_607.push({vid:58270, thumb: 'http://i.ytimg.com/vi/NPVlljVWqBg/0.jpg', title: 'Chad Vader S1 Ep2: The Date', desc: 'CHAD DVDS ARE BACK! Go to www.blamesociety.net and support Chad Vader. Chad goes on a date, and senses a disturbance in the store. . . Written and Directed by Aaron Yonda and Matt Sloan Produced by Courtney Collins courtneycollins.com http Music - Andrew Yonda (buffali.com) Cinematography - Tona Williams (http and John Urban (urbanphotoco.com) Lighting Director - John Urban (http Casting Director - Courtney Collins (courtneycollins.com) Assistant Director - Doug Chapin Sound Design - John ...'});
	cvids_607.push({vid:58271, thumb: 'http://i.ytimg.com/vi/gh8u6nTx8wY/0.jpg', title: 'Chad Vader S1 Ep3: The Night Shift', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get one, for yourself, or maybe a Chad-loving friend. Chad returns after being demoted. Will the denizens of the creepy night shift prevent his plans to take back the dayshift from becoming fully operational? GET CHAD VADER T-SHIRTS and other amazing items through cafepress: www.cafepress.com Starring: Chad - Aaron Yonda Clint/Voice of Chad - Matt Sloan Jeremy - Paul Guse Clarissa - Christina lavicka myspace.com Weird Jimmy - Craig ...'});
	cvids_607.push({vid:58272, thumb: 'http://i.ytimg.com/vi/ogIqayRDr4w/0.jpg', title: 'Chad Vader S1 Ep4: Dog In The Store', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone forever. This episode: A dog gets loose in the store! Written and Directed by Matt Sloan and Aaron Yonda Chad/Hal - Aaron Yonda myspace.com Clint/Voice of Chad - Matt Sloan myspace.com Jeremy - Paul Guse Clarissa - Christina lavicka myspace.com Weird Jimmy - Craig Johnson Lionel - Bill Bolz Randy - Brad Knight monkeybusinessinstitute.com Customer - Kristian Knutsen Shoplifter - Josh Klessig http Tammy ...'});
	cvids_607.push({vid:58273, thumb: 'http://i.ytimg.com/vi/VAkOfoI3SpE/0.jpg', title: 'Chad Vader S1 Ep5: Drunk', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. A tipsy Chad faces a lameness crisis. He gets help from an unexpected friend. Written by Matt Sloan, Aaron Yonda, Rob Matsushita and Craig Johnson Directed and Edited by Matt Sloan and Aaron Yonda Produced by Courtney Collins courtneycollins.com http Cinematography by Tona Williams tona.bigbite.org www.myspace.com Music - Andrew Yonda yondaphotography.com Lighting Director - John Urban http ...'});
	cvids_607.push({vid:58274, thumb: 'http://i.ytimg.com/vi/nmDf6SnTVxg/0.jpg', title: 'Chad Vader S1 Ep6: New Job', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. Chad Vader is back. He battles many obstacles in his search for meaningful employment. Meanwhile back at the store Clint is letting his newfound authority go to his head. Special cameo appearance by Madison Mayor Dave Cieslewicz. From Blame Society Productions at blamesociety.net Written and Directed by Matt Sloan and Aaron Yonda Co-Written by Craig Johnson and Rob Matsushita http Produced by ...'});
	cvids_607.push({vid:58275, thumb: 'http://i.ytimg.com/vi/jEzLrMQC5GE/0.jpg', title: 'Chad Vader S1 Ep7: Trapped In The Trash', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. Chad and Commander Wickstrom hatch a plan to get Chad\'s job back. Customers beware! Written and Directed by Matt Sloan and Aaron Yonda Co-Written by Craig Johnson and Rob Matsushita robmatsushita.blogspot.com Produced by Courtney Collins http myspace.com Starring: Chad / Hal - Aaron Yonda myspace.com Clint/Voice of Chad - Matt Sloan myspace.com Randy - Brad Knight monkeybusinessinstitute.com ...'});
	cvids_607.push({vid:58284, thumb: 'http://i.ytimg.com/vi/Vz0aXl303j0/0.jpg', title: 'Chad Vader S1 Ep8: Chad Fights Back', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. The long awaited battle between Clint and Chad is finally here. Episode 8, the last episode of Chad Vader: Season 1. Written and Directed by Matt Sloan and Aaron Yonda Co-Written by Craig Johnson and Rob Matsushita robmatsushita.blogspot.com Produced by Courtney Collins http myspace.com Starring: Chad / Hal - Aaron Yonda myspace.com Clint/Voice of Chad - Matt Sloan myspace.com Jeremy - Paul Guse ...'});
	cvids_607.push({vid:58276, thumb: 'http://i.ytimg.com/vi/nPC-xZwABK4/0.jpg', title: 'Chad Vader 1 Director\'s Commentary', desc: 'Commentary off the Chad Vader DVD. Get all the commentary with a CHAD DVD! Go to www.blamesociety.net and get yours before they\'re gone again. Find more Chad at www.youtube.com or at www.blamesociety.net'});
	cvids_607.push({vid:58277, thumb: 'http://i.ytimg.com/vi/DutVyuiy-xA/0.jpg', title: 'Chad Vader S2 Ep1: The Takeover', desc: 'Chad is back! Empire Market has been taken over by corporate chain Red Leader Foods. Chad and company get their first look at their new owner. Support season 2 by donating or buying merch at www.blamesociety.net Directed and Edited by Matt Sloan and Aaron Yonda http Written by Matt Sloan, Aaron Yonda, Craig Johnson, and Rob Matsushita Produced by Courtney Collins courtneycollins.com http Director of Photography - Tona Williams bigbite.org Chad - Aaron Yonda http Champion J Pepper and voice ...'});
	cvids_607.push({vid:58278, thumb: 'http://i.ytimg.com/vi/Cu7gzjK16oc/0.jpg', title: 'Chad Vader S2 Ep2: Laser Trouble', desc: 'Chad finally debuts his new, more powerful, laser checkout system with unexpected results. Directed and Edited by Matt Sloan and Aaron Yonda blamesociety.net Written by Matt Sloan, Aaron Yonda, Craig Johnson, and Rob Matsushita Produced by Courtney Collins http myspace.com Director of Photography - Tona Williams bigbite.org Chad - Aaron Yonda http Champion J Pepper and voice of Chad - Matt Sloan myspace.com Randy - Brad Knight monkeybusinessinstitute.com Commander Jeremy Wickstrom - Paul ...'});
	cvids_607.push({vid:58279, thumb: 'http://i.ytimg.com/vi/Ep9x1IXVi94/0.jpg', title: 'Chad Vader S2 Ep3: Into the Basement', desc: 'Chad and Jeremy must journey to the Empire Market basement, a creepy and dangerous place where only fools go. Written, Directed, and Edited by Matt Sloan and Aaron Yonda Produced by Courtney Collins courtneycollins.com http Assistant Director and Lighting - John Urban urbanphotoco.com Director of Photography - Tona Williams http Chad - Aaron Yonda blamesociety.net Voice of Chad - Matt Sloan http Commander Wickstrom - Paul Guse myspace.com Weird Jimmy - Craig Johnson myspace.com Maggie mccall ...'});
	cvids_607.push({vid:58280, thumb: 'http://i.ytimg.com/vi/er3gOybskfM/0.jpg', title: 'Chad Vader S2 Ep4: The Basement Strikes Back', desc: 'Chad and Commander Wickstrom face deadly robots and fight! Written, Directed, and Edited by Matt Sloan and Aaron Yonda twitter.com Produced by Courtney Collins courtneycollins.com http Assistant Director and Lighting - Rick Fatke fatkemedia.com and John Urban http Director of Photography - Tona Williams bigbite.org Chad - Aaron Yonda http Voice of Chad - Matt Sloan myspace.com Commander Wickstrom - Paul Guse myspace.com Weird Jimmy - Craig Johnson myspace.com Maggie mccall - Karen Moeller ...'});
	cvids_607.push({vid:58281, thumb: 'http://i.ytimg.com/vi/g9R-huk5Io8/0.jpg', title: 'Chad Vader S2 Ep5: The New Employee', desc: 'Chad is reunited with a crazed lunatic former employee who his new boss has rehired for some reason. Special Thanks Halloween Costumes www.starwarscostumes.com - www.halloweencostumes.com Support Chad! Get your Chad Vader dvds and t-shirts at blamesociety.net ---- Written, Directed, and Edited by Matt Sloan and Aaron Yonda Produced by Courtney Collins courtneycollins.com http Assistant Director: John Urban urbanphotoco.com Director of Photography Tona Williams bigbite.org Starring Chad ...'});
	cvids_607.push({vid:58282, thumb: 'http://i.ytimg.com/vi/zhCRdoN7mqQ/0.jpg', title: 'Chad Vader S2 Ep6: First Kiss', desc: 'Chad finally succeeds at romance and Randy finds a new weird friend. Help support Chad Vader, get a t-shirt or a DVD at www.blamesociety.net Special Thanks Halloween Costumes www.starwarscostumes.com - www.halloweencostumes.com Support Chad! Get your Chad Vader dvds and t-shirts at...'});
	cvids_607.push({vid:58283, thumb: 'http://i.ytimg.com/vi/NhUeKhJPw-w/0.jpg', title: 'Chad Vader S2 Ep7: Goodbye, Chad', desc: 'Chad, seriously in love for the first time, finds that life can be cruel, really horribly cruel, and then annoying. Follow the funny: www.twitter.com www.twitter.com www.twitter.com Special thanks to: www.halloweencostumes.com www.starwarscostumes.com Written, Directed, and Edited by Matt Sloan and Aaron Yonda myspace.com twitter.com Produced by Courtney Collins courtneycollins.com http Assistant Director - John Urban urbanphotoco.com Director of Photography - Tona Williams http starring ...'});
	cvids_607.push({vid:58285, thumb: 'http://i.ytimg.com/vi/urbwMpoDqkI/0.jpg', title: 'Chad Vader Re-enacts The Oscar Nominees', desc: 'Chad Vader re-enacts five oscar-nominated movies in three minutes. He also plays all the roles himself.'});
	cvids_607.push({vid:58286, thumb: 'http://i.ytimg.com/vi/7ocSZiRznVQ/0.jpg', title: '\"Are You Fit For Command?\" Chad Vader Training #4', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. Chad plants a hidden camera in Randy\'s office to show you what it\'s like to be the general manager of a grocery store. Thanks for subscribing. Written and Directed by Matt Sloan and Aaron Yonda Chad - Aaron Yonda Voice of Chad - Matt Sloan Randy - Brad Knight monkeybusinessinstitute.com Commander Wickstrom - Paul Guse Produced by Courtney Collins http myspace.com Assistant Director - John Urban ...'});
	cvids_607.push({vid:58287, thumb: 'http://i.ytimg.com/vi/wSW4qDs-JU0/0.jpg', title: '\"A Spy In Produce\" Chad Vader Training #1', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. Chad explains the proper way to deal with spies in the produce section, with multiple choice. This is the first in a new series of Chad Vader training videos. Chad - Aaron Yonda and Craig Johnson Hal - Aaron Yonda Randy - Brad Knight monkeybusinessinstitute.com Producer Courtney Collins courtneycollins.com http Assistant Director: John Urban urbanphotoco.com Camera Tona Williams bigbite.org Sound ...'});
	cvids_607.push({vid:58289, thumb: 'http://i.ytimg.com/vi/uM2S6k1Psag/0.jpg', title: '\"Decoding The Dress Code\" Chad Vader Training #3', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. #3 of the series, Chad Vader helps you figure out the complicated dress code at Empire Market. Written and Directed by Matt Sloan and Aaron Yonda Commander Edwards - Asa Derks Commander Wickstrom - Paul Guse Customer - Linda Hedenblad Chad Vader - Aaron Yonda Voice of Chad - Matt Sloan Randy - Brad Knight monkeybusinessinstitute.com Produced by Courtney Collins http myspace.com Assistant Director ...'});
	cvids_607.push({vid:58291, thumb: 'http://i.ytimg.com/vi/d7JRmGp9DgQ/0.jpg', title: 'Chad Vader\'s Miserable Labor Day', desc: 'Chad is forced to work on Labor Day, and he becomes very upset. Follow us on Twitter: www.twitter.com www.twitter.com'});
	cvids_607.push({vid:58292, thumb: 'http://i.ytimg.com/vi/ma5UwLN-Suo/0.jpg', title: 'Chad Vader and the Security Gate', desc: 'Chad Vader runs afoul of a wacky security guard.'});
	cvids_607.push({vid:58293, thumb: 'http://i.ytimg.com/vi/w-4O8o4XJr0/0.jpg', title: '\"Shoplifting: Never Lower Your Guard\" Chad Vader Training #5', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. How do you take out a shoplifter? Chad personally directs this training video and explains the proper way to dispatch a shoplifter. Written and Directed by Matt Sloan and Aaron Yonda Starring: Lionel - Bill Bolz Weird Jimmy - Craig Johnson myspace.com Randy - Brad Knight monkeybusinessinstitute.com Lloyd - Rob Matsushita Shoplifter - Mark mcconville http Matt Sloan myspace.com Aaron Yonda myspace ...'});
	cvids_607.push({vid:58294, thumb: 'http://i.ytimg.com/vi/CgU9MT-90Uo/0.jpg', title: 'Chad Vader Comment Read + Post Season 1 Update', desc: 'We chat about the first season, mention the second season, and a special guest reads some comments on episode 8. Camera - Nick Drake blamesociety.net'});
	cvids_607.push({vid:58295, thumb: 'http://i.ytimg.com/vi/EZGDrKDWgGU/0.jpg', title: 'Chad Vader Is Your Father', desc: 'Chad suckers Commander Wickstrom into doing his yearly Father\'s Day ritual. Season 1 Chad dvds available: www.blamesociety.net Our collab with Mediocre Films: www.youtube.com Starring GREG BENSON PAUL GUSE MATT SLOAN AARON YONDA Camera TONA WILLIAMS Music GREG BENSON ANDREW YONDA \u00a92009 Blame Society Productions'});
	cvids_607.push({vid:58296, thumb: 'http://i.ytimg.com/vi/ijpZeF8M8HA/0.jpg', title: 'Chad Vader Script Read-Blame Society Update 001', desc: 'We give you the latest news and read you a couple passages from the script for Season 2 episode 1 of Chad Vader. And read some comments. Super Deluxe Link: www.superdeluxe.com or blamesociety.net'});
	cvids_607.push({vid:58297, thumb: 'http://i.ytimg.com/vi/JBJo_Ag3dUA/0.jpg', title: '\"Stay Sober For Once\" - Chad Vader Greeting Card #6', desc: 'A card for the addict in your life. Be sure to send this to all the addicts you know.'});
	cvids_607.push({vid:58298, thumb: 'http://i.ytimg.com/vi/MWSY-ZDqekg/0.jpg', title: '\"Run Away!\" - Chad Vader Greeting Card #4: For Children', desc: 'Chad gives a Holiday Message to children from their parents, sort of... Feel free to send these greeting cards to friends and family for the holidays.'});
	cvids_607.push({vid:58299, thumb: 'http://i.ytimg.com/vi/sGTAnXqn9Jc/0.jpg', title: 'Chad After Dentist', desc: 'Follow our tweets - www.twitter.com www.twitter.com Try a Chad DVD, high quality Chad Vader: www.blamesociety.net Chad Vader returns from the Dentist feeling very similar to David. Directed by MATT SLOAN AARON YONDA www.blamesociety.net Director of Photography John Urban http Randy BRAD KNIGHT monkeybusinessinstitute.com Lightsaber CHARLEY BROWN Check out his star wars video: www.youtube.com Engineer of Chad\'s Voice JOHN LEE'});
	cvids_607.push({vid:58300, thumb: 'http://i.ytimg.com/vi/WrQg2c3hGxE/0.jpg', title: 'Chad Vader Hits 9 MILLION!', desc: '9 million views?! Holy crap. That\'s awesome.'});
	cvids_607.push({vid:58301, thumb: 'http://i.ytimg.com/vi/LdFy3wqxTGo/0.jpg', title: '\"Nice or Naughty?\" - Chad Vader Greeting Card #3', desc: 'Find out if you\'re on the naughty or the nice list. Feel free to share this and other video greeting cards with your friends and family this holiday season.'});
	cvids_607.push({vid:58302, thumb: 'http://i.ytimg.com/vi/ZX3aheU0qis/0.jpg', title: 'Chad Vader Goes Turkey Bowling', desc: 'Chad takes Commander Wickstrom turkey bowling to illustrate...well...something. The NEW Chad Vader season starts February 1st, 2009. Season 1 dvds and The Training Video dvds can be got at www.blamesociety.net (get them soon, we\'re going to be taking them off the market pretty soon it looks like) Written and Directed by MATT SLOAN AARON YONDA Starring PAUL GUSE AARON YONDA Voice of Chad MATT SLOAN Music Composed by ANDREW YONDA http Script Assistance COURTNEY COLLINS www.courtneycollins.com...'});
	cvids_607.push({vid:58303, thumb: 'http://i.ytimg.com/vi/GMVjSyyNrxU/0.jpg', title: 'Chad Vader Blogs and Raps (Blog 3 of 3)', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. Chad Vader, Day Shift Manager extraordinaire, breaks it down for you, old school. blamesociety.net'});
	cvids_607.push({vid:58304, thumb: 'http://i.ytimg.com/vi/n-0wNvf25hI/0.jpg', title: '\"Non-offensive Holiday Greeting\" Chad Vader Greeting Card #1', desc: 'Chad Vader provides an all-purpose, non-offensive holiday message. Feel free to share this and other video greeting cards with your friends and family this holiday season.'});
	cvids_607.push({vid:58305, thumb: 'http://i.ytimg.com/vi/I1KeR7pgx14/0.jpg', title: 'Chad Vader Wants a Woman (Blog 2 of 3)', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. A sad Chad discusses his need for a woman, and how he does not need overflowed toilets. blamesociety.net'});
	cvids_607.push({vid:58306, thumb: 'http://i.ytimg.com/vi/brmDBBP5VP4/0.jpg', title: 'Chad Vader Is Hyper (Blog 1 of 3)', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. Chad had some coffee and couldn\'t resist blogging--while he\'s at work.'});
	cvids_607.push({vid:58307, thumb: 'http://i.ytimg.com/vi/P6dUCOS1bM0/0.jpg', title: 'Chocolate Rain by Chad Vader', desc: 'CHAD DVDS ARE BACK IN STOCK! Go to www.blamesociety.net and get yours before they\'re gone again. Chocolate rain? We couldn\'t resist.'});
	cvids_607.push({vid:58308, thumb: 'http://i.ytimg.com/vi/nnP3CnvDcwM/0.jpg', title: 'Play Him Off Keyboard Chad', desc: 'It\'s a Chad Vader and Keyboard Cat duet. Don\'t get it? Go to: playhimoffkeyboardcat.com For Keyboard cat stuff go to: charlieschmidt.com'});
	cvids_607.push({vid:58309, thumb: 'http://i.ytimg.com/vi/ND6n81Hjmlo/0.jpg', title: 'Will Chad Vader Go To Youtube Live?', desc: 'We gave Chad a call to see if he could make it to Youtube Live on November 22nd.--- CHAD DVDS are back in stock!! www.blamesociety.net Chad, Aaron, and Matt did a funny commentary track you can watch with Star Wars: A New Hope, go here: www.rifftrax.com'});
html+='<div id="thumb_607" style="width:407px;overflow:hidden;height:336px;background-color:#FFFFFF;position:relative;float:left;">';
html+=vidthumbhtml_607(curvid_607);
html+='</div>';
	html +='<div style="height:26px;width:126px;position:absolute;right:5px;">';
		//html +='<img onclick="showmatrix_607(0);" style="position:absolute;left:66px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconmatrix24.png" title="overzicht van alle videos"/>';
		html +='<img id="pgprev_607" onclick="gotopageoffset_607(-1);" style="position:absolute;left:0px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconprev24.png" onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" title="blader terug"/>';
		//html +='<img onclick="playstop_607();" style="position:absolute;left:5px;top:20px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconstop24.png" title="stop"/>';
		//html +='<img onclick="playstart_607();" style="position:absolute;left:5px;top:30px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconplay24.png" title="afspelen"/>';
		html +='<img id="pgnext_607" onclick="gotopageoffset_607(1);" style="position:absolute;left:66px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/iconnext24.png" onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);"  title="blader verder"/>';
		html +='<div style="position:relative;top:54px; width:124px; margin:0px 0px 0px 0px;height:280px;overflow:hidden;border:1px solid #ddd;background-color:#fff" id="mxsoutline_607">';
			html+='<div id="mxs_607"  style="position:absolute;top:0px;background-color:#ffffff;"></div>';
			html+='<div id="mxs2_607" style="position:absolute;top:0px;background-color:#ffffff;"></div>';	// videolist placeholder
		html +='</div>';
	html +='</div>';
	html+='<div style="height:26px;width:100px;position:absolute;bottom:8px;left:0px;">';
	html+='<a target=_blank href="http://www.dik.nl/"><img style="position:absolute;left:0px;top:3px;height:25px;z-index:5;cursor:pointer;margin:0;padding:0;" border=0 src="http://incdn.s3.amazonaws.com/dikp_v1/img/project/dik/logo.png"></a>';
			//html +='<a target=_blank href="http://www.dik.nl/channel/player/7291/first"><div style="position:absolute;left:70px;top:9px;color:#444;font-size:11px;line-height:10px;cursor:pointer;width:185px;height:20px;overflow:hidden;" >powered by dik.nl</div></a>';
					html +='<img onclick="toggleembed_607();" src="http://www.dik.nl/img/icon_share30.png" style="cursor:pointer;position:absolute;left:384px;top:0px;" title="share or embed" alt="share or embed">';
				html +='<a style="text-decoration:none" target=_blank href="http://www.dik.nl/channel/player/7291/first"><div style="position:absolute;left:70px;top:3px;color:#444;font-size:11px;line-height:10px;cursor:pointer;width:185px;height:22px;overflow:hidden;" ><span style="color:#888;">Je kijkt naar het kanaal</span><br/>Chad Vader</div></a>';
		html+='</div>';
	
	html+='</div></div>';	// margin and innerflash
	html+='<iframe src="http://www.dik.nl/util/ustat" width="0" height="0" border="no" frameborder="0"  style="border:0; visibility: hidden;"></iframe>';
	wgElm_607.innerHTML=html;
	wgElm_607.style.display = 'block';

	gotopage_607(matrix_curpg);	// 1
		
}

function playnext_607() {
	if (curvid_607 < cvids_607.length -1 ) {
		curvid_607++;
		if (cpvideo_607)
			playstart_607();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_607');
			thumbdiv.innerHTML=vidthumbhtml_607(curvid_607);
		}
	}
}
function playprev_607() {
	if (curvid_607 >0 ) {
		curvid_607--;
		if (cpvideo_607)
			playstart_607();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_607');
			thumbdiv.innerHTML=vidthumbhtml_607(curvid_607);
		}
	}
}

// play video in video window
function playstart_607(vnr) {
	closepopup_607();	// close popup (if open)
	if (vnr==null)
		vnr=curvid_607;
	else
		curvid_607=vnr;	// set the current
	var thumbdiv=document.getElementById('thumb_607');
	thumbdiv.innerHTML='<div></div>';
	thumbdiv.style.background='#FFF url(http://incdn.s3.amazonaws.com/dikp_v1/img/spinner32.gif) no-repeat 173.5px 138px';
	thumbdiv.innerHTML='<iframe name="playerframe" class="playerframe" src="http://www.dik.nl/widget/playvideo/'+cvids_607[vnr].vid+'/407/336/L/W" width="407" height="336" frameborder="0" scrolling="no" allowtransparency="true"></iframe>';
	cpvideo_607=true;
}

// show large thumb video still
function playstop_607(vnr) {
	if (vnr==null)
		vnr=curvid_607;
	else
		curvid_607=vnr;	// set the current
	cpvideo_607=false;
	var thumbdiv=document.getElementById('thumb_607');
	thumbdiv.innerHTML=vidthumbhtml_607(vnr);
}

// big thumbnail / player window
function vidthumbhtml_607(vnr) {
	var html='';
	//th: 407 x 336  it: 407 x 274 t= -16 nrdesclines=2 
html+='<div style="width:407px;height:274px; overflow:hidden; position:absolute;left:0px;top:0px;">';
html+='<img src="'+cvids_607[vnr].thumb+'" style="width:407px;height:305.25px;top:-16px;left:0px;position:relative;">';
html+='</div>';
html+='<div style="width:397px;height:62px;position:absolute;left:0px;bottom:0px;background-color:#BBB;padding:5px;"><div style="overflow:hidden;height:52px;"><div style="white-space:nowrap; margin: 2px 3px; font-size:16px;color:#555555;">'+htmlspecialchars(cvids_607[vnr].title)+'</div><div style="margin: 2px 5px; font-size:13px;line-height:13px;color:#ffffff;overflow:hidden;height:27px;"  title="'+htmlspecialchars(cvids_607[vnr].desc)+'">'+htmlspecialchars(cvids_607[vnr].desc)+'</div><div style="padding: 3px 5px; letter-spacing:1px; background-color: #BBB; color: #333;font-size: 10px; position: absolute; right: 0px; top: -14px; ">'+(vnr+1)+'/'+(cvids_607.length)+'</div></div></div>';
html+='<div style="position: absolute; width:100px;height:100px;top:118px;left:154px;z-index:200;cursor:pointer;cursor:hand;background:url(http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/videoplay100.png) no-repeat;" onClick="playstart_607();"></div>';
	return html;
}

function visspb(vnr,show) {
	el = document.getElementById('spbid'+vnr);
	if (el) {
		el.style.display = show ? 'block':'none';  
	} 
	if (show && !cpvideo_607)
		playstop_607(vnr);
}

// thumbs rechts
function vidthumbhtmlSmall_607(vnr) {
	var html='';
	html='';
				html+='<div style="margin: 0px; float: left; position: relative; width: 124px; height: 92px;">';
				html+='<div style="width:104px;max-height:58px;background:#f6f6f6;margin:13px auto 0px auto;overflow:hidden;position:relative;">';
				html+='<div style="width:104px;height:58px;background:#cccccc;border:0px solid #dedede;overflow:hidden;position:relative;"  onmouseover="visspb('+vnr+',true);" onmouseout="visspb('+vnr+',false);" >';
						html+='<img style="position:absolute;width:104px;height:78px;top:-10px;left:0;cursor: pointer;" onclick="playstart_607('+vnr+')" title="'+htmlspecialchars(cvids_607[vnr].desc)+'" src="'+cvids_607[vnr].thumb+'" />';
						html+='<div id="spbid'+vnr+'" style="display:none; position: absolute; width:20px;height:20px;top:20px;left:40px;z-index:200;cursor:pointer;cursor:hand;background:url(http://incdn.s3.amazonaws.com/dikp_v1/img/widget/chart2/videoplay20.png) no-repeat;" onclick="playstart_607('+vnr+')"></div>';
					html+='</div>';
				html+='</div>';
				html+='<div style="position: absolute; bottom: 0px; left: 10px;padding:0 0 4px 0;width:104px;height:15px;z-index:200;color:#555;font-size:11px;overflow:hidden;white-space: nowrap;cursor: pointer;" >'+htmlspecialchars(cvids_607[vnr].title)+'</div>';
			html+='</div>';
		return html;
}

// cp 1..npages
function paginationhtml_607(cp,npages) {
	if (npages<=1)
		return '';	// empty if no pagination..
	var html='';
	html+='<div class="pages">';
	if (cp>1) {
		// we CAN prev!
		html+= '<span class="pageblock" onclick="gotopage_607('+(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_607('+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_607('+(cp+1)+');">Next &#187;</span>';
	else
		html+='<span class="pageblock_disabled">Next &#187;</span>';
	html+='</div>';
	return html;
}

function vidplayurl_607(vnr) {
	if (vnr==null)
		vnr=curvid_607;
	return 'http://www.dik.nl/channel/player/7291/'+cvids_607[vnr].vid;
}

// 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_607() {
  el = document.getElementById('ipopup_607');
  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;
}

//------------------------------------ button handlers --------------------------------------
function stButImg(oBut) {
	if (oBut.id == 'pgnext_607') { 
		if (matrix_curpg>=matrix_npages)
			oBut.src = img2_d.src;
		else
			oBut.src= butnext_mousein ? img2_ov.src : img2_ou.src;
	}
	if (oBut.id == 'pgprev_607') { 
		if (matrix_curpg<=1)
			oBut.src = img1_d.src;
		else
			oBut.src= butprev_mousein ? img1_ov.src : img1_ou.src;
	}
}

function oMouEv(oBut,mouseIn) {
	
	if (oBut.id == 'pgnext_607') 
		butnext_mousein=mouseIn;
	if (oBut.id == 'pgprev_607') 
		butprev_mousein=mouseIn;
	stButImg(oBut);
}

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

function initpage_607() {
	matrix_npages= Math.ceil(cvids_607.length / matrix_itemspp);
}

function gotopage_607(pg) {
		
	if (!matrix_npages)
		initpage_607();
	if (pg<1)
		pg=1;
	if (pg>matrix_npages)
		pg=matrix_npages;
		
	oldpg=matrix_curpg;
	matrix_curpg=pg;
	var mxs=document.getElementById('mxs_607');
	var mxs2=document.getElementById('mxs2_607');
	//if (!mxs)	
	//	alert('mxs_607 niet gevonden');
	var html='';
	for (var i=(matrix_curpg-1)*matrix_itemspp,cv=0;i<cvids_607.length && cv<matrix_itemspp;i++) {
		html+=  vidthumbhtmlSmall_607(i);
		cv++;
	}
	//html+=  '<div style="clear:both;"></div>';
	//if (matrix_npages>1) {
	//	html+=  '<div style="margin:10px 0px">'+paginationhtml_607(matrix_curpg, matrix_npages)+'</div>';
	//}
	if (oldpg<pg) {
		// stop old motions if busy
		if (tween1)	
			tween1.stop(); 
		if (tween2)
			tween2.stop();
		// tween UP
		(tweenflip?mxs2:mxs).innerHTML=html;	// put that in the NEW (to be shifted in) mxs
		// and start the tweens...
		// todo
		tween1 = new Tween((tweenflip?mxs2:mxs).style,'top',Tween.strongEaseOut,278,0      ,1,'px');
		tween1.start();
		tween2 = new Tween((tweenflip?mxs:mxs2).style,'top',Tween.strongEaseOut,0  ,-278 ,1,'px');
		tween2.start();
		tweenflip=!tweenflip;
		//mxs.innerHTML=html;
	}
	else if (oldpg>pg) {
		// tween down
		if (tween1)	
			tween1.stop(); 
		if (tween2)
			tween2.stop();
		(tweenflip?mxs2:mxs).innerHTML=html;	// put that in the NEW (to be shifted in) mxs
		// and start the tweens...
		// todo
		tween1 = new Tween((tweenflip?mxs2:mxs).style,'top',Tween.strongEaseOut,-278,0   ,1,'px');
		tween1.start();
		tween2 = new Tween((tweenflip?mxs:mxs2).style,'top',Tween.strongEaseOut,0   ,278   ,1,'px');
		tween2.start();
		tweenflip=!tweenflip;
	}
	else {
		(tweenflip?mxs:mxs2).innerHTML=html;
	}
	
	
	
	// disable/enable next/prev buttons
	el = document.getElementById('pgnext_607');
	if (el) 
		stButImg(el); // update nextbutton state

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

function gotopageoffset_607(offset) {	// 1 or -1
	if (matrix_npages==0)
		initpage_607();
	if (matrix_curpg+offset<0 || matrix_curpg+offset>matrix_npages) {
		gotopage_607(matrix_curpg);
		return 0;
	}
	gotopage_607(matrix_curpg+offset);
	return 1;
}

function showmatrix_607() {
	// close old one
	closepopup_607();

	matrix_npages= Math.ceil(cvids_607.length / 16);
	
	// open new
	var popup_div = document.createElement('div');
	var title='matrix';
	popup_div.id = "ipopup_607";
	popup_div.style.position = 'absolute';
	popup_div.style.border = 'none';
	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 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 onclick="closepopup_607();" 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 style="position:absolute;top:8px;left:15px;color:#888;font-size:15px;overflow:hidden;width:'+(base_width-50)+'px;">Chad Vader</div>';
	vid_html+=	'<div style="margin:30px 10px 10px 10px;" id="mxs_607">';
	// for (var i=0,cv=0;i<cvids_607.length && cv<16;i++) { 
	// 		vid_html+=  vidthumbhtmlSmall_607(i);
	// 		cv++;
	// 	}
	// 	vid_html+=  '<div style="clear:both;"></div>';
	// 
	// 	if (matrix_npages>1) {
	// 		vid_html+=  '<div style="margin:10px 0px">'+paginationhtml_607(matrix_curpg, matrix_npages)+'</div>';
	// 	}
	vid_html+=	'</div>';
	vid_html+=  '<div style="clear:both;"></div>';
	vid_html+='</div>';
					
	popup_div.innerHTML=vid_html;
	document.body.appendChild(popup_div);
	gotopage_607(matrix_curpg);
}


function closeembed_607() {
  el = document.getElementById('iembed_607');
  if (el) {
    el.parentNode.removeChild(el);
  } 
}
function toggleembed_607() {
	el = document.getElementById('iembed_607');
	if (el) 
		closeembed_607();
	else
		showembed_607();
}

function showembed_607() {
	// close old one
	closeembed_607();
	// open new
	var popup_div = document.createElement('div');
	var title='embed';
	popup_div.id = "iembed_607";
	popup_div.style.position = 'absolute';
	popup_div.style.border = 'none';
	var base_width=520;

	var base_height=90;
	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';
	popup_div.style.position = 'absolute';
	popup_div.style.bottom = '38px';
	popup_div.style.left = '10px';


	
	var vid_html='';
	vid_html+='<div style="width:510px; height:'+(base_height-10).toString()+'px; border:3px solid #BBB;padding:5px; background-color:#fff;color:#000;">';
	vid_html+='<div onclick="closeembed_607();" style="position:absolute;top:7px;right:0px;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 style="font-face:Arial, Helvetica;font-size:10px; margin:10px 0 0 0;">';
	vid_html+='<div style="padding-bottom:3px;"><div style="float:left;width:40px;">URL:</div><input type="text" onclick="this.focus();this.select();" style="border: 0pt none ; background-color: #ccc; width: 440px; font-size: 9px; height: 15px;" value="http://www.dik.nl/channel/player/7291/first"></div>';
	vid_html+='<div style=""><div style="float:left;width:40px;">Embed:</div><textarea rows=2 cols=100 onclick="this.focus();this.select();" style="border: 0pt none ; background-color: #ccc; width: 440px; font-size: 9px; height: 40px;">&lt;div id=&quot;viidoo_solo_92&quot;&gt&lt;/div&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.dik.nl/widget/solojs/7291/92/width:550/height:375/skin:clean&quot;&gt;&lt;/script&gt;</textarea></div>';	
	vid_html+='</div>';

	vid_html+='</div>';	
	popup_div.innerHTML=vid_html;
	
	em = document.getElementById('widget_flash_607');
	if (em) {
    	em.appendChild(popup_div);
	} 
}


// 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 + '"';
}




