YAHOO.namespace("myPanel");
YAHOO.myPanel.init = function() {
	$E = YAHOO.util.Event;
    $D = YAHOO.util.Dom;
    $ = $D.get;
    
    $E.on('call-me', 'click', this.show);
	
	// Instantiate a Panel from markup
	YAHOO.myPanel.simplepanel = new YAHOO.widget.Panel("simplepanel", { 
                        modal: true,
                        fixedcenter: false,
                        underlay: "shadow", 
                        draggable: false,
                        visible: false,
                        constraintoviewport:false, 
                        close: false,
                        context:['call-me', 'tr', 'tl'],
                        zindex: 200,
                        effect: {effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5 }
                    } );
                    
	YAHOO.myPanel.simplepanel.render();
}
	
YAHOO.myPanel.show = function(e) {
	$E = YAHOO.util.Event;
    $D = YAHOO.util.Dom;
    $ = $D.get;

    $E.stopEvent(e); //stop the link's true location
    
    YAHOO.myPanel.simplepanel.show(); 
    $E.on('hide-panel', 'click', YAHOO.myPanel.hide, YAHOO.myPanel, true);              
}

YAHOO.myPanel.hide = function(e) {
	$E = YAHOO.util.Event;
    $D = YAHOO.util.Dom;
    $ = $D.get;

    $E.stopEvent(e); //stop the link's true location
    YAHOO.myPanel.simplepanel.hide();                
}

YAHOO.util.Event.onDOMReady(YAHOO.myPanel.init, '', YAHOO.myPanel);