<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  
  <!-- include XSLs : ALPHABETIZED-->
  <xsl:include href="CI_Citation.xsl"/>
  <xsl:include href="CI_PresentationFormCode.xsl"/>
  <xsl:include href="constraints.xsl"/>
  <xsl:include href="contentInformation.xsl"/>
  <xsl:include href="dataQuality.xsl"/>
  <xsl:include href="dataCitation.xsl"/>
  <xsl:include href="EX_Extent.xsl"/>
  <xsl:include href="geographicExtent.xsl"/>
  <xsl:include href="lineageOutput.xsl"/>
  <xsl:include href="lineageProcessor.xsl"/>
  <xsl:include href="lineageSource.xsl"/>
  <xsl:include href="MD_AggregateInformation.xsl"/>
  <xsl:include href="MD_DigitalTransferOptions.xsl"/>
  <xsl:include href="MD_Distributor.xsl"/>
  <xsl:include href="MD_Identifier.xsl"/>
  <xsl:include href="metadataInfo.xsl"/>
  <xsl:include href="MD_SpatialRepresentationTypeCode.xsl"/>
  <xsl:include href="MI_Instrument.xsl"/>
  <xsl:include href="MI_Platform.xsl"/>
  <xsl:include href="MI_Operation.xsl"/>
  <xsl:include href="onlineResource.xsl"/>
  <xsl:include href="processStep.xsl"/>
  <xsl:include href="purpose.xsl"/>
  <xsl:include href="responsibleParty.xsl"/>
  <xsl:include href="temporalExtent.xsl"/>
  <!-- include common XSLs -->
  <xsl:include href="booleanTemplate.xsl"/>
  <xsl:include href="displayElement.xsl"/>
  <xsl:include href="IDs.xsl"/>
  <xsl:include href="TBD.xsl"/>

  <xsl:include href="../isoAltViews.xsl"/>


  <!-- HTML -->
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>FAQ for ISO 19115 and 19115-2</title>
        <style type="text/css">
					#leftcolumn {
						float: left;
						width:350px;
						min-height: 600px;
						border: 0px solid #bfbfbf;
						padding: 0px;
						padding-left: 0px;
					}
					#rightcolumn {
						float: left;
						width:850px;
						min-height: 600px;
						border: 0px solid #bfbfbf;
						margin-left: 0px;
						padding: 5px;
						padding-bottom: 8px;
					}
					table.mainTable {
						width:100%;
						border-style: none;
						vertical-align:top;
					}
					table.mainTable th {
						border-style: none;
						padding: 5px 5px 5px 5px;
						font-weight: bold;
						vertical-align: top;
						//background-color: #C0C0C0;
						text-align: left;
					}
					table.mainTable td {
						border-style: none;
						padding: 5px 5px 5px 5px;
						vertical-align:top;
					}
					table.resultTable {
						width:100%;
						border-width: 1px 1px 1px 1px;
						border-style: solid;
						vertical-align:top;
					}
					table.resultTable th {
						border-width: 1px 1px 1px 1px;
						border-style: solid;
						padding: 5px 5px 5px 5px;
						font-weight: bold;
						vertical-align: top;
						background-color: #C0C0C0;
						text-align: left;
						width: 160;
					}
					table.resultTable td {
						border-width: 1px 1px 1px 1px;
						border-style: solid;
						padding: 5px 5px 5px 5px;
						vertical-align:top;
					}
					ul {
						list-style: circle inside;
						padding: 0;
						margin: 0;
					}
					dt {
						font-weight: bold;
						}</style>        
                   <script type="text/javascript" language="javascript">                            
					function getTemplate(newText) {
						document.getElementById("rightcolumn").innerHTML = newText
					}
					function toggleDiv(divid) {
						if (document.getElementById(divid).style.display == 'none') {
							document.getElementById(divid).style.display = 'block';
						} else {
							document.getElementById(divid).style.display = 'none';
						}							
					}					
                   </script>
        
      </head>
      <body>

        <!-- Links to Alternate ISO views -->
        <xsl:call-template name="isoAltViews"/>

        <table class="mainTable">
          <tr>
            <td>
              <table>
                <tr>
                  <th colspan="2" align="left">
                    <font size="+3">
                      <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title">
                        <xsl:value-of select="normalize-space(.)"/>
                      </xsl:for-each>
                    </font>
                  </th>
                </tr>
                <xsl:choose>
                  <xsl:when test="//gmd:graphicOverview/gmd:MD_BrowseGraphic/gmd:fileName">
                    <tr>
                      <td valign="top" align="left">
                        <a href="{//gmd:graphicOverview[1]/gmd:MD_BrowseGraphic/gmd:fileName/gco:CharacterString}">
                          <img alt="browse graphic" style="width: 300px; float: right; border: 0px" src="{//gmd:graphicOverview[1]/gmd:MD_BrowseGraphic/gmd:fileName/gco:CharacterString}"/>
                        </a>
                      </td>
                      <td valign="top" align="left">
                        <xsl:for-each select="//gmd:MD_DataIdentification/gmd:abstract">
                          <xsl:value-of select="normalize-space(.)"/>
                        </xsl:for-each>
                      </td>
                    </tr>
                  </xsl:when>
                  <xsl:otherwise>
                    <tr>
                      <td colspan="2">
                        <xsl:for-each select="//gmd:MD_DataIdentification/gmd:abstract">
                          <xsl:call-template name="displayElement"/>
                        </xsl:for-each>
                      </td>
                    </tr>
                  </xsl:otherwise>
                </xsl:choose>
              </table>
              
              <!-- VARIABLES (alphabetized) -->
              <xsl:variable name="aggregateInformation">
                <xsl:call-template name="aggregateInformation"/>                
              </xsl:variable>
              <xsl:variable name="contentInfo">
                <xsl:call-template name="contentInfo"/>
              </xsl:variable>
              <!--<xsl:variable name="contributor"> <xsl:call-template name="contributorList"/> </xsl:variable>-->
              <xsl:variable name="dataCitation">
                <xsl:call-template name="dataCitation"/>
              </xsl:variable>
              <xsl:variable name="dataConstraints">
                <xsl:call-template name="dataConstraints"/>
              </xsl:variable>
              <xsl:variable name="dataQuality">
                <xsl:call-template name="dataQuality"/>
              </xsl:variable>
              <xsl:variable name="digtransf">
                <xsl:call-template name="MD_DigitalTransferOptions"/>
              </xsl:variable>
              <xsl:variable name="distributor">
                <xsl:call-template name="MD_Distributor"/>
              </xsl:variable>
              <xsl:variable name="DQ_Completeness">
                <xsl:call-template name="DQ_Completeness"/>
              </xsl:variable>
              <xsl:variable name="DQ_LogicalConsistency">
                <xsl:call-template name="DQ_LogicalConsistency"/>
              </xsl:variable>
              <xsl:variable name="DQ_PositionalAccuracy">
                <xsl:call-template name="DQ_PositionalAccuracy"/>
              </xsl:variable>
              <xsl:variable name="DQ_TemporalAccuracy">
                <xsl:call-template name="DQ_TemporalAccuracy"/>
              </xsl:variable>
              <xsl:variable name="DQ_ThematicAccuracy">
                <xsl:call-template name="DQ_ThematicAccuracy"/>
              </xsl:variable>
              <xsl:variable name="extents">
                <xsl:call-template name="EX_Extent"/>
              </xsl:variable>
              <xsl:variable name="geographicExtent">
                <xsl:call-template name="geographicExtent"/>
              </xsl:variable>
              <xsl:variable name="identifier">
                <xsl:call-template name="MD_Identifier"/>
              </xsl:variable>
              <xsl:variable name="instInfo">
                <xsl:call-template name="instInfo"/>
              </xsl:variable>
              <xsl:variable name="metadataConstraints">
                <xsl:call-template name="metadataConstraints"/>
              </xsl:variable>
              <xsl:variable name="metadataInfo">
                <xsl:call-template name="metadataInfo"/>
              </xsl:variable>
              <xsl:variable name="missInfo">
                <xsl:call-template name="missInfo"/>
              </xsl:variable>
              <xsl:variable name="onlineResource">
                <xsl:call-template name="onlineResource"/>
              </xsl:variable>
              <xsl:variable name="originator">
                <xsl:call-template name="originatorList"/>
              </xsl:variable>
              <xsl:variable name="output">
                <xsl:call-template name="lineageOutput"/>
              </xsl:variable>
              <xsl:variable name="platInfo">
                <xsl:call-template name="platInfo"/>
              </xsl:variable>
              <xsl:variable name="poc">
                <xsl:call-template name="pointOfContact"/>
              </xsl:variable>
              <xsl:variable name="presentationFormCode">
                <xsl:call-template name="presentationFormCode"/>
              </xsl:variable>
              <xsl:variable name="processStep">
                <xsl:call-template name="lineageSteps"/>
              </xsl:variable>
              <xsl:variable name="processor">
                <xsl:call-template name="lineageProcessor"/>
              </xsl:variable>
              <xsl:variable name="purpose">
                <xsl:call-template name="purpose"/>
              </xsl:variable>
              <xsl:variable name="responsibleParty">
                <xsl:call-template name="CI_ResponsibleParty"/>
              </xsl:variable>
              <xsl:variable name="source">
                <xsl:call-template name="lineageSource"/>
              </xsl:variable>
              <xsl:variable name="spatialTypeCode">
                <xsl:call-template name="spatialTypeCode"/>
              </xsl:variable>
              <xsl:variable name="tbd">
                <xsl:call-template name="TBD"/>
              </xsl:variable>
              <xsl:variable name="temporalExtent">
                <xsl:call-template name="temporalExtent"/>
              </xsl:variable>
              <table>
                <tr>
                  <td>
                    <!-- QUESTIONS -->
                    <div id="leftcolumn">
                      <ul>
                        <li>
                          <a href="javascript:;" onmousedown="toggleDiv('faqDiv');">What does this data set describe?</a>
                        </li>
                        <div id="faqDiv" style="display:none">
                          <ol>
                            <li>
                              <a href="javascript:getTemplate('{$dataCitation}')">How should this data set be cited?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$geographicExtent}')">What geographic area does the data set cover? </a>
                            </li>
                            <!--<LI><A href="#what.3">What does it look like?</A></LI>-->
                            <li>
                              <a href="javascript:getTemplate('{$temporalExtent}')">What is the temporal coverage of the data set? </a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$presentationFormCode}')">What is the geospatial form of this data set?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$spatialTypeCode}')">How does the data set represent geographic features?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$contentInfo}')">What are the contents of this dataset?</a>
                            </li>
                          </ol>
                        </div>
                        <li>
                          <a href="javascript:;" onmousedown="toggleDiv('faqDiv2');">Who produced the data set?</a>
                        </li>
                        <div id="faqDiv2" style="display:none">
                          <ol>
                            <li>
                              <a href="javascript:getTemplate('{$originator}')">Who are the originators of the data set?</a>
                            </li>
                            <!-- <li><a href="javascript:getTemplate('{$contributor}')">Who also contributed to the data set?</a></li>-->
                            <li>
                              <a href="javascript:getTemplate('{$poc}')">To whom should users address questions about the data?</a>
                            </li>
                          </ol>
                        </div>
                        <li>
                          <a href="javascript:getTemplate('{$purpose}')">Why was the data set created?</a>
                        </li>
                        <li>
                          <a href="javascript:;" onmousedown="toggleDiv('faqDiv4');">How was the data set created?</a>
                        </li>
                        <div id="faqDiv4" style="display:none">
                          <ol>
                            <li>
                              <a href="javascript:getTemplate('{$processStep}')">What changes have been made? </a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$processor}')">Who was the processor?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$source}')">What data sources were used in this process?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$output}')">What data sources were produced in this process?</a>
                            </li>
                          </ol>
                        </div>
                        <li>
                          <a href="javascript:;" onmousedown="toggleDiv('faqDiv4.1');">How reliable are the data?</a>
                          <!-- ; what problems remain in the data set -->
                        </li>
                        <div id="faqDiv4.1" style="display:none">
                          <ol>
                            <li>
                              <a href="javascript:getTemplate('{$DQ_LogicalConsistency}')">How well have the observations been checked?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$DQ_PositionalAccuracy}')">How accurate are the geographic locations, heights or depths?</a>
                            </li>
                            <!-- <li> <a href="javascript:getTemplate('{$DQ_PositionalAccuracy}')">How accurate are the heights or depths?</a> </li> -->
                            <li>
                              <a href="javascript:getTemplate('{$DQ_Completeness}')">Where are the gaps in the data? What is missing?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$DQ_ThematicAccuracy}')">How consistent are the relationships among the data, including topology?</a>
                            </li>
                          </ol>
                        </div>
                        <li>
                          <a href="javascript:;" onmousedown="toggleDiv('faqDiv5');">How can someone get a copy of the data set?</a>
                        </li>
                        <div id="faqDiv5" style="display:none">
                          <ol>
                            <li>
                              <a href="javascript:getTemplate('{$dataConstraints}')">Are there legal restrictions on access or use of the data?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$distributor}')">Who distributes the data?</a>
                            </li>
                            <!--<li> <a href="javascript:getTemplate('{$tbd}')">What's the catalog number I need to order this data set?</a> </li>--> 
                            <!--<li> <a href="javascript:getTemplate('{$dataConstraints}')"> What legal disclaimers am I supposed to read?</a> </li>-->
                            <li>
                              <a href="javascript:getTemplate('{$digtransf}')"> How can I download or order the data?</a>
                            </li>
                            <!--<li> <a href="javascript:getTemplate('{$tbd}')">Is there some other way to get the data?</a> </li>--> 
                            <!--<li> <a href="javascript:getTemplate('{$tbd}')"> What hardware or software do I need in order to use the data set?</a> </li>-->
                          </ol>
                        </div>
                        <li>
                          <a href="javascript:getTemplate('{$metadataInfo}')">Who wrote the metadata?</a>
                        </li>
                        <li>
                          <a href="javascript:;" onmousedown="toggleDiv('faqDiv6');">How were these data collected?</a>
                        </li>
                        <div id="faqDiv6" style="display:none">
                          <ol>
                            <li>
                              <a href="javascript:getTemplate('{$instInfo}')">What were the instruments or sensors used to collect the data? </a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$platInfo}')">What satellites, boats or other platforms were the instruments on?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$missInfo}')">What missions supported the platforms?</a>
                            </li>
                          </ol>
                        </div>
                        <li>
                          <a href="javascript:;" onmousedown="toggleDiv('faqDiv99');">Lists</a>
                        </li>
                        <div id="faqDiv99" style="display:none">
                          <ol>
                            <li>
                              <a href="javascript:getTemplate('{$aggregateInformation}')">What groups are this data set associated with?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$identifier}')">What are the identifiers associated with this data set?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$responsibleParty}')">What people and organizations are associated with this data set?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$extents}')">What are the temporal and spatial extents associated with this data set?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$dataQuality}')">What is the quality of this data set?</a>
                            </li>
                            <li>
                              <a href="javascript:getTemplate('{$onlineResource}')">What are the URLs and other online resources associated with this data set?</a>
                            </li>
                          </ol>
                        </div>
                      </ul>
                    </div>
                  </td>
                  <td>
                    <div id="rightcolumn"/>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </body>
    </html>    
  </xsl:template>
</xsl:stylesheet>
