﻿<!--

// Management of the structure of the content of the web site Bedecoone.blogspot.com  
// Webmaster Pelli (http://www.infograpix.com)

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// Management of the text of comments
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 	
	// Add a "s" to the text of the comment if it's necessary
	function bdc_write_comment(comment){
		if(Number(comment) > 1) document.write("s");
	}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// Management of the box of informations 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 	
	var bdc_boxes_name	= new Array();
	
	// Identification of the box
	function bdc_identification_box(id){
		// Ciblage de la photo en fonction de la version du navigateur
		if(document.getElementById){		
			// version IE5+ et NS6+
			var box	= document.getElementById(id);
		}else if (document.all) {
			// version IE4+
			var box	= document.all(id);
		}
		// renvoit le bloc
		return(box);
	}
	// - - - - - - - - - - - - - - - - - - - - - - - - - -
	// Open or close a box
	function bdc_modify_box(id){
		// Récupération des balises
		var lien							= bdc_identification_box("lien_" 	+ id);
		var contenu							= bdc_identification_box("contenu_" + id);
		var image							= bdc_identification_box("img_" 	+ id);
		// Vérification de la validité de la balise
		if (contenu != null) {
			// Analyse de l'effet demandé
			if (contenu.style.display 	== "none") {
				contenu.style.display 			= "";
				lien.title						= "Fermer la boite";
				if(image != null) image.src 	= adresse_serveur + "/image_site/fleche_open.gif";
				return true;
			} else {
				contenu.style.display 			= "none";
				lien.title						= "Ouvrir la boite";
				if(image != null) image.src 	= adresse_serveur + "/image_site/fleche_close.gif";
				return false;
			}
		}
	}
	// - - - - - - - - - - - - - - - - - - - - - - - - - -
	// Display manuelly a box
	function bdc_display_box(id){
		bdc_modify_box(id);
		bdc_set_cookies();
	}
	// - - - - - - - - - - - - - - - - - - - - - - - - - -
	// Display automatically the boxes
	function bdc_initialise_box(array_id){
		bdc_boxes_name	= array_id;
		var cookies		= bdc_get_cookies();
		if(cookies != null && cookies.length > 0){
			for(var box in array_id){	bdc_modify_box(array_id[box]);	}
			for(var box in cookies){
				if(cookies[box][1] == "true") bdc_modify_box(cookies[box][0]);
			}
		}else{
			for(var box in array_id){
				bdc_modify_box(array_id[box]);
			}
		}
		bdc_set_cookies();
	}
	
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// Management of cookies 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 	
	// Creation of the cookie
	function bdc_set_cookies(){
		// Check the value of the box
		var contenu		= "";
		for(var cell in bdc_boxes_name){
			var boite	= bdc_identification_box("contenu_" + bdc_boxes_name[cell]);
			var valeur	= true;
			if(boite.style.display == "none") valeur = false;
			contenu		+= bdc_boxes_name[cell] + "=" + valeur + "---";
		}
		var date_cook		= new Date();
		date_cook.setDate(date_cook.getDate()+ 120);
		document.cookie 	= "bedecoone_cook=" + escape(contenu) + ";expires=" + date_cook.toGMTString();
	}
	// Loading of the cookie
	function bdc_get_cookies(){
		var array_contenu			= new Array();
		if(document.cookie.length > 0){
			var index				= document.cookie.indexOf("bedecoone_cook=");
			if(index != -1){
				var index_start		= index + String("bedecoone_cook=").length;
				var index_end		= document.cookie.indexOf(";", index_start);
				if (index_end == -1) index_end	= document.cookie.length;
				var contenu			= unescape(document.cookie.substring(index_start, document.cookie.length));
				var array_temp		= contenu.split("---");
				for(var cell in array_temp){
					array_contenu[cell]	= array_temp[cell].split("=");
				}
			}
		}
		return array_contenu;
	}
		
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// Management of the horoscope 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 	
	// Write the text of the horoscope
	function bdc_display_horoscope(obj){
		var image		= bdc_identification_box("image_animini_horoscope");
		var animini		= obj.animini.toLowerCase();
		image.src		= adresse_serveur + "/horoscope/bandeau_" + animini + ".jpg";
		// Affichage du texte
		var texte		= "<p class=\"bdc_box_horoscope\">" + obj.intro + "</p>";
		var longueur	= obj.contenu.length;
		// Création progressive du texte
		for (var cellule = 0; cellule < longueur; cellule++){
			texte	+= "<p> " + obj.contenu[cellule] + " </p>";
		}
		// Write the text
		document.write(texte);
	}


	// Affichage des liens archives reformaté de la boîte archive
	function bdc_display_archive(archives){
		var contenu		= "";
		for(var cell = archives.length -1; cell >= 0; cell--){
			contenu		+= 	bdc_format_archive(archives[cell][0], archives[cell][1]);
		}
		// Envoie de la date
		document.write("<ul class=\"bdc_list_link\">"+ contenu + "</ul>");
	}
	
	function bdc_format_archive(nom, lien){
		var tableau 	= nom.split("/");
		if(tableau.length > 2){
			// Récupération du mois
			var mois		= "";
			switch(tableau[0]){
				case "01":	mois = "Janvier"; 	break;
				case "02":	mois = "Fevrier"; 	break;
				case "03":	mois = "Mars"; 		break;
				case "04":	mois = "Avril"; 	break;
				case "05":	mois = "Mai"; 		break;
				case "06":	mois = "Juin"; 		break;
				case "07":	mois = "Juillet"; 	break;
				case "08":	mois = "Aout"; 		break;
				case "09":	mois = "Septembre"; break;
				case "10":	mois = "Octobre"; 	break;
				case "11":	mois = "Novembre"; 	break;
				case "12":	mois = "Decembre"; 	break;
			}
			// Récupération de la date formatée
			var date		= mois + " " + String(tableau[2]).substring(0, 4);
		}else{
			var date 		= nom;
		}
		return ("<li><a href='" + lien + "' title='archive du mois de " + date + "' >" + date + "</a></li>");
	}

-->