/**
 * @author Derek Carlin
 * Controls interactions with the side-menu service and handling user login status changes.
 */
function SideMenuControl(loginControl) {
    this.loginControl = loginControl;
    loginControl.UserLoginEvent.subscribe(this.onLoginEvent, this);
}

SideMenuControl.prototype.renderSideMenu = function(results){
    var div = document.getElementById('sideMenu');
	if (div) {
		div.innerHTML = results;
	}
	else alert("not finding side menu!");
}

SideMenuControl.prototype.onLoginEvent = function(type, loginInfo, me){
    SideMenuService.renderSideMenu(function(results) {  me.renderSideMenu(results); });
}



var theSideMenu = null;

YAHOO.util.Event.onDOMReady(function(){
    theSideMenu = new SideMenuControl(theLoginControl);
});

// As with addListener, onAvailable, and onContentReady, you can pass a data object and adjust the scope
// YAHOO.util.Event.onDOMReady(init, data, scope);



