PageSourceSearch

https://agentagitateur.com/sa/576b810341099675df0d9c81ef482a6e63d64796site.js

js agentagitateur.com collected 2026-10-02 22:59:41 UTC 12,553 bytes, 436 lines download raw bytes

1var formcheck_forms = [];
2
3window.addEvent('domready', function(){
4	placeContent();
5	initArtistMenu();
6	initOtherMenu();
7	initArtistPage();
8	initTrombiPage();
9	initSearchForm();
10});
11
12window.addEvent('resize', function(){
13	placeContent();
14});
15
16addLoadEvent(function(){
17	new Request({url: SITE_ROOT+'ajax/?page=searchdata', method:'get', onSuccess: function(rep){
18		var data = rep.split('__||__');
19		var p = $('searchlist');
20		for (var i=0,j=data.length; i<j; i++) {
21			var infos = data[i].split('_|_');
22			var wu = infos[2];
23			var name = infos[0];
24			var cat = infos[1];
25			var a  = new Element('a', {'href':wu, 'searchname':name});
26			a.innerHTML = '<p class="flr">'+name+'</p><p class="fi">'+cat+'</p>';
27			a.inject(p);
28			TALENTS_SIMPLE.push(name.toLowerCase());
29			TALENTS_FULL.push(a);
30		}
31	}}).send();	
32});
33
34function placeContent(){
35	var h = window.getSize().y;
36	var w = window.getSize().x;
37	//alert(h);
38	if ( $('artistesmenu') )  $('artistesmenu').style.height = Math.round(h - 170 - 40 ) + 'px';
39	if ( $('artistesmenuothers') )  $('artistesmenuothers').style.height = Math.round(h - 170 - 40 ) + 'px';
40	if ( $('othersmenu') )  $('othersmenu').style.height = Math.round(h - 170 - 40 ) + 'px';
41	//if ( $('abssite') )  $('abssite').style.height = Math.round(h - 30 ) + 'px';
42	if ( $('abssiteartiste') ){
43		//$('abssiteartiste').style.width = Math.round(w - 280 ) + 'px';
44	}
45	var ww = $('sitemeasure').getSize().x;
46	if ( $('abssiteartiste') ) ww += 280;
47	
48	//$('absmenu').style.marginLeft = Math.round((w - 960 ) / 2) + 'px';
49	$('absmenu').style.width = ww + 'px';
50	$('absfoot').style.width = ww + 'px';
51}
52
53function initArtistMenu(){
54	var d = $('artistesmenu');
55	if ( !d ) return;
56	
57	initMenuScroll(d);
58	
59	var cy = getCookieScroll(d);
60	
61	var imgs = $('artistesmenuwrap').getElements('div.photo');
62	var to_load = [];
63	var pos = cy / 100;
64	for (var i = 0, j = imgs.length; i < j; i++) {
65		var url = SITE_ROOT+'ci/rcm_100_125/'+imgs[i].get('data-bgimgsrc');
66		imgs[i].style.backgroundImage = 'url('+url+')';
67		if( Math.abs(i-pos) < 10 ) to_load.push(url);
68	}
69
70	new Asset.images(to_load, {
71		onComplete: function() {
72			var p = $('artistesmenuwrap');
73			p.setStyle('opacity', 0);
74			p.setStyle('display', 'block');
75			$('artistesmenu').scrollTo(0,cy);
76			p.animate({'opacity':1}, 500);
77		}
78	});
79}
80
81function initOtherMenu(){
82	var d = $('artistesmenuothers');
83	if ( !d ) return;
84	
85	initMenuScroll(d);
86	d.scrollTo( 0, getCookieScroll(d) );
87}
88
89function initMenuScroll(d){
90	d.addEvent('scroll', function(){
91		var oy = this.getScroll().y;
92		var cn = this.className;
93		Cookie.write('ams', cn+'|'+oy);
94	});
95}
96
97function getCookieScroll(d){
98	var ct = Cookie.read('ams');
99	if ( !ct || ct.length == 0 ) return 0;
100	var dt = ct.split('|');
101	if ( dt.length == 2 && dt[0] == d.className )
102		return dt[1].toInt();
103	return 0;
104}
105
106function initArtistPage(){
107	initLightboxImgs();
108
109	initCvBioMenu();
110	
111	if ( $('videoplayerfirstimg') ){
112		$('videoplayerfirstimg').addEvent('click', function(){
113			playVideoInPlayer($$('div.vidlink')[0]);
114		});
115	}
116	
117	$$('div.vidlink').addEvent('click', function(){
118		playVideoInPlayer(this);
119	});
120
121	if ( $('sharemailform') && formcheck_forms['sharemailform'] ){
122		//alert('a');
123		formcheck_forms['sharemailform'].options.customSubmit = function(){
124			$('nlsubmit').setStyle('cursor','wait');
125			$('sharemailform').animate({'opacity':0.3},500,function(){
126				new Request({url:SITE_ROOT+'ajax/?page=mailshare', onComplete: function(txt, xml){
127					if ( txt.trim() == '1' ){ // success
128						$('sharemailform').animate({'opacity':'0'}, 500, function(){
129							$('sharemailform').setStyle('display','none');
130							$('sharemailformsuccess').setStyle('opacity','0');
131							$('sharemailformsuccess').setStyle('display','block');
132							$('sharemailformsuccess').animate({'opacity':'1'},500);
133						});
134					}
135				}}).post($('sharemailform'));
136			});
137			return false;
138		};
139	}
140
141	if ( $('sendMailLink') ){
142		$('sendMailLink').addEvent('click', function(e){
143			
144			//alert('a');
145			new Element('div',{
146				'styles':{background:'#000',width:'100%',height:'100%',opacity:'0.6',position:'absolute',top:0,left:0,zIndex:150},
147				'id':'popbg'
148			}).addEvent('click', closeAaPopup).inject(document.body);
149			
150			$('popup').style.display = 'block';
151			return false;
152		});
153	}
154}
155
156function initCvBioMenu(){
157	var d = $('cvbiomenu');
158	if ( !d ) return;
159
160	var cvbiomenu = d.getElements('span');
161	if ( cvbiomenu.length == 0 ){
162		cvbiomenu.setStyle('cursor', 'default');
163		return
164	}
165	cvbiomenu.addEvent('click', function(){
166		$('cvbiomenu').getElements('span').removeClass('current');
167		this.addClass('current');
168		if ( this.get('id') == 'cvbtn' ){
169			$('cvtxt').style.display = 'block';
170			$('biotxt').style.display = 'none';
171		}
172		else if ( this.get('id') == 'biobtn' ){
173			$('biotxt').style.display = 'block';
174			$('cvtxt').style.display = 'none';
175		}
176	});
177}
178
179function initLightboxImgs(){
180	var all_imgs = $$('img.lightboximg');
181	var imgs = [];
182	for(var i=0,j=all_imgs.length;i<j;i++){
183		if ( all_imgs[i].hasClass('clone') ) continue;
184		imgs.push(all_imgs[i]);
185	}
186	var imgs_len = imgs.length;
187	if ( imgs.length == 0 ) return;
188	var ws = window.getSize();
189	var imgs_src = [];
190	for(var i=0,j=all_imgs.length;i<j;i++){
191		var img = all_imgs[i];
192		img.addEvent('click', function(){
193			var nb = this.retrieve('lightboxnb');
194			var firstpart = $('lightboxsrcs').get('srcs').split('_|_');
195			var lastpart = $('lightboxsrcs').get('srcs').split('_|_');
196			firstpart.splice(0, nb);
197			lastpart.splice(nb, lastpart.length-nb);
198			firstpart.extend(lastpart);
199			firstpart = firstpart.map(function(i){
200				return [i];
201			});
202			Slimbox.open(firstpart);
203		});
204		var nb = (i >= imgs.length) ? i - (imgs_len - 1) : i;
205		img.store('lightboxnb', nb);
206		var imgw = img.get('ow').toInt();
207		var imgh = img.get('oh').toInt();
208		var ww = ws.x - 100;
209		var wh = ws.y - 200;
210		while ( imgw > ww || imgh > wh ){
211			var f = imgw/imgh;
212			if ( imgw > ww ){
213				imgw = ww;
214				imgh = imgw/f;
215			}
216			if ( imgh > wh ){
217				imgh = wh;
218				imgw = imgh*f;
219			}
220		}
221		//img.set('fsrc', SITE_ROOT+'ci/rm_'+Math.round(imgw)+'_'+Math.round(imgh)+'/'+img.get('osrc'));
222		if ( i < imgs_len ){
223			imgs_src.push(SITE_ROOT+'ci/rm_'+Math.round(imgw)+'_'+Math.round(imgh)+'/'+img.get('osrc'));
224		}
225	}
226	new Element('div', {'id':'lightboxsrcs','srcs':imgs_src.join('_|_'),'class':'inv'}).inject(document.body);
227	
228}
229
230function initTrombiPage(){
231	var trombilinks = $$('div.trombimenu');
232	if (!trombilinks || trombilinks.length == 0 ) return;
233	trombilinks.addEvent('click', function(){
234		selectTrombi(this);
235	});
236	var imgs = $('trombiphotos').getElements('div.photo');
237	for (var i = 0, j = imgs.length; i < j; i++) {
238		imgs[i].style.backgroundImage = 'url('+SITE_ROOT+'ci/rcm_125_150/'+imgs[i].get('data-bgimgsrc')+')';
239	}
240	var nb = Math.round(Math.random()*1);
241	selectTrombi(trombilinks[nb]);	
242}
243
244function initSearchForm(){
245	var d = $('rechercheres');
246	if ( !d ) return;
247	d.addEvent('mouseleave', resDivOut );
248	d.addEvent('mouseenter', resDivOver );
249}
250
251function selectTrombi(d){
252	if ( d.hasClass('current') ) return;
253	$('trombiphotos').getElements('>div').addClass('inv');
254	var p = $(d.get('data-content-id'));
255	//alert(id);
256	var to_load = [];
257	var imgs = p.getElements('div.photo');
258	for (var i = 0, j = Math.min(imgs.length, 16); i < j; i++) {
259		to_load.push(SITE_ROOT+'ci/rcm_125_150/'+imgs[i].get('data-bgimgsrc'));
260	};
261
262	new Asset.images(to_load, {
263		onComplete: function() {
264			p.setStyle('opacity', 0);
265			p.removeClass('inv');
266			p.animate({'opacity':1}, 500);
267		}
268	});
269	$$('div.trombimenu').removeClass('current');
270	d.addClass('current');
271	$('abssite').scrollTo(0,0);
272}
273
274function closeAaPopup(){
275	$('popbg').dispose();
276	$('popup').style.display = 'none';
277}
278
279function playVideoInPlayer(d){
280	var color = 'ffffff';
281	var id = d.get('vid');
282	var pr = d.get('vpr');
283	var src = '';
284	if (pr == 'YT') src = 'https://www.youtube.com/embed/'+id+'?controls=1&autoplay=1';
285	else if (pr == 'VM') src = 'https://player.vimeo.com/video/'+id+'?title=0&byline=0&portrait=0&color='+color+'&autoplay=1';
286	else if (pr == 'DM') src = 'https://www.dailymotion.com/embed/video/'+id+'?info=0&autoplay=1';
287	
288	var vp = $('vidsplayer');
289	vp.empty();
290			//d.set('html','<iframe src="'+src+'" width='+w.toString()+' height='+h.toString()+' frameborder="0" allowfullscreen></iframe>');
291	new Element('iframe', {'src':src,'width':'260px','height':'146px','frameborder':'0','allowfullscreen':'true','styles':{'background-color':'#000000'}}).inject(vp);
292}
293
294
295function setVimeoVideo(id){
296	var d = $('videodiv');
297	d.empty();
298	new Element('iframe', {'src':'http://player.vimeo.com/video/'+id+'?title=0&byline=0&portrait=0&autoplay=1&color=7e0099','width':'400','height':'240','frameborder':'0'}).inject(d);
299}
300
301addLoadEvent(function(){
302	if ( $('oaanchor') ){
303		var d = $('oaanchor');
304		var y = d.getPosition().y;
305		//alert(y);
306		window.scrollTo(0,y);
307	}
308});
309
310function startSlide(){
311	changeImage.delay(3000);
312}
313
314function changeImage(){
315	cur_img = cur_img + 1;
316	if ( cur_img == to_load.length )
317		cur_img = 0;
318	$('imgs').getElement('div.himg').addClass('oldimg');
319	new Element('div', {'styles':{'background-image':'url('+to_load[cur_img]+')','opacity':0},'class':'himg'}).inject($('imgs')).animate({'opacity':1}, 500, function(){
320		$('imgs').getElement('div.oldimg').dispose();
321		changeImage.delay(3000);
322	}, Fx.Transitions.Linear);
323}
324
325function closeCymaPopup(){
326	$('cymapopupclose').fireEvent('click');
327	return false;
328}
329
330function checkFootPosition(){
331	var bodyH = document.body.offsetHeight;
332	var winH = window.getSize().y;
333	var ecart = winH - bodyH;
334	
335	if ( ecart > 0 && $('foot')){
336		$('foot').style.marginTop = (ecart-1)+'px';
337	}
338	//else $('foot').style.marginTop = '15px';
339}
340
341
342function showProdDetail(id){
343	
344	showPopup();
345	$('popupcontent').innerHTML = $('popupdata'+id).innerHTML;
346}
347
348var TALENTS_SIMPLE = [];
349var TALENTS_FULL = [];
350var INPUTSELECTED = false;
351var RESSELECTED = false;
352var NO_RES = 'No result';
353
354function chercheTalent(inp){
355	var tosearch = inp.value.toLowerCase();
356	
357	if(tosearch.length < 1) {
358		$('rechercheres').style.display = 'none';
359		INPUTSELECTED = false;
360		RESSELECTED = false;
361		return;
362	}
363	INPUTSELECTED = true;
364	RESSELECTED = true;
365	
366	var founded = [];
367	console.log(TALENTS_SIMPLE.length);
368	for(var i=0,j=TALENTS_SIMPLE.length;i<j;i++){
369		if(TALENTS_SIMPLE[i].indexOf(tosearch) >= 0)
370			founded.push(i);
371	}
372	var ul= document.getElementById('cherchetalents');
373	//alert(TALENTS_SIMPLE.length);
374	while(ul.firstChild)ul.removeChild(ul.firstChild);
375	for(var i=0,j=Math.min(10, founded.length);i<j;i++){
376		var el = TALENTS_FULL[ founded[i] ];
377		el.clone().inject(ul);
378		/*
379		var li = document.createElement('li');
380		var a = document.createElement('a');
381		a.href = SITE_ROOT+data[1]+'/'+data[2];
382		var p = document.createElement('p');
383		var s = document.createElement('span');
384		s.appendChild(document.createTextNode(data[3].substring(0, 1)));
385		p.appendChild(s);
386		p.appendChild(document.createTextNode(data[3].substring(1, data[3].length)));
387		var p2 = document.createElement('p');
388		p2.style.fontStyle = 'italic';
389		p2.style.fontSize = '90%';
390		p2.appendChild(document.createTextNode(data[4]));
391		a.appendChild(p);
392		a.appendChild(p2);
393		li.appendChild(a);
394		ul.appendChild(li);
395		*/
396	}
397	if(founded.length == 0){
398		var li = document.createElement('li');
399		var p = document.createElement('p');
400		p.style.fontStyle = 'italic';
401		p.appendChild(document.createTextNode(NO_RES));
402		li.appendChild(p);
403		ul.appendChild(li);
404	}
405	$('rechercheres').style.display = 'block';
406}
407
408
409function chercheOut(){
410	INPUTSELECTED = false;
411	if(!RESSELECTED)
412		$('rechercheres').style.display = 'none';
413}
414
415function resDivOut(){
416	RESSELECTED = false;
417	if(!INPUTSELECTED)
418		$('rechercheres').style.display = 'none';
419}
420
421function resDivOver(){
422	//alert(RESSELECTED);
423	RESSELECTED = true;
424}
425
426function printdiv(divID)
427{
428	var headstr = "<html><head><title></title></head><body>";
429	var footstr = "</body>";
430	var newstr = document.all.item(divID).innerHTML;
431	var oldstr = document.body.innerHTML;
432	document.body.innerHTML = headstr+newstr+footstr;
433	window.print();
434	document.body.innerHTML = oldstr;
435	return false;
436}

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.