function Bloc(int_id,obj_parent,str_titre,str_chapeau,str_corps,str_dir, b_collapsable, b_deploye){

/******************************************/
/**********DECLARATION DE PROPRIETE********/
/******************************************/

	this._parent = obj_parent;
	this.dir = this._parent.dir + str_dir + "/";
	this.titre = str_titre;
	this.chapeau = str_chapeau;
	this.corps = str_corps;
	this.id = this._parent.id + "_" +"bloc_" + int_id;
	this.index = int_id;
	this.content = new Array();
	this.ouvert = b_deploye;
	this.collapsable = b_collapsable;	
	this.deploye = b_deploye;
	this.scriptPath = this._parent.scriptPath + ".content[" + this.index + "]";
	this.html = "";
	
/******************************************/
/**********DECLARATION DE METHODE**********/
/******************************************/
	
	this.createHtml = function () {

		var str_type = "";
		if (this._parent.type==null) {
			str_type = "projets";
		}else{
			str_type = this._parent.type;
		}

		var str_html = new String();
		
		
		//-------------------------		
		//vignettes
		//-------------------------
		if (this.content.length>0) {
			
			var excep = "";
			if (this.index==0) excep = "_first";
			str_html+= "<div id=\"illust_" + this.id +"\" class=\"vignette_container_"+str_type+excep+"\">\n";
			for (var iI = 0; iI < this.content.length; iI++){
				this.content[iI].createHtml();
				str_html+= this.content[iI].html;
			}				
			str_html+= "</div>\n";	
			str_html+= "<div id=\"fleche_" + this.id +"\" class=\"vignette_fleche_"+str_type+" \"><img src=\"img/fleche_illus.gif\"></div>";
		}
					
		if (this.index==0) str_html+= "<div class=\"bloc_top_"+str_type+"\"><img src=\"img/coin_bloctop.gif\"></div>";	
		str_html+= "<div id=\"" + this.id +"\" class=\"bloc_"+str_type+"\">\n";		

	

			
			//-------------------------		
			//titre
			//-------------------------		
			var isCollapsable = "";
			if (this.collapsable) {
				isCollapsable = "_collapsable";
			}
			str_html+= "<div class=\"bloc_titre"+isCollapsable+"\" ";
			if (this.collapsable) str_html+= " onClick=\""+this.scriptPath+".togleThis();\"";
			str_html+= ">" + this.titre + "</div>\n";
			
			//-------------------------		
			//content
			//-------------------------			
			str_html+= "<div id=\"content_" + this.id +"\">\n";									
				str_html+= "<div class=\"bloc_chapeau\">" + this.chapeau + "</div>\n";
				str_html+= "<div class=\"bloc_corps\">" + this.corps + "</div>\n";								
			str_html+= "</div>\n"			
						
		str_html+= "</div>\n";	
		
		//----------------		
		//bas des blocs
		//----------------
		if (this.index == this._parent.content.length - 1) {
			if (this._parent.type=="infos") {
				str_html += "<div class=\"bloc_bottom_infos\"><div>&nbsp;</div></div>";
			}else{
				if (this._parent.index < this._parent._parent.content.length - 1) {
					str_html += "<div class=\"bloc_bottom_projets\"><div>&nbsp;</div></div>";
				}	
			}
		}
	
		this.html = str_html;
	}
	
	this.togleThis = function () {
		this.toogle();
		
	}
	
	this.toogle = function() {
		

		oDiaporama.hideDiapo();
		
		
		var div = $('content_' + this.id);
		var divIllus = $('illust_' + this.id);
		var divFleche = $('fleche_' + this.id);
		
		if (div.visible()==false) {

			
			var nextid = int_id+1;
			var suivid = this._parent.id + "_" +"bloc_" + nextid;
			var nextdiv = $('content_' + suivid);
			
			if (nextdiv!=null) {
				if (nextdiv.visible()==true) {			
					var nextdivIllus = $('illust_' + suivid);
					var nextdivFleche = $('fleche_' + suivid);
					
					if (nextdiv!=null) nextdiv.show();
					if (nextdivIllus!=null) nextdivIllus.show();
					if (nextdivFleche!=null) nextdivFleche.show();
					
					if (nextdiv!=null) nextdiv.hide();
					if (nextdivIllus!=null) nextdivIllus.hide();
					if (nextdivFleche!=null) nextdivFleche.hide();
					
					if (nextdiv!=null) nextdiv.show();
					if (nextdivIllus!=null) nextdivIllus.show();
					if (nextdivFleche!=null) nextdivFleche.show();				
				}
			}		
			
			div.show();
			if (divIllus!=null) divIllus.show();
			if (divFleche!=null) divFleche.show();				
		
		//	var div = document.getElementById("content_"+this.id);
		//	window.scrollTo(0, div.offsetTop);					
		}else{
			
			div.hide();
			if (divIllus!=null) divIllus.hide();
			if (divFleche!=null) divFleche.hide();
			
			var nextid = int_id+1;
			var suivid = this._parent.id + "_" +"bloc_" + nextid;
			var nextdiv = $('content_' + suivid);
			
			if (nextdiv!=null) {
				if (nextdiv.visible()==true) {		
					var nextdivIllus = $('illust_' + suivid);
					var nextdivFleche = $('fleche_' + suivid);
					
					if (nextdiv!=null) nextdiv.show();
					if (nextdivIllus!=null) nextdivIllus.show();
					if (nextdivFleche!=null) nextdivFleche.show();
					
					if (nextdiv!=null) nextdiv.hide();
					if (nextdivIllus!=null) nextdivIllus.hide();
					if (nextdivFleche!=null) nextdivFleche.hide();
					
					if (nextdiv!=null) nextdiv.show();
					if (nextdivIllus!=null) nextdivIllus.show();
					if (nextdivFleche!=null) nextdivFleche.show();				
				}
			}		
			
		}
		this.ouvert = !this.ouvert;	
		setBgStatus();
	}
	
	



}
