Although you can do it with js its better to do this on the serverside.
Provided you have php running on your server
(and most do), then rename your pages to .php pages
Now you can use sessions.
Add this to all the non-index pages:
PHP Code:
<?php
@session_start();
if (@$_SESSION['auth'] != "yes" ){
header("Location: index.php");
exit();
} // end if
?>
then on the index page add:
PHP Code:
<?php
@session_start();
$_SESSION['auth'] = "yes";
?>
Of course all your internal links need to be changed to .php as well
no .htm ot .html can stay - all .php
OK