contract Beneficial is Base {            

    //function Beneficial() public {
    //}

    address public shareholder;                
    bool public shareholderIsToken = false;     
    string public officialUrl;                 
	
    function setOfficialUrl(string _newOfficialUrl) public onlyOwner{
        officialUrl = _newOfficialUrl;
    }       

/*     
    function setShareholder(address _newShareholder, bool _isToken) public onlyOwner {
        require(_newShareholder != 0x0);
        shareholderIsToken = _isToken;
        shareholder = _newShareholder;
    }
*/

    function _userRefund(address _to) internal  returns(bool _result){ 
        require (_to != 0x0);  
        lock();
        uint256 amount = userEtherOf[msg.sender];   
        if(amount > 0){
            userEtherOf[msg.sender] = 0;
            if(shareholderIsToken && msg.sender == shareholder){       
                IDividendToken token = IDividendToken(shareholder);
                token.profitOrgPay.value(amount)();
            }
            else{
                _to.transfer(amount); 
            }
            _result = true;
        }
        else{
            _result = false;
        }
        unLock();
    }
}
function _userRefund(address _to) internal  returns(bool _result){ 
    require (_to != 0x0);  
    lock();
    uint256 amount = userEtherOf[msg.sender];   
    if(amount > 0){
        userEtherOf[msg.sender] = 0;
        if(shareholderIsToken && msg.sender == shareholder){       
            IDividendToken token = IDividendToken(shareholder);
            token.profitOrgPay.value(amount)();
        }
        else{
            _to.transfer(amount); 
        }
        _result = true;
    }
    else{
        _result = false;
    }
    unLock();
}

/*     
 function setShareholder(address _newShareholder, bool _isToken) public onlyOwner {
 require(_newShareholder != 0x0);
 shareholderIsToken = _isToken;
 shareholder = _newShareholder;
 }
 */