function update_content() {
    var wndo = dw_scrollObj.col['wn'];
    wndo.updateDims(); // Recalculate dimensions based on changes 
    var x = wndo.getX();
    var y = wndo.getY();
    
    // Update size of scrollbar to match changes in scroll area 
    if ( wndo.vBarId ) { // do set up similarly for hBarId
        var barObj = dw_Slidebar.col[wndo.vBarId];
        dw_Scrollbar_Co.setBarSize(wndo, barObj);
        dw_Scrollbar_Co.updateScrollbar(wndo, x, y);
    }
    dw_scrollObj.scrollToId('wn', 'debut', 'lyr1', 1);
}

function init_dw_Scroll() {
    var wndo = new dw_scrollObj('wn', 'lyr1');
    wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
    wndo.setUpScrollControls('scrollbar');
    wndo.setUpScrollControls('extra_controls');
	
}
// if code supported, link in the style sheet and call the init function onload
if ( dw_scrollObj.isSupported() ) {
    dw_writeStyleSheet('fileadmin/maquette3/scrollbar_demo.css')
    dw_Event.add( window, 'load', init_dw_Scroll);
}


// on click over the area of the item, toggle the element...
YAHOO.Bubbling.on('navigate', function (layer, args) {
var el;
	   // if nobody has used the event, and
	   // the target of the event is inside an accordion item (YUI-CMS-ITEM)
if (!args[1].decrepitate && (el = YAHOO.Bubbling.getOwnerByClassName (args[1].target, 'yui-cms-item'))) {
	     // toggle the accordion item...
		 YAHOO.widget.AccordionManager.toggle(el);
}
});
	
(function() {
    // using the dispatcher to load the dynamic content
    function dynamic_navigation ( url ) {

    	YAHOO.plugin.Dispatcher.fetch ( 'lyr1', url );
    };
    // default behavior: this method will be executed every time you click on the page...
    var dynamicNav = function (layer, args) {
      var e = args[0],fin=0,
    	  el = args[1].anchor, reg=new RegExp("[/.]+", "g"),reg2=new RegExp("[#]+", "g");
      if (!args[1].decrepitate && el) {
    	  var h = el.getAttribute("href",2),
    	  
    	  	  r = el.getAttribute("rel"),
    	  	  t = el.getAttribute("dest"),
    		  l = new String(document.location);
    		  
      	  // checking if the href is not the current page or a jump anchor or a javascript function
      	  // checking if the rel or target attribute are defined...
      	  
		if (h.indexOf("javascript:",0)==0 ) return;
		if (h.indexOf("mailto:",0)==0 ) return;
		if ( (t.indexOf("centre",0)==0)||(t.indexOf("menu",0)==0) )
		{
			var tablea=h.split(reg);
    			//alert(tablea[0]+'/aj.html'+':'+t);		
        		dynamic_navigation (tablea[0]+'/aj.html');
              		args[1].decrepitate = true;
              		args[1].stop = true;
              		return;        				
		} 
		var tableau=h.split(reg2);      
		if (tableau.length == 2)
		{
			dw_scrollObj.scrollToId('wn', tableau[1], 'lyr1', 1);
              		args[1].decrepitate = true;
              		args[1].stop = true;				
		}
              	
      }
    };
    // initialization: subscribing the lowlevel behavior
    YAHOO.Bubbling.on('god', dynamicNav);
})();
