if (!Function.prototype.bindAsEventListener) {
	Function.prototype.bindAsEventListener = function() {
		var __method=this,args=arguments,object=args[0];
		return function(event) {var a = args;a[0]=(event || window.event);return __method.apply(object,a);}
	}
}
if (!Math.customRound) {
	Math.customRound = function (number, digits) {
		if (arguments.length == 1) var digits = 2;
		var d = Math.pow(10, digits);
		return parseInt(number * d) / d;
	}
}
if (typeof(IDTVHZP) == "undefined") {
	IDTVHZP = function () {this.initialize.apply(this, arguments);};
	IDTVHZP.prototype = {
		frame: null,
		initialize: function (ds) {
			this.ds = ds;
			this.element = document.getElementById('IDTVP_' + this.ds.id);
			if (!this.element && document.getElementsByClassName)
				try {
					this.element = document.getElementsByClassName ('idtv_4427d39f10')[0];
				} catch(e) {}
			if (!this.element) { alert ('The iDesktop.tv horizontal box is not not embedded properly!'); return;}
			this.element.innerHTML = '<div class="idtv_' + this.ds.id + '"><div class="idtv_bp"></div><div class="idtv_outres"><div class="idtv_inres"></div></div><div class="idtv_bn"></div></div>';
			var es = this.element.getElementsByTagName('div');
			this.elementout = es[0];
			this.btnprev = es[1]; this.btnnext = es[4];
			this.elementout = es[2];
			this.elementin = es[3];
			if (this.ds.data.error) {
				this.elementin.innerHTML = '<div style="text-align:center">' + this.ds.data.error + '</div>';
			} else {
				this.results = new Array();
				if (this.ds.only_public) { // go trough ds.data.results and remove all private videos
					var newdata = new Array();
					for (var i = 0; i < this.ds.data.results.length; i ++)
						if (!this.ds.data.results[i].isprivate)
							newdata.push(this.ds.data.results[i]);
					this.ds.data.results = newdata;
				}
				var jsonArr = this.ds.data.results;
				this.page = 0; this.resc = jsonArr.length;
				this.maxpage = Math.ceil(this.resc/this.ds.pp);
				for (var i = 0, n = this.resc; i < n; i ++) {
					var nr = document.createElement('div');
					nr.className = 'idtv_res';
					//nr.style.left = i * (this.ds.width - 40) + "px";
					jsonArr[i].title_esc = jsonArr[i].title.replace(/"/g, "&quot;");// ";
					var title = jsonArr[i].title_esc + (this.ds.thumb_show_length?' (' + jsonArr[i].length_seconds + ')':'');
					var t = '<img src="' + jsonArr[i].thumbnail_url + '" alt="' + jsonArr[i].title_esc + '" title="' + title + '" />';
					if (this.ds.thumb_show_title || this.ds.thumb_show_author || this.ds.thumb_show_length || this.ds.thumb_show_rating || this.ds.thumb_show_description) {
						var at = '';
						if (this.ds.thumb_show_title)
							//at = '<a href="http://www.idesktop.tv/?watch=' + jsonArr[i].id + '" title="' + jsonArr[i].title + '" target="_blank">' + jsonArr[i].title + "</a>";
							at = '<span class="t">' + jsonArr[i].title + "</span>";
						if (this.ds.thumb_show_author) {
							at += '<span class="ah">' + (this.ds.thumb_show_labels?'<span class="lb">Author: </span>':'') + jsonArr[i].author + '</span>';
						}
						if (this.ds.thumb_show_length || this.ds.thumb_show_views) {
							at += '<span class="lv">';
							if (this.ds.thumb_show_length) at += (this.ds.thumb_show_labels?'<span class="lb">Length: </span>':'') +jsonArr[i].length_seconds;
							if (this.ds.thumb_show_length && this.ds.thumb_show_views) at += ' | ';
							if (this.ds.thumb_show_views) at += (this.ds.thumb_show_labels?'<span class="lb">Views: </span>':'') + this.formatCommasInt(jsonArr[i].view_count);
							at += '</span>';
						}
						if (this.ds.thumb_show_rating)
							at += '<span class="r">' + (this.ds.thumb_show_labels?'<span class="lb">Rating: </span>':'') + Math.customRound(jsonArr[i].rating_avg, 1) + "</span>";
						if (this.ds.thumb_show_description) {
							at += '<span class="d">' + jsonArr[i].description + "</span>";
						}
						t = t + '<div class="out" title="' + title + '"><div class="in">' + at + '</div></div>';
					}
					nr.innerHTML += t;
					if (this.ds.mark_private && jsonArr[i].isprivate)
						nr.innerHTML += '<div class="private_mark">PRIVATE</div>';
					this.elementin.appendChild(nr);
					this.results.push(nr);
					nr.onclick = this.onresclick.bindAsEventListener(this, i);
					nr.style.display = 'none';
				}
				this.elementin.style.width = this.results.length * (this.ds.width - 40) + "px";
				this.btnprev.onclick = this.prevP.bindAsEventListener(this);
				this.btnnext.onclick = this.nextP.bindAsEventListener(this);
				if (this.results.length > 0)
					this.results[0].style.display = 'block';
			}
			var f = document.createElement('iframe');
			f.src = "http://www.idesktop.tv/embed/4427d39f10/utr.html?r=" + document.location;
			f.style.cssText = 'width:0;height:0;border:none;';
			f.frameborder = f.frameBorder = f.border = "0";
			this.element.appendChild(f);

		},
		onresclick: function (event,i) {
			var elem = event.target || event.srcElement;
			if (elem.tagName == 'A') return;
			if (this.ds.plpl == "newwin") {
				var loaded = false;
				if (this.frw) {
					try {
						this.frw.Player.playlist.selectItem(i);
						this.frw.Player.playlist.playSelected();
						loaded = true;
					} catch(e) {
						loaded = false;
					}
				}
				if (!loaded)
					this.frw = window.open ('http://'+this.ds.chost+'/embed/'+this.ds.id+'/play.html?vid='+this.ds.data.results[i].id, 'idtvwin', 'width=' + this.ds.plw + ',height=' + this.ds.plh + 'toolbar=no,status=no,scrollbars=no,resize=no');
				return;
			}
			if (!this.frame) {
				this.plclbtn = document.createElement('img');
				this.plclbtn.src = this.ds.clbtnsrc;
				this.plclbtn.onclick = this.closeplr.bindAsEventListener(this);
				this.plclbtn.className = 'idtvp_clbtn';
				this.frameholder = document.createElement('div');
				this.frameholder.id = 'idtvpfh' + this.ds.id;
				this.frame = document.createElement('iframe');
				this.frame.id = 'idtvpf' + this.ds.id;
				this.frame.frameborder = this.frame.frameBorder = this.frame.border = "0";
				try {
					document.body.appendChild(this.frameholder);
					this.ba = true;
				} catch (e) {
					this.elementout.appendChild(this.frameholder);
					this.ba = false;
				}
				this.frameholder.appendChild(this.plclbtn);

			}
			/*this.frameholder.style.top = this.results[i].offsetTop + "px";
			this.frameholder.style.left = this.results[i].offsetLeft + this.results[i].offsetWidth + "px";*/
			var scrlX = (window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft);
		    var scrlY = (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
		    var viewportW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth ;
		    var viewportH = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
		    var element = this.elementout;
			var elFixedX = 0, elFixedY = 0;
		    do {
		    	elFixedY += element.offsetTop  || 0; elFixedX += element.offsetLeft || 0; element = element.offsetParent || element.parentNode;
		    } while (element);
		    var nx = 0, ny =0;
			switch (this.ds.plpl) {
				case "center":
					nx = scrlX + ((viewportW - this.ds.plw) / 2) - elFixedX;
					ny = scrlY + ((viewportH - this.ds.plh) / 2) - elFixedY;
					break;
				case "left":
					nx = this.results[i].offsetLeft - this.ds.plw;
					ny = this.results[i].offsetTop - this.ds.pldelta;
					break;
				case "right":
					nx = this.results[i].offsetLeft + this.results[i].offsetWidth;
					ny = this.results[i].offsetTop - this.ds.pldelta;
					break;
				case "top":
					nx = this.results[i].offsetLeft - this.ds.pldelta;
					ny = this.results[i].offsetTop - this.ds.plh;
					break;
				case "bottom":
					nx = this.results[i].offsetLeft - this.ds.pldelta;
					ny = this.results[i].offsetTop + this.results[i].offsetHeight;
					break;
				default: return;
			}
			if (this.ba) {
				nx += elFixedX; ny += elFixedY;
				if (nx < 0) nx = 0;
				if (ny < 0) ny = 0;
			} else {
				if (this.ds.plpl != "center") { // some checks if top/left it is out of the viewport
					var rx = nx + elFixedX, ry = ny + elFixedY;
					if (rx < 0) nx -= rx;
					if (ry < 0) ny -= ry;
				}
			}
			this.frameholder.style.left = nx + "px";
			this.frameholder.style.top = ny + "px";

			this.frameholder.style.display = 'block';
			var loaded = false;
			try {
				if (this.frame.contentWindow && this.frame.contentWindow.Player) { // detect if script access is allowed
					this.frame.contentWindow.Player.playlist.selectItem(i);
					this.frame.contentWindow.Player.playlist.playSelected();
					loaded = true;
				}
			} catch (e) {};
			if (!loaded) {
				if (this.frame.parentNode == this.frameholder) this.frameholder.removeChild(this.frame);
				this.frame.src = 'http://'+this.ds.chost+'/embed/'+this.ds.id+'/play.html?vid='+this.ds.data.results[i].id;
				this.frameholder.appendChild(this.frame);
			}
		},
		closeplr: function (event) { this.frameholder.style.display='none'; this.frameholder.removeChild(this.frame); },
		showRes: function () {
			/*var s = this.page * this.ds.pp, e = Math.min (s + this.ds.pp, this.results.length) - 1;
			s = Math.max (e - this.ds.pp, 0);
			this.elementout.scrollLeft = s * (this.ds.width - 40);*/

		},
		nextP: function () {/*this.elementout.scrollLeft = Math.min(this.elementout.scrollLeft + this.elementout.offsetWidth, this.elementout.scrollWidth - this.elementout.offsetWidth);*/
			if (this.page < this.maxpage - 1) {
				this.results[this.page].style.display='none';
				this.page ++;// this.showRes();
				this.results[this.page].style.display='';
			}
		},
		prevP: function () {/*this.elementout.scrollLeft = Math.max(this.elementout.scrollLeft - this.elementout.offsetWidth, 0);*/
			if (this.page > 0) {
				this.results[this.page].style.display='none';
				this.page --; //this.showRes();
				this.results[this.page].style.display='';
			}
		},
		formatCommasInt: function (val) {
			var s = new String(val);
			var rgx = /(\d+)(\d{3})/;
			while (rgx.test(s)) s = s.replace(rgx, '$1' + ',' + '$2');
			return s;
		}
	}
}

var IDTVLBDataSource4427d39f10 = {
	id: '4427d39f10', chost:'www.idesktop.tv',clbtnsrc:'http://www.idesktop.tv/images/player_icons/close.gif',
	width: 417, height: 102, pp: 1,
	rows: 1, cols: 1,
	plw: 500, plh: 420,
	createP: function () {this.p = new IDTVHZP(this); },
	plpl: 'center',
	only_public:true,mark_private:true,
	thumb_show_title : true, thumb_show_author : false,
	thumb_show_rating : true, thumb_show_views: true,
	thumb_show_length : false, thumb_show_description : false,
	thumb_show_labels : true,
	thumbnail_text: 'R',
	pldelta: 0,
		data: {results: [{id:'XbI1FpLd4Vk',title:'Coldplay-- \u0022Clocks\u0022',author:'LunaLaVenus',real_length:'291',length_seconds:'04:51',rating_avg:'4.9',rating_count:'3630',view_count:'2555500',description:'Here is a another tribute to my favorite band, Coldplay. I made it with pictures from various photoshoots, and music video clips from \u0022Speed of Sound\u0022 and \u0022Clocks\u0022. Enjoy!',tags:'Coldplay, Clocks, Chris, Martin, Guy, Berryman, Will, Champion, Jonny, Buckland',thumbnail_url:'http://img.youtube.com/vi/XbI1FpLd4Vk/default.jpg',upload_time:'1152420922',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/XbI1FpLd4Vk/responses?v=2',ord:'2',isprivate:'',t:'v'},{id:'fXSovfzyx28',title:'Coldplay - Life In Technicolor ii (HD)',author:'parlophone',real_length:'273',length_seconds:'04:33',rating_avg:'4.9',rating_count:'18384',view_count:'5517018',description:'Official Promo Video for Coldplay\'s fantastic new single \'Life In Technicolor ii\', available in High Definition. Taken from the album \'Viva La Vida (Prospekt\'s March Edition)\' available from the Parlophone Store here: www.parlophone.co.uk',tags:'coldplay, life, in, technicolor, ii, official, promo, video, viva, la, vida, alternative, indie, pop, rock, high, definition, HD, parlophone, music',thumbnail_url:'http://img.youtube.com/vi/fXSovfzyx28/default.jpg',upload_time:'1232462926',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/fXSovfzyx28/responses?v=2',ord:'1',isprivate:'',t:'v'},{id:'dvgZkm1xWPE',title:'Coldplay - Viva La Vida',author:'parlophone',real_length:'242',length_seconds:'04:02',rating_avg:'4.8',rating_count:'99361',view_count:'48547697',description:'Official Promo Video for the fantastic new single from Coldplay - \'Viva La Vida\' Taken from the #1 Album \'Viva La Vida (Or Death And All His Friends)\' in shops now.',tags:'coldplay, viva, la, vida, official, promo, video, alternative, indie, pop, rock, parlophone, music',thumbnail_url:'http://img.youtube.com/vi/dvgZkm1xWPE/default.jpg',upload_time:'1217841933',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/dvgZkm1xWPE/responses?v=2',ord:'0',isprivate:'',t:'v'},{id:'_7OQSl4FdJE',title:'Coldplay - Scientist',author:'aldosetecidades',real_length:'378',length_seconds:'06:18',rating_avg:'4.9',rating_count:'6472',view_count:'2889118',description:'coldplay - the scientist live',tags:'coldplay, live, the, scientist',thumbnail_url:'http://img.youtube.com/vi/_7OQSl4FdJE/default.jpg',upload_time:'1146358959',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/_7OQSl4FdJE/responses?v=2',ord:'12',isprivate:'',t:'v'},{id:'dztdRzWxMo4',title:'Coldplay - \'In my place\' music video',author:'parlophone',real_length:'234',length_seconds:'03:54',rating_avg:'4.9',rating_count:'1856',view_count:'971725',description:'Coldplay - \'In my place\' music video',tags:'Coldplay, In, my, place, music, video',thumbnail_url:'http://img.youtube.com/vi/dztdRzWxMo4/default.jpg',upload_time:'1193147825',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/dztdRzWxMo4/responses?v=2',ord:'13',isprivate:'',t:'v'},{id:'dsz-EeNZBkI',title:'Coldplay - See You Soon',author:'tsvorvitaliy',real_length:'205',length_seconds:'03:25',rating_avg:'4.9',rating_count:'6307',view_count:'5132467',description:'This is a clip from Coldplay Live 2003 dvd. the song is called \u0022See You Soon\u0022',tags:'Coldplay, see, you, soon',thumbnail_url:'http://img.youtube.com/vi/dsz-EeNZBkI/default.jpg',upload_time:'1152663594',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/dsz-EeNZBkI/responses?v=2',ord:'14',isprivate:'',t:'v'},{id:'tmjPrdTNxQ0',title:'The Scientist - Coldplay',author:'ColdplayTV',real_length:'265',length_seconds:'04:25',rating_avg:'4.8',rating_count:'2891',view_count:'1419279',description:'Taken from the album A Rush Of Blood To The Head. Video directed by Jamie Thraves',tags:'the, scientist, coldplay, Jamie, Thraves',thumbnail_url:'http://img.youtube.com/vi/tmjPrdTNxQ0/default.jpg',upload_time:'1237403303',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/tmjPrdTNxQ0/responses?v=2',ord:'3',isprivate:'',t:'v'},{id:'IakDItZ7f7Q',title:'Coldplay - Violet Hill',author:'parlophone',real_length:'222',length_seconds:'03:42',rating_avg:'4.8',rating_count:'38558',view_count:'18075241',description:'Coldplay\'s new album, \'Viva la Vida\' out now. www.coldplay.com Video directed by Asa Mader.',tags:'Coldplay, Violet, Hill, full, official, video, viva, la, vida, new, album, single, death, and, all, his, friends',thumbnail_url:'http://img.youtube.com/vi/IakDItZ7f7Q/default.jpg',upload_time:'1211192040',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/IakDItZ7f7Q/responses?v=2',ord:'4',isprivate:'',t:'v'},{id:'skUJ-B6oVDQ',title:'Coldplay - \'Fix you\' music video',author:'parlophone',real_length:'299',length_seconds:'04:59',rating_avg:'4.9',rating_count:'2291',view_count:'884547',description:'Coldplay - \'Fix you\' music video',tags:'Coldplay, Fix, you, music, video',thumbnail_url:'http://img.youtube.com/vi/skUJ-B6oVDQ/default.jpg',upload_time:'1193146009',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/skUJ-B6oVDQ/responses?v=2',ord:'5',isprivate:'',t:'v'},{id:'E_exesnCA5Y',title:'Coldplay - Lovers In Japan',author:'parlophone',real_length:'248',length_seconds:'04:08',rating_avg:'4.9',rating_count:'10890',view_count:'5193869',description:'Official Promo Video for Coldplay\'s fantastic new single \'Lovers In Japan\'. Taken from the album \'Viva La Vida or Death And All His Friends\' which you can grab now from the Parlophone Store here: www.parlophone.co.uk',tags:'coldplay, lovers, in, japan, viva, la, vida, official, promo, video, alternative, indie, rock, parlophone, music',thumbnail_url:'http://img.youtube.com/vi/E_exesnCA5Y/default.jpg',upload_time:'1225207119',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/E_exesnCA5Y/responses?v=2',ord:'6',isprivate:'',t:'v'},{id:'2-RjMRP5IbI',title:'Coldplay - Lost',author:'parlophone',real_length:'262',length_seconds:'04:22',rating_avg:'4.9',rating_count:'8425',view_count:'5466083',description:'Official Promo Video for Coldplay\'s fantastic new single \'Lost\'. Taken from the brilliant Number 1 album \'Viva La Vida Or Death And All His Friends\' out now.',tags:'coldplay, lost, official, promo, video, viva, la, vida, alternative, indie, rock, parlophone, music',thumbnail_url:'http://img.youtube.com/vi/2-RjMRP5IbI/default.jpg',upload_time:'1222437042',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/2-RjMRP5IbI/responses?v=2',ord:'7',isprivate:'',t:'v'},{id:'CAME8GDRTfI',title:'Coldplay - \'Yellow\' music video',author:'parlophone',real_length:'278',length_seconds:'04:38',rating_avg:'4.9',rating_count:'1878',view_count:'1059187',description:'Coldplay - \'Yellow\' music video',tags:'Coldplay, Yellow, music, video',thumbnail_url:'http://img.youtube.com/vi/CAME8GDRTfI/default.jpg',upload_time:'1193150280',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/CAME8GDRTfI/responses?v=2',ord:'8',isprivate:'',t:'v'},{id:'fwGHQ6WyQFU',title:'Coldplay_Trouble',author:'EomJiHun',real_length:'270',length_seconds:'04:30',rating_avg:'4.9',rating_count:'11214',view_count:'7983646',description:'Coldplay_Trouble akira999.web-bi.net ... coldplay trouble ',tags:'coldplay, trouble',thumbnail_url:'http://img.youtube.com/vi/fwGHQ6WyQFU/default.jpg',upload_time:'1154653159',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/fwGHQ6WyQFU/responses?v=2',ord:'10',isprivate:'',t:'v'},{id:'-4w7an00vGI',title:'Coldplay - Don\'t Panic',author:'Jehann1999',real_length:'158',length_seconds:'02:38',rating_avg:'4.9',rating_count:'8509',view_count:'5589666',description:'Coldplay - Don\'t Panic',tags:'Coldplay, Don\'t, Panic',thumbnail_url:'http://img.youtube.com/vi/-4w7an00vGI/default.jpg',upload_time:'1147482090',comment_count:'0',url:'http://gdata.youtube.com/feeds/api/videos/-4w7an00vGI/responses?v=2',ord:'11',isprivate:'',t:'v'}]},
		initialize: function () {this.createP()}

};
var IDTVLBDataSource4427d39f10IF = function () {IDTVLBDataSource4427d39f10.initialize.apply(IDTVLBDataSource4427d39f10, []);};
if (document.getElementById('IDTVP_4427d39f10'))
	IDTVLBDataSource4427d39f10IF ();
else if (window.addEventListener)
	window.addEventListener("load", IDTVLBDataSource4427d39f10IF, true);
else
	window.attachEvent("onload", IDTVLBDataSource4427d39f10IF);