 By 814 Venice functioned as a fully independent republic.Even so, Venice became a partner of the Empire and trading privileges were granted to it by the Emperors via treaties, such as the Byzantine–Venetian Treaty of 1082.The Fourth Crusade (1202–1204) was initially intended to invade Muslim-controlled areas; instead, the Crusaders attacked the capital of the Byzantine Empire, Constantinople, resulting in the temporary dissolution of the empire and the sack of its capital.