View Full Version : Watermark Background Image randomizer script

02-13-2005, 12:24 AM
My goal is to have a page with a single image displayed and when the page is visited again it chooses a different picture.

Have the following script and on line the "if (document.all)" I keep getting A Runtime Error occurred: Unterminated string constant

The first picture displays but cannot figure out this Runtime error?

I'm using FP 2004.

<%@ Language="VBScript" %>
<% Option Explicit %>


<meta http-equiv="Content-Type" content="text/html;
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">

dim num, picNum, ArrPics
ArrPics =
picNum = 2
num = Round(Rnd*picNum)


<p align="center">

<img src="<% Response.Write (ArrPics(num)) %>" alt=" ">

<script language="JavaScript1.2">

Watermark Backgound Image Script-
) Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com

if (document.all)
no-repeat fixed center center"

<p align="center">
<a target="_blank" href="http://www.website.com/index.asp"><img border="0" src="media/picts/INDEX_images/1977_1.jpg"></a></p>

<p align="center">
<a target="_blank" href="http://www.website.com/index.asp">Blah Blah</a></p>


Thanks for your help!!!!

02-15-2005, 01:04 PM
this line might be it:
no-repeat fixed center center"

it should be all in one line:
document.body.style.cssText="url('media/picts/INDEX_images/1980_1.jpg')no-repeat fixed center center"