When the page refreshes it goes back to the original state. You'll have to set somewhere something that the browser maintains even on a refresh, for example a querystring, or a hash by changing the location like Kolink's suggestion. Than you can get the value to check if the div should be hidden or not. I'm not sure if hidden input maintains the value when the page refreshes, but that might be also a solution.
In summary, you can try setting a value in a query string, hash or hidden input on your click event and on load of the page you check this value and hide/show your div acordingly.
example:
function toggleInteractlogin(x)
{
if(x=='register')
{
location.href = "#register";
$('#login').hide();
$('#register').show();
}
else
{
location.href = "#login";
$('#register').hide();
$('#login').show();
}
}
and add this on your document on load event or put it somewhere outside of any function so that it is executed when the page loads.
toggleInteractlogin(location.hash.substring(location.hash.indexOf('#')+1));
I didn't test this. You might need to call another function similar to toggleInteractlogin on the document on load event, but without the location.href = ... part. I'm not sure, but the page might reload again when you set the location.href, but I don't think it will.