    <script type="text/javascript" src="../lib/javascript/AutoComplete.js"></script>
    <script type="text/javascript" src="../lib/javascript/XmlHttp.js"></script>

    <?php if (isset($templateData['error'])): ?>
	<div class="error">
      <h2>
      <?php print _('Errors occurred. Please see messages below.') ?>
      </h2>
    </div>
    <?php endif; ?>

    <h1><?php print _('Installation Type') ?></h1>
    <p>
      <?php print _('Please select the installation type') ?>
    </p>
    <form method="post" action="<?php generateUrl(sprintf('%s?step=%s', INDEX_PHP, $stepNumber)) ?>">
    <div class="multisite">
      <input type="radio" id="rbStandard" name="isMultisite" value="0" onclick="linkToggle(0)"
	<?php if (!$templateData['isMultisite']) print 'checked="checked"' ?>>
      <label for="rbStandard" class="radio">
	<?php print _('Standard installation') ?>
      </label>
      <br/>
      <?php printf(_('This is the default installation type. Choose this installation type if you want to install a new Gallery in the directory %s which will be accessible with the URL %s.'),
                   '<tt>' . $templateData['galleryDir'] . '</tt>', '<tt>' . $templateData['galleryUrl'] . '</tt>') ?>
    </div>
    <div class="multisite">
      <input type="radio" id="rbMultisite" name="isMultisite" value="1" onclick="linkToggle(1)"
	<?php if ($templateData['isMultisite']) print 'checked="checked"' ?>>
      <label for="rbMultisite" class="radio">
	<?php print _('Multisite installation') ?>
      </label>
      <br/>
      <?php print _('Gallery can support multiple independent sites with a single installation of the code. Choose this installation type if you want to install a new Gallery on the same webserver but in a different path, subdomain or URL domain.') ?>
      <br/>
      <?php printf(_('The multisites don\'t share albums, photos, users, or anything else. They all need their own database and their own storage directory. For more information and explanations about Multisite installations, visit the %s page.'),
                   '<a href="http://codex.gallery2.org/index.php/Gallery2:Multisite" target="_blank">Multisite Documentation</a>') ?>
      <br/>
      <br/>
      <?php if (isset($templateData['error'])): ?>
    	<div class="error">
    	  <?php if (isset($templateData['error']['missing_value'])) {
    		print _('You must enter a directory'); } ?>
    	  <?php if (isset($templateData['error']['missing_dir'])) {
    		print _('The directory you entered does not exist'); } ?>
              <?php if (isset($templateData['error']['codebase_dir'])) {
    		print _('The directory you entered is the codebase directory. If you want to install a Gallery in the codebase directory, select the standard installation type. If you want to install a multisite, choose another directory.'); } ?>
    	  <?php if (isset($templateData['error']['inaccessible_dir'])) {
    		print _('The directory you entered is not accessible.  Change the permissions so that the webserver can read this directory.'); } ?>
    	  <?php if (isset($templateData['error']['creation_error'])) {
    		print _('Unable to create multisite files. Ensure the files listed below are writeable.'); } ?>
    	</div>
     	<br/>
      <?php endif; ?>
      <?php print _('All multisites are installed from this central code repository (codebase).') ?>
      <br/>
      <?php print _('Enter the directory for the new multisite below. The path must be different from this codebase installation\'s path:') ?>
      <br/>
      <input type="text" id="dir" name="configPath" size="50"
	     value="<?php print $templateData['configPath'] ?>" autocomplete="off"/>
      <script type="text/javascript">
	// <![CDATA[
	autoCompleteAttach('dir', '<?php generateUrl(sprintf('%s?step=%s&%s=%s', INDEX_PHP, $currentStep->getStepNumber(), session_name(), session_id())) ?>&doAutoComplete=1&path=__VALUE__');

	function linkToggle(m) {
	  document.getElementById('linkContinue').style.display = m ? 'none' : 'inline';
	  document.getElementById('linkSelect').style.display = m ? 'inline' : 'none';
	}
	// ]]>
      </script>
      <br/>

      <?php print _('The directory must be writeable by your webserver/php user or contain the following writeable files:') ?>
      <div class="example">
<pre>
main.php
index.php
embed.php
upgrade/index.php
lib/support/index.php (optional)
</pre>
      </div>
    </div>
    </form>

    <div class="go">
	  <div class="btn btn-continue"><span><span><span><span>
	<a href="javascript:document.forms[0].submit()">
	  <span id="linkContinue"
	    <?php if ($templateData['isMultisite']) print ' style="display: none"' ?>>
	    <?php printf(_('Continue to Step %d&raquo;'), $stepNumber + 1) ?>
	  </span>
	  <span id="linkSelect"
	    <?php if (!$templateData['isMultisite']) print ' style="display: none"' ?>>
	    <?php print _('Select Directory') ?>
	  </span>
	</a>
	  </span></span></span></span></div>
    </div>
