How can I get a document path without the documents name? For example:

```
window.document.location 

```

gives me: `http://host.com/lorem/ipsum/document.php`  

and I need to get only: `http://host.com/lorem/ipsum/`.

Will be greatful for help.