Uri parse  javascript   http://james.padolsey.com/javascript/parsing-urls-with-the-dom/