Dalkeith Castle was located to the north east of Dalkeith, and was originally in the hands of the Clan Graham in the 12th century and given to the Clan Douglas in the early 14th century. James Douglas of Dalkeith became the Earl of Morton in the mid 15th century. The castle was strategically located in an easily defensible position above a bend in the River North Esk.
In 1642, Dalkeith Castle was sold by the Douglas family to Francis Scott, 2nd Earl of Buccleuch. The 2nd Earl of Buccleuch's daughter married the Duke of Monmouth, eldest illegitimate son of King Charles II. They became the Duke and Duchess of Monmouth & Buccleuch. After the Duke of Monmouth had been executed for treason, Anne Scott, 1st Duchess of Buccleuch, his widow, who held the Scottish title in her own right, asked architect James Smith to use William of Orange's Palace of Het Loo in the Netherlands as a model for the new Dalkeith Palace.
Smith and his cousins, Gilbert and James, signed the contract for mason work at Dalkeith Castle in March 1702. Construction of Dalkeith Palace began later that year, Smith deciding to incorporate a portion of the tower house of the old castle into the western side of the new structure. The outline of the old tower walls is still visible in the western facade of the palace today.
The 5th Duke of Buccleuch considered extensive rebuilding in 1831 and William Burn produced unexecuted designs in Jacobean style. More minor alterations were carried out, together with improvements to the surrounding estate including a new house and offices for the Duke's Chamberlain, and the construction, for the 5th Duke, of St Mary's Church as a private chapel by William Burn and David Bryce. The church contains one of only two water-powered organs in Scotland.
References:The Temple of Edfu is one of the best preserved ancient shrines in Egypt. It was built in the Ptolemaic Kingdom between 237 and 57 BC.
Edfu was one of several temples built during the Ptolemaic Kingdom, including the Dendera Temple complex, Esna, the Temple of Kom Ombo, and Philae. Its size reflects the relative prosperity of the time. The present temple initially consisted of a pillared hall, two transverse halls, and a barque sanctuary surrounded by chapels. The building was started during the reign of Ptolemy III Euergetes and completed in 57 BC under Ptolemy XII Auletes. It was built on the site of an earlier, smaller temple also dedicated to Horus, although the previous structure was oriented east–west rather than north–south as in the present site.