contract BrightCoinTokenPreSaleDetails is BrightCoinTokenOwner, BrightCoinTokenConfig
{

    //address owner;
    using SafeMath for uint;
    uint256 Availabletokenpresale;
    constructor() public
    { 
        Availabletokenpresale = maxCoinSoldDuringPresale*(10**uint256(decimals));
    }

  
    //Current Presale Status 
    bool public PreSaleOn = true;
 
     //Function for changing the startDate of Presale
    function changeStartDate(uint256 _startDateTimeStamp, uint256 _currenttime) public onlyTokenOwner  returns(bool){

    require(ICOstartDate > _currenttime );
    require( _startDateTimeStamp < ICOendDate );
    ICOstartDate = _startDateTimeStamp;
    return true;
  }

    function getMaxCoinSoldDuringPreSale() view internal  returns(uint256)
    {
        return Availabletokenpresale;
        
    }

    /**
   * @dev It changes end date of Presale , provided it is not crossed.
   * @param _endDateTimeStamp The new proposed end datetime for Presale.
   */
    function changeEndDate(uint256 _endDateTimeStamp,uint256 _currenttime) public onlyTokenOwner  returns(bool) 
    {
      require(ICOendDate > _currenttime);
      require( _endDateTimeStamp > ICOstartDate );
      ICOendDate = _endDateTimeStamp;
      return true;
    }
    
    /**
   * @dev It check whether the datetime passed is in presale period or not
   * @param _currenttime The datetime to be checked for presale period.
   */
     function inPreSalePeriod(uint256 _currenttime) public view returns (bool) {
      if (_currenttime >= ICOstartDate && _currenttime <= ICOendDate) 
          return true;
      else 
          return false;     
     }

    /**
   * @dev It will change the presale status or true/false depending upon input
   * @param _presalestatus the staus to be set with presale.
   */
     function changePresaleStatus(bool _presalestatus) public onlyTokenOwner 
     {
       PreSaleOn = _presalestatus;
     }
     
   function updatepresalemaxTokenCount(uint256 _token) internal 
  {
       Availabletokenpresale = Availabletokenpresale.sub(_token);
  }
}
//Section1
//...............................................................................
function changePresaleStatus(bool _presalestatus) public onlyTokenOwner 
{
  PreSaleOn = _presalestatus;
}

/**
 * @dev It will change the presale status or true/false depending upon input
 * @param _presalestatus the staus to be set with presale.
 */