
function open_close1(lif_id) {
lif = document.getElementById(lif_id);

if(lif.childNodes.length<'4') {
var ul = document.createElement('ul');
ul.className = 'menu2';

requete_ajax = function()
    {
        if ( ! xmlobj.readystate_ready_and_ok() )
        {
            return;
        }
        
    var menu_xml = xmlobj.xmlhandler.responseXML;

	var lis_xml = menu_xml.getElementsByTagName('li');
	var y;
	for(y = 0; y<lis_xml.length;y++) {
		var li_xml = lis_xml[y];

var li = document.createElement('li');
li.id = li_xml.getAttribute('id');
li.className = li_xml.getAttribute('class');

if(li_xml.getAttribute('oc')=='1') {
var li_oc = document.createElement('a');
li_oc.onclick = function () {
	open_close2(this.parentNode.id);
};
li_oc.className = 'open_close';
var li_oc_contenu = document.createTextNode('');
li_oc_contenu.data = '';
li_oc.appendChild(li_oc_contenu);
li.appendChild(li_oc);
}

var li_a = document.createElement('a');
li_a.href = li_xml.getAttribute('url');
var li_a_contenu = document.createTextNode('');
li_a_contenu.data = li_xml.firstChild.data;
li_a.appendChild(li_a_contenu);
li.appendChild(li_a);

ul.appendChild(li);
	}
lif.appendChild(ul);

var div = document.createElement('div');
div.className = 'bas2';
lif.appendChild(div);
  	};

  
  xmlobj = new ajax_request();
    xmlobj.onreadystatechange( requete_ajax );
  xmlobj.nocache = false;
  xmlobj.process( ipb_var_base_url + 'act=xmlout&do=menu_xml&id=' + lif_id + '&niveau=1&rev=3' );

}

if(lif.className=='') lif.className='open2';
else lif.className='';

}



function open_close2(lif_id) {
lif = document.getElementById(lif_id);

if(lif.childNodes.length<'4') {
var ul = document.createElement('ul');
ul.className = 'menu3';

requete_ajax = function()
    {
        if ( ! xmlobj.readystate_ready_and_ok() )
        {
            return;
        }
        
    var menu_xml = xmlobj.xmlhandler.responseXML;

	var lis_xml = menu_xml.getElementsByTagName('li');
	var y;
	for(y = 0; y<lis_xml.length;y++) {
		var li_xml = lis_xml[y];

var li = document.createElement('li');
li.id = li_xml.getAttribute('id');
li.className = li_xml.getAttribute('class');


var li_a = document.createElement('a');
li_a.href = li_xml.getAttribute('url');
var li_a_contenu = document.createTextNode('');
li_a_contenu.data = li_xml.firstChild.data;
li_a.appendChild(li_a_contenu);
li.appendChild(li_a);

ul.appendChild(li);
	}
lif.appendChild(ul);

var div = document.createElement('div');
div.className = 'bas3';
lif.appendChild(div);
  	};

  
  xmlobj = new ajax_request();
    xmlobj.onreadystatechange( requete_ajax );
  xmlobj.nocache = false;
  xmlobj.process( ipb_var_base_url + 'act=xmlout&do=menu_xml&id=' + lif_id + '&niveau=2&rev=1' );

}

if(lif.className=='') lif.className='open3';
else if(lif.className=='first') lif.className='first fopen3';
else if(lif.className=='first fopen3') lif.className='first';
else lif.className='';

}

window.onresize = function () {
window.larg_back = window.larg;
if (document.body)
{
window.larg = (document.body.clientWidth) - 16;
}
else
{
window.larg = (window.innerWidth) - 16;
}
if(navigator.appName == 'Microsoft Internet Explorer')
{
Drag.init(aThumb, null, 760, window.larg, 160, 160);
}
else {
Drag.init(aThumb, null, 760, window.larg, 160, 160);
largpx = Math.round(document.getElementById("conteneur2").offsetWidth * window.larg / window.larg_back);
if(largpx < 750) largpx=760;
if(largpx > window.larg) largpx=window.larg;
aThumb.style.left=largpx  +'px';
conteneur2.style.width=largpx +'px'; }

aThumb.style.top='160px';

aThumb.onDrag = function(x, y) {
conteneur2.style.width=x +'px';
aThumb.style.left=x +'px';
}

aThumb.onDragEnd = function(x,y) {
xmlobj = new ajax_request();    
xmlobj.process( ipb_var_base_url + 'automodule=slider&largeur='+ Math.round(x * 100/ larg ));
}
}

var pagination_bloc_id;

function pagination_accueil(bloc_id,url) {
pagination_bloc_id=bloc_id;
xmlobj = new ajax_request();
xmlobj.onreadystatechange( function() {
if ( ! xmlobj.readystate_ready_and_ok() )
	return;
document.getElementById(pagination_bloc_id).innerHTML=xmlobj.xmlhandler.responseText;
});
xmlobj.process( ipb_var_base_url + url);
return false;
}
