The Monte Carlo simulation of the Borexino detector