<?php
require('../wp-blog-header.php');
add_filter('wp_head', 'espg_head');

function espg_head() {
    echo '
    <link rel="alternate" type="text/xml" title="Latest Images RSS 2.0" href="' . returnCurrentWorkingDirectory() . '/rss_photos2.php" />
    <link rel="alternate" type="text/xml" title="Latest Galleries RSS 2.0" href="' . returnCurrentWorkingDirectory() . '/rss_folders.php" />
    <link rel="stylesheet" type="text/css" href="' . returnCurrentWorkingDirectory() . '/sp_styles.css" media="screen" />
    <style type="text/css" media="screen">
';

  if($display_file == '') {
     $divwidth = $GLOBALS['maxthumbwidth'] + 10;
     $divheight = $GLOBALS['maxthumbheight'] + 10;
     if($GLOBALS['showimgtitles'])
       $divheight += 16;
     if($GLOBALS['showdatesonthumbspage'])
       $divheight += 16;

     echo "    div.imgwrapper {\n";
     echo "        width: " . $divwidth . "px;\n        height: " . $divheight . "px;\n";
     if($GLOBALS['alignimages'])
       echo "        text-align: center;\n";
     echo "    }\n";
  } else {
     echo "    div#image {\n";
     echo "        width: " . ($GLOBALS['img_attr_width'] + 8) . "px;\n";
     echo "        height: " . ($GLOBALS['img_attr_height'] + 8) . "px;\n";
     echo "    }\n";
  }
  echo "    </style>\n";

  //IF A FILE WAS REQUESTED FOR VIEWING, OUTPUT Prev & Next LINKS.
  if(!empty($GLOBALS['display_file'])) {
      getPrevAndNextLink();
  //OTHERWISE, A DIRECTORY LISTING REQUEST WAS MADE; DISPLAY THE Start LINK.
  } else {
      if(empty($GLOBALS['disablestart']))
      getStartLink();
  } // END IF

  //IF A FILE WAS REQUESTED FOR VIEWING, LINK TO IMAGE-FADE SCRIPT
  if(!empty($GLOBALS['display_file']) && $GLOBALS['image_fade_in']) {
    echo '<script src="' . returnCurrentWorkingDirectory() . '/imagefade/imagefadein.js" type="text/javascript"></script>';
  }

  echo '    <script type="text/javascript">' . "\n"
     . '    <!--' . "\n"
     . '      document.title = "' . $GLOBALS['page_title'] . '";' . "\n"
     . '    -->' . "\n"
     . '    </script>' . "\n";
}

get_header();
?>

<div id="content" class="narrowcolumn">
<div id="espg">
<h2><?php getPageTitle(); ?></h2>