<?php

# some handy urls to avoid code duplication
$SERV "http://www.van-gils.org";
$BASE "$SERV/~bas";
$IMG  "$BASE/img";
$SELF $_SERVER['PHP_SELF']; 

# navigation bar is defined as an array
$nba = Array(   
  
"home"          => "index.php",
  
"resume"        => "resume.php",
  
"bridge"        => "bridge.php",
  
"publications"  => "pubs.php",
  
"software"      => "software.php",
  
"about"         => "about.php"
);

#############################################################################
#                               functions                                   #
#############################################################################



/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  function : mkheader
 *  in       : title for a page
 *  out      : nothing
 *
 *  print the doctype + html headers of the page, a nice title is inlcuded.
 *  Also loads the CSS file
 *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
function mkheader($title="Bas van Gils"){
  global 
$SERV,$BASE,$IMG,$nba;

  print 
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
  print 
"<html>\n";
  print 
"<head>\n";
  print 
"  <meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\">\n";
  print 
"  <link type=\"text/css\" rel=\"stylesheet\" href=\"$BASE/style.css\">\n";
  print 
"  <title> $title </title>\n";
  print 
"<meta name=\"verify-v1\" content=\"x5gZQVKBi8iTASjRTFGEbYjfxvFBxyvRyevWA1W+gCw=\" />";
  print 
"</head>\n\n";
  print 
"<body>\n";
  print 
"<div class=\"topbox\">\n";
  print 
"  <img src=\"$IMG/logo.png\" width=\"100\" alt=\"logo\">\n";
  print 
"</div>\n";
}


/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 * function : mkfooter
 * in       : nothing
 * out      : nothing
 *
 * print the footer of the page. This includes a link to my weblog, the 
 * last mod. date and today's date.
 *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
function mkfooter(){
  global 
$SERV,$BASE,$IMG,$nba;

  print 
"<br />";

  print 
"<p class=\"footer\">";
  print 
"&copy; Bas van Gils - \n";
  print 
"See also: <a href=\"$SERV/wordpress\">Weblog</a> / ";
  print 
"<a href=\"$SERV/gallery2\">Gallery</a><br>\n";
  print 
"Last modified: " date"F d Y."getlastmod() ) . "<br>\n";
  print 
"Today is: " date"F d Y."mktime() ) ;
  
  print 
"</p>";

  print 
"</body>\n";
  print 
"</html>\n";
}


/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 * function : navbar
 * in       : $mypic => which picture is shown in the navbar?
 * out      : nothing
 *
 * prints a nice navigation bar, a picture is shown based on parameters
 *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
function navbar($p="eyes.jpg"){
  global 
$SERV,$BASE,$IMG,$nba;

  print 
"<center><table border=\"0\" cellspacing=\"5\"> \n";
  print 
"<tr> \n";
  print 
"<td>";
  print 
"<img src=\"$IMG/$p\" width=\"80\" alt=\"my pic\"/>";
  print 
"</td> \n";
  print 
"<td>";
  foreach(
$nba as $k => $v){
    print 
"[<a href=\"$BASE/$v\">$k</a>]&nbsp;";
  }
  print 
"</td> \n";
  print 
"</tr> \n";
  print 
"</table></center> \n";
}


?>