//solo.js for channel 8357 / widget 92 / WxH: 140x122 / skin: clean / vid: 62146 / 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;
}
// 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_92= new Array();	// channelvideo's
var curvid_92=0;			// first video
var cpvideo_92=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_92 = document.getElementById('viidoo_solo_92');
if (wgElm_92) {
	vp_createwg();
}

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

	cvids_92.push({vid:62146, thumb: 'http://i.ytimg.com/vi/_FXoyr_FyFw/0.jpg', title: 'Toccata \& Fugue in d minor (BACH, J.S.)', desc: 'Kurt Ison, Sydney Town Hall. Edited and produced by Christopher Hayles, 2002.'});
	cvids_92.push({vid:62145, thumb: 'http://ak2.static.dailymotion.com/static/video/454/770/5077454:jpeg_preview_large.jpg?20071008042807', title: 'Michael Hedges - Cello Suite #1 in G Major (Bach) BWV 1007', desc: 'Bach\'s first cello suite (BWV 1007, the prelude), on the harp guitar, played as intended in G major. 8/1/87 performance at the Maheavy Theater in Great Barrington, MA. Tuning:G1C2C#2A1D2E2G2D3E3A3D4; 0.056 on the harp 5 sub-basses for the string gauge, and 0.056, 0.046, 0.036, 0.026, 0.017, 0.013 for the 6-string guiitar gauages. See http://www.nomadland.com/\&quot;\&gt;http://www.nomadland.com/ for information on Hedges and a fund for his children.'});
	cvids_92.push({vid:62144, thumb: 'http://l.yimg.com/a/i/us/sch/cn/v/v9/w946/3465565_448_336.jpeg?x=100\&y=70\&sig=lEgvW6te0AFYWOgxv8_tBw--', title: 'Sebastian Bach Eats It', desc: 'Sebastian Bach, best known for his stunning performances on Celebrity Rap Superstar, eats it hard while performing one of his older songs. If only he\'d SKIDded into...'});
	cvids_92.push({vid:62143, thumb: 'http://s4.mcstatic.com/thumb/1494739/0/4/catalog_item5/0/1/j_s_bach_organ_toccata.jpg', title: 'J.S.Bach - Organ Toccata', desc: 'the most famous organ music'});
	cvids_92.push({vid:62142, thumb: 'http://media1.break.com/dnet/media/2008/7/546917_0152f9ee-d8fc-4287-8a04-9adf7346b92c_prod_1_0001_thumb.jpg', title: 'World Series of Poker WSOP 2008 Ep.03 2\\/5 cardplayertube.com', desc: 'http:\\/\\/www.cardplayertube.com'});
	cvids_92.push({vid:62141, thumb: 'http://ak2.static.dailymotion.com/static/video/434/622/2226434:jpeg_preview_large.jpg?20080912203326', title: 'Doraemon - Co gai xinh nhu hoa bach hop', desc: ''});
	cvids_92.push({vid:62140, thumb: 'http://ak2.static.dailymotion.com/static/video/671/731/6137176:jpeg_preview_large.jpg?20090616125435', title: 'Rachel\'s winter recital Sonata No. 3 by Bach', desc: ''});
	cvids_92.push({vid:62139, thumb: 'http://i.ytimg.com/vi/4JG8KkWhsiY/0.jpg', title: 'Bach Double (Concerto for Two Violins in D minor)', desc: 'Bach Double (Concerto for Two Violins in D minor)'});
	cvids_92.push({vid:62138, thumb: 'http://l.yimg.com/a/p/i/bcst/yp/aniboom_dal/4227/72884413.jpg?x=100\&sig=ye3hs6LMoQ6Wm0pEyDrrjg--', title: 'Bach comes back - Funny Animated Movie', desc: 'Check out http://www.aniboom.com for more Cartoon Animations! - Bach comes back from the dead for a Halloween Special'});
	cvids_92.push({vid:62137, thumb: 'http://www.yubby.com/util/fetchurl?http%3A%2F%2F0.gvt0.com%2FThumbnailServer2%3Fapp%3Dvss%26contentid%3D04701725d07285c0%26offsetms%3D115000%26itag%3Dw160%26hl%3Dnl%26sigh%3DHOo_q6DSHOyZ7JkhjUIaZzTsxLo', title: 'Art \u2013  \u2013 \u201cAir on G string\u201c', desc: 'free-university-in-internet.blogspot.com Free University in Internet. Over 500 political, social, cultural \&amp; scientifical Clips under \u201c kam200 ...'});
	cvids_92.push({vid:62136, thumb: 'http://s1.mcstatic.com/thumb/2928756/0/4/catalog_item5/0/1/les_voix_de_da_a_ma_famille.jpg', title: 'Les Voix De Da\u00efa \"Ma Famille\"', desc: 'L\'histoire des \"Voix de Da\u00efa\", n\'aurait peut-\u00eatre jamais vu le jour, sans la rencontre de Vivian Roost, pianiste classique et compositeur, et C\u00e9line, jeune chanteuse \u00e2g\u00e9e \u00e0 peine de 20 ans\nC\'est au cours d\'une s\u00e9ance de travail, que Vivian s\'amuse \u00e0 pianoter un air de Tcha\u00efkovski  C\u00e9line fredonne quelques mots sur cette m\u00e9lodie qu\'elle d\u00e9couvre .. la magie op\u00e8re ..Ce moment si rare et intense se poursuit quand Vivian encha\u00eene ensuite sur un air de Brahms .. la voix de C\u00e9line, se pose alors si naturellement sur ces chefs d\'\u0153uvres classiques.. jusqu\'\u00e0 l\'\u00e9vidence !  \"et si nous mettions des mots\" sur ces m\u00e9lodies  ?  Ces harmonies si riches ne pourraient s\'habiller que de phrases d\'amour, entre partage et famille  Michel Eli,  auteur \u00e0 succ\u00e8s, se passionne pour ce projet et  se met \u00e0 l\'\u00e9criture..\nTout d\'abord, il a fallu choisir parmi les plus grands compositeurs, Chopin, Schubert, Tcha\u00efkovski, Bach, Mozart ou encore Beethoven . Des \u0153uvres datant parfois de plus de 200 ans et pourtant si fra\u00eeches et accessibles  .une fois choisies, il a fallu les r\u00e9orchestrer sans les ab\u00eemer, en faire des chansons daujourdhui avec des mots qui glissent sur la partition, qui respectent leur \u00e2me et puis des voix pour les porter, pour transmettre toutes leurs \u00e9motions  des voix d\'enfants.\n\nQuoi de plus beau et de plus sinc\u00e8re que la voix d\'un enfant pour dire \"je t\'aime\".\nVivian, n\'a pas de mal \u00e0 trouver \"ses interpr\u00e8tes\".\nConstance, Anastasia, Jos\u00e9phine et Alex, sont tous les 4 ses \u00e9l\u00e8ves en cours de chant \& piano. Ils se connaissent bien et ont l\'habitude de chanter ensemble.'});
	cvids_92.push({vid:62135, thumb: 'http://media1.break.com/dnet/media/2007/12/425278_25dbe53e-6372-4dfa-ab53-0df405c10932_prod_200_0001_thumb.jpg', title: 'Die deutsche Sprache geht den Bach hinab 1', desc: '1. Filmbeitrag zur Serie vom Nachrichtenmagazin DER GLOECKEL zum Verfall der deutschen Sprache. Eine Hausaufgabe f?r Schueler einer 4 Volksschulklasse ...<br \\/>Weitere Filmbeitraege zu dieser ...'});
	cvids_92.push({vid:62134, thumb: 'http://60.media.vimeo.com/d1/5/38/57/thumbnail-3857866.jpg', title: 'Bach', desc: ''});
	cvids_92.push({vid:62133, thumb: 'http://a.images.blip.tv/Toddconaway-bach305-9-143.jpg', title: 'bach', desc: '\n\nlaura\'s Bach dance\n\n'});
	cvids_92.push({vid:62132, thumb: 'http://cdn-thumbs.viddler.com/thumbnail_2_2c6e748e.jpg', title: 'Credit Cards - David Bach - Fight For Your Money', desc: 'David Bach discusses how credit cards, when used responsibly, can be a good resource. In his book, \"Fight for Your Money\", Bach gives you the tools to FIGHT BACK against the corporate machine and WIN.'});
	cvids_92.push({vid:62131, thumb: 'http://i.ytimg.com/vi/hZ9qWpa2rIg/0.jpg', title: 'Bach - Brandenburg Concertos No.3 - i: Allegro Moderato', desc: 'Bwv1048, Freiburg Baroque Orchestra'});
	cvids_92.push({vid:62130, thumb: 'http://l.yimg.com/a/i/us/sch/cn/v/v0/w627/213953_100_70.jpeg?x=100\&y=70\&sig=x746WvjPsbaSVD4zKb6N7Q--', title: 'Bach Before Breakfast', desc: 'Fugue in F Major, Well-Tempered Clavier I, by J.S. Bach'});
	cvids_92.push({vid:62129, thumb: 'http://ak2.static.dailymotion.com/static/video/804/653/16356408:jpeg_preview_large.jpg?20090708072135', title: 'Youth Chorus, 2008 Carmel Bach Festival', desc: 'More Carmel Bach Festival Videos at www.dailymotion.com/carmelbachThe Festival Youth Chorus is an auditioned group of 24-28 young regional singers, 19 or younger, chosen and directed by John Koza. They present several concerts of their own during the Festival and also appear onstage in main choral/orchestral concerts with the professional ensemble. This brief archival video by Doug Mueller features comments by Michael Becker and David Gordon during the Youth Chorus\' first full year back in 2005.More Festival info at www.bachfestival.org2009 Carmel Bach Festival, July 17-August 1'});
	cvids_92.push({vid:62128, thumb: 'http://l.yimg.com/a/i/us/sch/cn/v/v0/w659/225037_400_300.jpeg?x=100\&y=70\&sig=IkFN4Tfz8Nrg5TRmMwF_Jg--', title: 'Come Back To Me, Vanessa Hudgens - Music Video', desc: 'Vanessa Anne Hudgens is an American actress and singer. Come Back to Me is a song by Vanessa Hudgens from her debut album, V. The video for this song premiered...'});
	cvids_92.push({vid:62127, thumb: 'http://www.yubby.com/util/fetchurl?http%3A%2F%2F0.gvt0.com%2FThumbnailServer2%3Fapp%3Dvss%26contentid%3D889edf2e1186d0ec%26offsetms%3D475000%26itag%3Dw160%26hl%3Dnl%26sigh%3D-Dh_pLBVXlqM4QzQ5JFdSFPakPw', title: 'Goldberg Variations', desc: 'Glenn Gould Playing the Goldberg Variations ...'});
	cvids_92.push({vid:62126, thumb: 'http://s6.mcstatic.com/thumb/2640981/0/4/catalog_item5/0/1/3d_medical_animation_birth_of_baby_vaginal_childbirth.jpg', title: '3D Medical Animation: Birth of Baby (Vaginal Childbirth)', desc: 'This 3D medical animation of a baby\&#39;s birth shows a time lapse view of labor and delivery during normal vaginal birth in a simplified form with only the mother\&#39;s skeletal structures and the baby in the uterus. Also shown in detail is dilatation (dilation or dilating) and effacement (thinning) of the cervix during childbirth contractions. Music: Prelude from Bach\&#39;s Cello Suite No. 1 See more 3D medical animations from Nucleus Medical Art at http://www.nucleusinc.com/youtube ...'});
	cvids_92.push({vid:62125, thumb: 'http://media1.break.com/dnet/media/2008/4/484607_deebdc48-941e-418e-add5-431e5df2d0a8_prod_1_0001_thumb.jpg', title: '5 - Die deutsche Sprache geht den Bach hinab', desc: 'Der 5. Filmbeitrag zur Serie vom Nachrichtenmagazin DER GLOECKEL ueber den Niedergang der deutschen Sprache.<br \\/>Eine Baustellenbeschilderung einer Stadtverwaltung.<br \\/>Weitere Filmbeitraege find...'});
	cvids_92.push({vid:62124, thumb: 'http://ts.vimeo.com.s3.amazonaws.com/101/075/10107572_640.jpg', title: 'Bach', desc: 'Breve biografia do compositor Johann Sebastian Bach'});
	cvids_92.push({vid:62123, thumb: 'http://a.images.blip.tv/IranNegah-bache687-474-378.jpg', title: 'bache', desc: '\n\nbache\n\n'});
	cvids_92.push({vid:62122, thumb: 'http://cdn-thumbs.viddler.com/thumbnail_2_391a0040.jpg', title: 'Travel - David Bach - Fight For Your Money', desc: 'Author David Bach discusses how to save money on travel. In his book, \"Fight for Your Money\", Bach gives you the tools to FIGHT BACK against the corporate machine and WIN.'});
	cvids_92.push({vid:62121, thumb: 'http://p-images.veoh.com/image.out?imageId=media-v6606213wQEkep7H1207608320Med.jpg', title: 'Bach - Prelude', desc: 'Li Jei interpreta con maestria y gran tecnica esta obra obra de Bach original para chelo: Preludio de la obra BWV 1007. Formato wmv'});
	cvids_92.push({vid:62120, thumb: 'http://i.ytimg.com/vi/ipzR9bhei_o/0.jpg', title: 'Bach, Toccata and Fugue in D minor, organ', desc: 'Bach\'s most famous organ piece, with a bar-graph score. FAQ Q: Where can I get free sheet music for this piece? A: Sheet music for this can be found here: tinyurl.com Q: Who wrote Bach\'s Toccata and Fugue in D Minor? Q: Isn\'t that like asking who\'s buried in Grant\'s Tomb? A: Heh-heh. A theory has recently (1981) been put forth that JS Bach did not write this piece. A brief summary of the supporting evidence for this theory can be read here: en.wikipedia.org Q: What\'s wrong with ...'});
	cvids_92.push({vid:62119, thumb: 'http://ak2.static.dailymotion.com/static/video/165/653/16356561:jpeg_preview_large.jpg?20090708070623', title: 'Young Musician Auditions, 2008 Carmel Bach Festival', desc: 'More Carmel Bach Festival Videos at www.dailymotion.com/carmelbach------------------------------------------------------------------------------------------Every spring the Carmel Bach Festival holds open auditions for music students 19 or younger. Selected performers are chosen to appear in the Young Musicians Concerts during the summer Festival, in Carmel, Salinas, and King City. Fimmaker Doug Mueller spent two days at the 2008 auditions and captured these vignettes. Concert producer David Gordon adds his comments.More at www.bachfestival.org2009 Carmel Bach Festival, July 17-August 1------------------------------------------------------------------------------------------'});
	cvids_92.push({vid:62118, thumb: 'http://media1.break.com/dnet/media/2009/2/666806_d125af0e-64cf-40b2-8ba9-63f3676b065f_prod_1_0002_thumb.jpg', title: 'How to be an eco-friendly home owner', desc: 'Being a \\u0027green\\u0027 homeowner is good for the planet and good for your wallet, too. Best selling author David Bach explains how having an eco-friendly home will pay off in many ways.'});
	cvids_92.push({vid:62117, thumb: 'http://www.yubby.com/util/fetchurl?http%3A%2F%2F1.gvt0.com%2FThumbnailServer2%3Fapp%3Dvss%26contentid%3D450413c262724d01%26offsetms%3D55000%26itag%3Dw160%26hl%3Dnl%26sigh%3Dx_73kaDXcXUDkwqangD-aZ41k5c', title: 'Glenn Gould - JS Brandenburg Concerto No.5 (1962)', desc: 'Brandenburg Concerto No. 5 Johann Sebastian Bach Julius Baker - flute Oskar Schumsky - violin Glenn Gould - piano 1. Allegro 2. Affetuoso 3. Allegro.'});
	cvids_92.push({vid:62116, thumb: 'http://l.yimg.com/a/i/us/sch/cn/v/v0/w106/36503_100_70.jpeg', title: 'A Most Famous Work of Art', desc: 'We capture the expressions of the faces of people observing one of the world\'s most famous works of art.'});
	cvids_92.push({vid:62115, thumb: 'http://images.vimeo.com/17/67/63/176763121/176763121_200.jpg', title: 'BACH', desc: ''});
	cvids_92.push({vid:62114, thumb: 'http://cdn-thumbs.viddler.com/thumbnail_2_31970b96.jpg', title: 'David Bach - Automatic Millionaire', desc: 'Glen and Martha Price talk about how David Bach\'s Automatic Millionaire program has changed their lives.'});
	cvids_92.push({vid:62113, thumb: 'http://i.ytimg.com/vi/LU_QR_FTt3E/0.jpg', title: 'Rostropovich plays the Prelude from Bach\'s Cello Suite No. 1', desc: 'Mstislav Rostropovich plays the Prelude from Bach\'s Cello Suite No. 1 in G major, BWV 1007. Filmed at the Basilique Sainte Madeleine, V\u00e9zelay, Yvonne, France in 1991.'});
	cvids_92.push({vid:62112, thumb: 'http://p-images.veoh.com/image.out?imageId=media-v6601493aaMncMEz1207568991Med.jpg', title: 'Bach - Fugue', desc: 'El guitarrista Julian Bream interpreta esta fuga de la 1er sonata para violin de Johann Sebastian Bach. Formato wmv'});
	cvids_92.push({vid:62111, thumb: 'http://s3.mcstatic.com/thumb/2233578/0/4/catalog_item5/0/1/j_s_bach_air.jpg', title: 'J. S. Bach: Air', desc: 'The famous \"Air on a G-string\" from Bach\'s Suite for Orcherstra no. 3.\nAn arrangement I did years ago but never really used.\nThis arangement can now be purchased/downloaded at http://www.per-olovkindgren.com I hope you will enjoy it.'});
	cvids_92.push({vid:62110, thumb: 'http://a.images.blip.tv/VanderKOK-DOYOUWANTGODsTRUTHSCENEFROMBACHSFIGHTFORFREEDOM692-431-500.jpg', title: '\"DO YOU WANT GOD\'s TRUTH ? SCENE FROM BACH\'S FIGHT FOR FREEDOM', desc: '\nbach\n'});
	cvids_92.push({vid:62109, thumb: 'http://ak2.static.dailymotion.com/static/video/022/083/16380220:jpeg_preview_large.jpg?20090708070258', title: 'Vocal Master Class, Carmel Bach Festival', desc: 'More Carmel Bach Festival Videos at www.dailymotion.com/carmelbach------------------------------------------------------------------------------------------For 25 years the Carmel Bach Festival has sponsored a master class and training program for young professional singers interested in Baroque music. This video is an excerpt of a longer video documentary about the Bach Festival, created by Doug Mueller. Opening and closing titles of this excerpt added by David Gordon.Learn more about this master class online: www.spiritsound.com/bachinfo.html------------------------------------------------------------------------------------------'});
curvid_92=0;
html+='<div class="v69resetstyle" id="thumb_92" style="width:140px;height:96px;background-color:#FFFFFF;position:relative;">';
html+=vidthumbhtml_92(curvid_92);
html+='</div>';
	html +='<div class="v69resetstyle" style="height:26px;width:140px;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_92();"><span style="color:#888;"></div>';
	html +='<img style="position:absolute;left:-4px;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_92();">';
		html +='<img onclick="showmatrix_92(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_92" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);"/>';
		html +='<img onclick="playprev_92();" style="position:absolute;left:64px;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_92" 	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstop_92();" style="position:absolute;left:64px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconstop24.png" title="stop"  													id="pgstop_92"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	//html +='<img onclick="playstart_92();" style="position:absolute;left:88px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconplay24.png" title="play"  									id="pgplay_92"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	// start is now a toggle
	html +='<img onclick="playstartstop_92();" style="position:absolute;left:88px;top:1px;cursor:pointer;margin:0;padding:0;" src="http://www.yubby.com//img/widget/solo/iconplay24.png" title="play"  									id="pgplay_92"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='<img onclick="playnext_92();" style="position:absolute;left:112px;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_92"	onmouseover="oMouEv(this,true);" onmouseout="oMouEv(this,false);" />';
	html +='</div>';
	html+='</div>';
	wgElm_92.innerHTML=html;
	wgElm_92.style.display = 'block';
		updAllButState(); 
}

function playnext_92() {
	if (curvid_92 < cvids_92.length -1 ) {
		curvid_92++;
		if (cpvideo_92)
			playstart_92();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_92');
			thumbdiv.innerHTML=vidthumbhtml_92(curvid_92);
		}
	}
	updAllButState();
}
function playprev_92() {
	if (curvid_92 >0 ) {
		curvid_92--;
		if (cpvideo_92)
			playstart_92();	// we are playing video
		else {
			var thumbdiv=document.getElementById('thumb_92');
			thumbdiv.innerHTML=vidthumbhtml_92(curvid_92);
		}
	}
	updAllButState();
}

function playstart_92(vnr) {
	closepopup_92();	// close popup (if open)
	if (vnr==null)
		vnr=curvid_92;
	else
		curvid_92=vnr;	// set the current
	var thumbdiv=document.getElementById('thumb_92');
	thumbdiv.style.background='#FFF url(http://www.yubby.com/img/spinner32.gif) no-repeat 40px 18px';
	thumbdiv.innerHTML='<iframe name="playerframe" class="playerframe" src="http://www.yubby.com/widget/playvideo/'+cvids_92[vnr].vid+'/140/96/L/W" width="140" height="96" frameborder="0" scrolling="no" allowtransparency="true"></iframe>';
	cpvideo_92=true;
	updAllButState();
}

function playstop_92() {
	cpvideo_92=false;
	var thumbdiv=document.getElementById('thumb_92');
	thumbdiv.style.background='#FFF';
	thumbdiv.innerHTML=vidthumbhtml_92(curvid_92);
	updAllButState();
}

function playstartstop_92() {
	if (cpvideo_92) 
		playstop_92();
	else
		playstart_92();
}

function vidthumbhtml_92(vnr) {
	var html='';
	html+='<div class="v69resetstyle" style="width:130px;height:81px; overflow:hidden; position:absolute;left:5px;top:5px;">';
html+='<img src="'+cvids_92[vnr].thumb+'" style="width:130px;height:98px;top:-8px;position:relative;">';
html+='</div>';
html+='<div class="v69resetstyle" style="width:120px;height:0px;position:absolute;left:5px;top:86px;background-color:#AAA;padding:5px;"><div class="v69resetstyle" style="overflow:hidden;height:5px;width:120px;"><div class="v69resetstyle" style="margin: 1px 3px; white-space: nowrap; font-size:12px;line-height:12px;color:#555555;">'+htmlspecialchars(cvids_92[vnr].title)+'</div><div class="v69resetstyle" style="margin: 1px 5px; font-size:11px;line-height:11px;color:#ffffff;overflow:hidden;height:40px;"  title="'+htmlspecialchars(cvids_92[vnr].desc)+'">'+htmlspecialchars(cvids_92[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_92.length)+'</div></div></div>';
html+='<div class="v69resetstyle" style="position: absolute; width:72px;height:72px;top:12px;left:34px;z-index:200;cursor:pointer;cursor:hand;background:url(http://www.yubby.com/img/media_play72.png) no-repeat;" onClick="playstart_92();"></div>';
	return html;
}

function vidthumbhtmlSmall_92(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_92('+vnr+')" title="'+htmlspecialchars(cvids_92[vnr].desc)+'" src="'+cvids_92[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_92('+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_92[vnr].title)+'</div>';
			html+='</div>';
		html+='</div>';
	html+='</div>';
	return html;
}

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

function vidplayurl_92(vnr) {
	if (vnr==null)
		vnr=curvid_92;
	return 'http://www.yubby.com/channel/player/8357/'+cvids_92[vnr].vid;
}

//------------------------------------ button handlers --------------------------------------
function stButImg(oBut) {
	if (oBut.id == 'pgnext_92') { 
		if (curvid_92 >= cvids_92.length -1 ) 
			oBut.src = imgNext_d.src;
		else
			oBut.src= butnext_mousein ? imgNext_ov.src : imgNext_ou.src;
	}
	if (oBut.id == 'pgprev_92') { 
		if (curvid_92==0 ) 
			oBut.src = imgPrev_d.src;
		else
			oBut.src= butprev_mousein ? imgPrev_ov.src : imgPrev_ou.src;
	}
	if (oBut.id == 'pgplay_92') { 
		if (cpvideo_92) 	// 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_92') { 
	// 	if (!cpvideo_92 ) 	// currently NOT playing
	// 		oBut.src = imgStop_ov.src;
	// 	else
	// 		oBut.src= butstop_mousein ? imgStop_ov.src : imgStop_ou.src;
	// }
	if (oBut.id == 'pgmatrix_92') { 
		oBut.src= butmatrix_mousein ? imgMatrix_ov.src : imgMatrix_ou.src;
	}
}

function oMouEv(oBut,mouseIn) {
	
	if (oBut.id == 'pgnext_92') 
		butnext_mousein=mouseIn;
	if (oBut.id == 'pgprev_92') 
		butprev_mousein=mouseIn;
	if (oBut.id == 'pgplay_92') 
		butplay_mousein=mouseIn;
	// if (oBut.id == 'pgstop_92') 
	// 	butstop_mousein=mouseIn;
	if (oBut.id == 'pgmatrix_92') 
		butmatrix_mousein=mouseIn;
	stButImg(oBut);
}

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

	el = document.getElementById('pgprev_92');
	if (el) 
		stButImg(el); // update prevbutton state
		
	el = document.getElementById('pgplay_92');
	if (el) 
		stButImg(el); // update prevbutton state
		
	// el = document.getElementById('pgstop_92');
	// if (el) 
	// 	stButImg(el); // update prevbutton state

	el = document.getElementById('pgmatrix_92');
	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_92() {
  el = document.getElementById('ipopup_92');
  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_92(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_92');
	var html='';
	for (var i=(matrix_curpg-1)*16,cv=0;i<cvids_92.length && cv<16;i++) {
		html+=  vidthumbhtmlSmall_92(i);
		cv++;
	}
	html+=  '<div class="v69resetstyle" style="clear:both;"></div>';
	if (matrix_npages>1) {
		html+=  '<div  class="v69resetstyle" style="margin:10px 0px">'+paginationhtml_92(matrix_curpg, matrix_npages)+'</div>';
	}

	mxs.innerHTML=html;
}

function showmatrix_92() {
	// close old one
	closepopup_92();

	matrix_npages= Math.ceil(cvids_92.length / 16);
	
	// open new
	var popup_div = document.createElement('div');
	var title='matrix';
	popup_div.id = "ipopup_92";
	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_92();" 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;">Bach</div>';
	vid_html+=	'<div class="v69resetstyle" style="margin:30px 10px 10px 10px;" id="mxs_92">';
	// for (var i=0,cv=0;i<cvids_92.length && cv<16;i++) { 
	// 		vid_html+=  vidthumbhtmlSmall_92(i);
	// 		cv++;
	// 	}
	// 	vid_html+=  '<div style="clear:both;"></div>';
	// 
	// 	if (matrix_npages>1) {
	// 		vid_html+=  '<div style="margin:10px 0px">'+paginationhtml_92(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_92(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 + '"';
}



