contract Pausable is Ownable {
	event Pause();
	event Unpause();
	event PauseRefund();
	event UnpauseRefund();

	bool public paused = true;
	bool public refundPaused = true;
	// Deadline set to December 29th, 2017 at 11:59pm PST
	uint256 public durationInMinutes = 60*24*29+60*3+10;
	uint256 public dayAfterInMinutes = 60*24*30+60*3+10;
	uint256 public deadline = now + durationInMinutes * 1 minutes;
	uint256 public dayAfterDeadline = now + dayAfterInMinutes * 1 minutes;

	/**
	* @dev modifier to allow actions only when the contract IS NOT paused
	**/
	modifier whenNotPaused() {
		require(!paused);
		_;
	}

	/**
	* @dev modifier to allow actions only when the refund IS NOT paused
	**/
	modifier whenRefundNotPaused() {
		require(!refundPaused);
		_;
	}

	/**
	* @dev modifier to allow actions only when the contract IS paused
	**/
	modifier whenPaused {
		require(paused);
		_;
	}

	/**
	* @dev modifier to allow actions only when the refund IS paused
	**/
	modifier whenRefundPaused {
		require(refundPaused);
		_;
	}

	/**
	* @dev modifier to allow actions only when the crowdsale has ended
	**/
	modifier whenCrowdsaleEnded {
		require(deadline < now);
		_;
	}

	/**
	* @dev modifier to allow actions only when the crowdsale has not ended
	**/
	modifier whenCrowdsaleNotEnded {
		require(deadline >= now);
		_;
	}

	/**
	* @dev called by the owner to pause, triggers stopped state
	**/
	function pause() onlyOwner whenNotPaused returns (bool) {
		paused = true;
		Pause();
		return true;
	}

	/**
	* @dev called by the owner to pause, triggers stopped state
	**/
	function pauseRefund() onlyOwner whenRefundNotPaused returns (bool) {
		refundPaused = true;
		PauseRefund();
		return true;
	}

	/**
	* @dev called by the owner to unpause, returns to normal state
	**/
	function unpause() onlyOwner whenPaused returns (bool) {
		paused = false;
		Unpause();
		return true;
	}

	/**
	* @dev called by the owner to unpause, returns to normal state
	**/
	function unpauseRefund() onlyOwner whenRefundPaused returns (bool) {
		refundPaused = false;
		UnpauseRefund();
		return true;
	}
}
/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 **/
function unpauseRefund() onlyOwner whenRefundPaused returns (bool) {
	refundPaused = false;
	UnpauseRefund();
	return true;
}

/**
 	* @dev called by the owner to unpause, returns to normal state
 	**/