﻿// JavaScript Document
function gotoChaine(id) {
	document.location.href = "play-video.php?chaine="+id;
}

function affiche(id) {
	$("#"+id).show();	
}

function cache(id) {
	$("#"+id).hide();		
}

function showVideos(id,type, chaine) {
	$('#'+id).load('_librairies/t_ajax.php',{id_ajax:15, type:type, chaine:chaine});	
}
		
function menuDepliant(id, chaines) {
	
	var id_chaines = chaines.split(';');
	
	for (i = 0; i < id_chaines.length; i++) {
	  if ( parseInt(id_chaines[i]) != id  &&  document.getElementById('chaine'+parseInt(id_chaines[i])).style.display=='none') {
	  	document.getElementById('chaine'+parseInt(id_chaines[i])).style.display='block';
	  }
	}

	
	if (document.getElementById('chaine'+id).style.display=='block') {
		document.getElementById('chaine'+id).style.display='none';		
	}
	else if (document.getElementById('chaine'+id).style.display=='none') {
		document.getElementById('chaine'+id).style.display='block';
	}
	
	$('#deplie-'+id).slideToggle("slow")
	.siblings("p:visible").slideUp("slow");
}

function retireaccent(chaine) {
	temp = chaine.replace(/[àâä]/gi,"a");
	temp = temp.replace(/[éèêë]/gi,"e");
	temp = temp.replace(/[îï]/gi,"i");
	temp = temp.replace(/[ôö]/gi,"o");
	temp = temp.replace(/[ùûü]/gi,"u");
	temp = temp.replace(/[ç]/gi,"c");
	temp = temp.replace(/['']/gi," ");
	temp = temp.replace("…","...");
	return temp;
}

function afficheBulle(bulle){
	if(document.getElementById(bulle).style.display == 'none'){
		document.getElementById(bulle).style.display = 'block';
	}else{
		document.getElementById(bulle).style.display = 'none';
	}
}

/*
	$(".accordion2 h3").click(function(){
		//alert($(this).next("p"));
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});
	*/
	
	

