//chart2.js for channel 14056 / widget 397 / 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_397= new Array();	// channelvideo's
var curvid_397=0;			// first video
var cpvideo_397=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_397 = document.getElementById('viidoo_chart2_397');
if (wgElm_397) {
	vp_createwg();
}

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

function vp_createwg() {
	var html='<div id="widget_flash_397" 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_397.push({vid:70879, thumb: 'http://a.images.blip.tv/Beganda-SelectsFromViviansKitchen175-896.jpg', title: 'Selects from Vivian\'s Kitchen', desc: '\n\n'});
	cvids_397.push({vid:70878, thumb: 'http://i.ytimg.com/vi/hc89YRlPSGg/0.jpg', title: 'Cooking Perfect Steak', desc: 'Cooking perfect steak is easy with the help of Chef Tips host Jason Hill. Hill explains how to tell when a steak is done by using a simple restaurant method. Now, you\'ll always know the correct steak cooking temperature.'});
	cvids_397.push({vid:70877, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/318/463/31846324_640.jpg', title: 'Cooking', desc: 'For my site.'});
	cvids_397.push({vid:70863, thumb: 'http://i.ytimg.com/vi/ylDEhvjMua8/0.jpg', title: 'How to Cook Iraqi Food: Kubba', desc: 'This dish is unique to the Iraqi city of Mosul, hence the name Kubba\'t Mosul. Kubba is done differently in other parts of Iraq, in Baghdad they resemble dumplings which can either be fried in oil or cooked in a stew. Kubba is how \"Kibbe\" is pronounced in Iraqi dialect. In Mosul, kibbe is made with bulgur, because of the wheat fields that surround the city. Maslawi\'s pride themselves on making the large flat versions of kubba. This dish is perfect for spring with asparagus, chicken, and ...'});
	cvids_397.push({vid:70864, thumb: 'http://i.ytimg.com/vi/952cbaswIbY/0.jpg', title: 'How to Cook Iraqi Food: Basra Date Tarts', desc: 'Basra is a city famous for its expansive date palm groves. This is a step to step guide on how to make Basra Date Tarts, which are inspired by the date groves that have surrounded the city for millenia. The shell is made with dates, oatmeal, and walnuts, and filled with honey-sweetened yogurt. This is a rich, yet all-natural dessert recipe with a lot of heritage. Recipe: 1 1/2 cups of dates for 2 shells 1 handful of oats 1 1/2 cups yogurt 1 T of honey 1 tsp of rosewater 1/3 cup chopped ...'});
	cvids_397.push({vid:70865, thumb: 'http://i.ytimg.com/vi/0W5AaxgSL4E/0.jpg', title: 'Iraqi food cuisine cooking', desc: 'Yummy Iraqi food :) Music: Naseer Shamma - Baghdad Kma Uhebuha'});
	cvids_397.push({vid:70866, thumb: 'http://i.ytimg.com/vi/KeZuE7cZguI/0.jpg', title: 'Iraqi food (Stuffed Zucchini\'s)', desc: 'Iraqi cook Kay Karim cooking stuffed zucchinis. Kay Karim grew up in Baghdad, and immigrated to the United States in 1968. She kept her family heritage alive through cooking these traditional meals for family and friends. www.IraqiFamilyCookbook.com'});
	cvids_397.push({vid:70867, thumb: 'http://i.ytimg.com/vi/ofmtb7XDE6E/0.jpg', title: 'How to make Iraqi Kebabs', desc: 'FOR HIGH QUALITY: www.youtube.com Nawal Nasrallah\'s Iraqi Kebab Recipe. By Nawal Nasrallah: I was once asked to demonstrate an Iraqi dish for a group of middle-schoolers in Boston Universitys Kids Program, Cooking Up Culture I made kebab rolled in flat leavened bread, garnished with onion relish, chopped parsley, and tomatoes. This traditional dish with its long history proved to be a hit with the kids. They asked for seconds and thirds. To prepare a batch of Iraqi kebab enough for making ...'});
	cvids_397.push({vid:70869, thumb: 'http://assets0.ordienetworks.com/tmbs/ad22f17ef0/fullsize_2.jpg', title: '\n    Cooking With Tim part 2\n  ', desc: '\n          \n      \n        Cooking With Tim part 2 2:12\n        Still working on 2007\'s Christmas dinner....it was a short beverage break but it was strong!  Nothing like cooking under the influence!\n        Submitted by: capn_ron_2008)\n        Kinda Cute\n        Keywords: Part 2 Christmas goose cooking channel network Fowl Play\n        Views: 96\n      \n\n  '});
	cvids_397.push({vid:70870, thumb: 'http://ak2.static.dailymotion.com/static/video/181/795/18597181:jpeg_preview_large.jpg?20091107222032', title: 'Cooking with Loving Hut Milpitas:Tofu Club Sandwich ', desc: 'http://SupremeMasterTV.com \u2013Cooking with Loving Hut Milpitas:Tofu Club Sandwich. Episode: 1145, Air Date: 2 November 2009.'});
	cvids_397.push({vid:70871, thumb: 'http://123image.123video.nl/585/585316_t.jpg', title: 'Letscookit.tv Alvo nieuw recept: mosselen met prei room en spekjes', desc: 'Mosselen eten blijft altijd een beetje speciaal. Probeer maar eens deze inventieve variatie van onze chef-kok. Een echte lekkernij! Een videorecept van Letscookit.tv.\r\n\r\nMeer kookdemo\'s en alle videorecepten live te bekijken op Letscookit.tv'});
	cvids_397.push({vid:70872, thumb: 'http://i.ytimg.com/vi/DuMkW35BwK8/0.jpg', title: 'Great Depression Cooking Ep:1 - Pasta with Peas', desc: '91 year old cook and great grandmother, Clara, recounts her childhood during the Great Depression as she prepares meals from the era. Learn how to make simple yet delicious dishes while listening to stories from the Depression. www.GreatDepressionCooking.com'});
	cvids_397.push({vid:70873, thumb: 'http://s1.mcstatic.com/thumb/130552/722819/4/catalog_item5/0/1/david_blaine_changes_coffee_into_money.jpg', title: 'David Blaine Changes Coffee Into Money', desc: 'Cool New Custom Web Search\nhttp://www.shoppersmarketplace.com/google.html\nhttp://www.timbojo.ws Wow, if we could all change our coffee into money, so many of our problems would be over!'});
	cvids_397.push({vid:70880, thumb: 'http://frame.revver.com/frame/120x90/1919652.jpg', title: 'Healthylicious - all about healthy eating.', desc: 'http://www.healthylicious.org is your source for news on healthy eating and diet.  Find tips on weight loss, exercise and recipes.'});
	cvids_397.push({vid:70881, thumb: 'http://00.media.vimeo.com/d1/5/43/35/thumbnail-4335090.jpg', title: 'Cooking', desc: 'Slightly more colourful than captured here.\n\nReally!'});
	cvids_397.push({vid:70882, thumb: 'http://storage.zideo.nl/16700/6b344b576e6c31716b6e343d.png', title: 'Yummy Yummy Cooking Jam', desc: 'Yummy Yummy Cooking Jam'});
	cvids_397.push({vid:70883, thumb: 'http://i.ytimg.com/vi/yREFkmrrYiw/0.jpg', title: 'Great Depression Cooking Ep:2 - Egg Drop Soup', desc: '91 year old cook and great grandmother, Clara, recounts her childhood during the Great Depression as she prepares meals from the era. Learn how to make simple yet delicious dishes while listening to stories from the Depression. In this episode Clara makes Egg Drop Soup and remembers a story about her brother. www.GreatDepressionCooking.com'});
	cvids_397.push({vid:70884, thumb: 'http://80.media.vimeo.com/d1/5/16/59/1659244/1659244_200x150.jpg', title: 'cooking', desc: ''});
	cvids_397.push({vid:70885, thumb: 'http://s3.mcstatic.com/thumb/392090/2804042/4/catalog_item5/0/1/potatoes_power_my_mp3_player_amazing.jpg?v=2', title: 'Potatoes Power My MP3 Player! Amazing!', desc: 'How does it work? I could not believe it! The next time your battery dies, just grab those handy sweet potatoes you have with you.'});
	cvids_397.push({vid:70886, thumb: 'http://frame.revver.com/frame/120x90/1919523.jpg', title: 'Chicken Lajawab with Vicky Vij at Bukhara Grill', desc: 'Join us at Bukhara Grill for authentic North Indian cuisine in Midtown, New York City. Here, fragrant spices and ingredients such as ginger, garlic, onions, cloves, green cardamom and tumeric powder make for a perfectly piquant meal.'});
	cvids_397.push({vid:70887, thumb: 'http://assets0.ordienetworks.com/tmbs/fb37afc55d/fullsize_11.jpg', title: '\n    Pot \& Pans - Pothead Cooking Show - Episode 1\n  ', desc: '\n          \n      \n        Pot \& Pans - Pothead Cooking Show - ... 9:28\n        Man, the munchies will make you eat some messed up stuff! Take \u00e2\u0080\u009cEl Chefe,\u00e2\u0080\u009d a New York Latino cook with a new cooking show called \'Pot and Pans.\' In this first episode, he sets out to make a munchie-killing burrito based on ordinary items from his fridge \& closet like Lucky Charms, chocolate sauce, and leftover lasagna made by his ex-girlfriend\u00e2\u0080\u0099s mother (they broke up six months ago). Episode 1: Lucky Charm Burrito. *The show is 90% improvised dialogue*\n        Submitted by: makefunnotwar)\n        Kinda Cute\n        Keywords: cooking show Episode 1 Man The Make You Messed Up New York pot and pans head ghetto latino New York City marijuana el chefe chef improv spoof reggaeton weed\n        Views: 570\n      \n\n  '});
	cvids_397.push({vid:70888, thumb: 'http://i.ytimg.com/vi/Zg0p5TXi_Cc/0.jpg', title: 'How To Cook Roti', desc: 'How to cook Roti :) ... roti cooking food indian guyana guyanese curry ethinic asian jemeela bread naan kebab tikka masala recipe pizza fajitas '});
	cvids_397.push({vid:70889, thumb: 'http://i.ytimg.com/vi/ROGdJ6unS4U/0.jpg', title: 'Lebanese Cooking: How To Make Summer Squash with Rice', desc: 'A delightful way to make a tasty Lebanese squash dish. This is a vegetarian alternative to kousa mihshi stuffed with rice, garbanzo beans, parsley, and tomato, is satisfying and wonderfully seasoned. If the light green, very tender, Lebanese summer squash are unavailable, use small yellow crooknecks of dark green zucchini. Mexican squash varieties are very similar to Lebanese and might be found in farmers\' markets. Seeds for Lebanese squash are available through a few seed companies, if you ...'});
	cvids_397.push({vid:70890, thumb: 'http://ak2.static.dailymotion.com/static/video/801/905/18509108:jpeg_preview_large.jpg?20091103040345', title: 'Martin Yan\'s Hong Kong  _ Tomorrow\'s Hong Kong', desc: 'Martin Yan\'s Hong Kong  series page at Hulu.comMartin explores new culinary trends with local food and wine experts, and tours a famous cooking school where the next generation of Hong Kong chefs are born.'});
	cvids_397.push({vid:70891, thumb: 'http://i.ytimg.com/vi/atsoSDtGxLs/0.jpg', title: 'Cooking @ DISH - Red Velvet Cupcakes', desc: 'Pastry Chef Wendy is back by popular demand with a fantastic Southern recipe... Red Velvet Cupcakes!'});
	cvids_397.push({vid:70892, thumb: 'http://i.ytimg.com/vi/32_A0-er4Ws/0.jpg', title: 'Cooking With Love: Alice\'s Kitchen', desc: 'Cooking garden fresh foods made with love, from mother to daughter, generations of family knowledge passed down through oral tradition trace a living legacy of Lebanese food.'});
	cvids_397.push({vid:70893, thumb: 'http://images.vimeo.com/25/08/70/250870290/250870290_640.jpg', title: 'Cooking', desc: ''});
	cvids_397.push({vid:70894, thumb: 'http://i.ytimg.com/vi/1IEWJmm4Tms/0.jpg', title: 'Great Depression Cooking Ep:4.5 - Fresh Bread (Peppers and Eggs part 2)', desc: 'In this recipe Clara uses 5 lbs of flour to 2 oz. of yeast. Add room temperature water throughout process until the mixture feels like proper dough. Add touch of salt and sugar to taste. 93 year old cook and great grandmother, Clara, recounts her childhood during the Great Depression as she prepares meals from the era. Learn how to make simple yet delicious dishes while listening to stories from the Great Depression. www.GreatDepressionCooking.com'});
	cvids_397.push({vid:70895, thumb: 'http://i.ytimg.com/vi/JG4zV0euo1E/0.jpg', title: 'Cabbage Pizza Recipe by Manjula, Indian Vegetarian Cooking', desc: 'www.ManjulasKitchen.com INGREDIENTS'});
	cvids_397.push({vid:70896, thumb: 'http://i.ytimg.com/vi/OBUM86Q87HA/0.jpg', title: 'Pani Puri Recipe by Manjula, Indian Vegetarian Cooking', desc: 'www.ManjulasKitchen.com Learn how to make Pani Puri, an Indian treat. Makes about 60 puris. Ingredients Pani (Spicy Water) 1 cup mint leaves (Pudina) 2 to 4 green chilies (adjust to taste) 3 tablespoons tamarind paste (Imli) 3 tablespoons lemon juice 1 teaspoon black salt 1 teaspoon salt (adjust to taste) 1/4 teaspoon ginger powder 1/8 teaspoon asafetida (Hing) 1 tablespoon roasted cumin seed powder 1 tablespoon sugar (adjust to taste) 1/2 teaspoon black pepper 4 cups water (adjust to taste ...'});
	cvids_397.push({vid:70897, thumb: 'http://i.ytimg.com/vi/HkbQ7VqdOvs/0.jpg', title: 'Omama Japanese Cooking #11 - Dashi Maki', desc: 'Japanese food favorite; dashi maki. Firm scrambled egg roll. Children love it! A standard on any sushi platter.'});
	cvids_397.push({vid:70898, thumb: 'http://i.ytimg.com/vi/ACOmKiJDkA4/0.jpg', title: 'How to Make Onigiri (Japanese Rice Balls)', desc: 'Sake or Water Soy Sauce Salt Water 50ml Water (0.21 us cup) 5g Salt (0.18 oz) - Toppings - Shiso Leaf Parsley Kinome - Young Leaves of Sansho Pepper About Music Fr\u00e9d\u00e9ric Chopin - Valse in D-flat major \"Minute Waltz\" - Op. 64 No. 1 Play by Muriel Nguyen Xuan, recording by St\u00e9phane Magnenat creativecommons.org ... cooking healthy Japanese food recipe ume okaka onigiri rice ball salmon umeboshi hiroshimana sardine tuna miso shiso kinome toasted nori short rib \u304a\u306b\u304e\u308a \u6599\u7406 \u30ec\u30b7\u30d4 \u30af\u30c3\u30ad\u30f3\u30b0 \u4f5c\u308a\u65b9 ...'});
	cvids_397.push({vid:70899, thumb: 'http://ak2.static.dailymotion.com/static/video/555/844/18448555:jpeg_preview_large.jpg?20091030223457', title: 'Pumpkin Ideas for Pumpkin Puree', desc: 'http://www.WebCookingClasses.com  Don\'t forget this holiday season that your Halloween porch ornament is also food.  Learn how to cook your pumpkin in two methods for soup, side dish, or filling.  Distributed by Tubemogul.'});
	cvids_397.push({vid:70900, thumb: 'http://assets0.ordienetworks.com/tmbs/125fca07cd/fullsize_11.jpg', title: '\n    Will Cook for Shoes - GINGER COOKIE RECIPE\n  ', desc: '\n          \n      \n        Will Cook for Shoes - GINGER COO... 8:03\n        A girl who hates to cook rewards herself with SHOES!  Yummy in ALL ways!  Will she inspire you too?\n        Submitted by: Magstar64)\n        Kinda Cute\n        Keywords: Will Cook Ginger Cookie for shoes ginger cookies recipes food\n        Views: 26\n      \n\n  '});
	cvids_397.push({vid:70904, thumb: 'http://p-images.veoh.com/image.out?imageId=media-v1830244sKARGAdM1199292305Med.jpg', title: 'Cooking Vegetarian Program 17', desc: ' World Famous Chef Suala Tupolo presents the next in a series of programs showing how to cook simple, yet delicious vegetarian meals.'});
	cvids_397.push({vid:70905, thumb: 'http://bitcast.vimeo.com/vimeo/thumbnails/defaults/default.75x100.jpg', title: 'Making a Vinegarette', desc: ''});
	cvids_397.push({vid:70906, thumb: 'http://assets0.ordienetworks.com/tmbs/aaf70dc879/fullsize_1.jpg', title: '\n    Cooking with Ricky\n  ', desc: '\n          \n      \n        Cooking with Ricky 7:49\n        Weekend Leisure presents \"Learning with Ricky\". In this episode, host Riccardo Sammarco explains concepts behind his astoundingly simple method for cooking a wiener--its essence dictating the procedure. Also includes \"Celebrity Corner\" segment.\nweekendleisure.ca 2007\n\n        Submitted by: Weekend Leisure)\n        Kinda Cute\n        Keywords: wiener ketchup mustard sauerkraut gas stove Paris Hilton Angelina Jolie Jessica Simpson Tom Cruise Nicole Kidman\n        Views: 362\n      \n\n  '});
	cvids_397.push({vid:70907, thumb: 'http://i.ytimg.com/vi/lZhe7ksSxII/0.jpg', title: 'Cooking With Mr. Grind - Bologna-Deli-Delights', desc: 'Today We are Making Bologna-Deli-Delights...... sit back and Enjoy the Master Chef..'});
	cvids_397.push({vid:70908, thumb: 'http://i.ytimg.com/vi/3DgQjx2qIa4/0.jpg', title: 'Great Depression Cooking DVD', desc: 'Now in Stock!!! -------------------- Please visit www.greatdepressioncooking.com/DVD for more details -------------------- Clara\'s youtube.com videos will continue to be viewed on youtube for free, of course.'});
	cvids_397.push({vid:70909, thumb: 'http://ak2.static.dailymotion.com/static/video/825/083/18380528:jpeg_preview_large.jpg?20091027133224', title: 'Digg Food - Home Cooking Show', desc: 'More cooking recipes and delicious food in http://www.diggfood.com'});
	cvids_397.push({vid:70910, thumb: 'http://i.ytimg.com/vi/btQT8lyd84E/0.jpg', title: 'How to Grill Pizza, or Cooking Light for a Cool House', desc: 'Here\'s how to grill a pizza and make it with fresh mozzarella. Try it you will absolutely love it. for more go to: www.cookingfordads.net join me on Twitter @cookingfordads'});
	cvids_397.push({vid:70911, thumb: 'http://20.media.vimeo.com/d1/5/46/21/thumbnail-4621732.jpg', title: 'Healthy Muscle Breakfast', desc: 'I was teaching Greg how to make my salmon patties. This is a modified version of Arnold\'s \"Muscle Burger\"  (I replaced the ground beef with salmon).\n\nIngredients:\n * 16 Wheat Thins, ground\n * 3 egg whites\n * 1 can salmon\n\nYou can substitute oats for Wheat Thins. And if your cholesterol is kosher, then you can use two whole eggs instead of three egg whites.\n\nIt is more healthy than it is delicious. But I really enjoy eating these! Makes two large patties.'});
	cvids_397.push({vid:70912, thumb: 'http://50.media.vimeo.com/d1/5/29/35/64/thumbnail-29356485.jpg', title: 'Eggs Cooking', desc: 'This is a video of some eggs cooking.'});
	cvids_397.push({vid:70913, thumb: 'http://ak2.static.dailymotion.com/static/video/283/953/18359382:jpeg_preview_large.jpg?20091026132134', title: 'How to Make Taco Seasoning Mix', desc: 'Learn how to make taco seasoning mix with this simple recipe.'});
	cvids_397.push({vid:70914, thumb: 'http://ak2.static.dailymotion.com/static/video/714/753/18357417:jpeg_preview_large.jpg?20091026114101', title: 'KFC original recipe is no longer a secret, Fried Chicken', desc: 'http://recipe-secrets.info/ Stop waiting on those long lines at restaurants to pay for dishes you can quickly make in your own kitchen! Re-create your favorite restaurant dishes at home for a fraction of the cost by following these easy step-by-step instructions. Get kudos and praise from friends and family members when they find out you actually made these delicious dishes yourself! Uncover the cooking techniques used by world class chefs from famous restaurants. Stop wasting time searching for these recipes on other sites only to be frustrated by recipes that don\'t really work. We\'ve been perfecting these recipes collectively with our community of over 45,000 forum members since 2003. restaurant recipes free restaurant recipes restaurant recipes book recipes for restaurant real restaurant recipes restaurant recipes com restaurant recipes online recipes restaurant troy top restaurant recipes favorite restaurant recipes recipes from restaurant restaurant salsa r'});
	cvids_397.push({vid:70915, thumb: 'http://ak2.static.dailymotion.com/static/video/984/313/18313489:jpeg_preview_large.jpg?20091023214529', title: 'Chiffon Cake (Pastry Friends)', desc: 'http://PastryFriends.com - The secret resource for people with a passion for pastry.  Here, I show you how to make a perfect chiffon cake. Fluffy, isn\'t it? ;-D'});
	cvids_397.push({vid:70916, thumb: 'http://00.media.vimeo.com/d1/5/20/21/42/20214215/20214215_200x150.jpg', title: 'Oliver cooking', desc: 'ollie cooking'});
	cvids_397.push({vid:70917, thumb: 'http://i.ytimg.com/vi/lGX8m8lAzOs/0.jpg', title: 'Great Depression Cooking - Eggplant Parmesan (season 2-2)', desc: '94 year old cook and great grandmother, Clara, recounts her childhood during the Great Depression as she prepares meals from the era. Learn how to make simple yet delicious dishes while listening to stories from the Great Depression.'});
	cvids_397.push({vid:70918, thumb: 'http://ak2.static.dailymotion.com/static/video/308/552/18255803:jpeg_preview_large.jpg?20091020185708', title: 'Sembusek', desc: 'Banu Atabay\'\u0131n M\u00fctevaz\u0131 Lezzetler\u00ae Yemek Kitaplar\u0131 serisinden Sembusek\'in g\u00f6rsel anlat\u0131m\u0131. http://lezzetler.com Yemek Tarifleri, Turkish Cooking Recipes'});
	cvids_397.push({vid:70919, thumb: 'http://i.ytimg.com/vi/ybHTSLySU3I/0.jpg', title: 'kadai bhendi indian vegeterian cooking', desc: 'okra cooked in indian style'});
	cvids_397.push({vid:70920, thumb: 'http://ak2.static.dailymotion.com/static/video/700/702/18207007:jpeg_preview_large.jpg?20091017214404', title: 'Rice with noodles-Iran-11-10-2009-4', desc: ''});
html+='<div id="thumb_397" style="width:407px;overflow:hidden;height:336px;background-color:#FFFFFF;position:relative;float:left;">';
html+=vidthumbhtml_397(curvid_397);
html+='</div>';
	html +='<div style="height:26px;width:126px;position:absolute;right:5px;">';
		//html +='<img onclick="showmatrix_397(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_397" onclick="gotopageoffset_397(-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_397();" 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_397();" 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_397" onclick="gotopageoffset_397(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_397">';
			html+='<div id="mxs_397"  style="position:absolute;top:0px;background-color:#ffffff;"></div>';
			html+='<div id="mxs2_397" 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/14056/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_397();" 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/14056/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/>cooking</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_397.innerHTML=html;
	wgElm_397.style.display = 'block';

	gotopage_397(matrix_curpg);	// 1
		
}

function playnext_397() {
	if (curvid_397 < cvids_397.length -1 ) {
		curvid_397++;
		if (cpvideo_397)
			playstart_397();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_397');
			thumbdiv.innerHTML=vidthumbhtml_397(curvid_397);
		}
	}
}
function playprev_397() {
	if (curvid_397 >0 ) {
		curvid_397--;
		if (cpvideo_397)
			playstart_397();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_397');
			thumbdiv.innerHTML=vidthumbhtml_397(curvid_397);
		}
	}
}

// play video in video window
function playstart_397(vnr) {
	closepopup_397();	// close popup (if open)
	if (vnr==null)
		vnr=curvid_397;
	else
		curvid_397=vnr;	// set the current
	var thumbdiv=document.getElementById('thumb_397');
	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_397[vnr].vid+'/407/336/L/W" width="407" height="336" frameborder="0" scrolling="no" allowtransparency="true"></iframe>';
	cpvideo_397=true;
}

// show large thumb video still
function playstop_397(vnr) {
	if (vnr==null)
		vnr=curvid_397;
	else
		curvid_397=vnr;	// set the current
	cpvideo_397=false;
	var thumbdiv=document.getElementById('thumb_397');
	thumbdiv.innerHTML=vidthumbhtml_397(vnr);
}

// big thumbnail / player window
function vidthumbhtml_397(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_397[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_397[vnr].title)+'</div><div style="margin: 2px 5px; font-size:13px;line-height:13px;color:#ffffff;overflow:hidden;height:27px;"  title="'+htmlspecialchars(cvids_397[vnr].desc)+'">'+htmlspecialchars(cvids_397[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_397.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_397();"></div>';
	return html;
}

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

// thumbs rechts
function vidthumbhtmlSmall_397(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_397('+vnr+')" title="'+htmlspecialchars(cvids_397[vnr].desc)+'" src="'+cvids_397[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_397('+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_397[vnr].title)+'</div>';
			html+='</div>';
		return html;
}

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

function vidplayurl_397(vnr) {
	if (vnr==null)
		vnr=curvid_397;
	return 'http://www.yubby.com/channel/player/14056/'+cvids_397[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_397() {
  el = document.getElementById('ipopup_397');
  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_397') { 
		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_397') { 
		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_397') 
		butnext_mousein=mouseIn;
	if (oBut.id == 'pgprev_397') 
		butprev_mousein=mouseIn;
	stButImg(oBut);
}

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

function initpage_397() {
	matrix_npages= Math.ceil(cvids_397.length / matrix_itemspp);
}

function gotopage_397(pg) {
		
	if (!matrix_npages)
		initpage_397();
	if (pg<1)
		pg=1;
	if (pg>matrix_npages)
		pg=matrix_npages;
		
	oldpg=matrix_curpg;
	matrix_curpg=pg;
	var mxs=document.getElementById('mxs_397');
	var mxs2=document.getElementById('mxs2_397');
	//if (!mxs)	
	//	alert('mxs_397 niet gevonden');
	var html='';
	for (var i=(matrix_curpg-1)*matrix_itemspp,cv=0;i<cvids_397.length && cv<matrix_itemspp;i++) {
		html+=  vidthumbhtmlSmall_397(i);
		cv++;
	}
	//html+=  '<div style="clear:both;"></div>';
	//if (matrix_npages>1) {
	//	html+=  '<div style="margin:10px 0px">'+paginationhtml_397(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_397');
	if (el) 
		stButImg(el); // update nextbutton state

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

function gotopageoffset_397(offset) {	// 1 or -1
	if (matrix_npages==0)
		initpage_397();
	if (matrix_curpg+offset<0 || matrix_curpg+offset>matrix_npages) {
		gotopage_397(matrix_curpg);
		return 0;
	}
	gotopage_397(matrix_curpg+offset);
	return 1;
}

function showmatrix_397() {
	// close old one
	closepopup_397();

	matrix_npages= Math.ceil(cvids_397.length / 16);
	
	// open new
	var popup_div = document.createElement('div');
	var title='matrix';
	popup_div.id = "ipopup_397";
	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_397();" 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;">cooking</div>';
	vid_html+=	'<div style="margin:30px 10px 10px 10px;" id="mxs_397">';
	// for (var i=0,cv=0;i<cvids_397.length && cv<16;i++) { 
	// 		vid_html+=  vidthumbhtmlSmall_397(i);
	// 		cv++;
	// 	}
	// 	vid_html+=  '<div style="clear:both;"></div>';
	// 
	// 	if (matrix_npages>1) {
	// 		vid_html+=  '<div style="margin:10px 0px">'+paginationhtml_397(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_397(matrix_curpg);
}


function closeembed_397() {
  el = document.getElementById('iembed_397');
  if (el) {
    el.parentNode.removeChild(el);
  } 
}
function toggleembed_397() {
	el = document.getElementById('iembed_397');
	if (el) 
		closeembed_397();
	else
		showembed_397();
}

function showembed_397() {
	// close old one
	closeembed_397();
	// open new
	var popup_div = document.createElement('div');
	var title='embed';
	popup_div.id = "iembed_397";
	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_397();" 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/14056/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/14056/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_397');
	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 + '"';
}




