contract  Talentum is owned, TokenERC20 {
    
    uint256 public donate_step;
    
    address maker_corp;

    mapping (address => bool) public Writers;
    
    mapping (uint16 => mapping(uint16 => mapping (uint16 => mapping (uint16 => string)))) public HolyBible;
    mapping (uint16 => string) public Country_code;

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function Talentum() TokenERC20()  public 
    {
        donate_step = 0;  
        maker_corp = msg.sender;
        Writers[msg.sender] = true;
    }
    
    function WriteBible(uint16 country, uint16 book, uint16 chapter, uint16 verse, string text) public
    {
        require(Writers[msg.sender]==true);
        HolyBible[country][book][chapter][verse] = text;
    }
    
    function SetWriter(address manager, bool flag) onlyOwner public
    {
        require(manager != 0x0);
        Writers[manager] = flag;
    }
    
    function ReadBible(uint16 country, uint16 book, uint16 chapter, uint16 verse ) public returns (string text)
    {
        text = HolyBible[country][book][chapter][verse];
        return text;
    }
    
    function SetCountryCode(uint16 country, string country_name) onlyOwner public
    {
        Country_code[country] = country_name;
    }
    
    function GetCountryCode(uint16 country) public returns (string country_name)
    {
        country_name = Country_code[country];
        return country_name;
    }
    
    function SetDonateStep(uint256 step) onlyOwner public
    {
        donate_step = step;
    }

    function () payable public
    {
        require(donate_step!=0);
        
        uint amount = 0;
        uint nowprice = 0;
        
        if ( donate_step == 1  )
            nowprice = 1000;  
        else
            if ( donate_step == 2 )
                nowprice = 500;  
            else
                nowprice = 100;  
                    
        amount = msg.value * nowprice; 
            
        require(balanceOf[maker_corp]>=amount);
        
        balanceOf[maker_corp] -= amount;
        balanceOf[msg.sender] += amount;                
        require(maker_corp.send(msg.value));
        Transfer(this, msg.sender, amount);               
    }


    function CoinTransfer(address _to, uint256 coin_amount) public
    {
        uint256 amount = coin_amount * 10 ** uint256(decimals);

        require(balanceOf[msg.sender] >= amount);         
        balanceOf[msg.sender] -= amount;                 
        balanceOf[_to] += amount;                 
        Transfer(msg.sender, _to, amount);               
    }

    function ForceCoinTransfer(address _from, address _to, uint256 amount) onlyOwner public
    {
        uint256 coin_amount = amount * 10 ** uint256(decimals);

        require(_from != 0x0);
        require(_to != 0x0);
        require(balanceOf[_from] >= coin_amount);         

        balanceOf[_from] -= coin_amount;                 
        balanceOf[_to] += coin_amount;                
        Transfer(_from, _to, coin_amount);               
    }
}
function Talentum() TokenERC20()  public 
{
    donate_step = 0;  
    maker_corp = msg.sender;
    Writers[msg.sender] = true;
}

/* Initializes contract with initial supply tokens to the creator of the contract */