If you're using custom JavaScripts with SharePoint some global JavaScript variables may come in handy. These variables work if you're using SharePoint's default or any other custom master page. L_Menu_BaseUrl - the base URL of the site / subsite
Read More...
Read the complete post at http://feeds.feedburner.com/~r/WebBorg/~3/344321152/couple-of-useful-javascript-global.html