(function() {
    var attributes = {
        height: { to: 90 }
    };
    var anim = new YAHOO.util.Anim('demo1', attributes);

    YAHOO.util.Event.on('demo1', 'mouseover', function() {
		anim.duration = 0.25;
        anim.animate();
    });

    
})();

(function() {
    var attributes = {
        height: { to: 65 }
    };
    var anim1 = new YAHOO.util.Anim('demo1', attributes);

    YAHOO.util.Event.on('demo1', 'mouseout', function() {
		anim1.duration = 0.25;
        anim1.animate();
    });

    
})();




(function() {
    var attributes = {
        height: { to: 90 }
    };
    var anim = new YAHOO.util.Anim('demo2', attributes);

    YAHOO.util.Event.on('demo2', 'mouseover', function() {
		anim.duration = 0.25;
        anim.animate();
    });

    
})();

(function() {
    var attributes = {
        height: { to: 65 }
    };
    var anim1 = new YAHOO.util.Anim('demo2', attributes);

    YAHOO.util.Event.on('demo2', 'mouseout', function() {
		anim1.duration = 0.25;
        anim1.animate();
    });

    
})();

YAHOO.namespace("example.container");

function init() {
	// Build overlay1 based on markup
	YAHOO.example.container.overlay1 = new YAHOO.widget.Overlay("overlay1", { 
																			  visible:true,
																			  width:"500px",
																			  zIndex:1000,
																			  constraintoviewport:false,
																			  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} } );
	YAHOO.example.container.overlay1.render("example");

	// Build overlay2 based on markup
	YAHOO.example.container.overlay2 = new YAHOO.widget.Overlay("overlay2", { 
																			  visible:false,
																			  width:"500px",
																			  zIndex:1000,
																			  constraintoviewport:true,
																			  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} } );
	YAHOO.example.container.overlay2.render("example");

	

	YAHOO.util.Event.addListener("show1", "click", YAHOO.example.container.overlay1.show, YAHOO.example.container.overlay1, true);
	YAHOO.util.Event.addListener("hide1", "click", YAHOO.example.container.overlay1.hide, YAHOO.example.container.overlay1, true);

	YAHOO.util.Event.addListener("show1", "click", YAHOO.example.container.overlay2.hide, YAHOO.example.container.overlay2, true);
	YAHOO.util.Event.addListener("hide1", "click", YAHOO.example.container.overlay2.show, YAHOO.example.container.overlay2, true);

	

}

YAHOO.util.Event.onDOMReady(init);
