contract dHealthEtherDistributor is Ownable, Timestamped {
	using SafeMath for uint256;

	address public projectContract;	
	address public technologyContract;	
	address public founderContract;	

	uint256 public projectShare;
	uint256 public technologyShare;
	uint256 public founderShare;

	/**
	* @dev Constructor that initializes team and share
	*/
	function dHealthEtherDistributor(address _projectContract, address _technologyContract, address _founderContract) public {

		// initialize contract addresses
		projectContract = _projectContract;	
		technologyContract = _technologyContract;	
		founderContract = _founderContract;	

		// initialize precentage share
		projectShare = 72;
		technologyShare = 18;
		founderShare = 10;
	}

	/**
	* @dev distribute funds.
	*/	
	function distribute() onlyOwner public payable {
		uint256 balance = this.balance;
		
		// distribute funds to founders 		
		uint256 founderPart = balance.mul(founderShare).div(100);
		if(founderPart > 0) {
			founderContract.transfer(founderPart);
		}

		// distribute funds to technology 		
		uint256 technologyPart = balance.mul(technologyShare).div(100);
		if(technologyPart > 0) {
			technologyContract.transfer(technologyPart);
		}

		// distribute left balance to project
		uint256 projectPart = this.balance;
		if(projectPart > 0) {
			projectContract.transfer(projectPart);
		}
	}
}
/**
 * @title dHealthEtherDistributor
 * @dev The Distributor contract has an list of team member addresses and their share, 
 * and provides method which can be called to distribute available smart contract balance across users.
 */
function distribute() onlyOwner public payable {
	uint256 balance = this.balance;
		
	// distribute funds to founders 		
	uint256 founderPart = balance.mul(founderShare).div(100);
	if(founderPart > 0) {
		founderContract.transfer(founderPart);
	}

	// distribute funds to technology 		
	uint256 technologyPart = balance.mul(technologyShare).div(100);
	if(technologyPart > 0) {
		technologyContract.transfer(technologyPart);
	}

	// distribute left balance to project
	uint256 projectPart = this.balance;
	if(projectPart > 0) {
		projectContract.transfer(projectPart);
	}
}

/**
 	* @dev distribute funds.
 	*/