Lina, please use the CODE tag when displaying code in your posts...
// like this
window.location = "URL HERE";
This just sends the user to a new URL in the same window they are currently looking at.
window.open("URL HERE", "_blank", "width=300,height=200");
This opens a new window/tab with the specified URL. You can change the width and height if desired (in pixels).
Whether a new tab or window opens depends on the browser. I think IE opens new windows, Firefox opens tabs etc....there's no way to specify which one you want (I'm 90% sure).
To only display it once a day for each visitor is more complicated and involves using cookies to check the last time they visited the site. See
Google.