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

    <h1>Installation Type</h1>
    <p>
      <?php print _('Please select the installation type') ?>
    </p>
    <form method="post" action="">
    <p style="margin-left: 2.2em; text-indent: -2.2em">
      <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>') ?>
    </p>
    <p style="margin-left: 2.2em; text-indent: -2.2em">
      <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 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 printf('%s?step=%s', INDEX_PHP, $currentStep->getStepNumber()) ?>&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 if (isset($templateData['error'])): ?>
	<span 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.'); } ?>
	</span>
	<br/>
      <?php endif; ?>
      <?php print _('The directory must be writeable by your webserver/php user or contain the following writeable files:') ?>
      <div class="example" style="margin-top: 0; padding-top: 0; padding-bottom: 0">
<pre>main.php
index.php
embed.php
upgrade/index.php</pre>
      </div>
    </p>
    </form>

    <div class="go">
      <span class="goToNext">
	<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>
    </div>
