<?php
  
//pass numbers only;
  
function startDiv($height$width$top$left$zIndex$class)
  {
    echo(
'<div class="style'.$class.'" style="z-index:'.$zIndex.'; width:'.$width.'px; height:'.$height.'px; position:absolute; left:'.$left.'px; top:'.$top.'px;">');
    echo(
"\n");
  }
  
  function 
endDiv()
  {
    echo(
"</div>\n");
  }
  
  function 
makeImage($filename)
  {
    echo(
'<a href="index.php">');
    echo(
'<img src="'.$filename.'" alt="the best image on the web!">');
   echo(
'</a>');
  }

  function 
makeText($filename)
  {
    echo(
'<span class="text">');
    echo(
"\n");
    include(
$filename);
    echo(
"</span>\n");
  }
  
  function 
recursiveFillPage($recursionLevel)
  {
      if(
$recursionLevel <= 0) return;
      
      
$probability;
      
$heightMax$widthMax 1500;
      
$height$width$top=0$left=0$zIndex$class;
      
$images glob('Images/*');
      
$text glob('Text/*');
      
$maxImageIndex count($images) - 1;
      
$maxTextIndex  count($text  ) - 1
      
$filename$fileIndex;
      
$i;

      
$probability 0.0//count(images) / count(text);
      
      
for($i=0$i<100$i++)
        {
          
$height rand(100600);
          
$width  rand(100600);
          
$class  rand(  1,   2);
          
$zIndex rand(  0,  10);
          
          
startDiv($height$width$top$left$zIndex$class);
          
          if(
$recursionLevel == 1)
          {
            if(
rand()/getRandMax() > $probability)
              { 
//random image
                
$fileIndex rand(0$maxImageIndex);
                
$filename  $images[$fileIndex];
                
makeImage($filename);
              }
            else
              { 
//random text
                
$fileIndex rand(0$maxTextIndex);
                
$filename  $text[$fileIndex];
                
makeText($filename);
              }
            }
          
recursiveFillPage($recursionLevel-1);

          
endDiv();
          
          
$left  += $width-200;
          if(
$left $widthMax)
            {
              
$top   += $height-200;
              
$left  0;
            }
        }  
  }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Welcome!</title>
    <meta name="author" content="Michael Krzyzaniak and ..." />
    <meta name="description" content="scrollbars" />
    <meta name="keywords" content="scrollbars, glitch, error, properties of the internet" />
    
    <style type="text/css">
    body
    {
      margin:0px;
      padding:0px;
      background-color:black;
      background-image:url(Background/1.jpg);
    }
    div 
    {
      overflow:auto;
    }
    .text
    {
      display:block;
      width:110%;
      height-min:110%;
      white-space:pre-wrap;
    }
    .style1
    {
      background-color:black;
      color:red;
      font-size:25pt;
      font-weight:bold;
      font-family:courier, monospace;
      background-image:url(Background/2.jpg);
    }
    .style2
    {
      background-color:black;
      color:green;
      font-family:Courier, monospace;
      font-size:20pt;
      background-image:url(Background/2.jpg);
    }
    </style>
  </head>

  <body>
    <?php
      recursiveFillPage
(2);
    
?>
  </body>
</html>