
  /*
    function to draw the blocks down the right hand side of the page 
  */
  function draw_blocks(url) {

    /*
      stores the name i.e. 'contact.html' with the '.html' removed
    */
    var docname = extract_filename(url);

    /*
      the size of the spacing between blocks - can be 10, 15, 20 or 25
    */
    var spacer_size = '10'

    /*
      used to store the position of the current page in the array of pages
    */
    var docnumber = 0

    /*
      used to cycle through the three images for each set of blocks
    */
    var imagename = new Array(3);
    imagename[0] = 'a';
    imagename[1] = 'b';
    imagename[2] = 'c'; 

    /*
      store the array position of the current page
    */
    for (var x=0; x<a.length; x++)
      if (a[x]==docname)
        docnumber = x;

    if (docname=='')
      docnumber = 1;

    /*
      draw the three block images depending on whether the page requires 'default' or 'pagebased' images 
    */
    if (imagetype[docnumber]=='pagebased') {
      for (var i=0; i<imagename.length; i++) { 
        document.write('<img src="images/blocks/' + docname + '_' + imagename[i] + '.gif" alt="' + docname + '"><br>');
        document.write('<img src="images/blocks/spacer/spacer' + spacer_size + '.gif" alt="' + docname + '"><br>');
      }
    } else {
      for (var i=0; i<imagename.length; i++) {
        document.write('<img src="images/blocks/default_' + imagename[i] + '.gif" alt="' + docname + '"><br>');
        document.write('<img src="images/blocks/spacer/spacer' + spacer_size + '.gif" alt="'+ docname + '"><br>');
      }
    }

    /*
      finally draw the relevant long mill image
    */
    document.write('<img src="images/blocks/long/thinmill' + (docnumber) + '.gif" alt="' + docname + '"><br>');

    /*
      and the w3c html validation code
    */
    document.write('<a href="http://validator.w3.org/check?uri=referer"><img border="0" src="images/various/blank80x20.gif" alt="Validate HTML" width="80" height="20"></a>');
  }

