is there any one who could say me how write such a code :
i want write a code that downloads a cab file from a server.
that cab file sets a flag on the client computer and in the html code the flag will be checked. then if flag has been set i want that all of the html page be displayed , otherwise i want the an alert say the user that you should press yes button when the download file has been displayed on your computer.
i began to write such a code, some people said me that use document.write such way :
<body>

<object>
object id = ...
clsid = ...
codebase = "some place on some server"
</object>

<script>
if flag then
document.write(all of html page)
else
alert (you shuold press yes)
end if
</script>
but a problem rised :
when i remove the object part , the could truly runs, but when i put the object part(that it should be) it the page doesn't displayed, wether the object has been executed or has not been executed !!!!
i putted the object part on the head part , but nothing !!!!
i asked another people, they said me that you could use display and innerhtml tags ! but i am not a html coder !!!!

does any one could help me how i could solve this problem ?
if a peiece of code , i'll be so thankfull !!!
by the way i don't want write server side codes ! i only want that write client side code !
the only thing that i want know is this that how i can prevent displaying the web page when a flag has not been set as i described before ?