/*
Require Prototype librairie 1.5.0_rc0+ (http://prototype.conio.net/)
Require dombuilder.js (http://www.vivabit.com/bollocks/2006/04/06/introducing-dom-builder)
*/

FullSkinBox = {
	apply : function(selector,skin)
	{
		elements = $$(selector);
		for (var k in elements)
		{
			if(typeof(elements[k])=="object") //bug incompréhensible ... le for(in) renvoi des functions d'event
			{
				var clone = elements[k].cloneNode(true);
				var html = DomBuilder.apply();
				var myNode = html.DIV(
					{'class':skin+"-FSB-container"},
					html.DIV(
						{'class':skin+"-FSB-T"},
						html.DIV(
							{'class':skin+"-FSB-R"},
							html.DIV(
								{'class':skin+"-FSB-B"},
								html.DIV(
									{'class':skin+"-FSB-L"},
									html.DIV(
										{'class':skin+"-FSB-TL"},
										html.DIV(
											{'class':skin+"-FSB-TR"},
											html.DIV(
												{'class':skin+"-FSB-BR"},
												html.DIV(
													{'class':skin+"-FSB-BL"},
													html.DIV(
														{'class':skin+"-FSB-content"},
														clone
													)
												)
											)
										)
									)
								)
							)
						)
					)
				);
				elements[k].parentNode.replaceChild(myNode,elements[k]);
			}
		}
	}
};