re-
VISION

PHOTOGRAPHY AND GRAPHICS BY JAY BOERSMA

WebworkJavaScript Complex Random Image Generator

Hit the Refresh or Reload button to change this "refrigerator poetry."

The sentence is generated from a series of 42 small graphic "word magnet" images located in directories titled article, adjective, subject, verb, object and adverb.

<html>
<head>
<title>Webwork/JavaScript/Randomly Generated Images</title>

<script language="javascript">
<!-- // begin
random.m=714025; random.a=4096; random.c=150889;
random.seed = (new Date()).getTime()%random.m;
function random()
{
  random.seed = (random.seed*random.a + random.c) % random.m;
  return random.seed / random.m;
}

function randomizeimages()
{
  randomizeimage('image1', 6, 'article/', '.gif');
  randomizeimage('image2', 6, 'adjective/', '.gif');
  randomizeimage('image3', 6, 'subject/', '.gif');
  randomizeimage('image4', 6, 'verb/', '.gif');
  randomizeimage('image5', 6, 'object/', '.gif');
  randomizeimage('image6', 6, 'adverb/', '.gif');
}

function randomizeimage(img, count, base, type)
{
 document.images[img].src = base + Math.floor(random() * count + 1) + type
}
// end hiding -->
</script>
</head>

<body bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#000000" 
alink="#ff00ff" onload="randomizeimages()">

<p align="center"">
<img name="image1" src="article/7.gif" height="20" border="0">
<img name="image2" src="adjective/7.gif" height="20" border="0">
<img name="image3" src="subject/7.gif" height="20" border="0">
<img name="image4" src="verb/7.gif" height="20" border="0">
<img name="image5" src="object/7.gif" height="20" border="0">
<img name="image6" src="adverb/7.gif" height="20" border="0"></p>

</body>
</html>


Javascript Table of Contents | Webwork Table of Contents