/*************************************************
* Auteur MORAND Sébastien						 *
* Création 2008									 *
* http://sebastien-morand.com					 *
**************************************************/

/* class historique */

function historique ()
	{
	this.id_actif = 0;
	}

historique.prototype.hash = function()
	{
	window.location.hash = connect.nbr_requetes;
	this.id_actif = connect.nbr_requetes;
	}
	
historique.prototype.charger = function(id)
	{
	mapile.ajouter(requetes[id]);
	}

historique.prototype.afficher_historique = function()
	{
	var html = 'taille historique : ' + connect.nbr_requetes + "<br /><br />---<br />";
	var i;
	for(i=connect.nbr_requetes-1; i>=0; i--)
		{
		if(i == this.id_actif)
			{
			html = html + "<b>|" + requetes[i].div + " - " + requetes[i].fichier + " - " + requetes[i].methode + "|</b><br />---<br />";
			}
		else
			{
			html = html + "|" + requetes[i].div + " - " + requetes[i].fichier + " - " + requetes[i].methode + "|<br />---<br />";
			}
		}
	return html;
	}

historique.prototype.verif = function()
	{
	id = window.location.hash.substring(1);
	if( (window.location.hash != null) && (window.location.hash != '') && (connect.nbr_requetes > 0) && (this.id_actif != id) )
		{
		if(requetes[id] != null)
			{
			this.id_actif = id;
			this.charger(id);
			}
		}
	}

