$(document).ready(function(){	
	ini_description_prof();	
	ini_description_gen();
	ini_description_eventment();
});

function ini_description_prof() {
	var lang = "fr";
	if ($("div.blueBox a.savoir-plus").html() == 'Read more about this teacher') {
		lang = "en";
	}	
	$("div.blueBox div.description").hide();
	$("div.blueBox a.savoir-plus").click(function() {
		var desc = $(this).parent().parent().find("div.description");
		if (desc.css("display") == "none") {
			desc.show();
			if (lang == "en") {
				$(this).html("Hide informations about this teacher");
			} else {
				$(this).html("Cacher les informations sur ce professeur");
			}			
		} else {
			desc.hide();
			if (lang == "en") {
				$(this).html("Read more about this teacher");
			} else {
				$(this).html("En savoir plus sur ce professeur");
			}
		}
		return false;
	});	
}


function ini_description_gen() {
	var lang = "fr";
	if ($("div.box a.lire-plus").html() == 'read more') {
		lang = "en";
	}
	
	$("div.box .resume").show();
	$("div.box .description").hide();
	
	$("div.box a.lire-plus").click(function(e) {
		e.preventDefault();
		
		var resume = $(this).parent().parent().parent().find(".resume");
		var desc = $(this).parent().parent().parent().find(".description");
		
		if (desc.css("display") == "none") {
			resume.hide();
			desc.show();
			if (lang == "en") {
				$(this).html("hide details");
			} else {
				$(this).html("cacher la suite");
			}			
		} else {
			resume.show();
			desc.hide();
			if (lang == "en") {
				$(this).html("read more");
			} else {
				$(this).html("suite de l'article");
			}
		}
		return false;
	});	
}



function ini_description_eventment() {
	var lang = "fr";
	if ($("div.box a.event-lire-plus span").html() == 'read more') {
		lang = "en";
	}
	
	$("div.box .event-resume").show();
	$("div.box .event-desc").hide();
	
	$("div.box a.event-lire-plus").click(function(e) {
		e.preventDefault();
		
		var resume = $(this).parent().parent().find(".event-resume");
		var desc = $(this).parent().parent().find(".event-desc");
		
		if (desc.css("display") == "none") {
			resume.hide();
			desc.show();
			if (lang == "en") {
				$(this).children("span").html("hide details");
			} else {
				$(this).children("span").html("cacher la suite");
			}			
		} else {
			resume.show();
			desc.hide();
			if (lang == "en") {
				$(this).children("span").html("read more");
			} else {
				$(this).children("span").html("suite de l'article");
			}
		}
		return false;
	});	
}
