// hierarchie.class.js (v1.0)
// Feuille de scripts JavaScript - Rubrique Etat des lieux
// Copyright 1999-2004 Versus Studio

// Scripts de définition des classes utilisées dans la rubrique Etat des lieux


// *
// *  Classe Theme : gestion d'un theme
// *
// *
// *

function Theme( indice, titre ) {
	this.indice = indice ; 
	this.titre  = titre ;
	this.ary_page = new Array() ;
	this.selected = false ;
}

// Ajout d'une page au thème
Theme.prototype.AddPage = function( page, titre ) {
	var indice = this.ary_page.length ;
	this.ary_page[ indice ] = new Array( page, titre ) ;
}

// Affichage de l'option du select correspondant au theme
Theme.prototype.AfficheTheme = function() {
	if( this.selected ) {
		document.writeln('<option value="'+ this.indice +'" selected>'+ this.titre +'</option>') ;
	} else {
		document.writeln('<option value="'+ this.indice +'">'+ this.titre +'</option>') ;
	}
}

// Affichage de la liste des pages présentes dans le theme
Theme.prototype.AffichePageTheme = function( param1, param2 ) {
	if( this.ary_page.length == 0 ) {
		document.writeln("<p>Le thème sélectionné ne contient actuellement aucune page.</p>")
	} else {
		var i ;
		for( i=0 ; i<this.ary_page.length ; i++ ) {
			document.writeln('<p> --> <a href="'+ this.ary_page[i][0] +'?'+ param1 +'&'+ param2 +'='+ this.indice +'"> '+ this.ary_page[i][1] +' </a></p>') ;
		}
	}
}


