    var visibleDiv = $("div1");
            function toggle(newSrc){
                if($("div1").fx){$("div1").fx.stop();}
                if($("div2").fx){$("div2").fx.stop();}
                if(visibleDiv == $("div1")){
                    $("image2").src = newSrc;
                    $("div1").fx = new Fx.Style($("div1"), 'opacity', {duration: 500}).start(0);
                    $("div2").fx = new Fx.Style($("div2"), 'opacity', {duration: 500}).start(1);
                    visibleDiv = $("div2");
                }else{
                    $("image1").src = newSrc;
                    $("div1").fx = new Fx.Style($("div1"), 'opacity', {duration: 500}).start(1);
                    $("div2").fx = new Fx.Style($("div2"), 'opacity', {duration: 500}).start(0);
                    visibleDiv = $("div1");
                }
            }

            function loadImages(buttonsAndImages){
                for(biPairKey in buttonsAndImages) {
                    var image = new Element('img',{ src:buttonsAndImages[biPairKey], style:'margin:3px;' });
                    $(biPairKey).image = image;
                }
            }

            function faderInit(){
                //create an object to store the relationship of the buttons to the images.
                var buttonsAndImages = {'button1':'images/front-rollover1.jpg','button2':'images/front-rollover2.jpg','button3':'images/front-rollover3.jpg'};
                loadImages(buttonsAndImages);
            }
            window.addEvent("domready", faderInit);
			
window.addEvent('domready', function() {
$('wrapDiv').addEvent('mouseleave', function() {
      toggle('images/front-intro.jpg');
 });
});
