PageSourceSearch

https://www.assises-riviere-loiret.fr/modules/mod_jux_social_tabs/assets/js/jux_social_tabs.js

js assises-riviere-loiret.fr collected 2026-10-03 02:46:41 UTC 41,432 bytes, 1,203 lines download raw bytes

1/*
2 * DC Social Media Tabs
3 * Copyright (c) 2012 Design Chemical
4 * http://www.designchemical.com/blog/index.php/premium-jquery-plugins/jquery-social-media-tabs-plugin/
5 * Version 1.7.3 (26-06-2015)
6 */
7 
8(function($){
9
10	SocialTabsObject = function(el, options) {
11		this.create(el, options);
12	};
13	
14	$.extend(SocialTabsObject.prototype, {
15		
16		version   : '1.7.3',
17	
18		create: function(el, options) {
19		
20			this.defaults = {
21				widgets: 'twitter,facebook,fblike,fbrec,google,rss,flickr,delicious,youtube,pinterest,lastfm,dribbble,vimeo,stumbleupon,tumblr,deviantart,linkedin,instagram',
22				twitter: {
23					title: 'Latest Tweets',
24					link: true,
25					follow: 'Follow on Twitter',
26					followId: '',
27					limit: 10,
28					retweets: false,
29					replies: false,
30					images: '', // large w: 786 h: 346, thumb w: 150 h: 150, medium w: 600 h: 264, small w: 340 h 150
31					url: 'twitter.php',
32					icon: 'twitter.png'
33				},
34				facebook: {
35					title: 'Facebook',
36					link: true,
37					follow: 'Follow on Facebook',
38					limit: 10,
39					url: JUX_BASE_URL + 'modules/mod_jux_social_tabs/facebook.php',
40					feed: 'feed', // feed, posts
41					icon: 'facebook.png'
42				},
43				fblike: {
44					title: '',
45					link: false,
46					follow: '',
47					limit: 36,
48					stream: false,
49					header: true,
50					icon: 'fblike.png'
51				},
52				fbrec: {
53					title: '',
54					link: false,
55					follow: '',
56					header: true,
57					icon: 'fbrec.png'
58				},
59				google: {
60					title: 'Google +1',
61					link: true,
62					follow: 'Add to Circles',
63					pageId: '',
64					header: 0,
65					image_width: 75,
66					image_height: 75,
67					api_key: 'AIzaSyB1UZNnscjMDjjH-pi_XbnLRld2wAqi3Ek',
68					shares: true,
69					limit: 10,
70					icon: 'google.png'
71				},
72				youtube: {
73					title: 'Youtube',
74					link: false,
75					follow: 'Follow on Youtube',
76					limit: 10,
77					api_key: 'AIzaSyB1zptnRspzltRVLGQJMBCH2yYujYp7ytI',
78					thumb: 'medium',
79					subscribe: true,
80					icon: 'youtube.png'
81				},
82				flickr: {
83					title: 'Flickr',
84					link: true,
85					follow: '',
86					lang: 'en-us',
87					limit: 20,
88					icon: 'flickr.png'
89				},
90				delicious: {
91					title: 'Delicious',
92					link: true,
93					follow: 'Follow on Delicious',
94					limit: 10,
95					icon: 'delicious.png'
96				},
97				digg: {
98					title: 'Latest Diggs',
99					link: false,
100					limit: 10,
101					icon: 'digg.png',
102					hdrBg: "#ececec", 
103					hdrTxt: "#555", 
104					tabBg: "#4684be", 
105					tabTxt: "#b3daff", 
106					tabOnTxt: "#d41717", 
107					bdyBg: "#fff", 
108					stryBrdr: "#ccc", 
109					lnk: "#105cb6", 
110					descTxt: "#999", 
111					subHd: "#999"
112				},
113				pinterest: {
114					title: 'Pinterest',
115					link: true,
116					follow: 'Follow on Pinterest',
117					limit: 10,
118					icon: 'pinterest.png'
119				},
120				rss: {
121					title: 'Subscribe to our RSS',
122					link: true,
123					follow: 'Subscribe',
124					limit: 10,
125					text: 'contentSnippet',
126					icon: 'rss.png'
127				},
128				lastfm: {
129					title: 'Last.fm',
130					link: true,
131					follow: '',
132					limit: 20,
133					feed: 'recenttracks',
134					icon: 'lastfm.png'
135				},
136				dribbble: {
137					title: 'Dribbble',
138					link: true,
139					follow: 'Follow on Dribbble',
140					limit: 10,
141					feed: 'shots',
142					icon: 'dribbble.png'
143				},
144				vimeo: {
145					title: 'Vimeo',
146					link: true,
147					follow: 'Follow on Vimeo',
148					limit: 10,
149					feed: 'likes',
150					thumb: 'small',
151					stats: true,
152					icon: 'vimeo.png'
153				},
154				stumbleupon: {
155					title: 'Stumbleupon',
156					link: true,
157					follow: 'Follow',
158					limit: 10,
159					feed: 'favorites',
160					icon: 'stumbleupon.png'
161				},
162				tumblr: {
163					title: 'Tumblr',
164					link: true,
165					follow: 'Follow',
166					limit: 10,
167					thumb: 250,
168					video: 250,
169					icon: 'tumblr.png'
170				},
171				deviantart: {
172					title: 'Deviantart',
173					link: true,
174					follow: 'Follow',
175					limit: 10,
176					icon: 'deviantart.png'
177				},
178				linkedin: {
179					plugins: 'CompanyProfile,MemberProfile,CompanyInsider,JYMBII',
180					CompanyInsider: 'innetwork,newhires,jobchanges',
181					MemberProfile: 'true',
182					CompanyProfile: 'true',
183					icon: 'linkedin.png'
184				},
185				instagram: {
186					title: 'Instagram',
187					limit: 10,
188					accessToken: '',
189					redirectUrl: '',
190					clientId: '',
191					thumb: 'low_resolution',
192					comments: 3,
193					likes: 8,
194					icon: 'instagram.png'
195				},
196				tweetId: '',
197				share: true,
198				external: true,
199				method: 'slide',
200				position: 'fixed',
201				location: 'right',
202				align: 'top',
203				offset: 10,
204				speed: 600,
205				loadOpen: false,
206				autoClose: false,
207				width: 360,
208				height: 630,
209				start: 0,
210				controls: true,
211				rotate: {
212					direction: 'down',
213					delay: 6000
214				},
215				wrapper: 'dcsmt',
216				content: 'dcsmt-content',
217				slider: 'dcsmt-slider',
218				slides: 'tab-content',
219				tabs: 'social-tabs',
220				classOpen: 'dcsmt-open',
221				classClose: 'dcsmt-close',
222				classToggle: 'dcsmt-toggle',
223				classSlide: 'dcsmt-slide',
224				active: 'active',
225				zopen: 1000,
226				imagePath: 'images/icons/'
227			};
228			this.o = {};
229			this.timer_on = 0;
230			this.id = 'dcsmt-'+$(el).index();
231			this.timerId = '';
232			
233			this.o = $.extend(true,this.defaults,options);
234			
235			$(el).addClass(this.o.content).wrap('<div id="'+this.id+'" class="'+this.o.wrapper+'" />');
236			var $a = $('#'+this.id),$c = $('.'+this.o.content,$a),ca = 'active';
237			
238			$a.css({width: this.o.width+'px'});
239			$c.append('<ul class="'+this.o.tabs+'"></ul>').append('<ul class="'+this.o.slider+'"></ul>');
240			
241			var tabs = this.o.tabs, slider = this.o.slider, slides = this.o.slides, self = this;
242			path = img_link + this.o.imagePath;
243			
244			$.each(this.o.widgets.split(','), function(i,v){
245				var cl = i == 0 ? 'dcsmt-'+v+' first' : 'dcsmt-'+v ;
246				$('.'+tabs,$c).append('<li class="'+cl+'"><a href="#" rel="'+i+'" title="'+v+'"><img src="'+path+self.o[v].icon+'" alt="" rel="'+v+'" /></a></li>');
247				$('.'+slider,$c).append('<li class="'+slides+' tab-'+v+'"><div class="tab-inner"></div></li>');
248			});
249			
250			var $r = $('.'+this.o.slider,$a), $s = $('.'+this.o.slides,$a), $t = $('.'+this.o.tabs,$a), $l = $('li',$t);
251			
252			if(this.o.method == 'slide'){
253				var align = this.o.align == 'left' || this.o.align == 'right' ? 'align-'+this.o.align : 'align-top' ;
254				$a.addClass(this.o.location).addClass(align).css({position: this.o.position});
255			} else {
256				$a.addClass('static');
257			}
258			
259			hb = this.o.height-parseInt($s.css('border-top-width'),10)-parseInt($s.css('padding-top'),10)-parseInt($s.css('border-bottom-width'),10)-parseInt($s.css('padding-bottom'),10);
260			wb = this.o.width-parseInt($s.css('border-right-width'),10)-parseInt($s.css('padding-right'),10)-parseInt($s.css('border-left-width'),10)-parseInt($s.css('padding-left'),10);
261			$s.css({height: hb+'px', width: wb+'px'});
262			$('.tab-inner',$s).css({height: hb+'px', width: wb+'px'});
263			
264			if(this.o.controls){
265				$c.append('<div class="controls"><ul><li><a href="#" class="play"></a></li><li><a href="#" class="prev"></a></li><li><a href="#" class="next"></a></li><li><a href="#" class="'+this.o.classClose+' close"></a></li></ul></div>');
266				$('.controls',$c).css({width: '127px'});
267			}
268			
269			if(this.o.method == 'slide'){
270				this.dcslide($a,$t,$s,$l);
271			} else {
272				this.dcstatic($a,$t,$l);
273			}
274			if(this.o.loadOpen == true){
275				this.open($a);
276			}
277			this.slickTabs(this.o.start,$a,$t,$s);
278			this.addevents($a,$t,$s,$l);
279		},
280		
281		addevents: function(a,t,s,l){
282			var self = this, ca = this.o.active, cw = this.o.wrapper, co = this.o.classOpen, cc = this.o.classClose, ct = this.o.classToggle, 
283			cs = this.o.classSlide, m = this.o.method, start = this.o.start, external = this.o.external;
284			$('a',l).click(function(){
285				var i = parseInt($(this).attr('rel'),10);
286				if($(this).parent().hasClass(ca)){
287					if(m == 'slide'){
288						self.close(a,l,s);
289					}
290				} else {
291					if(!$('li.active',t).length && m == 'slide'){
292						self.open(a);
293					}
294					self.slickTabs(i,a,t,s);
295				}
296				return false;
297			});
298			a.hover(function(){
299				if($('.tab-active .stream').length){
300					$('.controls',this).fadeIn();
301				} else {
302					$('.controls',this).hide();
303				}
304			},
305				function(){$('.controls',this).fadeOut();
306			});
307			$('.controls',a).delegate('a','click',function(){
308				var x = $(this).attr('class'), stream = $('.tab-active .stream',a);
309				switch(x)
310				{
311					case 'prev':
312					self.pauseTimer();
313					ticker(stream,'prev');
314					break;
315					case 'next':
316					self.pauseTimer();
317					ticker(stream,'next');
318					break;
319					case 'play':
320					self.rotate(a);
321					$('.controls .play').removeClass('play').addClass('pause');
322					break;
323					case 'pause':
324					self.pauseTimer();
325					break;
326				}
327				return false;
328			});
329			if(this.o.method == 'slide'){
330				$('.'+co).click(function(e){
331					if(!a.hasClass(ca)){
332						self.open(a);
333					}
334					var i = parseInt($(this).attr('rel'),10) ? parseInt($(this).attr('rel'),10) : start ;
335					self.slickTabs(i,a,t,s);
336					e.preventDefault();
337				});
338				$('.'+cc).click(function(e){
339					if(a.hasClass(ca)){
340						self.close(a,l,s);
341					}
342					e.preventDefault();
343				});
344				$('.'+ct).click(function(e){
345					if(a.hasClass(ca)){
346						self.close(a,l,s);
347					} else {
348						self.open(a);
349						var i = parseInt($(this).attr('rel'),10) ? parseInt($(this).attr('rel'),10) : start ;
350						self.slickTabs(i,a,t,s);
351					}
352					e.preventDefault();
353				});
354			}
355			$('.'+cs).click(function(e){
356				if(m == 'slide'){
357					if(!a.hasClass(ca)){
358						self.open(a);
359					}
360				}
361				var i = parseInt($(this).attr('rel'),10) ? parseInt($(this).attr('rel'),10) : start ;
362				self.slickTabs(i,a,t,s);
363				e.preventDefault();
364			});
365			s.delegate('a','click',function(){
366				if($(this).parent().hasClass('section-share')){
367					var u = $(this).attr('href');
368					window.open(u,'sharer','toolbar=0,status=0,width=626,height=436');
369					return false;
370				} else {
371					if(external){this.target = '_blank';}
372				}
373			});
374			s.delegate('a','click',function(){
375				if($(this).parents().hasClass('tab-facebook')){
376					var u = $(this).attr('href').split('/&');
377					$(this).attr('href',u[0]);
378				}
379			});
380			if(this.o.autoClose == true){
381				$('body').mouseup(function(e){
382					if(a.hasClass(ca) && !$(e.target).parents().hasClass(cw)){
383						if(!$(e.target).hasClass(co) || !$(e.target).hasClass(cs)){
384							self.close(a,l,s);
385						}
386					}
387				});
388			}
389		},
390		dcslide: function(a,t,s,l){
391			t.css({position: 'absolute'});
392			s.css({position: 'relative'});
393			tw = l.outerWidth(true);
394			th = t.outerHeight();
395			var p1 = {marginLeft: '-'+this.o.width+'px', top: this.o.offset+'px', left: 0};
396			var p2 = {top: 0, right: 0, marginRight: '-'+tw+'px', width: tw+'px'};
397			switch(this.o.location){
398				case 'right':
399				p1 = {marginRight: '-'+this.o.width+'px', top: this.o.offset+'px', right: 0};
400				p2 = {top: 0, left: 0, marginLeft: '-'+tw+'px', width: tw+'px'};
401				break;
402				case 'top':
403				p1 = {marginTop: '-'+this.o.height+'px', top: 0};
404				p2 = {bottom: 0, marginBottom: '-'+th+'px'};
405				if(this.o.align == 'left'){
406					a.css({left: this.o.offset+'px'});
407					t.css({left: 0});
408				} else {
409					a.css({right: this.o.offset+'px'});
410					t.css({right: 0});
411				}
412				break;
413				case 'bottom':
414				p1 = {marginBottom: '-'+this.o.height+'px', bottom: 0};
415				p2 = {top: 0, marginTop: '-'+th+'px'};
416				if(this.o.align == 'left'){
417					a.css({left: this.o.offset+'px'});
418					t.css({left: 0});
419				} else {
420					a.css({right: this.o.offset+'px'});
421					t.css({right: 0});
422				}
423				break;
424			}
425			a.css(p1).addClass('sliding');
426			t.css(p2);
427		},
428		dcstatic: function(a,t,l){
429			th = l.outerHeight();
430			a.addClass(this.o.active);
431			t.css({height: th+'px'});
432		},
433		slickTabs: function(i,a,t,s){
434			var self = this;
435			$('li',t).removeClass(this.o.active).eq(i).addClass(this.o.active);
436			s.removeClass('tab-active').hide().eq(i).addClass('tab-active').show();
437			if(!$('li:eq('+i+')',t).hasClass('loaded') && a.hasClass(this.o.active)){
438				var type = $('li:eq('+i+') img',t).attr('rel');
439				var widget = createWidget(this.id,type,this.o[type+'Id'],this.o[type],this.o.width,this.o.height,this.o.share,this.o.tweetId);
440				$('.'+this.o.slides+':eq('+i+') .tab-inner',a).empty().hide().append(widget).fadeIn(600).addClass('loaded');
441				$('li:eq('+i+')',t).addClass('loaded');
442				if(type == 'facebook' || type == 'fblike' || type == 'fbrec'){
443					fbLink(this.o[type+'Id'], $('.btn-type-'+type));
444				} else if(type == 'linkedin'){
445					$.getScript("http://platform.linkedin.com/in.js?async=true", function(){
446						IN.init();
447					});
448				}
449			}
450			if(!a.hasClass(this.o.active) && this.o.method == 'slide'){
451				$('li',t).removeClass(this.o.active);
452			}
453			if(this.o.rotate.delay > 0){
454				self.pauseTimer();
455				self.rotate(a);
456				$('.controls .play').removeClass('play').addClass('pause');
457			}
458		},
459		open: function(a){
460			var p1 = {marginBottom: "-=5px"},p2 = {marginBottom: 0},self = this;
461			a.css({zIndex: this.o.zopen});
462			switch (this.o.location) {
463				case 'top': 
464				p1 = {marginTop: "-=5px"},p2 = {marginTop: 0};
465				break;
466				case 'left':
467				p1 = {marginLeft: "-=5px"},p2 = {marginLeft: 0};		
468				break;
469				case 'right': 
470				p1 = {marginRight: "-=5px"},p2 = {marginRight: 0};
471				break;
472			}
473			a.animate(p1, 100).animate(p2, this.o.speed).addClass(this.o.active);
474		},
475		close: function(a,l,s){
476			var self = this, ca = this.o.active;
477			if(a.hasClass(ca)){
478				var p = {"marginBottom": "-"+this.o.height+'px'};
479				switch (this.o.location) {
480					case 'top': 
481					p = {"marginTop": "-"+this.o.height+'px'};
482					break;
483					case 'left':
484					p = {"marginLeft": "-"+this.o.width+'px'};		
485					break;
486					case 'right': 
487					p = {"marginRight": "-"+this.o.width+'px'};
488					break;
489				}
490				a.animate(p, this.o.speed, function(){
491					a.removeClass(ca);
492					l.removeClass(ca);
493					s.removeClass('tab-active');
494				});
495				self.pauseTimer();
496			}
497		},
498		rotate: function(a){
499			var self = this, stream = $('.tab-active .stream',a), speed = this.o.speed, delay 
499= this.o.rotate.delay, r = this.o.rotate.direction == 'up' ? 'prev' : 'next' ;
500			this.timer_on = 1;
501			this.timerId = setTimeout(function(){
502				ticker(stream,r,speed);
503				self.rotate(a);
504			}, delay);
505		},
506		pauseTimer: function(){
507			clearTimeout(this.timerId);
508			this.timer_on = 0;
509			$('.controls .pause').removeClass('pause').addClass('play');
510		}
511	});
512	
513	$.fn.dcSocialTabs = function(options, callback){
514		var d = {};
515		this.each(function(){
516			var s = $(this);
517			d = s.data("socialtabs");
518			if (!d){
519				d = new SocialTabsObject(this, options, callback);
520				s.data("socialtabs", d);
521			}
522		});
523		return d;
524	};
525	
526	function createWidget(obj,type,id,o,w,h,share,tweetId){
527		
528		var ti = obj+'-'+type,c = '',t = '',p = '',href = '',n = o.limit,stream = '<ul id="'+ti+'" class="stream"></ul>',data,frl = 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0';
529		
530		switch (type) {
531
532			case 'twitter':
533			var cp = id.split('/'), cq = id.split('#'), cu = o.url.split('?'), replies = o.replies == true ? '&exclude_replies=false' : '&exclude_replies=true' ;
534			var param = '&include_entities=true&include_rts='+o.retweets+replies;
535			url1 = cu.length > 1 ? o.url + '&' : o.url + '?';
536			url = cp.length > 1 ? url1 + 'url=list&list_id='+cp[1]+'&per_page='+n+param : url1 + 'url=timeline&screen_name='+id+'&count='+n+param;
537			if(cq.length > 1){
538				var rts = o.retweets == false ? '+exclude:retweets' : '' ;
539				url = url1 + 'url=search&q='+encodeURIComponent(cq[1])+'&count='+n;
540			}
541			href = 'https://www.twitter.com/';
542			href += cp.length > 1 || cq.length > 1 ? o.followId : id ;
543			c += stream;
544			getFeed(ti,type,url,data,o,id,share,tweetId);
545			break;
546			
547			case 'facebook':
548			c += stream;
549			href = 'https://www.facebook.com/' + id;
550			var curl = o.url.replace(/\&#038;/gi, "&");
551			url = curl + '?id='+id+'&limit='+n+'&feed='+o.feed;
552			getFeed(ti,type,url,data,o,id,share,tweetId);
553			break;
554			
555			case 'fblike':
556			src = 'https://www.facebook.com/plugins/likebox.php?id='+id+'&amp;width='+w+'&amp;connections='+n+'&amp;stream='+o.stream+'&amp;header='+o.header+'&amp;height='+h;
557			c += getFrame(src,w,h);
558			break;
559			
560			case 'fbrec':
561			src = 'https://www.facebook.com/plugins/recommendations.php?site='+id+'&amp;width='+w+'&amp;height='+h+'&amp;header='+o.header+'&amp;colorscheme=light&amp;font&amp;border_color';
562			c += getFrame(src,w,h);
563			break;
564			
565			case 'google': 
566			href = 'https://plus.google.com/'+id;
567			if(o.header > 0){
568				var ph = o.header == 1 ? 69 : 131 ;
569				var gc = o.header == 1 ? 'small' : 'standard' ;
570				c += '<link href="https://plus.google.com/'+o.pageId+'" rel="publisher" /><script type="text/javascript">window.___gcfg = {lang: "en"};(function(){var po = document.createElement("script");po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(po, s);})();</script><div class="google-page '+gc+'"><g:plus href="https://plus.google.com/'+o.pageId+'" width="'+w+'" height="'+ph+'" theme="light"></g:plus></div>';
571			}
572			c += stream;
573			url = 'https://www.googleapis.com/plus/v1/people/'+id+'/activities/public';
574			data = {key: o.api_key, maxResults: n, prettyprint: false, fields:"items(id,kind,object(attachments(displayName,fullImage,id,image,objectType,url),id,objectType,plusoners,replies,resharers,url),published,title,url,verb)"};
575			getFeed(ti,type,url,data,o,id,share,tweetId);
576			break;
577
578			case 'youtube': 
579			href = 'https://www.youtube.com/user/'+id;
580			if(o.subscribe){
581			c += '<iframe src="https://www.youtube.com/subscribe_widget?p='+o.id+'" class="youtube-subscribe" scrolling="no" frameBorder="0" height="72"></iframe>';
582			
583			}
584			c += stream;
585			var cp = id.split('/'), cq = decodeURIComponent(id).split('#'), cc = id.split('!');
586			if(cq.length > 1){
587				url = 'https://www.googleapis.com/youtube/v3/search?part=snippet&key=' + o.api_key + '&pageToken=&order=date&maxResults=' + n + '&q=' + cq[1];
588				href = 'https://www.youtube.com/results?search_query=' + cq[1];
589			} else {
590				if(cc.length > 1){
591					id = cc[1];
592					id = 'UU' + cc[1].substring(2);
593					href = 'https://www.youtube.com/channel/UC' + id.substring(2);
594				} else {
595					id = cp.length > 1 ? cp[1] : id ;
596					if(id.substr(0,2) != 'UU'){
597						// is channel ID
598						href = 'https://www.youtube.com/channel/' + id;
599						id = 'UU' + id.substring(2);
600					} else {
601						// is list ID
602						href = 'https://www.youtube.com/channel/UC' + id.substring(2);
603					}
604				}
605				url = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=' + id + '&key=' + o.api_key + '&pageToken=&maxResults=' + n;
606			}
607			getFeed(ti,type,url,data,o,id,share,tweetId);
608			break;
609			
610			case 'flickr':
611			var cq = id.split('/'), fd = cq.length > 1 ? 'groups_pool' : 'photos_public' ;
612			id = cq.length > 1 ? cq[1] : id ;
613			href = 'http://www.flickr.com/photos/'+id;
614			c += stream;
615			url = 'http://api.flickr.com/services/feeds/'+fd+'.gne?id='+id+'&lang='+o.lang+'&format=json&jsoncallback=?';
616			getFeed(ti,type,url,data,o,id,share,tweetId);
617			break;
618
619			case 'delicious':
620			href = 'https://www.delicious.com/'+id;
621			c += stream;
622			url = 'http://feeds.delicious.com/v2/json/'+id;
623			getFeed(ti,type,url,data,o,id,share,tweetId);
624			break;
625			
626			case 'digg':
627			href = 'https://digg.com/users/'+id;
628			c += '<div id="'+ti+'"><a href="https://digg.com/users/'+id+'"></a></div><script type="text/javascript">(function() { var s, s1, diggWidget = {id: "'+ti+'", layout: 1, colors: {hdrBg: "'+o.hdrBg+'", hdrTxt: "'+o.hdrTxt+'", tabBg: "'+o.tabBg+'", tabTxt: "'+o.tabTxt+'", tabOnTxt: "'+o.tabOnTxt+'", bdyBg: "'+o.bdyBg+'", stryBrdr: "'+o.stryBrdr+'", lnk: "'+o.lnk+'", descTxt: "'+o.descTxt+'", subHd: "'+o.subHd+'"}, title: "'+o.title+'", width: '+w+', requests: [{t: "'+id+'", p: {count: "'+n+'", method: "user.getDugg", username: "'+id+'"}}], hide: {}}; if (window.DiggWidget) { if (typeof DiggWidget == "function") { new DiggWidget(diggWidget); } else { DiggWidget.push(diggWidget); } } else { DiggWidget = [diggWidget]; s = document.createElement("SCRIPT"); s.type = "text/javascript"; s.async = true; s.src = "https://widgets.digg.com/widgets.js";s1= document.getElementsByTagName("SCRIPT")[0]; s1.parentNode.insertBefore(s, s1); } })();</script>';
629			break;
630			
631			case 'pinterest':
632			var cp = id.split('/'), ext = cp.length > 1 ? '/rss' : '/feed.rss';
633			href = 'https://www.pinterest.com/'+id;
634			c += stream;
635			url = frl+'&num='+n+'&callback=?&q=' + encodeURIComponent(href+ext);
636			getFeed(ti,type,url,data,o,id,share,tweetId);
637			break;
638			
639			case 'rss':
640			href = id;
641			c += stream;
642			url = frl+'&num='+n+'&callback=?&q=' + encodeURIComponent(href);
643			getFeed(ti,type,url,data,o,id,share,tweetId);
644			break;
645			
646			case 'lastfm':
647			href = 'https://www.last.fm/user/'+id;
648			c += stream;
649			var ver = o.feed == 'lovedtracks' ? '2.0' : '1.0' ;
650			url = frl+'&num='+n+'&callback=?&q=' + encodeURIComponent('https://ws.audioscrobbler.com/'+ver+'/user/'+id+'/'+o.feed+'.rss');
651			getFeed(ti,type,url,data,o,id,share,tweetId);
652			break;
653			
654			case 'dribbble':
655			href = 'http://www.dribbble.com/'+id;
656			url = o.feed == 'likes' ? 'http://api.dribbble.com/players/'+id+'/shots/likes' : 'http://api.dribbble.com/players/'+id+'/shots' ;
657			c += stream;
658			getFeed(ti,type,url,data,o,id,share,tweetId);
659			break;
660			
661			case 'vimeo':
662			href = 'https://www.vimeo.com/'+id;
663			c += stream;
664			url = 'https://vimeo.com/api/v2/'+id+'/'+o.feed+'.json';
665			getFeed(ti,type,url,data,o,id,share,tweetId);
666			break;
667			
668			case 'stumbleupon':
669			href = 'http://www.stumbleupon.com/stumbler/'+id;
670			c += stream;
671			url = frl+'&num='+n+'&callback=?&q=' + encodeURIComponent('http://rss.stumbleupon.com/user/'+id+'/'+o.feed);
672			getFeed(ti,type,url,data,o,id,share,tweetId);
673			break;
674			
675			case 'tumblr':
676			href = 'http://'+id+'.tumblr.com';
677			c += stream;
678			url = 'http://'+id+'.tumblr.com/api/read/json?callback=?';
679			getFeed(ti,type,url,data,o,id,share,tweetId);
680			break;
681			
682			case 'deviantart':
683			href = 'https://'+id+'.deviantart.com';
684			c += stream;
685			url = frl+'&num='+n+'&callback=?&q=' + encodeURIComponent('https://backend.deviantart.com/rss.xml?type=deviation&q=by%3A'+id+'+sort%3Atime+meta%3Aall');
686			getFeed(ti,type,url,data,o,id,share,tweetId);
687			break;
688			
689			case 'linkedin':
690			id = id.split(',');
691			$.each(o.plugins.split(','), function(i,v){
692				if(id[i]){
693					var mod = v == 'CompanyInsider' ? ' data-modules="'+o[v]+'"' : '' ;
694					mod = v == 'MemberProfile' || v == 'CompanyProfile' ? ' data-related="'+o[v]+'"' : mod ;
695					c += getLinkedIn(id[i],v,mod,w-20);
696				}
697			});
698			break;
699			
700			case 'instagram':
701			href = '#';
702			c += stream;
703			url = 'https://api.instagram.com/v1';
704			var cp = id.substr(0,1), cq = id.split(cp), url1 = encodeURIComponent(cq[1]), qs = '';
705			switch(cp)
706			{
707				case '?':
708				var p = cq[1].split('/');
709				qs = '&lat='+p[0]+'&lng='+p[1]+'&distance='+p[2];
710				url += '/media/search';
711				break;
712				case '#':
713				url += '/tags/'+url1+'/media/recent';
714				break;
715				case '!':
716				url += '/users/'+url1+'/media/recent';
717				break;
718				case '@':
719				url += '/locations/'+url1+'/media/recent';
720				break;
721			}
722			if(o.accessToken == ''){
723				if (location.hash) {
724					o.accessToken = location.hash.split('=')[1] ;
725				} else {
726					location.href="https://instagram.com/oauth/authorize/?client_id="+o.clientId+"&redirect_uri="+o.redirectUrl+"&response_type=token"; 
727				}
728			}
729			url += '?access_token='+o.accessToken+'&client_id='+o.clientId+qs;
730			getFeed(ti,type,url,data,o,id,share,tweetId);
731			break;
732		}
733		if(type != 'digg' && type != 'linkedin'){
734			if(o.follow){
735				p = o.follow != '' ? '<a href="'+href+'" class="dcsmt-btn btn-type-'+type+'">'+o.follow+'</a>' : '' ;
736			}
737			t = o.title != '' ? o.title : '' ;
738			t = o.link ? '<a href="'+href+'" class="btn-type-'+type+'">'+t+'</a>' : t ;
739			c = t != '' ? '<div class="profile"><h3>'+t+'</h3>'+p+'</div>'+c : c ;
740		}
741		return c;
742	};
743	
744	function getFeed(target,type,url,data,o,id,share,tweetId){
745		var x = '#'+target,html = [],d = '',dataType = type == 'twitter' || type == 'facebook' ? 'json' : 'jsonp';
746		jQuery.ajax({
747			url: url,
748			data: data,
749			cache: true,
750			dataType: dataType,
751			success: function(a){
752				var error = '',px = $(x).width();
753				switch(type)
754				{
755					case 'facebook':
756						a = a.responseData.feed.entries;
757					break;
758					case 'google':
759						error = a.error ? a.error : '' ;
760						a = a.items;
761					break;
762					case 'flickr':
763						a = a.items;
764					break;
765					case 'instagram':
766						a = a.data;
767					break;
768					case 'twitter':
769						error = a.errors ? a.errors : '' ;
770						var cq = id.split('#');
771						if(cq.length > 1){a = a.statuses} ;
772					break;
773					case 'dribbble':
774						a = a.shots;
775					break;
776					case 'tumblr':
777						a = a.posts;
778					break;
779					case 'delicious':
780					break;
781					case 'youtube':
782						a = a.items;
783					break;
784					case 'vimeo':
785					break;
786					default:
787						if(a.responseStatus == 200){
788							a = a.responseData.feed.entries;
789						} else {
790							error = a.responseDetails;
791						}
792					break;
793				}
794				if(error == ''){
795					$.each(a, function(i,item){
796						if(i < o.limit){
797							d = item.publishedDate;
798							var x = '<a href="'+item.link+'" class="title">'+item.title+'</a>', sq = item.link, st = item.title, s = '';
799							html.push('<li>');
800							switch(type)
801							{
802								case 'twitter':
803								d = parseTwitterDate(item.created_at);
804								var un = item.user.screen_name, ua = item.user.profile_image_url_https ;
805								html.push('<a href="https://www.twitter.com/'+un+'" class="thumb"><img src="'+ua+'" alt="" /></a>');
806								html.push('<span class="twitter-user"><a href="https://www.twitter.com/'+un+'"><strong>
806'+item.user.name+'</strong> @'+un+'</a></span><br />');
807								html.push(linkify(item.text));
808								if(o.images != '' && item.entities.media){
809									$.each(item.entities.media, function(i,media){
810										html.push('<a href="'+media.media_url_https+'" class="twitter-image"><img src="'+media.media_url_https+':'+o.images+'" alt="" /></a>');
811									});
812								}
813								sq = item.id_str;
814								break;
815								
816								case 'facebook':
817								var thumb = item.thumb;
818								if(thumb != null)
819									{
820										if(thumb.indexOf('safe_image.php') != -1) {
821											thumb = unescape(thumb.match(/url=([^&]+)/)[1]);
822										} 
823										html.push('<a href="' + item.link + '"><img src="'+thumb+'" alt="" /></a>');
824									}
825								html.push(linkify(item.content));
826								sq = item.link;
827								st = item.content;
828								break;
829								
830								case 'delicious':
831								d = item.dt;
832								html.push('<a href="' + item.u + '" class="title">'+item.d+'</a>');
833								html.push('<span class="text">'+item.n+'</span>');
834								sq = item.u;
835								st = item.d;
836								break;
837								
838								case 'rss':
839								html.push(x+item[o.text]);
840								break;
841								
842								case 'pinterest':
843								var img=$('img',item.content).attr('src') ? '<a href="'+item.link+'"><img src="'+$('img',item.content).attr('src')+'" alt="" /></a>':'';
844								html.push(img);
845								html.push(item.contentSnippet);
846								st = item.contentSnippet;
847								break;
848
849								case 'youtube':
850								var vidId = 'https://www.youtube.com/watch?v='+item.snippet.resourceId.videoId+'&feature=youtube_gdata';
851								var ytthumb = o.thumb;
852								html.push('<a href="'+vidId+'" class="thumb"><img src="'+item.snippet.thumbnails[ytthumb].url+'" alt="" /></a>');
853								html.push('<a href="' + vidId + '" class="title">'+item.snippet.title+'</a>');
854								html.push(item.snippet.description);
855								d = item.snippet.publishedAt;
856								break;
857								
858								case 'flickr':
859								d = '';
860								html.push('<a href="' + item.link + '" class="thumb" title="'+ item.title +'"><img src="' + item.media.m + '" alt="" /></a>');
861								break;
862								
863								case 'lastfm':
864								html.push('<a href="'+item.content+'" class="title">'+item.title+'</a>');
865								break;
866								
867								case 'dribbble':
868								d = item.created_at;
869								html.push('<a href="'+item.url+'" class="thumb"><img src="' + item.image_teaser_url + '" alt="' + item.title + '" /></a>');
870								html.push('<span class="meta"><span class="views">'+num(item.views_count)+'</span><span class="likes">'+num(item.likes_count)+'</span><span class="comments">'+num(item.comments_count)+'</span></span>');
871								sq = item.url;
872								break;
873								
874								case 'deviantart':
875								html.push(x+item.content);
876								break;
877								
878								case 'tumblr':
879								d = item.date;
880								var x = '<a href="'+item['url-with-slug']+'">', z = '';
881								switch(item.type)
882								{
883									case 'photo':
884									x += item['photo-caption']+'</a>';
885									z += '<img src="'+item['photo-url-'+o.thumb]+'" alt="" />';
886									st = item['photo-caption'];
887									break;
888									case 'video':
889									x += item['video-caption']+'</a>';
890									z += o.video != '400' ? item['video-player-'+o.video] : item['video-player'] ;
891									st = item['video-caption'];
892									break;
893									case 'regular':
894									x += item['regular-title']+'</a>';
895									z += item['regular-body'];
896									st = item['regular-title'];
897									break;
898									case 'quote':
899									x += item['quote-source']+'</a>';
900									z += item['quote-text'];
901									st = item['quote-source'];
902									break;
903									case 'audio':
904									x = item['id3-artist'] ? '<a href="'+item['url-with-slug']+'">'+item['id3-artist']+' - '+item['id3-album']+'</a>' : '' ;
905									x += item['id3-title'] ? '<a href="'+item['url-with-slug']+'" class="track">'+item['id3-title']+'</a>' : '' ;
906									z += item['audio-caption'] ? item['audio-caption'] : '' ;
907									z += item['audio-player'] ? item['audio-player'] : '' ;
908									st = item['id3-artist']+' - '+item['id3-album']+' - '+item['id3-title'];
909									break;
910									case 'conversation':
911									x += item['conversation-title']+'</a>';
912									z += item['conversation-text'];
913									st = item['conversation-title'];
914									break;
915									case 'link':
916									var ltxt = item['link-text'].replace(/:/g, '').replace(/\?/g, '').replace(/\!/g, '').replace(/\./g, '').replace(/\'/g, '');
917									x = '<a href="'+item['link-url']+'">'+ltxt+'</a>';
918									z += item['link-description'];
919									st = ltxt;
920									break;
921								}
922								html.push(x);
923								html.push(z);
924								st = stripHtml(st);
925								sq = item['url-with-slug'];
926								break;
927
928								case 'vimeo':
929								d = '', f = o.feed, at = item.name, tx = item.description;
930								if(f == 'channels'){
931									if(item.logo != ''){
932										html.push('<a href="'+item.url+'" class="logo"><img src="'+item.logo+'" alt="" width="'+px+'" /></a>');
933									}
934								} else if(f == 'groups'){
935									html.push('<a href="'+item.url+'" class="thumb"><img src="'+item.thumbnail+'" alt="" /></a>');
936								} else {
937									var thumb = 'thumbnail_'+o.thumb, at = item.title, tx = f != 'albums' ? item.duration+' secs' : item.description ;
938									html.push('<a href="'+item.url+'" class="thumb"><img src="'+item[thumb]+'" alt="" /></a>');
939								}
940								html.push('<a href="'+item.url+'" class="title">'+at+'</a>');
941								html.push('<span class="text">'+tx+'</span>');
942								if(o.stats == true){
943									var m = '';
944									m += f == 'albums' || f == 'channels' || f == 'groups' ? '<span class="videos">'+num(item.total_videos)+'</span>' : '' ;
945									if(f == 'channels'){
946										m += '<span class="users">'+num(item.total_subscribers)+'</span>';
947									} else if(f == 'groups'){
948										m += '<span class="users">'+num(item.total_members)+'</span>';
949									} else if(f != 'albums'){
950										m += '<span class="likes">'+num(item.stats_number_of_likes)+'</span><span class="views">'+num(item.stats_number_of_plays)+'</span><span class="comments">'+num(item.stats_number_of_comments)+'</span>';
951									}
952									html.push('<span class="meta">'+m+'</span>');
953								}
954								var dt = item.upload_date;
955								if(f == 'likes'){
956									dt = item.liked_on;
957								} else if(f == 'albums' || f == 'channels' || f == 'groups'){
958									dt = item.created_on;
959								}
960								html.push('<span class="date">'+dt+'</span>');
961								sq = item.url;
962								st = at;
963								break;	
964								
965								case 'stumbleupon':
966								var src = $('img',item.content).attr('src');
967								if(src && o.feed == 'favorites'){
968									html.push('<a href="'+item.link+'" class="thumb"><img src="'+src+'" alt="" /></a>');
969								}
970								html.push(x+item.contentSnippet);
971								break;
972								
973								case 'instagram':
974								d = parseInt(item.created_time * 1000,10);
975								html.push('<a href="'+item.link+'" class="thumb"><img src="' + item.images[o.thumb].url + '" alt="" /></a>');
976								if(item.caption !=null){
977									html.push(item.caption.text);
978								}
979								if(item.comments.count > 0 && o.comments > 0){
980									i = 0;
981									html.push('<span class="meta"><span class="comments">'+num(item.comments.count)+' comments</span></span>');
982									$.each(item.comments.data, function(i,cmt){
983										if(o.comments > i){
984											html.push('<span class="meta item-comments"><img src="'+cmt.from.profile_picture+'" />'+cmt.from.full_name+' - '+cmt.text+'</span>');
985											i++;
986										} else {
987											return false;
988										}
989									});
990								}
991								if(item.likes.count > 0 && o.likes > 0){
992									i = 0;
993									html.push('<span class="meta"><span class="likes">'+num(item.likes.count)+' likes</span></span>');
994									html.push('<span class="meta item-likes">');
995									$.each(item.likes.data, function(i,lk){
996										if(o.likes > i){
997											html.push('<img src="'+lk.profile_picture+'" />');
998											i++;
999										} else {
1000											return false;
1001										}
1002									});
1003									html.push('</span>');
1004								}
1005								st = item.caption !=null ? item.caption.text : '' ;
1006								break;
1007								
1008								case 'google':
1009								var g = item.object.replies ? num(item.object.replies.totalItems) : 0, m = item.object.plusoners ? num(item.object.plusoners.totalItems) : 0, p = item.object.resharers ? num(item.object.resharers.totalItems) : 0, dl;
1010								d = item.published;
1011								dl = {src: "",imgLink: "",useLink: "",useTitle: ""};
1012								var k = item.object.attachments;
1013								if (k) if (k.length){
1014									for (var l = 0; l < k.length; l++) {
1015										var h = k[l];
1016										if (h.image) {
1017											dl.src = h.image.url;
1018											dl.imgLink = h.url;
1019											if (h.fullImage) {
1020												dl.w = h.fullImage.width || 0;
1021												dl.h = h.fullImage.height || 0
1022											}
1023										}
1024										if (h.objectType == "article") dl.useLink = h.url;
1025										if (h.displayName) dl.useTitle = h.displayName
1026									}
1027									if (!dl.useLink) dl.useLink = dl.imgLink;
1028									var img_h = o.image_height ? o.image_height : 75 ;
1029									var img_w = o.image_width ? o.image_width : 75 ;
1030									if (dl.src.indexOf("resize_h") >= 0) dl.src = dl.w >= dl.h ? dl.src.replace(/resize_h=\d+/i, "resize_h=" + img_h) : dl.src.replace(/resize_h=\d+/i, "resize_w=" + img_w)
1031								}
1032								dl = dl;
1033								html.push((dl.src ? (dl.useLink ? '<a href="' + dl.useLink + '" class="thumb">' : '')+'<img src="' + dl.src + '" />'+(dl.useLink ? '</a>' : '') : ''));
1034								var t1 = px/(dl.w/dl.h) < px/3 ? ' clear' : '' ;
1035								html.push((dl.useLink ? '<a href="' + dl.useLink + '" class="title'+t1+'">' : '')+(item.title ? item.title : dl.useTitle)+(dl.useLink ? '</a>' : ''));
1036								if(o.shares){
1037									html.push('<span class="meta"><span class="plusones">+1s '+m+'</span><span class="shares">'+p+'</span><span class="comments">'+g+'</span></span>');
1038								}
1039								sq = dl.useLink;
1040								st = dl.useTitle;
1041								break;
1042							}
1043							if(share == true){
1044								s = shareLink(st,sq,tweetId,type);
1045								html.push('<span class="section-share">'+s+'</span>');
1046							}
1047							if(type == 'twitter'){
1048								d = d != '' ? html.push('<span class="date"><a href="https://twitter.com/'+un+'/status/'+item.id_str+'">'+nicetime(new Date(d).getTime())+'</a></span></li>') : '' ;
1049							} else {
1050								d = d != '' ? html.push('<span class="date">'+nicetime(new Date(d).getTime())+'</span></li>') : '' ;
1051							}
1052						}
1053					});
1054				} else {
1055					html.push('<li class="dcsmt-error">Error. '+error+'</li>');
1056				}
1057				$(x).html(html.join(''));
1058			}
1059		});
1060	};
1061		
1062	function getFrame(src,w,h){
1063		html = '<iframe src="'+src+'" scrolling="no" frameborder="0" style="border: none; background: #fff; overflow: hidden; width: '+w+'px; height: '+h+'px;" allowTransparency="true"></iframe>';
1064		return html;
1065	};
1066	
1067	function getLinkedIn(id,a,b,w){
1068		id = a == 'JYMBII' ? 'data-companyid="'+id+'"' : 'data-id="'+id+'"' ;
1069		out = '<script type="IN/'+a+'" data-width="'+w+'" '+id+b+' data-format="inline"></script>';
1070		return out;
1071	};
1072		
1073	function linkify(text){
1074		text = text.replace(
1075			/((https?\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi,
1076			function(url){
1077				var full_url = !url.match('^https?:\/\/') ? 'http://' + url : url ;
1078				return '<a href="' + full_url + '">' + url + '</a>';
1079			}
1080		);
1081		text = text.replace(/(^|\s)@(\w+)/g, '$1@<a href="https://www.twitter.com/$2">$2</a>');
1082		text = text.replace(/(^|\s)#(\w+)/g, '$1#<a href="https://twitter.com/search/%23$2">$2</a>');
1083		return text;
1084	}
1085
1086	function parseTwitterDate(a){
1087		var out = navigator.userAgent.indexOf("MSIE")>= 0 ? a.replace(/(\+\S+) (.*)/, '$2 $1') : a ;
1088		return out;
1089	}
1090	
1091	function stripHtml(v){
1092		var $html = $(v);
1093		return $html.text();
1094	}
1095	
1096	function shareLink(st,sq,tweetId,type){
1097		var s = '';
1098		if(type == 'twitter'){
1099			var intent = 'https://twitter.com/intent/';
1100			s = '<a href="'+intent+'tweet?in_reply_to='+sq+'&via='+tweetId+'" class="share-reply"></a>';
1101			s += '<a href="'+intent+'retweet?tweet_id='+sq+'&via='+tweetId+'" class="share-retweet"></a>';
1102			s += '<a href="'+intent+'favorite?tweet_id='+sq+'" class="share-favorite"></a>';
1103		} else {
1104			var sq = encodeURIComponent(sq), st = encodeURIComponent(st);
1105			s = '<a href="http://www.facebook.com/sharer.php?u='+sq+'&t='+st+'" class="share-facebook"></a>';
1106			s += '<a href="https://twitter.com/share?url='+sq+'&text='+st+'&via='+tweetId+'" class="share-twitter"></a>';
1107			s += '<a href="https://plus.google.com/share?url='+sq+'" class="share-google"></a>';
1108			s += '<a href="http://www.linkedin.com/shareArticle?mini=true&url='+sq+'&title='+st+'" class="share-linkedin"></a>';
1109			return s;
1110		}
1111		return s;
1112    }
1113	
1114		function nicetime(a){
1115			var d = Math.round((+new Date - a) / 1000), fuzzy = '';
1116			var chunks = new Array();
1117                    chunks[0] = [60 * 60 * 24 * 365 , 'year', 'years'];
1118                    chunks[1] = [60 * 60 * 24 * 30 , 'month', 'months'];
1119                    chunks[2] = [60 * 60 * 24 * 7, 'week', 'weeks'];
1120                    chunks[3] = [60 * 60 * 24 , 'day', 'days'];
1121                    chunks[4] = [60 * 60 , 'hr', 'hrs'];
1122                    chunks[5] = [60 , 'min', 'mins'];
1123                    var i = 0, j = chunks.length;
1124                    for (i = 0; i < j; i++) {
1125                        s = chunks[i][0];
1126                        if ((xj = Math.floor(d / s)) != 0)
1127                        {
1128                            n = xj == 1 ? chunks[i][1] : chunks[i][2] ;
1129                            break;
1130                        }
1131                    }
1132                    fuzzy += xj == 1 ? '1 '+n : xj+' '+n ;
1133                    if (i + 1 < j) {
1134                        s2 = chunks[i + 1][0];
1135                        if ( ((xj2 = Math.floor((d - (s * xj)) / s2)) != 0) )
1136                        {
1137                            n2 = (xj2 == 1) ? chunks[i + 1][1] : chunks[i + 1][2] ;
1138                            fuzzy += (xj2 == 1) ? ' + 1 '+n2 : ' + '+xj2+' '+n2 ;
1139                        }
1140                    }
1141					fuzzy += ' ago';
1142            return fuzzy;
1143		}
1144
1145		function num(a){
1146            var b = a;
1147            if (a > 999999) b = Math.floor(a / 1E6) + "M";
1148            else if (a > 9999) b = Math.floor(a / 1E3) + "K";
1149            else if (a > 999) b = Math.floor(a / 1E3) + "," + a % 1E3;
1150            return b
1151        };
1152		
1153		function parseQ(url){
1154			var v = [], hash, q = url.split('?')[1];
1155			if(q != undefined){
1156				q = q.split('&');
1157				for(var i = 0; i < q.length; i++){
1158					hash = q[i].split('=');
1159					v.push(hash[1]);
1160					v[hash[0]] = hash[1];
1161				}
1162			}
1163			return v;
1164		};
1165		
1166		function ticker(s,b,speed){
1167			var $a = $('li:last',s),$b = $('li:first',s),$gx;
1168			if(b == 'next'){
1169				$gx = $a.clone().hide().css({opacity: 0});
1170				$b.before($gx);
1171				$a.remove();
1172				$gx.slideDown(speed,'linear',function(){
1173					$(this).animate({opacity: 1},speed);
1174				});
1175			} else {
1176				var bh = $b.outerHeight(true);
1177				$gx = $b.clone();
1178				$b.animate({marginTop: -bh+'px',opacity: 0},speed,'linear',function(){
1179					$a.after($gx);
1180					$b.remove();
1181				});
1182			}
1183		};
1184		
1185		function fbLink(id,obj){
1186			var link = '';
1187			jQuery.ajax({
1188				url: 'https://graph.facebook.com/'+id,
1189				cache: true,
1190				dataType: 'jsonp',
1191				async: false,
1192				success: function(a){
1193					obj.attr('href',a.link);	
1194				}
1195			});
1196		};
1197		
1198})(jQuery);
1199
1200jQuery(window).load(function(){
1201	jQuery.getScript("//platform.twitter.com/widgets.js", function(){});
1202	jQuery.getScript("https://apis.google.com/js/platform.js", function(){});
1203});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.