added site-direction for use in html tag and some code prettifying

I added the template variable site-direction for better support in RTL based themes
On the way I changed the variable brow to browser and added spaces for better code view