function leftElement() {
    this.init = function(nb)
    {
        this.nb = nb;
        this.id = 'leftel' + nb;
        this.sid = 'subel' + nb;
        this.r = false;
        this.home = false;
        this.children = new Array();
        return this;
    },
    this.clear = function()
    {
        $(this.id).className = 'menuLvl'+this.lvl;
    },
    this.select = function()
    {
	$(this.id).className = 'menuLvl'+this.lvl+'Sel'+(this.children.length?'Sub':'');
        lefty.sel[this.lvl] = this;
    },
    this.getUrl = function()
    {
        if (this.lvl > 0 || this.home)
        {
            var t = this.home ? 'centerHome': 'centerColumn';
            $('centerColumn').style.display = 'none';
            $('ajaxload').style.display = 'block';
            if (this.p == undefined) this.p = '';
            if (webo_ok == 1 && this.tz != undefined && this.tp != undefined)
            {
                if (this.tz > 0)
                {
                    if (this.tp > 0)
                    {
                        if (webo_leech == 1)
                        {
                            webo_zpi(this.tz, this.tp, this.ti, this.tt);
                        }
                    }
                }
            }
            if (webo_leech == 0)
            {
                var url = '/delia-CMS/template7/includes_new/' + t + '/showroom_id-' + showroom_id + '/site_id-' + site_id + '/topic_id-' + this.nb + '/';
                var imgUrl = this.p;
            }
            else
            {
                var url = 'delia-CMS_template7_includes_new_' + t + '_showroom_id-' + showroom_id + '_site_id-' + site_id + '_topic_id-' + this.nb + '.html';
                var imgUrl = this.p.replace(/\//g, '_');
                imgUrl = './images/' + imgUrl.substr(1, imgUrl.length - 1);
            }
            var img = new Image();
            if (this.p != '') img.src = imgUrl;
            var request = new Ajax.Request(url, {
                method: 'get',
                onSuccess: function(t, u) {
                    if (img.src == '' || img.complete || u) {
                        $('ajaxload').style.display = 'none';
                        var content = t.responseText;
                        content = content.replace(/\r\n/g, "");
                        content = content.replace(/\n/g, "");
                        var pattern = "id[\\s]*=[\\s]*\"" + 'centerColumn' + "\"[^>]*>(.*)<\/[\\w]+>[\\s]*$";
                        var regex = new RegExp(pattern, "i");
                        var m = regex.exec(content);
                        if (m)
                        {
                            $('centerColumn').innerHTML = m[1];
			    if(ie6mode)
			    {
				$('centerColumn').show();
				if(window.pngfix)pngfix();
			    }
			    else Effect.Appear('centerColumn');
                        }
                    } else
                    {
                        img.onload = img.onerror = function() {
                            request.options.onSuccess(t, true)
                        };
                    }
                }
            });
        }
    }
}
var lefty = {
    assarr: new Array(),
    assancharr: new Array(),
    children: new Array(),
    toreduce: new Array(),
    sel: new Array(3),
    lastDetail: 0,
    moving:0,
    init: function() {
        lefty.parse(arr, 0, lefty);
    },
    parse: function(a, lvl, p) {
        for (var l in a)
        {
            var o = new leftElement();
            p.children.push(o.init(l));
            if (lvl > 0) o.parent = p;
	    else o.r = true;
            lefty.assarr[l] = o;
            o.lvl = lvl;
            o.p = a[l].p;
            o.direct = a[l].direct;
            o.tz = a[l].tz;
            o.tp = a[l].tp;
            o.tt = a[l].tt;
            o.ti = a[l].ti;
            if (a[l].a != '') lefty.assancharr[a[l].a] = l;
            Event.observe(o.id, 'click', lefty.click);
            if (a[l].dl == 0)
            {
                lefty.sel[0] = o;
                o.home = true;
            }
            else
            lefty.parse(a[l].d, lvl + 1, o);
        }
    },
    click: function(e)
    {
        if (typeof(e) == 'object')
        {
            var o = lefty.assarr[lefty.getIdd(Event.element(e)).match(/leftel(\d+)/)[1]];
        }
        else var o = lefty.assarr[e];
        if (o.direct != undefined && o.direct != '')
        {
            if (webo_leech == 0)
            var pdfUrl = o.direct;
            else
            {
                var pdfUrl = o.direct.match(/-(.+\.pdf)/);
                if (pdfUrl != null)
                pdfUrl = './pdf/' + pdfUrl[1];
                else pdfUrl = '';
            }
            if (pdfUrl != '') window.open(pdfUrl);
        }
        else if(lefty.moving == 0)
        {
            o.getUrl();
            lefty.clear();
            var sup = 0;
            var ex = 0;
	    var subcall = false;
            switch (o.lvl)
            {
            case 2:
                o.select();
                o = o.parent;
		subcall = true;
            case 1:
                o.select();
                if (o.children.length > 0 && !o.r)
                {
                    $(o.sid).style.height = '1px';
                    $(o.sid).style.display = 'block';
                    sup = o.children.length * 1800+1800;
		    lefty.moving++;
                    new Effect.Scale(o.sid, sup, {
                        scaleX: false,
                        scaleContent: false,
			afterFinish: function(o){lefty.moving--;}
                    });
                    o.r = true;
                    lefty.toreduce.push(o);
                }
                ex = o.nb;
                o = o.parent;
		subcall = true;
            case 0:
                o.select();
                lefty.reduce(ex);
                /*var bottomMenu = $('bottomMenu');
                if (bottomMenu !== null)
                {
                    if (o.home) bottomMenu.style.display = 'none';
                    else bottomMenu.style.display = 'block';
                }*/
                for (var i = 0; i < lefty.children.length; i++)
                {
		    if (lefty.children[i] == o && !o.home && lefty.children[i].r)
                    {
			    //ouverture
			    //if(!lefty.children[i].home)$( lefty.children[i].id).style.borderWidth = "1px 0";
			    pc = lefty.children[i].children.length * 1800 + 1800 + sup;
                            $(lefty.children[i].sid).style.display = 'block';
                            $(lefty.children[i].sid).style.height = '1px';
			    lefty.moving++;
                            new Effect.Scale(lefty.children[i].sid, pc, {
                                scaleX: false,
                                scaleContent: false,
                                afterFinish: function(o) {
                                    o.element.style.height = ''
				    lefty.moving--;
                                }
                            });
                            lefty.children[i].r = false;
                    }
                    else if(!subcall)
                    {
                        //fermeture
			if(!o.home)lefty.children[i].clear();
			if (!lefty.children[i].r && !lefty.children[i].home)
                        {
                           //$(lefty.children[i].id).className = 'menuLvl0Sel';
			   //$( lefty.children[i].id).style.borderWidth = "1px 0 0 0";
			    lefty.children[i].h = $(lefty.children[i].sid).offsetHeight;
			    lefty.moving++;
                            new Effect.Scale(lefty.children[i].sid, 2, {
                                scaleX: false,
                                scaleContent: false,
                                afterFinish: function(o) {
                                    o.element.style.height = '1px';
                                    o.element.style.display = 'none'
				    lefty.moving--;
                                }
                            });
                            lefty.children[i].r = true;
                        }
                    }
                }
            }
        }
    },
    clear: function()
    {
        for (var i = 0; i < 4; i++)
        {
            if (lefty.sel[i] != null)
            {
                lefty.sel[i].clear();
                lefty.sel[i] = null;
            }
        }
    },
    reduce: function(v) {
        var t = lefty.toreduce;
        lefty.toreduce = new Array();
        for (var i = 0; i < t.length; i++)
        {
            if (t[i].nb != v)
            {
                new Effect.Scale(t[i].sid, 1, {
                    scaleX: false,
                    scaleContent: false,
                    afterFinish: function(o) {
                        o.element.style.display = 'none'
                    }
                });
                t[i].r = false;
            }
            else lefty.toreduce.push(t[i]);
        }
    },
    getIdd: function(el)
    {
        do {
            if (el.getAttribute('id') != undefined && el.getAttribute('id') != '')
            return el.getAttribute('id');
        }
        while (el = el.parentNode);
    },
    psShowDetails: function(id)
    {
        var details = $('psDetails' + id),
        content = $('psDetailsContent' + id);
        if (content !== null)
        {
            details.show();
            if (content.offsetHeight) content.style.height = '210px';
            details.hide();
        }
        $('centerColumnFilter').style.display = 'block';
        new Effect.Opacity('centerColumnFilter', {
            duration: 0.5,
            from: 0.0,
            to: 0.4,
            afterFinish: function() {
                $('psDetails' + id).style.display = 'block';
                $('psDetails' + id).style.visibility = 'visible';
            }
        });
        lefty.lastDetail = id;
    },
    psHideDetails: function()
    {
        $('psDetails' + lefty.lastDetail).style.display = 'none';
        new Effect.Opacity('centerColumnFilter', {
            duration: 0.5,
            from: 0.4,
            to: 0.0,
            afterFinish: function(o) {
                o.element.style.display = 'none';
                o.element.style.filter = 'alpha(opacity=0)';
            }
        });
    },
    crossLink: function(anch)
    {
        lefty.click(lefty.assancharr[anch]);
    }
}
/*function laover(o) {
    if (o.className != 'leftPanelTopicTitleOn')
    o.style.backgroundImage = onUrl('menuBgH.gif')
}
function laout(o) {
    if (o.className != 'leftPanelTopicTitleOn')
    o.style.backgroundImage = onUrl('menuBg.gif');
}
function lbover(o) {
    if (o.className != 'selected')
    {
        o.style.backgroundImage = onUrl('menuElementBgH.gif');
        o.firstChild.style.color = 'white';
        o.firstChild.style.backgroundImage = onUrl('dotte_arrow_orange_up.gif');
    }
}
function lbout(o) {
    if (o.className != 'selected')
    {
        o.style.backgroundImage = onUrl('menuElementBg.gif');
        o.firstChild.style.color = '#162B40';
        o.firstChild.style.backgroundImage = onUrl('dotte_arrow_blue.gif');
    }
}
function lcover(o) {
    if (o.className != 'selected')
    {
        o.style.backgroundImage = onUrl('menuSubElementBgH.gif');
        o.firstChild.style.color = 'white';
        o.firstChild.style.backgroundImage = onUrl('dotte_arrow_orange_up.gif');
    }
function lcout(o) {
    if (o.className != 'selected')
    {
        o.style.backgroundImage = onUrl('menuSubElementBg.gif');
        o.firstChild.style.color = '#162B40';
        o.firstChild.style.backgroundImage = onUrl('dotte_arrow_blue.gif');
    }
}
function onUrl(img)
 {
    if (webo_leech == 0)
    return 'url(/argosSites/peugeot/images/pages_services_1024/' + img + ')';
    else
    return 'url(./images/argosSites_peugeot_images_pages_services_1024_' + img + ')';
}*/
function menuOver(o)
{
	o.style.backgroundColor = "#eeeeee";
}
function menuOut(o)
{
	o.style.backgroundColor = "";
}
function showHomeOverlay()
{
	$("centerHomeOverlay").show();
	$("centerHomeFilter").show();
}
function hideHomeOverlay()
{
	$("centerHomeOverlay").hide();
	$("centerHomeFilter").hide();
}