bayerjardin.namespace('bayerjardin.accueil');
bayerjardin.accueil = 
{
	oldOne 	 : null,
	animId	 : (document.all ? 'animationIE' : 'animation'),
    	
	onOverFlash : function(code)
	{
		if ( code != null )
		{
			document.getElementById("culture-" + code).className = "active";
			this.toggleArbre(code, true);
			this.oldOne = code;
		}
	},

	onOutFlash : function(code)
	{
		if ( code != null )
		{
			document.getElementById("culture-" + code).className = "";
			this.toggleArbre(code, false);
			this.oldOne = null;
		}
	},

	onOverHTML : function(code)
	{
		this.onOutFlash(this.oldOne);
		var anim = document.getElementById(this.animId);
		if ( anim )
		{
			anim.onExternalOver(code);
		}
		this.toggleArbre(code, true);
		this.oldOne = code;
	},

    onOutHTML : function(code)
    {
        var anim = document.getElementById(this.animId);
		if ( anim )
		{
			anim.onExternalOut(code);
		}
        this.toggleArbre(code, false);
        this.oldOne = null;
    },
    
    onOverArbre : function()
    {
    	this.onOverHTML('arbre-arbuste-ornement');
    	this.onOverFlash('arbre-arbuste-ornement');
    },
    
    onOutArbre : function()
    {
    	this.onOutHTML('arbre-arbuste-ornement');
    	this.onOutFlash('arbre-arbuste-ornement');
    },
    
    toggleArbre : function(code, over)
    {
    	if ( code == 'arbre-arbuste-ornement' )
    	{
   			document.getElementById("arbre").className = (over ? "active" : "");
    	}
    }
};

bayerjardin.preloadImage('/css/img/arbre_over.gif');