Template ={
	load :function(){
		if( Cufon ){
			var oFontsLoader = new Ajax ({ bCache: true })
			var fLoadFont = function ( sFontName , sTarget , o ){
				oFontsLoader.get( "@pp/fonts/" + Fonts[ sFontName ] + ".font.js" , "js" , sTarget ? function(){ Cufon.replace( sTarget , o )} : null )
				}
			for( var i = 0 , ni = aFonts.length ; i < ni ; i++ ){
				var o = aFonts[i][1]
				if( o.fontFamily ) fLoadFont( o.fontFamily , aFonts[i][0] , o )
				}
			}
		if( sPreloaderImage && loader ) loader.style.backgroundImage = "url(@pp/images/preloader/" + sPreloaderImage  + ")"
		FileSystem.load( sTemplateDir + 'css/TextBox.css' )
		for( var i = 0 , a = [ "bg", "page" , "link" ] ; i < a.length ; i++ )
			window[ a[i] + "Sound" ] = null
		if( swfsound ){
			swfsound.onload = function(){
				swfsound.bReady = true
				for( var i = 0 , a = [ "bg", "page" , "link" ] ; i < a.length ; i++ ){
					var o = Sounds[ a[i]]
					if( o && o.mp3 ){
						var sTarget = a[i] + "Sound"
						window[ sTarget ] = swfsound.loadSound( '@pp/mp3/' + o.mp3, ( a[i] != "page" ) && bSounds ? true : false );
						swfsound.setVolume( window[ sTarget ], o.volume );
						}
					}
				}
			swfsound.embedSWF( '@pp/widgets/swfsound/swfsound.swf' )
			if( bSounds && ! isNaN( bgSound ) && swfsound.bReady )
				swfsound.startSound( bgSound )
			}
		if( left && sLeftWidth ) left.style.width = sLeftWidth
		if( right && sRightWidth ) right.style.width = sRightWidth
		if( template ){
			template.className = sTemplateName
			if( sMinWidth ) template.style.minWidth = sMinWidth
			if( sWidth ) template.style.width = sWidth
			template.style.visibility = 'visible'
			}
		var a____ = aNodes.clone()
		if( ! Pages ){
			Pages = new Widget ()
			var aRootElements = []
			, oElementList = {}
			, oSiblingList = {}
			, fAddChildNodes =function( o , a ){
				o.appendChild( new Fragment( a ))
				}
			, fAddSibling =function( o ){
				fAddChildNodes( oElementList[ o.nParentId ], o.aChild )
				}
			, fCreateElement =function( a ){
				var o = new Node ( "NODE" )
				o.extend( { id: a[0], nParentId: a[1] , sLabel: a[2] , sImage: a[3] || sDefaultImage })
				oElementList[ a[0]] = o
				}
			, fListRootElements =function( a ){
				if( a[0] == a[1]) aRootElements.push( oElementList[ a[0]])
				}
			, fListSibling =function( a ){
				if( a[0] != a[1]){
					var nId = a[1]
					oSiblingList[ nId ] = oSiblingList[ nId ] || []
					oSiblingList[ nId ].push( oElementList[ a[0]])
					}
				}
			if( in_array( sSort , [ "0" , "1" , "2" ])) a____.sortBy( sSort , sOrder )
			a____.each( fCreateElement )
			a____.each( fListRootElements )
			a____.each( fListSibling )
			fAddChildNodes( Pages , aRootElements )
			var aSiblingList = []
			oSiblingList.each( function( a , n ){ aSiblingList.push({ nParentId: n , aChild : a })} , [ Array ])
			aSiblingList.sortBy(  "nParentId" , "ASC" )
			aSiblingList.each( fAddSibling )
			}
		var nId = Cookie.get( "ID" )
		nId = nId ? nId: 1
		oAjax = new Ajax ({ bCache : true , sResponseType : "text" })
		oAjax.get( sTemplateDir + 'template.xml?s=' + CACHE_ID ,'xml' , Template.Add.contents )
		Page.load( nId )
		},
	Navigation :{ // ?n' + CACHE_ID 
		load :function(){
			if( bFx ) FileSystem.load( '@pp/js/Fx.js' )
				else FileSystem.loaded['@pp/js/Fx.js'] = Fx = false
			if( bStaticMenu ){
				if( oStaticMenu ) oStaticMenu.eRoot.style.display = ""
					else waitObject(
							[ "STATIC_MENU_LOADED" ],
							Template.Navigation.Add.StaticMenu,
							[ sTemplateDir + 'css/staticMenu.css' , '@pp/widgets/StaticMenu.js' ]
							)
				} else if( oStaticMenu ) oStaticMenu.eRoot.style.display = "none"
			if( bPathBox ){
				if( oPathBox ) oPathBox.eRoot.style.display = ""
					else waitObject(
							[ "PATH_BOX_LOADED" ],
							Template.Navigation.Add.PathBox,
							[ sTemplateDir + 'css/pathBox.css' , '@pp/widgets/PathBox.js' ]
							)
				} else if( oPathBox )	oPathBox.eRoot.style.display = "none"
			if( bHistory && ! History ) FileSystem.load( '@pp/widgets/History.js' )
			if( eHistory ) eHistory.style.display = bHistory ? "" : "none"
			},
		Add :{
			Menu :function( eNode , sType ){
				var re = /childNodes(.*)/
				if( re.test( sType )){
					var nId = sType.replace( re , '$1' )
					sType = "childNodes"
					if( ! nId ) nId = ID
					}
				switch( sType ){
					case "childNodes" :
						var oParent= Pages.getElementById( nId )
						if( oParent ){
							var oNode = oParent.firstChild
							, eDIV =  Tag( "DIV" , { className: "childNodes" })
							, eUL = Tag( "UL" )
							eDIV.appendNodes( Tag( "DIV" , { className: "topSideMenu" }), eUL, Tag ( "DIV" , { className: "bottomSideMenu" }))
							while( oNode ){
								eUL.appendChild( Tag.interlock( Tag( "LI" ) , Tag( "A" , { 
									href: "#" ,
									rel: oNode.id ,
									innerHTML: oNode.sLabel 
									,style: { backgroundImage: oNode.sImage != sDefaultImage ? 'url(@pp/images/16/' + oNode.sImage + ')' : 'none' }	/*  */
									})))
								if( oNode.id == ID ) eUL.lastChild.className = "selected"
								oNode = oNode.nextSibling
								}
							eNode.appendChild( eDIV )
							}
						break;
					default: throw new Error( "Menu " + sType + " indéfinie." )
					}
				},
			History :function(){
				},
			PathBox :function(){
				if( ! navigation ) return
				PathBox.prototype.sDefaultImage = sDefaultImage
				PathBox.prototype.sImagesPath = "@pp/images/16/"
				PathBox.prototype.oTree = Pages
				oPathBox = new PathBox ( aNodes , {
					sSort: sSort,
					// eNextSibling : oStaticMenu ? oStaticMenu.eRoot : null , 
					eParentNode: navigation ,
					nId: ID
					})
				oPathBox.onchange = function( nId ){ if( nId != ID ) Page.load( nId , "pathbox" )}
				},
			StaticMenu :function(){
				if( ! navigation ) return
				StaticMenu.prototype.oTree = Pages
				oStaticMenu = new StaticMenu ( aNodes, {
					aEffect : [ "expo.out" , 250 ],
					bDistribute : bDistribute,
					sSort: sSort,
					nDepth: nDepth,
					eParentNode : navigation,
					eNextSibling : oPathBox ? oPathBox.eRoot : null , 
					nId : ID,
					sDirection : sDirection
					})
				addEvent( oStaticMenu.oDOM.eDL , "click" , function( evt ){
					var e = getElement( evt )
					if( e.nodeName == "A" ){
						oStaticMenu.hideAll()
						Page.load( e.parentNode.id , "staticmenu" )
						}
					return stopPropagation( evt )
					})
				}
			}
		},
	Add :{ 
		contents :function( o ){
			if( header ) header.innerHTML = getValue( o , 'header' )
			if( footer ) footer.innerHTML = getValue( o , 'footer' )
			if( Cufon ) Cufon.refresh()
			}
		}
	}
