 function OuvrirPopup(page,nom,option) {
       window.open(page,nom,option);
    }   // ---------------------------------------------------function showSelectBoxes(){	var selects = document.getElementsByTagName("select");	for (var i=0, len=selects.length; i<len; ++i) {		selects[i].style.visibility = "visible";	}}function hideSelectBoxes(){	var selects = document.getElementsByTagName("select");	for (var i=0, len=selects.length; i<len; ++i) {		selects[i].style.visibility = "hidden";	}}function showFlash(){	var flashObjects = document.getElementsByTagName("object");	for (var i=0, len=flashObjects.length; i<len; ++i) {		flashObjects[i].style.visibility = "visible";	}	var flashEmbeds = document.getElementsByTagName("embeds");	for (var i=0, len=flashEmbeds.length; i<len; ++i) {		flashEmbeds[i].style.visibility = "visible";	}}function hideFlash(){	var flashObjects = document.getElementsByTagName("object");	for (var i=0, len=flashObjects.length; i<len; ++i) {		flashObjects[i].style.visibility = "hidden";	}	var flashEmbeds = document.getElementsByTagName("embeds");	for (var i=0, len=flashEmbeds.length; i<len; ++i) {		flashEmbeds[i].style.visibility = "hidden";	}}var ParapgraphWrapper = Class.create({ 	initialize: function(sourceColumnIn, sourceParagraphIn, destinationColumnIn, heightIn) 	{		this.sourceColumn=sourceColumnIn;		this.height=heightIn;		//Duplicate the current paragraph by shallow copy		if (destinationColumnIn.hasChildNodes()) {								destinationColumnIn.insertBefore(sourceParagraphIn.cloneNode(false),destinationColumnIn.firstChild);		} else {			destinationColumnIn.appendChild(sourceParagraphIn.cloneNode(false));		}			this.processElement(sourceParagraphIn,destinationColumnIn.firstChild);	},		/**	* Recursively loops over given <source>, moving text from <source> to <dest>	* until the column height is less or equal to the target height.	*	* Preconditions: <source> and <dest> are element nodes.	*/	processElement: function (source,dest) 	{		var lastSourceChild;				while (lastSourceChild=source.lastChild) {			if (lastSourceChild.nodeType==1) {				//Make a shalow clone copy of this element to the destination				//node, to preserve styles and attributes.				var newDest=lastSourceChild.cloneNode(false);				if (dest.hasChildNodes()) {										dest.insertBefore(newDest,dest.firstChild);				} else {					dest.appendChild(newDest);				}				//recursively process this node.				if (this.processElement(lastSourceChild,newDest)) {					return true;				}										} else if (lastSourceChild.nodeType==3) {				//Wrap this text node..				if (this.wrapTextNode(lastSourceChild,dest)) {					//..and return when the target has been reached.					return true;				}			}						//This node has been cleaned out. Remove it.			source.removeChild(lastSourceChild);		} 						return false;	},		/**	* Cuts words at the end of <source>, until the column height	* is less or equal to target-height.	* Cut words are then placed into <dest>	*	* Preconditions: <source> is a text node. <dest> is an element node.	*/	wrapTextNode: function (source,dest) 	{			var sourceText=source.nodeValue;				//Split the text at spaces.		var sourceTextAray=sourceText.split(/\s/);		var destTextArray=new Array();				//Keep removing words form the source until the column fits.		while (this.sourceColumn.getDimensions().height>this.height && sourceTextAray.length>0) {			destTextArray.push(sourceTextAray.pop());			source.nodeValue=sourceTextAray.join(' ');		}				//Add spaces at the front and end, if there are spaces in the original.		var newText=(/^\s/.test(sourceText)?' ':'') + (destTextArray.reverse().join(' ')) + (/\s$/.test(sourceText)?' ':'');				//Put the text into the destination node in the next column.		var newTextNode=document.createTextNode(newText);		if (dest.hasChildNodes()) {								dest.insertBefore(newTextNode,dest.firstChild);		} else {			dest.appendChild(newTextNode);		}				//return true if the target has been reached.		return this.sourceColumn.getDimensions().height<=this.height;	}});// src : element (DIV), previewer : element (DIV), dest : identifier (dest<xx>, <xx> column number), heights : array of column heights. var Columnizer = Class.create({	initialize: function(id_src, id_previewer, id_dest, colContentClass, heights)	{		this.src = $(id_src);		this.previewer = $(id_previewer);		this.dest = $(id_dest);		this.colContentClass = colContentClass;		this.maxHeight = heights;		this.realHeight = 0;		for(var i=0; i<this.maxHeight.length; i++)		{		  if(this.maxHeight[i] > this.realHeight) this.realHeight = this.maxHeight[i];		}		this.init();	},	init: function()	{		this.previewer.show();		// Remplissage de toutes les colonnes		this.cols = new Array();		var i = 0;		var currentCol = 0;		this.createColumn();		while(this.cols[currentCol])		{			var cCol = this.cols[currentCol];			var cHeight = this.maxHeight[currentCol % this.maxHeight.length] - 10;			while((cCol.getDimensions().height <= cHeight) && this.src.childNodes[i])			{   				var newNode = this.src.childNodes[i].cloneNode(true);				cCol.appendChild(newNode);				i++;			}			if((cCol.getDimensions().height > cHeight) && cCol.lastChild)			{				var target = this.createColumn();				switch (cCol.lastChild.nodeName.toLowerCase()) 				{				  case 'p': 				  default:				  new ParapgraphWrapper(cCol, cCol.lastChild, target, cHeight);					break;					// RAW TEXT				}			}			this.attachColumn(currentCol);			currentCol++;		}	    this.numPages = Math.ceil(this.cols.length / this.maxHeight.length);	},	updatePages: function()	{		var pagesnum = new Array(this.numPages);		for(var i=1; i<=this.numPages; i++)		{			if(i == this.currentPage)			{				pagesnum[i-1] = '<b class="noir">' + i + '</b>';			}			else			{				pagesnum[i-1] = '<a href="#" onclick="columns.displayPage(' + i + '); gb.ib.nextImage(); return false;">' + i + '</a>';			}		}		$('colPages').update(pagesnum.join('&nbsp;&nbsp;&nbsp;'));	},    attachColumn: function(i)	{		var conteneur = new Element("DIV", { 									className: "col",									style: "display: none; height:" + this.maxHeight[i % this.maxHeight.length] + "px; "										 + "padding-top: " + (this.realHeight - this.maxHeight[i % this.maxHeight.length]) + "px;"									});				Element.setHeight(this.cols[i], this.maxHeight[i % this.maxHeight.length] - 10);		conteneur.appendChild(this.cols[i]);		if( (i != 0) && ((i % this.maxHeight.length) == 0) ) // Colonne de gauche		{			conteneur.onclick = function() { this.colPrev() }.bind(this);			conteneur.onmouseover = function() { conteneur.addClassName('lhover'); }			conteneur.onmouseout = function() { conteneur.removeClassName('lhover'); }		}		else if( (i < (this.cols.length - 1))				&& ((i % this.maxHeight.length) == (this.maxHeight.length -1)) ) // colonne de droite		{			conteneur.onclick = function() { this.colNext() }.bind(this);			conteneur.onmouseover = function() { conteneur.addClassName('rhover'); }			conteneur.onmouseout = function() {	conteneur.removeClassName('rhover'); }		}				this.dest.appendChild(conteneur);	},	displayPage: function(page)	{		this.previewer.hide();		this.currentPage = page;		this.updatePages();			if(this.currentPage == 1)			$('btnPrev').addClassName('disabled');		else			$('btnPrev').removeClassName('disabled');		if(this.currentPage == this.numPages)			$('btnNext').addClassName('disabled');		else			$('btnNext').removeClassName('disabled');		for(var i = 0; i < this.cols.length; i++)		{			if( (Math.floor(i / this.maxHeight.length) + 1) == this.currentPage)			{				this.cols[i].parentNode.show();					}			else			{				this.cols[i].parentNode.hide();			}		}	},	createColumn: function()	{		var elem = new Element("DIV", { className: this.colContentClass });		if(this.fontsize) { elem.style.fontSize = this.fontsize; }		this.previewer.appendChild(elem); // On les crée dans le previewer, hors maquette, pour IE...		this.cols.push(elem);		return elem;	},	setFontSize: function(size)	{		this.fontsize = size;		this.previewer.style.fontSize = this.fontsize;		this.previewer.style.position = "absolute";		this.previewer.style.offsetLeft = 2048;		var ccols = $$('div.col');		for(var i=0; i<ccols.length; i++)		{			Element.remove(ccols[i]);		}		var cpage = this.currentPage;		this.init();		this.displayPage(cpage);	},	colPrev: function()	{	  if(this.currentPage > 1)	  {		this.displayPage((this.currentPage - 1));		gb.ib.nextImage();	  }	},	colNext: function()	{	  if(this.currentPage < this.numPages)	  {		this.displayPage((this.currentPage + 1));		gb.ib.nextImage();	  }	}});