For Internet Explorer we use the technique explained on this page: How Internet Explorer lt 7 does it.
Other browsers use the technique from this page: How good browsers do it.