/* ------------------------------------------------------------------------	To controll the font size------------------------------------------------------------------------- */function set_font_size(direction){	if(direction == 'up'){		$('body').removeClass('small').addClass('bigger');	}else{		$('body').removeClass('bigger');	}}/* ------------------------------------------------------------------------	The send to a friend snippet------------------------------------------------------------------------- */function send_to_friend(caller){	if($('body').hasClass('fr')){		$(caller).attr('href','mailto:?subject=Regarde cette page que j\'ai trouvé: ' + document.title + '&body=Tu peux la voir au: ' + window.location);	}else{		$(caller).attr('href','mailto:?subject=Take a look at this page I found: ' + document.title + '&body=You can see it here: ' + window.location);	}}/* ------------------------------------------------------------------------	Fonction pour faire la rotation des images------------------------------------------------------------------------- */features = {	init : function(){		currentFeature = 0;		$('div.feature li:gt(0)').hide();				if($('div.feature li').size() > 0){			setTimeout('features.change()',8900);		}	},	change : function(){		$('div.feature li:eq('+currentFeature+')').fadeOut(function(){			currentFeature ++;			if(currentFeature == $('div.feature li').size()) { currentFeature = 0; }			$('div.feature li:eq('+currentFeature+')').fadeIn();			setTimeout('features.change()',8900);		});	}}/* ------------------------------------------------------------------------	Fonction pour la validation------------------------------------------------------------------------- */$.fn.validate = function(){	hasError = false;	$(this).find('input,textarea').each(function(){		if($(this).val() == ""){			hasError = true;			$(this).addClass('error');		}else{			$(this).removeClass('error');		}	});		(hasError) ? $(this).find('div.errors').show() : $(this).find('div.errors').hide();}/* ------------------------------------------------------------------------	Fonction pour le filtering dans la recherche------------------------------------------------------------------------- */$.fn.filtering = function(){	container = this;	controls = $(this).find('div.controls');	current_terms = 1;	total_terms = 4;		$(controls).find('.plus').click(function(){		if(current_terms > total_terms) return false;		current_terms++;				if(current_terms == 2){			$(container).find('.term_2').show();			$('.controls .minus').css('display','block');		}else{			$(container).find('.terms:last').clone().insertAfter($(container).find('.terms:last'));					// Set the proper classes, names			$(container).find('.terms:last').removeClass('term_'+(current_terms-1)).addClass('term_'+current_terms);			$(container).find('.terms:last input').attr({'name':'term_'+current_terms,'id':'term_'+current_terms});			$(container).find('.terms:last select:first').attr({'name':'operand_'+current_terms,'id':'operand_'+current_terms});			$(container).find('.terms:last select:last').attr({'name':'with_'+current_terms,'id':'with_'+current_terms});		}		return false;	});		$(controls).find('.minus').click(function(){		if(current_terms <= 2) return false;		current_terms--;		$(container).find('.terms:last').remove();		return false;	});}/* ------------------------------------------------------------------------	Fonction pour le expando dans la recherche------------------------------------------------------------------------- */$.fn.init_toggle = function(){	$(this).each(function(){		var container = this;		$(this).find('h3 a').click(function(){			if($(this).hasClass('plus')){				$(container).find('.toggle').slideDown();				$(this).removeClass('plus').addClass('minus');			}else{				$(container).find('.toggle').slideUp();				$(this).removeClass('minus').addClass('plus');			};			return false;		});	});}/* ------------------------------------------------------------------------	Fonction pour le expando dans le sidebar------------------------------------------------------------------------- */$.fn.sidebar_expando = function(){	$(this).each(function(){		$(this).click(function(){			if($(this).hasClass('open') || $(this).parent().hasClass('open')){				container = $(this).parent();				$(this).parent().find('.toggle').slideUp(function(){ $(container).removeClass('open'); });				$(this).removeClass('open');			}else{				$(this).parent().find('.toggle').slideDown();				$(this).addClass('open');			};			return false;		});	});}/* ------------------------------------------------------------------------	Fonction pour le expando dans le search------------------------------------------------------------------------- */$.fn.search_expando = function(){	$(this).find('li').each(function(){		$(this).find('a.expand').click(function(){			if($(this).hasClass('open')){				content = $(this).text();				content = content.substr(content.indexOf('[-]')+3,content.length);				content = "[+] " + content;				$(this).text(content).parent().parent().find('.expando').slideUp();				$(this).removeClass('open');			}else{				content = $(this).text();				content = content.substr(content.indexOf('[+]')+3,content.length);				content = "[-] " + content;				$(this).text(content).parent().parent().find('.expando').slideDown();				$(this).addClass('open');			};			return false;		});	});}/* ------------------------------------------------------------------------	Fonction pour changer de langue------------------------------------------------------------------------- */changelang = function(language,page){	langJson = {		// Reseau DIALOG		'/reseau-dialog/': [			{			'en':'/dialog-network/',			'fr':'/reseau-dialog/'			}],		'/reseau-dialog/presentation/': [			{			'en':'/dialog-network/presentation/',			'fr':'/reseau-dialog/presentation/'			}],		'/reseau-dialog/mission/': [			{			'en':'/dialog-network/mission',			'fr':'/reseau-dialog/mission/'			}],		'/reseau-dialog/programmes/': [			{			'en':'/dialog-network/programs',			'fr':'/reseau-dialog/programmes/'			}],		'/reseau-dialog/membres/': [			{			'en':'/dialog-network/members/',			'fr':'/reseau-dialog/membres/'			}],		'/reseau-dialog/membres/chercheurs/': [			{			'en':'/dialog-network/members/researchers/',			'fr':'/reseau-dialog/membres/chercheurs/'			}],		'/reseau-dialog/membres/etudiants/': [			{			'en':'/dialog-network/members/students/',			'fr':'/reseau-dialog/membres/etudiants/'			}],		'/reseau-dialog/partenaires/': [			{			'en':'/dialog-network/partners/',			'fr':'/reseau-dialog/partenaires/'			}],		'/reseau-dialog/gouvernance/': [			{			'en':'/dialog-network/governance/',			'fr':'/reseau-dialog/gouvernance/'			}],		'/reseau-dialog/nous-joindre/': [			{			'en':'/dialog-network/contact-us/',			'fr':'/reseau-dialog/nous-joindre/'			}],		// Activites		'/activites/': [			{			'en':'/activities/',			'fr':'/activites/'			}],		'/activites/prochaines-activites/': [			{			'en':'/activities/upcoming-activities/',			'fr':'/activites/prochaines-activites/'			}],		'/activites/forum-dialog/': [			{			'en':'/activities/dialog-forum/',			'fr':'/activites/forum-dialog/'			}],		'/activites/grands-evenements/': [			{			'en':'/activities/events/',			'fr':'/activites/grands-evenements/'			}],		'/activites/rencontres-et-ateliers/': [			{			'en':'/activities/meetings-and-workshops/',			'fr':'/activites/rencontres-et-ateliers/'			}],		'/activites/dialog-a-linternational/': [			{			'en':'/activities/dialogs-international/',			'fr':'/activites/dialog-a-linternational/'			}],					// Recherche		'/recherche/': [			{			'en':'/research/',			'fr':'/recherche/'			}],		'/recherche/approches-et-pratiques/': [			{			'en':'/research/approaches-and-practices/',			'fr':'/recherche/approches-et-pratiques/'			}],		'/recherche/etat-de-la-recherche/': [			{			'en':'/research/state-of-research/',			'fr':'/recherche/etat-de-la-recherche/'			}],		'/recherche/etat-de-la-recherche/projets-en-cours/': [			{			'en':'/research/state-of-research/ongoing-research/',			'fr':'/recherche/etat-de-la-recherche/projets-en-cours/'			}],		'/recherche/etat-de-la-recherche/resultats-de-recherche/': [			{			'en':'/research/state-of-research/research-findings/',			'fr':'/recherche/etat-de-la-recherche/resultats-de-recherche/'			}],		'/recherche/publications/': [			{			'en':'/research/publications/',			'fr':'/recherche/publications/'			}],		'/recherche/publications/bulletin/': [			{			'en':'/research/publications/newsletter/',			'fr':'/recherche/publications/bulletin/'			}],		'/recherche/publications/revue-inditerra/': [			{			'en':'/research/publications/inditerra-journal/',			'fr':'/recherche/publications/revue-inditerra/'			}],		'/recherche/lalliance-odena/': [			{			'en':'/research/odena-alliance/',			'fr':'/recherche/lalliance-odena/'			}],					// Formation		'/formation/': [			{			'en':'/training/',			'fr':'/formation/'			}],		'/formation/zone-etudiante/': [			{			'en':'/training/student-zone/',			'fr':'/formation/zone-etudiante/'			}],		'/formation/zone-etudiante/bourses-et-allocations/': [			{			'en':'/training/student-zone/grants-allowances/',			'fr':'/formation/zone-etudiante/bourses-et-allocations/'			}],		'/formation/zone-etudiante/stages/': [			{			'en':'/training/student-zone/internships/',			'fr':'/formation/zone-etudiante/stages/'			}],		'/formation/universite-nomade/': [			{			'en':'/training/nomadic-university/',			'fr':'/formation/universite-nomade/'			}],					// Outils		'/outils/': [			{			'en':'/tools/',			'fr':'/outils/'			}],		'/outils/banque-documentaire-autochtonia/': [			{			'en':'/tools/autochtonia-documentary-bank/',			'fr':'/outils/banque-documentaire-autochtonia/'			}]	};	location.href = '/' + language + langJson[page][0][language];}function EstCeOK(){	FaireSubmit = "oui";	isIE = (document.all);			varFirst = document.forms["recherche"].termes_un.value;	varSecond = document.forms["recherche"].termes_deux.value;	varThird = document.forms["recherche"].termes_trois.value;		varFirst = ((trim(varFirst)).replace(/"  "/g," "));	varSecond = ((trim(varSecond)).replace(/"  "/g," "));	varThird = ((trim(varThird)).replace(/"  "/g," "));			if (varFirst.length > 2)	{		if (varSecond.length == 0)		{			if (varThird.length == 0)			{				return true; //document.forms["recherche"].submit();//alert('ca passe');			}			else 			{				alert ('Recherche impossible. Veuillez entrer plus de deux caract\350res.');				return false;							}		}		else if (varSecond.length > 2)		{			if (varThird.length == 0)			{				return true; //document.forms["recherche"].submit();//alert('ca passe');			}			else if (varThird.length > 2)			{				return true; //document.forms["recherche"].submit();//alert('ca passe');			}			else 			{				alert('Recherche impossible. Veuillez entrer plus de deux caract\350res.');				return false;							}								}		else 		{			alert('Recherche impossible. Veuillez entrer plus de deux caract\350res.');			return false;		}	}	else 	{		alert('Recherche impossible. Veuillez entrer plus de deux caract\350res.');		return false;	}}function Mettre(){	document.forms["recherche"].from_dates.checked = true;	document.forms["recherche"].all_dates.checked = false;	}
