//solo.js for channel 23749 / widget 162949 / WxH: 350x304 / skin: clean / vid: 0 / autoplay: N / matrix: Y 
// Widget standard js for yubby
// NOT based on prototype or jquery - cause it must be lightweight and cant interfere with host

/**
 *	htmlspecialchars - like its php counterpart
 *	@author rvw
 *	@since 08-03-2010 12:19
 */
function htmlspecialchars(string) {
	string = string.toString();
	string = string.replace(/&/g, '&amp;');    
	string = string.replace(/</g, '&lt;').replace(/>/g, '&gt;');
	string = string.replace(/"/g, '&quot;');
	// single quote.. string = string.replace(/'/g, '&#039;');
	return string;
}

//------------ tween.js ----------------------
function Delegate() {}
Delegate.create = function (o, f) {
	var a = new Array() ;
	var l = arguments.length ;
	for(var i = 2 ; i < l ; i++) a[i - 2] = arguments[i] ;
	return function() {
		var aP = [].concat(arguments, a) ;
		f.apply(o, aP);
	}
}

Tween = function(obj, prop, func, begin, finish, duration, suffixe){
	this.init(obj, prop, func, begin, finish, duration, suffixe)
}
var t = Tween.prototype;

t.obj = new Object();
t.prop='';
t.func = function (t, b, c, d) { return c*t/d + b; };
t.begin = 0;
t.change = 0;
t.prevTime = 0;
t.prevPos = 0;
t.looping = false;
t._duration = 0;
t._time = 0;
t._pos = 0;
t._position = 0;
t._startTime = 0;
t._finish = 0;
t.name = '';
t.suffixe = '';
t._listeners = new Array();	
t.setTime = function(t){
	this.prevTime = this._time;
	if (t > this.getDuration()) {
		if (this.looping) {
			this.rewind (t - this._duration);
			this.update();
			this.broadcastMessage('onMotionLooped',{target:this,type:'onMotionLooped'});
		} else {
			this._time = this._duration;
			this.update();
			this.stop();
			this.broadcastMessage('onMotionFinished',{target:this,type:'onMotionFinished'});
		}
	} else if (t < 0) {
		this.rewind();
		this.update();
	} else {
		this._time = t;
		this.update();
	}
}
t.getTime = function(){
	return this._time;
}
t.setDuration = function(d){
	this._duration = (d == null || d <= 0) ? 100000 : d;
}
t.getDuration = function(){
	return this._duration;
}
t.setPosition = function(p){
	this.prevPos = this._pos;
	var a = this.suffixe != '' ? this.suffixe : '';
	this.obj[this.prop] = Math.round(p) + a;
	this._pos = p;
	this.broadcastMessage('onMotionChanged',{target:this,type:'onMotionChanged'});
}
t.getPosition = function(t){
	if (t == undefined) t = this._time;
	return this.func(t, this.begin, this.change, this._duration);
};
t.setFinish = function(f){
	this.change = f - this.begin;
};
t.geFinish = function(){
	return this.begin + this.change;
};
t.init = function(obj, prop, func, begin, finish, duration, suffixe){
	if (!arguments.length) return;
	this._listeners = new Array();
	this.addListener(this);
	if(suffixe) this.suffixe = suffixe;
	this.obj = obj;
	this.prop = prop;
	this.begin = begin;
	this._pos = begin;
	this.setDuration(duration);
	if (func!=null && func!='') {
		this.func = func;
	}
	this.setFinish(finish);
}
t.start = function(){
	this.rewind();
	this.startEnterFrame();
	this.broadcastMessage('onMotionStarted',{target:this,type:'onMotionStarted'});
	//alert('in');
}
t.rewind = function(t){
	this.stop();
	this._time = (t == undefined) ? 0 : t;
	this.fixTime();
	this.update();
}
t.fforward = function(){
	this._time = this._duration;
	this.fixTime();
	this.update();
}
t.update = function(){
	this.setPosition(this.getPosition(this._time));
	}
t.startEnterFrame = function(){
	this.stopEnterFrame();
	this.isPlaying = true;
	this.onEnterFrame();
}
t.onEnterFrame = function(){
	if(this.isPlaying) {
		this.nextFrame();
		setTimeout(Delegate.create(this, this.onEnterFrame), 0);
	}
}
t.nextFrame = function(){
	this.setTime((this.getTimer() - this._startTime) / 1000);
	}
t.stop = function(){
	this.stopEnterFrame();
	this.broadcastMessage('onMotionStopped',{target:this,type:'onMotionStopped'});
}
t.stopEnterFrame = function(){
	this.isPlaying = false;
}

t.continueTo = function(finish, duration){
	this.begin = this._pos;
	this.setFinish(finish);
	if (this._duration != undefined)
		this.setDuration(duration);
	this.start();
}
t.resume = function(){
	this.fixTime();
	this.startEnterFrame();
	this.broadcastMessage('onMotionResumed',{target:this,type:'onMotionResumed'});
}
t.yoyo = function (){
	this.continueTo(this.begin,this._time);
}

t.addListener = function(o){
	this.removeListener (o);
	return this._listeners.push(o);
}
t.removeListener = function(o){
	var a = this._listeners;	
	var i = a.length;
	while (i--) {
		if (a[i] == o) {
			a.splice (i, 1);
			return true;
		}
	}
	return false;
}
t.broadcastMessage = function(){
	var arr = new Array();
	for(var i = 0; i < arguments.length; i++){
		arr.push(arguments[i])
	}
	var e = arr.shift();
	var a = this._listeners;
	var l = a.length;
	for (var i=0; i<l; i++){
		if(a[i][e])
		a[i][e].apply(a[i], arr);
	}
}
t.fixTime = function(){
	this._startTime = this.getTimer() - this._time * 1000;
}
t.getTimer = function(){
	return new Date().getTime() - this._time;
}
Tween.backEaseIn = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*(t/=d)*t*((s+1)*t - s) + b;
}
Tween.backEaseOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
}
Tween.backEaseInOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158; 
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
Tween.elasticEaseIn = function(t,b,c,d,a,p){
		if (t==0) return b;  
		if ((t/=d)==1) return b+c;  
		if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) {
			a=c; var s=p/4;
		}
		else 
			var s = p/(2*Math.PI) * Math.asin (c/a);
		
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	
}
Tween.elasticEaseOut = function (t,b,c,d,a,p){
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
	}
Tween.elasticEaseInOut = function (t,b,c,d,a,p){
	if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) var p=d*(.3*1.5);
	if (!a || a < Math.abs(c)) {var a=c; var s=p/4; }
	else var s = p/(2*Math.PI) * Math.asin (c/a);
	if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
}

Tween.bounceEaseOut = function(t,b,c,d){
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
}
Tween.bounceEaseIn = function(t,b,c,d){
	return c - Tween.bounceEaseOut (d-t, 0, c, d) + b;
	}
Tween.bounceEaseInOut = function(t,b,c,d){
	if (t < d/2) return Tween.bounceEaseIn (t*2, 0, c, d) * .5 + b;
	else return Tween.bounceEaseOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}

Tween.regularEaseIn = function(t,b,c,d){
	return c*(t/=d)*t + b;
	}
Tween.regularEaseOut = function(t,b,c,d){
	return -c *(t/=d)*(t-2) + b;
	}

Tween.regularEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t + b;
	return -c/2 * ((--t)*(t-2) - 1) + b;
	}
Tween.strongEaseIn = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}
Tween.strongEaseOut = function(t,b,c,d){
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
	return c/2*((t-=2)*t*t*t*t + 2) + b;
	}

//======= end tween.js
// pgstats - poor mans page statistics.. 
// NOT based on prototype or jquery - cause it must be lightweight

// // get our script src, to know our baseurl so we can call home
// var pgstatsScriptSource = (function(scripts) {
//     var scripts = document.getElementsByTagName('script'),
//         script = scripts[scripts.length - 1];	// at ths very moment, we are the last script guaranteed
// 
//     if (script.getAttribute.length !== undefined) {
//         return script.src
//     }
// 
//     return script.getAttribute('src', -1)
// }());

var pgstats= {
	browser: navigator.userAgent,
	uid: '',
	scr: screen.width.toString()+'x'+screen.height.toString(),
	url: document.URL,
	referrer: document.referrer,
	ecollect: {},
	baseurl: 'http://www.yubby.com/',	// pgstatsScriptSource.substr(0,pgstatsScriptSource.lastIndexOf('/pgstats/')),
	init: function() {
		if (!(this.uid=this.readCookie('pgstats'))) {
			this.uid= Math.round(Math.random() * 2147483647).toString();
			this.uid+= Math.round(Math.random() * 2147483647).toString();
			this.createCookie('pgstats',this.uid,365*2);
		}
	}, 
	xPageHit: function () {
		var xhReq=this.createXMLHttpRequest();
		if (!xhReq)
			return 'ERR:xhReq';	// forget it..
		if (!this.baseurl)
			return 'ERR:baseurl';	// forget it..
		xhReq.open('get',this.baseurl+'pgstats/tick?'+this.collectInfo(),true);
		// xhReq.onreadystatechange = function() {
		//     if (xhReq.readyState != 4)  { return; }
		//     var serverResponse = xhReq.responseText;
		//     alert(serverResponse);
		// };
		xhReq.send();
		return 'OK';
	},
	collectInfo: function() {
		var rv;
		rv='ts=' + new Date().getTime();
		//rv+='&br='+this.encURI(this.browser);
		rv+='&uid='+this.uid;
		rv+='&url='+this.encURI(this.url);
		rv+='&refer='+this.encURI(this.referrer);
		//rv+='&ssrc='+this.encURI(this.baseurl);
		rv+='&scr='+this.scr;
		for (i in this.ecollect) {
			rv+='&'+i+'='+this.encURI(this.ecollect[i]);
		}

		return rv;
	},
	addcollect: function(key,val) {
		this.ecollect[key]=val;
	},
	//------- helper functions ----------
	createCookie: function (name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	},
	readCookie: function(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	},
	eraseCookie: function(name) {
		createCookie(name,"",-1);
	},
	encURI: function(url) {
		//return encodeURIComponent(url);	// forgets to encode a lot of chars. Useless
		var s = escape(url);	// this is the most complete one, however forgets to encode star, slash, @ and +
		s = s.replace(/\*/g,"%2A");
		s = s.replace(/\//g,"%2F");
		s = s.replace(/\@/g,"%40");
		s = s.replace(/\+/g,"%2B");
		return s;
	},
	createXMLHttpRequest: function() {
  		try { return new XMLHttpRequest(); } catch(e) {}
		try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
		try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}
		return null;
	}
}
pgstats.init();
//pgstats.addcollect('vid','234234');
//pgstats.xPageHit();
var isIE = /MSIE ((5\.5)|[6])/.test(navigator.userAgent) && navigator.platform == "Win32";

var cvids_162949= new Array();	// channelvideo's
var curvid_162949=0;			// first video
var cpvideo_162949=false;		// false=thumb, true=video

// in IE, you need to declare these before the vp_createwg is called, otherwise they do not exist in the onclick context
var matrix_curpg=1;
var matrix_npages=1;


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

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

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

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

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

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

var wgElm_162949 = document.getElementById('viidoo_solo_162949');
if (wgElm_162949) {
	vp_createwg();
}

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

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

	cvids_162949.push({vid:121795, thumb: 'http://i.ytimg.com/vi/OkrMnu9k4-A/0.jpg', title: 'Spongebob We Will Rock You', desc: 'Spongebob and his friends singin\' We Will Rock You, from Queen EDIT: 2009/03/21 Almost 1.000.000 views... EDIT 2: 2009/03/22 995564 Views...so close... EDIT 3: 2009/03/23 999051 Views.... EDIT4: 2009/03/24 FINALLY OVER 1 MILLION VIEWS, THANKS! EDIT5: 2009/09/04 Over 2 Million Views! Thanks!'});
	cvids_162949.push({vid:121798, thumb: 'http://i.ytimg.com/vi/k7_7semtxI0/0.jpg', title: 'Original Batman Clips (fight scenes)', desc: 'a few clips of the original batman scenes, possibly one of the greatest shows of all time , well maybe'});
	cvids_162949.push({vid:121797, thumb: 'http://i.ytimg.com/vi/0dPys1cmlfM/0.jpg', title: 'Creedence Clearwater Revival - It Came Out Of The Sky', desc: 'From the album :Willy and the poorboys great track'});
	cvids_162949.push({vid:121794, thumb: 'http://i.ytimg.com/vi/LP1pjLdxJI0/0.jpg', title: 'Michael Jackson - Billie Jean', desc: 'Honeywagon covers Michael Jackson\'s hit Billie Jean in their own inimitable bluegrass style!'});
	cvids_162949.push({vid:121793, thumb: 'http://i.ytimg.com/vi/OplkZcbMVng/0.jpg', title: 'Burlesque - Official Trailer [Christina Aguilera \& Cher]', desc: 'Burlesque is an upcoming American contemporary musical film directed and written by Steve Antin starring Christina Aguilera and Cher. PLOT : Ali (Christina Aguilera) is a small-town girl with a big voice who escapes hardship and an uncertain future to follow her dreams to Los Angeles. After stumbling upon The Burlesque Lounge, a majestic but ailing theater that is home to an inspired musical revue, Ali lands a job as a cocktail waitress from Tess (Cher), the club\'s proprietor and headliner. Burlesque\'s outrageous costumes and bold choreography enrapture the young ingenue, who vows to perform there one day. Soon enough, Ali builds a friendship with a featured dancer named Gerogia (Julianne Hough), finds an enemy in a troubled, jealous performer named Nikki (Kristen Bell), and garners the affection of a bartender and fellow musician Jack (Cam Gigandet). With the help of a sharp-witted stage manager (Stanley Tucci) and gender-bending host named Alexis (Alan Cumming), Ali makes her way from the bar to the stage. Her spectacular voice restores The Burlesque Lounge to its former glory, though not before a charismatic entrepreneur Marcus Gerber (Eric Dane) arrives with an enticing proposal.'});
	cvids_162949.push({vid:121799, thumb: 'http://i.ytimg.com/vi/wgTPH5y1-ZI/0.jpg', title: 'Steve Martin - King Tut (Live 1979)', desc: ''});
	cvids_162949.push({vid:121800, thumb: 'http://i.ytimg.com/vi/dqbBy_JxrK4/0.jpg', title: 'Johnny Carson _ The Animals', desc: 'Johnny Carson with animals'});
	cvids_162949.push({vid:121796, thumb: 'http://i.ytimg.com/vi/h6TIEkB4_F8/0.jpg', title: 'Beatles - Twist \& Shout (live in 65)', desc: 'Beatles playing twist \& shout in New York in 1965...'});
	cvids_162949.push({vid:120769, thumb: 'http://i.ytimg.com/vi/ZN5PoW7_kdA/0.jpg', title: 'The Annoying Orange', desc: 'An Orange annoys the hell out of his friend, Apple. ANNOYING ORANGE YOUTUBE PAGE: youtube.com ANNOYING ORANGE T-SHIRT: bit.ly ANNOYING ORANGE TWITTER: twitter.com ANNOYING ORANGE FACEBOOK: facebook.com WATCH THE ANNOYING ORANGE SERIES: www.youtube.com OUTTAKE: www.youtube.com DANEBOE TWITTER: twitter.com DANEBOE FACEBOOK: facebook.com 2ND CHANNEL: youtube.com STORE: www.gagfilms.com SEND ME STUFF! Daneboe 5225 Canyon Crest Dr. 71-117 Riverside, CA 92507'});
	cvids_162949.push({vid:118370, thumb: 'http://i.ytimg.com/vi/ZWWFnQoR5fc/0.jpg', title: 'The Expendables 2010 Trailer 2', desc: 'Sylvester Stallone new movie with the best movie heroes of all time.Dolph Lundgren, Bruce willies Arnold Schwarzenegger, Jet Li, Jason Statham and many more. This is the new Official movie trailer The expendables PS.Non of this is mine \& I don\'t get any profits from it. Enjoy!rate,comment \& subscribe=)'});
	cvids_162949.push({vid:120773, thumb: 'http://i.ytimg.com/vi/FJSOZ83HKLs/0.jpg', title: 'Annoying Orange: Grandpa Lemon', desc: 'Orange tries to annoy Grandpa Lemon. If only Grandpa could stay awake. RETWEET: 3.ly GRANDPA LEMON SHIRT: 3.ly ANNOYING ORANGE SHIRTS: annoyingorange.spreadshirt.com TWITTER twitter.com FACEBOOK: facebook.com CALL ME: (310) 736-6773 DAILYBOOTH: dailybooth.com WATCH ALL MY EPISODES! www.youtube.com DANEBOE\'S CHANNEL: youtube.com STARRING KEVINBRUECK as GRANDPA LEMON: youtube.com'});
	cvids_162949.push({vid:120771, thumb: 'http://i.ytimg.com/vi/hsBDEiJFrws/0.jpg', title: 'Scared Eggs', desc: 'A carton of eggs get scared out of their shells! TWITTER: twitter.com FACEBOOK: facebook.com 2ND CHANNEL: youtube.com STORE: www.gagfilms.com DAILYBOOTH: dailybooth.com SEND ME STUFF! Daneboe 5225 Canyon Crest Dr. 71-117 Riverside, CA 92507'});
	cvids_162949.push({vid:118372, thumb: 'http://i.ytimg.com/vi/I2KuK1WzBzw/0.jpg', title: 'Elvis On Tour Coming to Blu-Ray and DVD', desc: 'Elvis On Tour is coming to Blu-Ray and DVD for the first time. This Golden Globe winning documentary has been re-mastered in high definition picture and sound for an unforgettable experience.'});
	cvids_162949.push({vid:115479, thumb: 'http://i.ytimg.com/vi/pexjekM7s_o/0.jpg', title: 'The Top 10 Best Wipeout Moments Ever!', desc: 'Tune in Tuesdays at 8/7c on ABC this summer for Wipeout and watch full episodes at abc.go.com'});
	cvids_162949.push({vid:114888, thumb: 'http://i.ytimg.com/vi/g_Y_rLBIxOM/0.jpg', title: 'First Full-Length \"The Green Hornet\" Trailer 2011 [HD]', desc: 'Yahoo! Movies has premiered the first full-length trailer for the brand new film The Green Hornet, which will arrive in theaters nationwide on January 14, 2011. MovieTubeXP.Blogspot.com The Green Hornet comes to theaters January 14th, 2011 and stars Christoph Waltz, Cameron Diaz, Seth Rogen, Edward Furlong, Edward James Olmos, Tom Wilkinson, Jay Chou, Sterling Cooper. The film is directed by Michel Gondry.'});
	cvids_162949.push({vid:112276, thumb: 'http://i.ytimg.com/vi/8NUBVcit5VM/0.jpg', title: 'Scott Pilgrim Vs. The World - New Theatrical Trailer HD (5/31/10)', desc: 'The theatrical trailer for \'Scott Pilgrim Vs. The World\' that will be playing infront of \'Get Him to the Greek.\' I do not own this video or any of the trademarks or characters associated with it. The film and this trailer are \u00a9 2010 Universal Pictures. The Scott Pilgrim comics are \u00a9 2004-2010 Bryan Lee O\'Malley and Oni Press. All rights reserved. Official Movie Site: www.scottpilgrimthemovie.com Official Comic Site: www.scottpilgrim.com Facebook group: www.facebook.com (Make sure you \'Like\' them!)'});
	cvids_162949.push({vid:112855, thumb: 'http://i.ytimg.com/vi/3Zd_khk6zXo/0.jpg', title: 'adidas Originals - Star Wars\u2122 Cantina 2010', desc: 'www.facebook.com adidas Originals invites you to join David Beckham, Daft Punk, Snoop Dogg, Franz Beckenbauer, Noel Gallagher, Ian Brown, Ciara, Jay Baruchel, DJ Neil Armstrong and some of your dear, old friends for an intergalactic 2010 FIFA World Cup\u2122 viewing party that you\'ll never forget.'});
	cvids_162949.push({vid:112279, thumb: 'http://i.ytimg.com/vi/SyoA4LXQco4/0.jpg', title: 'IRON BABY', desc: 'An Iron Man movie parody starring my baby girl. The costume was created by her uncle STROB. www.youtube.com Get some pictures here... files.me.com/patrickboivin/b0ph05'});
	cvids_162949.push({vid:112277, thumb: 'http://i.ytimg.com/vi/XTfxrnuCjdA/0.jpg', title: 'Groovin\' with Ken!', desc: 'Toy Story 3 will be presented in Disney Digital 3D\u2122 in select theaters on June 18th, 2010. The creators of the beloved Toy Story films re-open the toy box and bring moviegoers back to the delightful world of Woody, Buzz and our favorite gang of toy characters in TOY STORY 3. Woody and Buzz had accepted that their owner Andy would grow up someday, but what happens when that day arrives?'});
	cvids_162949.push({vid:112275, thumb: 'http://i.ytimg.com/vi/_qWCOJPwdXw/0.jpg', title: 'More Cowbell Snl Full Original Skit (Real Video!)', desc: 'More Cowbell Snl Full Original Skit (Great Quality) More Cowbell Snl Full Original Skit (Great Quality) More Cowbell Snl Full Original Skit (Great Quality) More Cowbell Snl Full Original Skit (Great Quality)'});
	cvids_162949.push({vid:112273, thumb: 'http://i.ytimg.com/vi/gRP11gWdDKk/0.jpg', title: 'MORNING GLORY \'Trailer #1\' 1080p HD (Rachel McAdams, Harrison Ford, Diane Keaton)', desc: 'Morning Glory is an upcoming comedy film directed by Roger Michell and written by Aline Brosh McKenna. It stars Harrison Ford, Rachel McAdams, Jeff Goldblum, Diane Keaton, and Patrick Wilson. The film was originally scheduled for release on July 30, 2010 in the US, but was pushed back to November 12, 2010.'});
	cvids_162949.push({vid:112278, thumb: 'http://i.ytimg.com/vi/4ywmoXZwkA0/0.jpg', title: '\'The American\' Trailer HD', desc: 'For more info on \'The American\' visit: www.hollywood.com'});
	cvids_162949.push({vid:105401, thumb: 'http://i.ytimg.com/vi/6oTMosZ76b8/0.jpg', title: 'Tiger Woods Nike Golf Commercial', desc: 'Tiger Woods bouncing a golf ball for a Nike golf commercial'});
	cvids_162949.push({vid:95897, thumb: 'http://i.ytimg.com/vi/jacYVzzA-Pc/0.jpg', title: 'SI Swimsuit 2010: Week 1', desc: 'SI will reveal a new set of 2010 swimsuit models every Tuesday. This week travel to Chile and meet Daniella, Julie, Zoe and Irina. For more SI Swimsuit 2010 reveal go to www.si.com/swimsuitreveal'});
	cvids_162949.push({vid:112274, thumb: 'http://i.ytimg.com/vi/Zh-Q8ru3oVc/0.jpg', title: 'Skittles Tube Sock Commercial', desc: 'Meet Tube Sock.'});
	cvids_162949.push({vid:93319, thumb: 'http://i.ytimg.com/vi/2297efxAv8Q/0.jpg', title: 'Petra Nemcova \& Noemie Lenoir - Mississippi', desc: 'So you\'re a photographer, on a beach in Mississippi, shooting Petra Nemcova. She\'s looking hot, wearing a wet swimsuit. And you think, \"Hey, know what would be awesome? Let\'s grab a stuffed crow.\" Watch hundreds of free full-length streaming movies and TV shows on www.crackle.com TWITTER twitter.com TAGS: si issue sexy Petra Nemcova Noemie Lenoir swimsuit 2004 supermodel cover bathing suit Sports illustrated fantasy bikini women nude topless pose hot sand beach minisode watch free streaming television video tv'});
	cvids_162949.push({vid:95889, thumb: 'http://i.ytimg.com/vi/oUcIkNE9rM0/0.jpg', title: 'Brooklyn Decker Model Diary 2010 SI Swimsuit', desc: 'Brooklyn Decker gives you an behind-the-scenes look of her shoot in the Maldives for the SI Swimsuit 2010 issue.'});
	cvids_162949.push({vid:95890, thumb: 'http://i.ytimg.com/vi/GO-ci0exZE0/0.jpg', title: 'Anne V Model Diary SI Swimsuit', desc: 'Anne V brings you behind the scenes of her SI Swimsuit 2010 shoot. For more videos and photos visit sportsillustrated.cnn.com'});
	cvids_162949.push({vid:95895, thumb: 'http://i.ytimg.com/vi/T0C-ngPkopM/0.jpg', title: 'Zoe Duchesne Model Diary', desc: 'Zoe Duchesne brings you behind the scenes of her SI Swimsuit 2010 shoot. For more videos and exclusive photos go to: sportsillustrated.cnn.com'});
	cvids_162949.push({vid:95896, thumb: 'http://i.ytimg.com/vi/W3fBjuQ6At0/0.jpg', title: 'Damaris Lewis In Palm Springs: 2010 Sports Illustrated Swimsuit', desc: 'Damaris Lewis is wearing a Guess bikini and this sexy suit can be found at swimspot.com Get one for yourself!!!'});
	cvids_162949.push({vid:95898, thumb: 'http://i.ytimg.com/vi/8B1mMv1yNi0/0.jpg', title: 'SI Swimsuit 2010: Teaser 3', desc: 'SI will reveal a new set of 2010 swimsuit models every Tuesday. This week travel to India and Palm Springsl and meet Hilary Rhoda, Esti Ginzburg, Julie Ordon, Sonia Dara, Damaris Lewis and Genevieve Morton. For more SI Swimsuit 2010 reveal go to www.si.com/swimsuitreveal'});
	cvids_162949.push({vid:108886, thumb: 'http://i.ytimg.com/vi/BnVaI79vUHI/0.jpg', title: 'Melissa Keller \& Erin Cummings - Brazil', desc: 'Soccer and hot women go together like bikini\'s and sun block. Suspicious? Kick soccer balls in Brazil with Melissa Keller and Erin Cummings as they shed all those extra clothes getting in the way of their activity. They\'re very, very convincing. Watch hundreds of free full-length streaming movies and TV shows on www.crackle.com TWITTER twitter.com TAGS: si issue sexy Melissa Keller Erin Cummings brazil Brazilian swimsuit 2002 supermodel Sports illustrated fantasy bikini women nude topless pose hot sunny wax minisode watch free streaming television video tv'});
	cvids_162949.push({vid:95899, thumb: 'http://i.ytimg.com/vi/ZIGSfN63MhE/0.jpg', title: 'SI Swimsuit 2010: Teaser 2', desc: 'SI will reveal a new set of 2010 swimsuit models every Tuesday. This week travel to Portugal and meet Anne V, Cintia, Jessica Gomes and Jessica White. For more SI Swimsuit 2010 reveal go to www.si.com/swimsuitreveal'});
	cvids_162949.push({vid:95900, thumb: 'http://i.ytimg.com/vi/aqJQ-ecibHM/0.jpg', title: 'SI Swimsuit 2010: Teaser 4', desc: 'Next Tuesday SI will reveal who the SI Swimsuit 2010 cover model is. Go to www.si.com/swimsuit to view all the videos, photos and much much more. This week we bring you to our final destination: the Maldives. Meet our gorgeous models Bar Refaeli, Brooklyn Decker, Dominique Piek and Christine Teigen. For more SI Swimsuit 2010 reveal go to www.si.com/swimsuitreveal Download the SI Swimsuit 2010 Application at the Apple App. Store, available Feb. 9th with exclusive videos and hundreds of SI Swimsuit 2010 photos.'});
	cvids_162949.push({vid:108883, thumb: 'http://i.ytimg.com/vi/KZ1HgPsGPU0/0.jpg', title: 'Heidi Klum \& Molly Sims - Argentina', desc: 'Is it hot in here, or is it just Heidi? Heidi Klum and Molly Sims strap on swimsuits and strut their stuff in Argentina with goats and horses... and a wheelbarrow. If you like supermodels in skimpy outfits, this will please you greatly. Watch hundreds of free full-length streaming movies and TV shows on www.crackle.com TWITTER twitter.com TAGS: Sports illustrated si swim suit issue sexy molly sims heidi klum argentina 2002 supermodel fantasy bikini nude topless cowboy gaucho goat horse wheelbarrow pose hot sunny minisode watch free streaming television video tv'});
	cvids_162949.push({vid:108884, thumb: 'http://i.ytimg.com/vi/e_J2AK44u5E/0.jpg', title: 'Serena Williams - Miami', desc: 'Serena Williams has taken off the tennis shoes and slipped into a sleek white swimsuit. Now, I know you\'re thinking \"Hey, can\'t she wear both of those things together?\" Well I don\'t know the anwser to that. Let\'s just enjoy the visual, okay? Watch hundreds of free full-length streaming movies and TV shows on www.crackle.com TWITTER twitter.com TAGS: si issue Serena Williams sexy swimsuit 2003 supermodel cover bathing suit Sports illustrated fantasy bikini women nude topless pose hot sand beach minisode watch free streaming television tv'});
	cvids_162949.push({vid:108885, thumb: 'http://i.ytimg.com/vi/iePKIeFkw4o/0.jpg', title: 'Melissa Keller \& Marisa Miller - Iowa', desc: 'Holy topless horseback riding! Melissa Keller and Marisa Miller have invaded the farmlands of Iowa, and they\'re not leaving until they\'ve made corn both sexy AND sweet. Watch hundreds of free full-length streaming movies and TV shows on www.crackle.com Tags si issue sexy Melissa Keller Marisa Miller swimsuit 2004 supermodel cover bathing suit Sports illustrated fantasy bikini women nude topless pose hot sand beach minisode Iowa watch free streaming television tv video'});
	cvids_162949.push({vid:108887, thumb: 'http://i.ytimg.com/vi/_XmUOJyqwqk/0.jpg', title: 'Best of Supermodels - New York 2004', desc: 'SI Swimsuit Issue, this is your life. And considering it consists of All-Stars Cheryl Tiegs, Christie Brinkley, Paulina Porizkova, Elle Macpherson, Tyra Banks, Rachel Hunter, Roshumba Williams, and Heidi Klum, you can die happy. Watch hundreds of free full-length streaming movies and TV shows on www.crackle.com Crackle Twitter twitter.com Minisode Twitter: twitter.com Be a Facebook Fan! www.facebook.com Tags: si issue sexy Tyra Banks Heidi Klum Christie Brinkley elle macpherson swimsuit 2004 supermodel cover bathing suit Sports illustrated fantasy bikini women nude topless pose hot sand beach minisode watch free streaming television tv video crackle'});
	cvids_162949.push({vid:108888, thumb: 'http://i.ytimg.com/vi/Vq4V_N_Wl4k/0.jpg', title: 'Carolyn Murphy \& Frankie Rayder - Adirondacks', desc: 'Awesome alert! Not only do we have hot, barely dressed girls in this one, we also have an amphibious car! Carolyn Murphy, tired of regular car accidents on account of her hotness, has decided to step it up. Someone\'s insurance rate is about to go up. Watch hundreds of free full-length streaming movies and TV shows on www.crackle.com TWITTER twitter.com TAGS: si issue sexy Carolyn Murphy Franki Rayder Molly Sims swimsuit 2004 supermodel cover bathing suit Sports illustrated fantasy bikini women nude topless pose hot sand beach Adirondacks minisode watch free streaming television video tv'});
	cvids_162949.push({vid:120775, thumb: 'http://i.ytimg.com/vi/5SZSV9VstdE/0.jpg', title: '2010 Miss America Swimsuit Bikini Contest', desc: 'tinyurl.com 2010 Miss America Pageant A group of 53 beauty queens picked from around the country for their smiles, struts and interview savvy were set to woo a panel of judges in hopes of winning the Miss America 2010 crown. The young women from all 50 states plus the District of Columbia, Virgin Islands and Puerto Rico will cap a week of preliminary competition with the scheduled crowning of a winner Saturday night in Las Vegas. The winner, crowned by reigning Miss America Katie Stam, gets a \00000 scholarship and embarks on a yearlong run with the title to represent the organization and raise awareness for her chosen platform. katie stam mario lopez clinton kelly vivica fox dave koz katie harman shawn johnson brooke white paul rodriguez virginia california michigan caressa cameron kristy cavinder nicole blaszczyk oregon cc barber new york alyse zwick puerto rico mimi pabon oklahooma taylor treat organization scholarhips january jan 21st \"january 21\" 2010 miss america pageant winner las vegas american swimsuit swim suit bikini bikinis'});
html+='<div class="v69resetstyle" id="thumb_162949" style="width:350px;height:278px;background-color:#FFFFFF;position:relative;">';
html+=vidthumbhtml_162949(curvid_162949);
html+='</div>';
	html +='<div class="v69resetstyle" style="height:26px;width:350px;position:relative;background-color:#FFFFFF;">';
	html +='<div class="v69resetstyle" style="position:absolute;left:35px;top:3px;color:#444;font-size:11px;line-height:10px;cursor:pointer;width:185px;height:20px;overflow:hidden;" onclick="location.href=vidplayurl_162949();"><span style="color:#888;"></div>';
	html +='<img style="position:absolute;left:206px;top:0px;height:25px;z-index:5;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com/img/project/yubby/logo.png" onclick="location.href=vidplayurl_162949();">';
		html +='<img onclick="showmatrix_162949(0);" style="position:absolute;left:5px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconmatrix24.png" title="popup an overview with all videos"  	id="pgmatrix_162949" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);"/>';
		html +='<img onclick="playprev_162949();" style="position:absolute;left:274px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconprev24.png" title="go to the previous video in the channel"  		id="pgprev_162949" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstop_162949();" style="position:absolute;left:274px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconstop24.png" title="stop"  													id="pgstop_162949"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstart_162949();" style="position:absolute;left:298px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconplay24.png" title="play"  									id="pgplay_162949"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	// start is now a toggle
	html +='<img onclick="playstartstop_162949();" style="position:absolute;left:298px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconplay24.png" title="play"  									id="pgplay_162949"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='<img onclick="playnext_162949();" style="position:absolute;left:322px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconnext24.png" title="go to the next video in the channel"  	id="pgnext_162949"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='</div>';
	html+='</div>';
	wgElm_162949.innerHTML=html;
	wgElm_162949.style.display = 'block';
		updAllButState(); 
}

function playnext_162949() {
	if (curvid_162949 < cvids_162949.length -1 ) {
		curvid_162949++;
		if (cpvideo_162949)
			playstart_162949();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_162949');
			thumbdiv.innerHTML=vidthumbhtml_162949(curvid_162949);
		}
	}
	updAllButState();
}
function playprev_162949() {
	if (curvid_162949 >0 ) {
		curvid_162949--;
		if (cpvideo_162949)
			playstart_162949();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_162949');
			thumbdiv.innerHTML=vidthumbhtml_162949(curvid_162949);
		}
	}
	updAllButState();
}

function playstart_162949(vnr) {
	closepopup_162949();	// close popup (if open)
	if (vnr==null)
		vnr=curvid_162949;
	else
		curvid_162949=vnr;	// set the current
	var thumbdiv=document.getElementById('thumb_162949');
	thumbdiv.style.background='#FFF url(http://www.yubby.com/img/spinner32.gif) no-repeat 145px 109px';
	thumbdiv.innerHTML='<iframe name="playerframe" class="playerframe" src="http://www.yubby.com/widget/playvideo/'+cvids_162949[vnr].vid+'/350/278/L/W" width="350" height="278" frameborder="0" scrolling="no" allowtransparency="true"></iframe>';
	cpvideo_162949=true;
	updAllButState();
}

function playstop_162949() {
	cpvideo_162949=false;
	var thumbdiv=document.getElementById('thumb_162949');
	thumbdiv.style.background='#FFF';
	thumbdiv.innerHTML=vidthumbhtml_162949(curvid_162949);
	updAllButState();
}

function playstartstop_162949() {
	if (cpvideo_162949) 
		playstop_162949();
	else
		playstart_162949();
}

function vidthumbhtml_162949(vnr) {
	var html='';
	html+='<div class="v69resetstyle" style="width:340px;height:213px; overflow:hidden; position:absolute;left:5px;top:5px;">';
html+='<img src="'+cvids_162949[vnr].thumb+'" style="width:340px;height:255px;top:-21px;position:relative;">';
html+='</div>';
html+='<div class="v69resetstyle" style="width:330px;height:50px;position:absolute;left:5px;top:218px;background-color:#AAA;padding:5px;"><div class="v69resetstyle" style="overflow:hidden;height:47px;width:330px;"><div class="v69resetstyle" style="margin: 2px 3px; white-space: nowrap; font-size:15px;line-height:15px;color:#555555;">'+htmlspecialchars(cvids_162949[vnr].title)+'</div><div class="v69resetstyle" style="margin: 2px 5px; font-size:13px;line-height:13px;color:#ffffff;overflow:hidden;height:40px;"  title="'+htmlspecialchars(cvids_162949[vnr].desc)+'">'+htmlspecialchars(cvids_162949[vnr].desc)+'</div><div class="v69resetstyle" style="padding: 3px 5px; letter-spacing:1px; background-color: #aaa; color: white; position: absolute; right: 0px; top: -14px; font-size: 10px;">'+(vnr+1)+'/'+(cvids_162949.length)+'</div></div></div>';
html+='<div class="v69resetstyle" style="position: absolute; width:72px;height:72px;top:103px;left:139px;z-index:200;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/media_play72.png) no-repeat;" onClick="playstart_162949();"></div>';
	return html;
}

function vidthumbhtmlSmall_162949(vnr) {
	var html='';
	html='';
	html+='<div class="v69resetstyle" style="margin: 5px; float: left; position: relative; width: 162px; height: 90px;">';
		html+='<div  class="v69resetstyle" style="width:160px;max-height:122px;background:#f6f6f6;margin:0 auto 6px auto;overflow:hidden;position:relative;">';
			html+='<div  class="v69resetstyle" style="width:156px;height:86px;background:#cccccc;border:2px solid #dedede;overflow:hidden;position:relative;">';
				html+='<img style="position:absolute;width:160px;height:119px;top:-20px;left:0;cursor: pointer;" onclick="playstart_162949('+vnr+')" title="'+htmlspecialchars(cvids_162949[vnr].desc)+'" src="'+cvids_162949[vnr].thumb+'" />';
				html+='<div class="v69resetstyle" style="position: absolute; width:24px;height:24px;top:28px;left:68px;z-index:200;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/media_play24.png) no-repeat;" onclick="playstart_162949('+vnr+')"></div>';
				html+='<div class="v69resetstyle" style="position: absolute; bottom: 0px; left: 0px;width:156px;height:15px;z-index:200;background-color:#dedede;color:#000000;font-size:11px;overflow:hidden;white-space: nowrap;padding:2px 5px 2px 3px;filter: alpha(opacity=80);filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80);-moz-opacity: 0.80; opacity: 0.80;cursor: pointer;" onclick="playVideo_773417(15893)" >'+htmlspecialchars(cvids_162949[vnr].title)+'</div>';
			html+='</div>';
		html+='</div>';
	html+='</div>';
	return html;
}

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

function vidplayurl_162949(vnr) {
	if (vnr==null)
		vnr=curvid_162949;
	return 'http://www.yubby.com/channel/player/23749/'+cvids_162949[vnr].vid;
}

//------------------------------------ button handlers --------------------------------------
function stButImg(oBut) {
	if (oBut.id == 'pgnext_162949') { 
		if (curvid_162949 >= cvids_162949.length -1 ) 
			oBut.src = imgNext_d.src;
		else
			oBut.src= butnext_mousein ? imgNext_ov.src : imgNext_ou.src;
	}
	if (oBut.id == 'pgprev_162949') { 
		if (curvid_162949==0 ) 
			oBut.src = imgPrev_d.src;
		else
			oBut.src= butprev_mousein ? imgPrev_ov.src : imgPrev_ou.src;
	}
	if (oBut.id == 'pgplay_162949') { 
		if (cpvideo_162949) 	// we are currently playing
			oBut.src = butplay_mousein ? imgStop_ov.src : imgStop_ou.src;
		else
			oBut.src= butplay_mousein ? imgPlay_ov.src : imgPlay_ou.src;
	}
	// if (oBut.id == 'pgstop_162949') { 
	// 	if (!cpvideo_162949 ) 	// currently NOT playing
	// 		oBut.src = imgStop_ov.src;
	// 	else
	// 		oBut.src= butstop_mousein ? imgStop_ov.src : imgStop_ou.src;
	// }
	if (oBut.id == 'pgmatrix_162949') { 
		oBut.src= butmatrix_mousein ? imgMatrix_ov.src : imgMatrix_ou.src;
	}
}

function oMouEv(oBut,mouseIn) {
	
	if (oBut.id == 'pgnext_162949') 
		butnext_mousein=mouseIn;
	if (oBut.id == 'pgprev_162949') 
		butprev_mousein=mouseIn;
	if (oBut.id == 'pgplay_162949') 
		butplay_mousein=mouseIn;
	// if (oBut.id == 'pgstop_162949') 
	// 	butstop_mousein=mouseIn;
	if (oBut.id == 'pgmatrix_162949') 
		butmatrix_mousein=mouseIn;
	stButImg(oBut);
}

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

	el = document.getElementById('pgprev_162949');
	if (el) 
		stButImg(el); // update prevbutton state
		
	el = document.getElementById('pgplay_162949');
	if (el) 
		stButImg(el); // update prevbutton state
		
	// el = document.getElementById('pgstop_162949');
	// if (el) 
	// 	stButImg(el); // update prevbutton state

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

//------------------------------------ other stuff -------------
// find absolute top loc of object

function vp_offsetTop(obj) {
    curtop = 0;
    if (obj.offsetParent) {
    curtop = obj.offsetTop
    while (obj = obj.offsetParent) {
      curtop += obj.offsetTop
    }
  }
  return curtop;
}

function vp_offsetLeft(obj) {
  curtop = 0;
  if (obj.offsetParent) {
    curtop = obj.offsetLeft;
    while (obj = obj.offsetParent) {
      curtop += obj.offsetLeft;
    }
  }
  return curtop;
}


function closepopup_162949() {
  el = document.getElementById('ipopup_162949');
  if (el) {
    el.parentNode.removeChild(el);
  } 
}

//
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function gotopage_162949(pg) {
	if (pg<1)
		pg=1;
	if (matrix_npages<1)
		matrix_npages=1;
	if (pg>matrix_npages) 
		pg=matrix_npages;
		
	matrix_curpg=pg;
	var mxs=document.getElementById('mxs_162949');
	var html='';
	for (var i=(matrix_curpg-1)*16,cv=0;i<cvids_162949.length && cv<16;i++) {
		html+=  vidthumbhtmlSmall_162949(i);
		cv++;
	}
	html+=  '<div class="v69resetstyle" style="clear:both;"></div>';
	if (matrix_npages>1) {
		html+=  '<div  class="v69resetstyle" style="margin:10px 0px">'+paginationhtml_162949(matrix_curpg, matrix_npages)+'</div>';
	}

	mxs.innerHTML=html;
}

function showmatrix_162949() {
	// close old one
	closepopup_162949();

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

	var base_width=172*4+25;

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

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


	
	var vid_html='';
	vid_html+='<div class="v69resetstyle" style="padding:0px;position:relative;border:2px #CCC solid;background-color:white;width:'+(base_width-4)+'px;height:'+(base_height-4)+'px;">';
	vid_html+='<br style="display:none;"/><style type="text/css">	\
		.pages {padding:2px 0 2px 8px; margin:0; clear:both;font-size:12px;} \
			.pages span.pageblock {border: 1px solid #888; color:#000; height: 12px; padding: 3px 6px;margin: 0px 4px 0px 0px;cursor: pointer;cursor:hand;}\
			.pages span.pageblock:hover {color:#D10101;text-decoration:underline;}	\
			.pages span.pageblock_disabled {border: 1px solid #888; color: #aaa; height: 12px; padding: 3px 6px;margin: 0px 4px 0px 0px;}\
			.pages span.pageblock_dots {border: 0px solid #888; color: #000; height: 12px; padding: 3px 6px;margin: 0px 4px 0px 0px;}\
			.pages span.pageblock_curpage {border: 1px solid #888; color: #aaa; height: 12px; padding: 3px 6px;margin: 0px 4px 0px 0px;}\
		</style>';
	vid_html+=	'<div class="v69resetstyle" onclick="closepopup_162949();" 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 class="v69resetstyle" style="position:absolute;top:8px;left:15px;color:#888;font-size:15px;overflow:hidden;width:'+(base_width-50)+'px;">KOOL T.V.</div>';
	vid_html+=	'<div class="v69resetstyle" style="margin:30px 10px 10px 10px;" id="mxs_162949">';
	// for (var i=0,cv=0;i<cvids_162949.length && cv<16;i++) { 
	// 		vid_html+=  vidthumbhtmlSmall_162949(i);
	// 		cv++;
	// 	}
	// 	vid_html+=  '<div style="clear:both;"></div>';
	// 
	// 	if (matrix_npages>1) {
	// 		vid_html+=  '<div style="margin:10px 0px">'+paginationhtml_162949(matrix_curpg, matrix_npages)+'</div>';
	// 	}
	vid_html+=	'</div>';
	vid_html+=  '<div class="v69resetstyle" style="clear:both;"></div>';
	vid_html+='</div>';
					
	popup_div.innerHTML=vid_html;
	document.body.appendChild(popup_div);
	gotopage_162949(matrix_curpg);
}

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

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

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



