var Profile =
{
    UDIR : "/People/profile/",
    showSongBox : function (ContenstNum, Obj)
    {
        
        this.setOff();
       
        
        Obj.className = "on";
        
        var F = function ()
        {
            if($('contentPlayer'))   Player.setContentPlayer();
        }
        
        AutoRun.setDocument($('PlayerArea'), { 'CONTEST_NUM' :  ContenstNum, 'onComplete' : F } , this.UDIR+'Player.php');            
        
    },
    
    showPlayListBox : function (PlayListNum, Obj)
    {
        this.setOff();
        var F = function ()
        {
            if($('contentPlayer'))   Player.setContentPlayer();
        }
        
        Obj.className = "on";
        AutoRun.setDocument($('PlayerArea'), { 'ALBUM_NUM' :  PlayListNum, 'onComplete' : F } , this.UDIR+'Playlist.php');  
        
    },
    
    setOff : function()
    {
        $('ShareContent').innerHTML = '';
        
        
        var OnObj = $$('.on');
        var F = function (obj)
        {
            obj.className = 'off';    
        }
        
        
        OnObj.each(F, this);
        
        
    },
    
    showGBList:function ()
    {
        if(!document.GB_FORM) return;
        
        var Param = 
        {
            'USER_NUM': document.GB_FORM.USER_NUM.value,
            onComplete : User.setNickBar
        }
        
        
        AutoRun.setDocument($('GB_List'), Param,  '/People/profile/GB_List.php')
        
    },
    
    submitGuestBook : function (F)
    {
        var  F = document.GB_FORM;
       
        if(!form.checkValue(F.GB_CONTENT,      1, "Please input Guest book contents.")) return false;
        
        
        $(F).send({
            
            onComplete : function (Msg)
            {
                if(Msg == 'OK')
                {
                    this.showGBList();
                    F.GB_CONTENT.value = '';
                    
                }
                else
                {
                    alert(Msg);
                }
            
            }.bind(this)
            
            
         });
        
        
        return false;
    },
    
    deleteGuestBook : function (GB_NUM)
    {
       
        if(confirm('do you want to remove this content?'))
        {
            var Result = Ajax.exec('/People/profile/GB_delete.php', { 'GB_NUM' : GB_NUM } );
            
            if(Result.text == 'OK') 
            {
                this.showGBList();
                
            } 
            else 
            {
                alert(Result.text);
            }
        }
        
        return;
    }
    
}


addEvent(window, 'load', Profile.showGBList);

