YAHOO.namespace("room");
YAHOO.room.init = function() {
	$E = YAHOO.util.Event;
    $D = YAHOO.util.Dom;
    $ = $D.get;
	
	// Instantiate a Panel from markup
	YAHOO.room.savePanel = new YAHOO.widget.Panel("savePanel", { 
                        modal: true,
                        fixedcenter: false,
                        underlay: "shadow", 
                        draggable: false,
                        visible: false,
                        constraintoviewport: false, 
                        y:0,
                        context:['sub-panel', 'br', 'tr'],
                        close: false, 
                        zindex: 200,
                        width:'400px',
                        effect: {effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5 }
                    } );
                    
	YAHOO.room.savePanel.render();
	$E.on('save-me-panel', 'click', YAHOO.room.show);
}
	
YAHOO.room.show = function(e) {
	$E = YAHOO.util.Event;
    $D = YAHOO.util.Dom;
    $ = $D.get;

    $E.stopEvent(e); //stop the link's true location
	$E.on('cancel', 'click', YAHOO.room.hide, YAHOO.room, true);
    
    YAHOO.room.savePanel.show();  
    $('room_name').focus();              
}

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

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

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