//chart2.js for channel 3462 / widget 629 / 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.yubby.com/',	// pgstatsScriptSource.substr(0,pgstatsScriptSource.lastIndexOf('/pgstats/')),
	init: function() {
		if (!(this.uid=this.readCookie('pgstats'))) {
			this.uid= Math.round(Math.random() * 2147483647).toString();
			this.uid+= Math.round(Math.random() * 2147483647).toString();
			this.createCookie('pgstats',this.uid,365*2);
		}
	}, 
	xPageHit: function () {
		var xhReq=this.createXMLHttpRequest();
		if (!xhReq)
			return 'ERR:xhReq';	// forget it..
		if (!this.baseurl)
			return 'ERR:baseurl';	// forget it..
		xhReq.open('get',this.baseurl+'pgstats/tick?'+this.collectInfo(),true);
		// xhReq.onreadystatechange = function() {
		//     if (xhReq.readyState != 4)  { return; }
		//     var serverResponse = xhReq.responseText;
		//     alert(serverResponse);
		// };
		xhReq.send();
		return 'OK';
	},
	collectInfo: function() {
		var rv;
		rv='ts=' + new Date().getTime();
		//rv+='&br='+this.encURI(this.browser);
		rv+='&uid='+this.uid;
		rv+='&url='+this.encURI(this.url);
		rv+='&refer='+this.encURI(this.referrer);
		//rv+='&ssrc='+this.encURI(this.baseurl);
		rv+='&scr='+this.scr;
		for (i in this.ecollect) {
			rv+='&'+i+'='+this.encURI(this.ecollect[i]);
		}

		return rv;
	},
	addcollect: function(key,val) {
		this.ecollect[key]=val;
	},
	//------- helper functions ----------
	createCookie: function (name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	},
	readCookie: function(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	},
	eraseCookie: function(name) {
		createCookie(name,"",-1);
	},
	encURI: function(url) {
		//return encodeURIComponent(url);	// forgets to encode a lot of chars. Useless
		var s = escape(url);	// this is the most complete one, however forgets to encode star, slash, @ and +
		s = s.replace(/\*/g,"%2A");
		s = s.replace(/\//g,"%2F");
		s = s.replace(/\@/g,"%40");
		s = s.replace(/\+/g,"%2B");
		return s;
	},
	createXMLHttpRequest: function() {
  		try { return new XMLHttpRequest(); } catch(e) {}
		try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
		try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}
		return null;
	}
}
pgstats.init();
//pgstats.addcollect('vid','234234');
//pgstats.xPageHit();
// 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_629= new Array();	// channelvideo's
var curvid_629=0;			// first video
var cpvideo_629=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/yubbyp_v1/img/widget/chart2/iconprev24ov.png";
img1_ou.src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconprev24.png";
img1_d.src ="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconprev24d.png";
img2_ov.src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconnext24ov.png";
img2_ou.src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconnext24.png";
img2_d.src ="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconnext24d.png";

var wgElm_629 = document.getElementById('viidoo_chart2_629');
if (wgElm_629) {
	vp_createwg();
}

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

function vp_createwg() {
	var html='<div id="widget_flash_629" 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_629.push({vid:83549, thumb: 'http://storage.zideo.nl/32751/6b3453536d3178776b6e343d.png', title: 'Best commercial ever...', desc: 'Any questions?'});
	cvids_629.push({vid:83548, thumb: 'http://s.mnstat.com/2330-large.jpg', title: 'Heineken - funny commercial', desc: '8 items or less...'});
	cvids_629.push({vid:83547, thumb: 'http://assets0.ordienetworks.com/tmbs/f2541a52b3/fullsize_22.jpg', title: '\n    Swear Jar--Funniest Commercial Ever!\n  ', desc: '\n          \n      \n        Swear Jar--Funniest Commercial Ever! 1:00\n        Funniest commercial ever. This is a Budweiser commercial that I claim no right to whatsoever, just loved it and wanted to share.\n        Submitted by: slygirl1007)\n        Immortal\n        Keywords: bud beer funny swear jar budweiser office comedy swearing bleep Bud Light\n        Views: 292,807\n      \n\n  '});
	cvids_629.push({vid:49651, thumb: 'http://i.ytimg.com/vi/ysmLA5TqbIY/1.jpg', title: 'HASTILY MADE CLEVELAND TOURISM VIDEO', desc: 'The Cleveland Tourism Board gave me 14 million dollars about 8 months ago to make a promotional video to bring people to Cleveland. As usual, I waited till the last minute and I ended up having to shoot and edit it in about an hour yesterday afternoon. I probably should have invested more time. If you\'re bored, come and see my sketch group this Tuesday the 21st and Wednesday the 22nd at Hilarities/Pickwick and Frolic right in the heart of the exceptional downtown Cleveland. Hit up ...'});
	cvids_629.push({vid:49650, thumb: 'http://i.ytimg.com/vi/3xh0BQ2ahyo/1.jpg', title: 'Los Simpson', desc: 'Los simpsons parodia Parody The simpsons ... simpsons homero marge march homer simpson parodia parody '});
	cvids_629.push({vid:48150, thumb: 'http://i.ytimg.com/vi/uNZtuEV0DGU/1.jpg', title: '\u5168\u4e16\u754c\u7537\u4eba\u7684\u5922\u60f3,\u4e0d\u770b\u5f8c\u6094!', desc: '\u597d\u7fa8\u6155.. ... \u6bd4\u57fa\u5c3c\u6cf3\u88dd\u7f8e\u5973sexy \u65e5\u672c\u7d9c\u85dd\u77ed\u7247\u7661\u6f22Japanese '});
	cvids_629.push({vid:48135, thumb: 'http://i.ytimg.com/vi/cjnuVFmiDfM/1.jpg', title: 'The Destroyer vs. Victor the Bear', desc: 'An old video of legendary masked man, The Destroyer, taking on his arch-nemesis, Victor the Bear.'});
	cvids_629.push({vid:48196, thumb: 'http://media07.kyte.tv/store/010/07/crr/0907/20/07/1721339-356575-video13_mp4_120_90-tom-1000.jpg?h=3615555e3b69cf5b53ce96a23ec65f5c', title: 'Adult pirates', desc: ''});
	cvids_629.push({vid:48138, thumb: 'http://i.ytimg.com/vi/2il-PUiVrQI/1.jpg', title: 'WTF!?! CHEWBACCA GETS TASERED ON CAMERA!!!', desc: 'THIS IS F****** MESSED!! CHEWBACCA IS CAPTURED, RESTRAINED, AND TASERED TILL HE SCREAMS \"YARGGLLALRG!\" ... wtf its chewbacca getting tasered what wise ass bitch wookie '});
	cvids_629.push({vid:47269, thumb: 'http://cdn-thumbs.viddler.com/thumbnail_2_dc75d41f.jpg', title: 'Gay Amputee Singing Mariah Carey\'s Obsessed', desc: 'Gay Amputee Singing Mariah Carey\'s Obsessed'});
	cvids_629.push({vid:47178, thumb: 'http://i.ytimg.com/vi/rv6qxC4IToU/1.jpg', title: 'They got talent... to headshot', desc: 'Fake, or not fake doesn\'t matter. Fake czy nie fake, czy to istotne? ... \"Russia\'s got talent\" idol \"britan got talent\" \"got talent\" accident funny \u015bmieszne headshot bow ruscy '});
	cvids_629.push({vid:47161, thumb: 'http://i.ytimg.com/vi/ND3q7xj3ZrM/1.jpg', title: 'Walrus Mask', desc: 'This is a full head foam latex mask we completed. It\'ll be in a gallery shortly. www.northfur.ca ... mask masking fx_makeup makeup prosthetic latex foam_latex furry halloween costume special_effects ar '});
	cvids_629.push({vid:46145, thumb: 'http://i.ytimg.com/vi/pes7qYWNngQ/1.jpg', title: 'GIULIANO,THE BEGINNING OF A NEW HISTORY', desc: 'I AM GIULIANO AND THIS IS MY STORY FROM WHEN I AM BORN TO ARRIVE ALAGE OF 4 YEARS,I AM ONE CHAMPION,AND I HAVE ONE GUINNESS WORLD RECORDS,,I AM THE WORLD STRONGEST KID ! ! ! ... SHOW GYMNASTICS BODYBUILDING MUSCLES '});
	cvids_629.push({vid:46025, thumb: 'http://i.ytimg.com/vi/wdLVLPoRXR4/1.jpg', title: 'Cute Little Pug Pushes Her Pug Puppies Around Portland in a Stroller', desc: 'Our 8-1/2 month old Pug puppy, Jenny, pushes her Nintendog pug dollies around Portland, Oregon. She leaves from our home, goes under the St Johns Bridge, and visits Waterfront Park, Downtown Portland, Union Station, Pittock Mansion, Rose Gardens, and the Grotto, and returns back home. Music: Child\'s Garden by Dax Johnson ... PUG DOG STROLLER PORTLAND CUTE WATERFRONT PARK ROSE GARDEN PITTOCK MANSION '});
	cvids_629.push({vid:45424, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/175/653/17565340_200.jpg', title: 'CASSIUS : YOUTH, SPEED, TROUBLE, CIGARETTES.  \"GUMMO MASHUP\"', desc: 'La future bombe du groupe Cassius \"Youth, Speed, Trouble, Cigarettes.\", clip homemade using Gummo\'s scenes ;) !'});
	cvids_629.push({vid:44982, thumb: 'http://i.ytimg.com/vi/Wo-gGes6qig/1.jpg', title: 'Trailer for Noboru Iguchi\'s \'Robogeisha\'   Cinema Suicide', desc: ''});
	cvids_629.push({vid:44895, thumb: 'http://storage.zideo.nl/24032/6b3447616d6c70776b6e303d.png', title: 'Gwen Spreads HIV On Purpose (Because She\u00e2\u0080\u0099s Nuts) [NSFW] ', desc: 'After \u00e2\u0080\u009csticking a hanger in [her] vagina and \u00e2\u0080\u009closing a baby\u00e2\u0080\u009d (like she was at the grocery store), crazy, crazy mother of two Gwen picked up HIV through a blood transfusion (or, in her words, \u00e2\u0080\u009cpoison blood\u00e2\u0080\u009d), and is intent on spreading on to as many men as possible, which already includes \u00e2\u0080\u009chalf of the New Orleans Police Department.\u00e2\u0080\u009d  This clip is just one in a series of Ricki Lake Minisodes, which trims full episodes down to under five minutes, making them ripe for both cultural theorists and people who like their freak shows \u00e2\u0080\u009cfun-sized.\u00e2\u0080\u009d'});
	cvids_629.push({vid:44630, thumb: 'http://media1.break.com/dnet/media/2009/6/797230_f2887dd9-da41-4f12-8c6c-b95e5b64a295_prod_1_0001_thumb.jpg', title: 'Super Smoker Makes You Look Cool!', desc: 'There is no doubt about it now...the super smoker electronic cigarette just makes you look ultra ultra cool!'});
	cvids_629.push({vid:44234, thumb: 'http://images.vimeo.com/87/30/28/87302869/87302869_200x150.jpg', title: 'GORBACHOV: THE MUSIC VIDEO - BIGGER AND RUSSIANER', desc: 'I did this video for a Russian Metal Band called ANJ. It is pretty crazy. When I saw the lyrics it seemed to be an earnest tribute to Mikael Gorbachov (that\'s how the Russians spell it), so I was a bit confounded about what the video concept should be, but then I had a brainstorm to take it way over the top and I think it was just the thing. Suffice to say it\'s half Russian History allegory as told through an old zombie movie made in the Soviet Union, and half animated Soviet Propaganda posters. It\'s in HD, so let it load a bit before you play it and then click the little \"four arrows\" symbol on the lower right part of the viewer to see it in true HD. BTW- the band has asked that I include their myspace address: http://www.myspace.com/anjkill'});
	cvids_629.push({vid:44233, thumb: 'http://i.ytimg.com/vi/A9P9I9CN7Ww/1.jpg', title: 'Ruby Rocket Private Detective - Awesome Cartoon', desc: 'Check more at www.aniboom.com Ruby Rocket battles crime, and other problems! Animation by Sam Niemann If you wanna chat with me facebook: www.tinyurl.com MySpace - www.myspace.com Twitter - www.twitter.com If you liked this animation, don\'t forget to subscribe, you know you want to . ... Private Detective Cartoon Animation aniboom drama '});
	cvids_629.push({vid:44232, thumb: 'http://i.ytimg.com/vi/oexZc5XXeeo/1.jpg', title: 'Cruise to Hell', desc: 'sofie decided that since we didn\u2019t go to church, we must go TO HELL!!!!'});
	cvids_629.push({vid:44231, thumb: 'http://i.ytimg.com/vi/g94fu8uUiAQ/1.jpg', title: 'Sofie Wants Us to Get Religion', desc: 'go to church!'});
	cvids_629.push({vid:44230, thumb: 'http://i.ytimg.com/vi/QbusUyeBb3k/1.jpg', title: 'Hideous Transformation', desc: 'Clip from Call Me Tonight anime (1986). Thought the anime itself was a bit silly, but the monster designs weren\'t bad for 1986. ... Call Me Tonight anime clip transformation monster demon beast horror 80s mediocre retro vintage japan japanimation manga '});
	cvids_629.push({vid:44229, thumb: 'http://i.ytimg.com/vi/O_84MAfap6c/1.jpg', title: 'I am He-Man', desc: 'I am He-Man'});
	cvids_629.push({vid:44228, thumb: 'http://i.ytimg.com/vi/GJjUVIIYptE/1.jpg', title: 'The Astounding World of the Future', desc: 'A funny mid-20th century newsreel featuring amazingly accurate predictions of the year 2000. BEST SHORT FILM - New York Comedy Film Festival OFFICIAL SELECTION Montrael Just For Laughs Comedy Festival Chicago Short Film Festival Written and Directed by Scott Dikkers Starring Tim Harrod, Maria Schneider DP: Natalie Richter ... parody satire comedy funny old newsreel prediction Scott Dikkers Onion Tim Harrod Maria Schneider robot ray short film '});
	cvids_629.push({vid:41826, thumb: 'http://i.ytimg.com/vi/qQEoobDZYpw/1.jpg', title: ' Arachnid', desc: 'A Spider Morality Tale. What. The. Spider. ... animated terrifying '});
	cvids_629.push({vid:47268, thumb: 'http://media1.break.com/dnet/media/2009/7/822811_1cfd113c-615b-45a0-b77a-ddbbf2d6daf8_prod_1_0001_thumb.jpg', title: 'Gay Amputee Singing Mariah Carey\u2019s Obsessed', desc: 'Just as weird as it sounds'});
	cvids_629.push({vid:41829, thumb: 'http://i.ytimg.com/vi/sCoti7KWvHc/1.jpg', title: 'Beware the Zombie Beach Ninjas', desc: 'NINJA VAMPIRE RAIDERS (Aka VAMPIRE RAIDERS VS NINJA QUEEN)'});
	cvids_629.push({vid:41835, thumb: 'http://assets0.ordienetworks.com/tmbs/b8347e0dab/fullsize_5.jpg?67be2dd4', title: '\n    BANNED by 5secondfilms.com\n  ', desc: '\n          \n      \n        BANNED by 5secondfilms.com 0:51\n        A compilation of banned shorts from 5secondfilms.com\n        Submitted by: 5secondfilms\n        Kinda Cute\n        Keywords: five second films banned magic show volunteer casualties war blowjay bj whale cartoon\n        Views: 7,834\n      \n\n  '});
	cvids_629.push({vid:41832, thumb: 'http://i.ytimg.com/vi/MZERfeh7n4Q/1.jpg', title: 'Here Comes Mr. Meatloaf', desc: 'ALF was the greatest, but Mr. Meatloaf got the best of him!'});
	cvids_629.push({vid:41834, thumb: 'http://i.ytimg.com/vi/UqVvuzQjMOQ/1.jpg', title: 'Sofie thinks You Are All Corporate Shills or Dupes', desc: 'Bill Hicks - Corporate Shills Need more proof?'});
	cvids_629.push({vid:41837, thumb: 'http://i.ytimg.com/vi/h4KRQHvGUb0/1.jpg', title: 'Unko-san #1', desc: 'More info: www.pinktentacle.com ... unko unkosan japan '});
	cvids_629.push({vid:41093, thumb: 'http://i.ytimg.com/vi/PWhxCB0ndJE/1.jpg', title: 'DEATH METAL PARROT', desc: '... DEATH METAL PARROT '});
	cvids_629.push({vid:83544, thumb: 'http://s.mnstat.com/1165-large.jpg', title: 'Funny Toyota commercial', desc: 'A little strange but good commercial for Toyota cars.'});
	cvids_629.push({vid:41250, thumb: 'http://i.ytimg.com/vi/YPsd5BhDNu4/1.jpg', title: 'Funky forest, go for a drink?', desc: 'Another weird movie from japan ... Funky forest naisu no mori nice japan weird '});
	cvids_629.push({vid:41249, thumb: 'http://i.ytimg.com/vi/sqK-wNtqxFE/1.jpg', title: 'Nykytanssi', desc: 'This time we are serious. We made this masterpiece to prove our artistic talent and to inspire millions of people around the globe. Truly, truly interesting dance performance. ... Castle Street productions modern dance art artistic abtract suomi finnish finland tumppi performance music video canon md-111 '});
	cvids_629.push({vid:41248, thumb: 'http://i.ytimg.com/vi/xayd1c0wtOE/1.jpg', title: 'We\'re not candy    Singing Pills, This is serious....', desc: 'We\'re not candy. Singing Pills. This is serious..serious, we could make you Delirious ... candy Delirious '});
	cvids_629.push({vid:40994, thumb: 'http://i.ytimg.com/vi/pLTI3lejhGg/1.jpg', title: 'Starwars Disco Fever', desc: 'From \"Forbidden Transmission\" series. Kris Kristofferson as Han Solo? :^? ... Starwars Disco Bizarre '});
	cvids_629.push({vid:41247, thumb: 'http://123image.123video.nl/6/682_t.jpg', title: 'Seriously salty chick fight', desc: 'Chicks fighting, dirty, and salty fighting too!'});
	cvids_629.push({vid:41001, thumb: 'http://i.ytimg.com/vi/XhZ_GVCkufg/1.jpg', title: '\u30a6\u30b5\u30bf\u30af\u306e\u8a71\u3000\u52d5\u304b\u306a\u3044\u30a6\u30b5\u30bf\u30af\u3000\u5f8c\u7de8 2/2', desc: '\u30b2\u30b9\u30c8\uff1a\u306f\u3080\u3064\u3093\u30b5\u30fc\u30d6\u524d\u7de8 1/2 www.youtube.com \u30a6\u30b5\u30bf\u30af\u30c0\u30f3\u30b9\u8b1b\u5ea7 / Hamtsun Serve\'s dance Lesson www.youtube.com \u300c\u30a6\u30b5\u30bf\u30af\u306e\u8a71\u300d www.fmworld.net ... dance \u30c0\u30f3\u30b9 \u306f\u3080\u3064\u3093\u30b5\u30fc\u30d6 Hamutsun Serve '});
	cvids_629.push({vid:40993, thumb: 'http://i.ytimg.com/vi/LcONhxo3K2k/1.jpg', title: 'harris pest control ad', desc: 'cross-dressing exterminator ad from detroit ... cross-dressing transvestite exterminator detroit '});
	cvids_629.push({vid:41004, thumb: 'http://i.ytimg.com/vi/xHw5T4_JmmM/1.jpg', title: 'lol internet', desc: 'A music video by Jakob Bienenhalm bienenhalm.de Credits: Music \& Video: Jan C. Obergfell Dance \& Performance: Julia Schramm Sebastian Glaser ... demoscene myspace german music funny lol internet internets interweb pokemon sex porn dance pop techno nascar roflmao '});
	cvids_629.push({vid:40989, thumb: 'http://i.ytimg.com/vi/GLqlaYLmshQ/1.jpg', title: 'Killing of Satan', desc: 'End of an era? ... Satan Philippines Challenge '});
	cvids_629.push({vid:41003, thumb: 'http://i.ytimg.com/vi/hta0ndC7Dqw/1.jpg', title: 'The 7 Faces of Dr. Lao-Fortune-telling Scene', desc: 'In this scene from The 7 Faces of Dr. Lao [featuring Tony Randall attempting to play a Chinese man], an old spinster is dealt a lethal fortune-telling, transcribed below: \"Apollonius of Tyana reads your future\" From The Circus of Dr. Lao, Charles G. Finney, 1935. The widow Mrs. Howard T. Cassan came to the circus in her flimsey brown dress and her low shoes and went direct to the fortuneteller\'s tent. She paid her mite and sat down to hear her future. Apollonius warned her she was going to ...'});
	cvids_629.push({vid:40999, thumb: 'http://i.ytimg.com/vi/MfiCmpwoKqE/1.jpg', title: 'A Date With Death: Mind control 101', desc: 'Mind control 101: Psychorama! A Revolutionary new process Subliminal messages directly on the brain banned and controversial- -too powerful for television! ... Date With Death Mind control 101 Revolutionary new process Psychorama Subliminal messages banned too powerful for television and controversial Gerald Mohr Liz Renay Harry Lauter Conspiracy theory MKULTRA CIA Hollywood Lucifurian Mason dangerous curves '});
	cvids_629.push({vid:41002, thumb: 'http://i.ytimg.com/vi/teLnlErJhvk/1.jpg', title: 'Overseer and Prophetess McKinney casting a homosexual demon', desc: 'This man had a spirit in him. It can not stay it has to go. The Homosexual spirit is not of GOD!!!!! ... Manifestedgloryct '});
	cvids_629.push({vid:41000, thumb: 'http://i.ytimg.com/vi/ttvGz7rnjRE/1.jpg', title: 'Killer Klowns From Outer Space (1988) Theatrical Trailer', desc: 'This is the plot when a small town is invaded by aliens from outer space who are capturing and killing the townspeople, no one takes them seriously. Why? The aliens all look like circus clowns, use weapons that look clown like, and all have painted on smiles. Only a few of the young people in the town realize the danger and of course no one believes them. Armed with an ice cream truck they try and rescue their friends. Will you survive the attack of the killer klowns? (C) Retrojunk.com ...'});
	cvids_629.push({vid:40996, thumb: 'http://i.ytimg.com/vi/bbkX7a8FSj8/1.jpg', title: '\u30b5\u30e9\u30ea\u30fc\u30de\u30f3\u4f8d \u5eca\u4e0b\u7de8', desc: '\u5eca\u4e0b\u3067\u540c\u50da\u3092\u53e3\u8aac\u3044\u3066\u3044\u308b\u30d5\u30c8\u30c9\u30ad\u3082\u306e\u3092\u767a\u898b\u3002\u5929\u8a85\u3092\u4e0b\u305b\uff01 \u5199\u771f\u3092\u9001\u308b\u3068\u52d5\u753b\u306b\u51fa\u6f14\u3067\u304d\u308b\u7121\u6599\u30a8\u30f3\u30bf\u30e1\u30b5\u30a4\u30c8\u300c\u30e2\u30fc\u30b7\u30e7\u30f3\u30dd\u30fc\u30c8\u30ec\u30fc\u30c8\u30fb\u30d1\u30fc\u30af\u300d\u304b\u3089\u3002 \u30a2\u30af\u30bb\u30b9\u306f\u643a\u5e2f\u304b\u3089\u21d2 mppark.jp ... MotionPortrait mpPARK \u30e2\u30fc\u30b7\u30e7\u30f3\u30dd\u30fc\u30c8\u30ec\u30fc\u30c8 MP\u52d5\u753b '});
	cvids_629.push({vid:40998, thumb: 'http://i.ytimg.com/vi/je8PKCkpQhU/1.jpg', title: 'Get Your Hopes Up', desc: 'NEW AWESOMENESS FROM HARD PLACE! Winterland flora and fauna, passion and pursuit. Spring 2006 ... Hard Place Get Your Hopes Up Huizenga Tiger Zebra Blood '});
	cvids_629.push({vid:40997, thumb: 'http://i.ytimg.com/vi/WqtSuFOXd9c/1.jpg', title: 'How To Handle A Woman!', desc: 'A Classic William Shatner Clip that Must be seen! ... William Shatner Star Trek Trekkie '});
	cvids_629.push({vid:40992, thumb: 'http://i.ytimg.com/vi/GFNN5bqZFq8/1.jpg', title: 'What the F*** was that?(Evil Dead The Musical', desc: 'A Evil Dead the Musical slide show, with shots from the Musical and Movies to the song What the Fuck was That? ... Evil Dead The Musical '});
	cvids_629.push({vid:40991, thumb: 'http://i.ytimg.com/vi/WLKk00OYKhU/1.jpg', title: 'Jesus Will Survive - Jesus Christ! The Musical', desc: 'Director\'s Cut. ... christ hollywood dancing jesus will survive gloria gaynor javier prato '});
	cvids_629.push({vid:40990, thumb: 'http://i.ytimg.com/vi/6WlPEgtCXVA/1.jpg', title: 'BEST FWENDS - BLOOD', desc: 'BLACKMAGICROLLERCOASTER.COM ... BEST FWENDS BLOOD BLACK MAGIC ROLLERCOASTER SAMHAIN INITIUM MOSHI JEAN-CLAUDE VAN DAMME DAM DAMN ALAMO DRAFTHOUSE AUSTIN JEAN CLAUDE BEASTMASTER JR. BEAST MASTER POWDER PEOPLE DANZIG MOTHER BLOODSPORT TIMECOP KICKBOXER LIL\' LIL LITTLE JUNIOR SWEDE CASPER '});
html+='<div id="thumb_629" style="width:407px;overflow:hidden;height:336px;background-color:#FFFFFF;position:relative;float:left;">';
html+=vidthumbhtml_629(curvid_629);
html+='</div>';
	html +='<div style="height:26px;width:126px;position:absolute;right:5px;">';
		//html +='<img onclick="showmatrix_629(0);" style="position:absolute;left:66px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconmatrix24.png" title="popup an overview with all videos"/>';
		html +='<img id="pgprev_629" onclick="gotopageoffset_629(-1);" style="position:absolute;left:0px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconprev24.png" onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" title="scroll back"/>';
		//html +='<img onclick="playstop_629();" style="position:absolute;left:5px;top:20px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconstop24.png" title="stop"/>';
		//html +='<img onclick="playstart_629();" style="position:absolute;left:5px;top:30px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconplay24.png" title="play"/>';
		html +='<img id="pgnext_629" onclick="gotopageoffset_629(1);" style="position:absolute;left:66px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://incdn.s3.amazonaws.com/yubbyp_v1/img/widget/chart2/iconnext24.png" onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);"  title="scroll forward"/>';
		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_629">';
			html+='<div id="mxs_629"  style="position:absolute;top:0px;background-color:#ffffff;"></div>';
			html+='<div id="mxs2_629" 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.yubby.com/"><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/yubbyp_v1/img/project/yubby/logo.png"></a>';
			//html +='<a target=_blank href="http://www.yubby.com/channel/player/3462/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 yubby.com</div></a>';
					html +='<img onclick="toggleembed_629();" src="http://www.yubby.com/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.yubby.com/channel/player/3462/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;">You are watching channel</span><br/>WTF is going on here?</div></a>';
		html+='</div>';
	
	html+='</div></div>';	// margin and innerflash
	html+='<iframe src="http://www.yubby.com/util/ustat" width="0" height="0" border="no" frameborder="0"  style="border:0; visibility: hidden;"></iframe>';
	wgElm_629.innerHTML=html;
	wgElm_629.style.display = 'block';

	gotopage_629(matrix_curpg);	// 1
		
}

function playnext_629() {
	if (curvid_629 < cvids_629.length -1 ) {
		curvid_629++;
		if (cpvideo_629)
			playstart_629();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_629');
			thumbdiv.innerHTML=vidthumbhtml_629(curvid_629);
		}
	}
}
function playprev_629() {
	if (curvid_629 >0 ) {
		curvid_629--;
		if (cpvideo_629)
			playstart_629();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_629');
			thumbdiv.innerHTML=vidthumbhtml_629(curvid_629);
		}
	}
}

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

// show large thumb video still
function playstop_629(vnr) {
	if (vnr==null)
		vnr=curvid_629;
	else
		curvid_629=vnr;	// set the current
	cpvideo_629=false;
	var thumbdiv=document.getElementById('thumb_629');
	thumbdiv.innerHTML=vidthumbhtml_629(vnr);
}

// big thumbnail / player window
function vidthumbhtml_629(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_629[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_629[vnr].title)+'</div><div style="margin: 2px 5px; font-size:13px;line-height:13px;color:#ffffff;overflow:hidden;height:27px;"  title="'+htmlspecialchars(cvids_629[vnr].desc)+'">'+htmlspecialchars(cvids_629[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_629.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/yubbyp_v1/img/widget/chart2/videoplay100.png) no-repeat;" onClick="playstart_629();"></div>';
	return html;
}

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

// thumbs rechts
function vidthumbhtmlSmall_629(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_629('+vnr+')" title="'+htmlspecialchars(cvids_629[vnr].desc)+'" src="'+cvids_629[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/yubbyp_v1/img/widget/chart2/videoplay20.png) no-repeat;" onclick="playstart_629('+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_629[vnr].title)+'</div>';
			html+='</div>';
		return html;
}

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

function vidplayurl_629(vnr) {
	if (vnr==null)
		vnr=curvid_629;
	return 'http://www.yubby.com/channel/player/3462/'+cvids_629[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_629() {
  el = document.getElementById('ipopup_629');
  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_629') { 
		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_629') { 
		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_629') 
		butnext_mousein=mouseIn;
	if (oBut.id == 'pgprev_629') 
		butprev_mousein=mouseIn;
	stButImg(oBut);
}

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

function initpage_629() {
	matrix_npages= Math.ceil(cvids_629.length / matrix_itemspp);
}

function gotopage_629(pg) {
		
	if (!matrix_npages)
		initpage_629();
	if (pg<1)
		pg=1;
	if (pg>matrix_npages)
		pg=matrix_npages;
		
	oldpg=matrix_curpg;
	matrix_curpg=pg;
	var mxs=document.getElementById('mxs_629');
	var mxs2=document.getElementById('mxs2_629');
	//if (!mxs)	
	//	alert('mxs_629 niet gevonden');
	var html='';
	for (var i=(matrix_curpg-1)*matrix_itemspp,cv=0;i<cvids_629.length && cv<matrix_itemspp;i++) {
		html+=  vidthumbhtmlSmall_629(i);
		cv++;
	}
	//html+=  '<div style="clear:both;"></div>';
	//if (matrix_npages>1) {
	//	html+=  '<div style="margin:10px 0px">'+paginationhtml_629(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_629');
	if (el) 
		stButImg(el); // update nextbutton state

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

function gotopageoffset_629(offset) {	// 1 or -1
	if (matrix_npages==0)
		initpage_629();
	if (matrix_curpg+offset<0 || matrix_curpg+offset>matrix_npages) {
		gotopage_629(matrix_curpg);
		return 0;
	}
	gotopage_629(matrix_curpg+offset);
	return 1;
}

function showmatrix_629() {
	// close old one
	closepopup_629();

	matrix_npages= Math.ceil(cvids_629.length / 16);
	
	// open new
	var popup_div = document.createElement('div');
	var title='matrix';
	popup_div.id = "ipopup_629";
	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_629();" style="position:absolute;top:7px;right:8px;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/icon_bw_close22.png) no-repeat;width:24px;height:24px;z-index:10000;"></div>';
	vid_html+=	'<div style="position:absolute;top:8px;left:15px;color:#888;font-size:15px;overflow:hidden;width:'+(base_width-50)+'px;">WTF is going on here?</div>';
	vid_html+=	'<div style="margin:30px 10px 10px 10px;" id="mxs_629">';
	// for (var i=0,cv=0;i<cvids_629.length && cv<16;i++) { 
	// 		vid_html+=  vidthumbhtmlSmall_629(i);
	// 		cv++;
	// 	}
	// 	vid_html+=  '<div style="clear:both;"></div>';
	// 
	// 	if (matrix_npages>1) {
	// 		vid_html+=  '<div style="margin:10px 0px">'+paginationhtml_629(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_629(matrix_curpg);
}


function closeembed_629() {
  el = document.getElementById('iembed_629');
  if (el) {
    el.parentNode.removeChild(el);
  } 
}
function toggleembed_629() {
	el = document.getElementById('iembed_629');
	if (el) 
		closeembed_629();
	else
		showembed_629();
}

function showembed_629() {
	// close old one
	closeembed_629();
	// open new
	var popup_div = document.createElement('div');
	var title='embed';
	popup_div.id = "iembed_629";
	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_629();" style="position:absolute;top:7px;right:0px;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/icon_bw_close22.png) no-repeat;width:24px;height:24px;z-index:10000;"></div>';
	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.yubby.com/channel/player/3462/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.yubby.com/widget/solojs/3462/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_629');
	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 + '"';
}




