

 try { document.addEventListener('click', handleClick, false);
     } catch(e) {
     if(document.attachEvent){ document.attachEvent('onclick', handleClick);}
     else                    { document.onclick = handleClick;}
 }

 function handleClick(e)
 {
  var event = e || window.event;
  if(event.ctrlKey || event.shiftKey || event.altKey) return true;
  if(event.which && event.which != 1) return true;

  var target = event.target || event.srcElement;
  while(target && !/^a$/i.test(target.nodeName)) {
   target = target.parentNode;
  }

  if(!target || !target.getAttribute('rel')) return true;

  var rel = target.getAttribute('rel');
  var href = target.getAttribute('href');
  switch(rel) {

   case 'illustration':
    window.open(href, '', 'width=840,height=586,resizable=yes,scrollbars=1');
    break;

   case 'sketch':
    window.open(href, '', 'width=840,height=586,resizable=yes,scrollbars=1');
    break;

   case 'splash':
    window.open(href, '', 'width=840,height=586,resizable=yes,scrollbars=1');
    break;

   case 'external':
    window.open(href,"_blank");
    break;
    default:
   return true;
  }

  try { event.preventDefault(); } catch(e){}
   return false;
  }


 function show_banner()
 {

  text  = "<div class=\"banner\"><form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
  text += "<input type=\"image\" src=\"images/ic_banner.gif\" name=\"submit\" alt=\"paypal\" />";
  text += "<input type=\"hidden\" name=\"cmd\"           value=\"_ext-enter\" />";
  text += "<input type=\"hidden\" name=\"redirect_cmd\"  value=\"_xclick\" />";
  text += "<input type=\"hidden\" name=\"business\"      value=\"arjan@drububu.com\" />";
  text += "<input type=\"hidden\" name=\"currency_code\" value=\"EUR\" />";
  text += "<input type=\"hidden\" name=\"item_name\"     value=\"tutorial\" />";
  text += "<input type=\"hidden\" name=\"amount\"        value=\"3.99\" />";
  text += "</form></div>\n";

  document.writeln(text);

 }


 function show_navigation(txt)
 {
  var lookup = new Array(
                         new Array(
                                   new Array("pixel art general", "index.html")
                                  ),

                         new Array(
                                   new Array("preface/start"    , "preface.html"),
                                   new Array("ic-project"       , "icproject.html"),
                                   new Array("workflow"         , "workflow.html"),
                                   new Array("sketches"         , "sketches.html"),
                                   new Array("outline/shading"  , "shading.html"),
                                   new Array("illustration"     , "illustration.html")
                                  ),

                         new Array(
                                   new Array("deleted artwork"  , "deleted_artwork.html"),
                                   new Array("statistics"       , "statistics.html"),
                                   new Array("presentation"     , "presentation.html"),
                                   new Array("evaluation/hints" , "shading.html")
                                  ),

                         new Array(
                                   new Array("microsoft paint"  , "mspaint.html"),
                                   new Array("adobe photoshop"  , "photoshop.html"),
                                   new Array("adobe illustrator", "illustrator.html"),
                                   new Array("adobe flash"      , "flash_general.html")
                                  ),

                         new Array(
                                   new Array("scaling pixel art", "scaling_pixelart.html"),
                                   new Array("pixelfonts"       , "pixelfonts.html"),
                                   new Array("voxels"           , "voxels.html"),
                                   new Array("psychology"       , "psychology.html"),
                                   new Array("press"            , "press.html"),
                                   new Array("disclaimer"       , "disclaimer.html"),
                                   new Array("about"            , "about.html")
                                  ),

                         new Array(
                                   new Array("buy slikscreen"   , "silkscreen.html"),
                                   new Array("buy tutorial"     , "tutorial.html")
                                  )
                        );


  document.writeln("<div id=\"flash_navigation\">");

  text = " <div id=\"navigation\">\n";

  for(a=0; a<lookup.length; a++){
   text += "  <div class=\"navigation_collumn\">\n";
   for(b=0; b<lookup[a].length; b++){
    text += "   ";
    text += (lookup[a][b][0]==txt) ? "<i class=\"selection\">" : "<a href=\""+lookup[a][b][1]+"\">";
    text += lookup[a][b][0];
    text += (lookup[a][b][0]==txt) ? "</i>" : "</a>";
    text += "<br />\n";
   }
   text += "  </div>\n";
  }
  text += " </div>\n";

  document.writeln(text);
  document.writeln("</div>");

  document.writeln("<script type=\"text/javascript\">");
  document.writeln(" var so = new SWFObject(\"flash/header.swf\", \"flash_player\", \"778\", \"180\", \"8\", \"#000000\");");
  document.writeln(" so.addVariable(\"baseColor\", \"0x000000\");");
  document.writeln(" so.addVariable(\"page\", \""+txt+"\");");
  document.writeln(" so.write(\"flash_navigation\");");
  document.writeln("</script>");
 }








