Index: /main/trunk/greenstone3/web/interfaces/default/interfaceConfig.xml
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/interfaceConfig.xml	(revision 26870)
+++ /main/trunk/greenstone3/web/interfaces/default/interfaceConfig.xml	(revision 26871)
Index: /main/trunk/greenstone3/web/interfaces/default/style/core.css
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/style/core.css	(revision 26870)
+++ /main/trunk/greenstone3/web/interfaces/default/style/core.css	(revision 26871)
@@ -810,4 +810,45 @@
 }
 
+.pano_canvas_full{
+	margin:0px auto;
+	width:900px;
+	height:500px;
+}
+
+.pano_canvas_fullscreen{
+	margin:0px auto;
+	width:1280px;
+	height:720px;
+}
+
+.pano_canvas_half{
+	z-index: 1;
+	float: right;
+	width:450px;
+	height:500px;
+	background-color:#000000;
+}
+
+.navigate-point {
+	z-index: 97;
+  	position: absolute;
+	overflow: hidden;
+	width: 80px;
+	height: 80px;
+	margin-left: -40px;
+	margin-top: -40px;
+	background-image: url("../images/navMarker.png");
+	cursor: pointer;
+}
+
+.fullscreenToggle{
+	z-index: 2;
+	position: relative;
+	float: right;
+	top: 28px;
+	left: 128px;
+	padding: 5px;
+}
+
 dl dt { font-weight:bold;
       padding-top:10px; }
Index: /main/trunk/greenstone3/web/interfaces/default/transform/classifiertools.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/classifiertools.xsl	(revision 26870)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/classifiertools.xsl	(revision 26871)
@@ -171,13 +171,31 @@
 		<xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
 		    <xsl:if test="metadataList/metadata[@name='Latitude' or @name='Longitude']">
-		        <xsl:call-template name="mapFeatures"/>
+		        <xsl:call-template name="mapFeaturesIcon"/>
 		    </xsl:if>
 		</xsl:if>
-	</xsl:template>
-
-	<xsl:template name="mapFeatures">
+
+
+		<xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
+		  <xsl:if test=" metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude'] and metadataList/metadata[@name = 'PhotoType']='Panorama'">
+                    <xsl:call-template name="panoramaViewerFeaturesIcon"/>
+                  </xsl:if>
+		</xsl:if>
+
+	</xsl:template>
+
+	<xsl:template name="mapFeaturesIcon">
 		<td style="padding-left:5px; padding-right:5px;" valign="top">
 			<a href="javascript:focusDocument('{@nodeID}');"><img src="interfaces/{$interface_name}/images/map_marker.png"/></a>
 		</td>
 	</xsl:template>
+
+
+	<xsl:template name="panoramaViewerFeaturesIcon">
+                <td style="padding-left:5px; padding-right:5px;" valign="top">
+                        <a href="javascript:switchPanorama('{@nodeID}');">
+                                <img src="interfaces/default/images/map_marker.png"/>
+                        </a>
+                </td>
+        </xsl:template>
+
 </xsl:stylesheet>
Index: /main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl	(revision 26870)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl	(revision 26871)
@@ -79,10 +79,20 @@
 
 		<xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
-			<xsl:call-template name="map-scripts"/>
-		</xsl:if>
+		  <xsl:call-template name="map-scripts"/>
+		</xsl:if>
+		
+		<xsl:if test="/page/pageResponse/format/gsf:option[@name='mapEnabledOpenLayers']/@value = 'true'">
+		  <xsl:call-template name="openlayers-map-scripts"/>
+		</xsl:if>
+
+
+		<xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
+		  <xsl:call-template name="panoramaViewer-scripts"/>
+		</xsl:if>
+
 		
 		<xsl:if test="/page/pageRequest/userInformation and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
-			<xsl:call-template name="init-direct-edit"/>
-			<script type="text/javascript" src="interfaces/{$interface_name}/js/debug_scripts.js"><xsl:text> </xsl:text></script>
+		  <xsl:call-template name="init-direct-edit"/>
+		  <script type="text/javascript" src="interfaces/{$interface_name}/js/debug_scripts.js"><xsl:text> </xsl:text></script>
 		</xsl:if>
 		
@@ -500,3 +510,20 @@
 		<script type="text/javascript">$(window).load(initializeMapScripts);</script>
 	</xsl:template>
+
+	<xsl:template name="openlayers-map-scripts">
+		<script src="interfaces/{interface_name}/js/OpenLayers.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	</xsl:template>
+
+	<xsl:template name="panoramaViewer-scripts">
+           <script src="interfaces/{$interface_name}/js/three45.min.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script src="interfaces/{$interface_name}/js/Tween.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script src="interfaces/{$interface_name}/js/THREEx.FullScreen.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script src="interfaces/{$interface_name}/js/Detector.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script src="interfaces/{$interface_name}/js/RequestAnimationFrame.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script src="interfaces/{$interface_name}/js/OpenLayers.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script src="interfaces/{$interface_name}/js/panoramaMarker.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script src="interfaces/{$interface_name}/js/panoramaViewer.js" type="text/javascript"><xsl:text> </xsl:text></script>
+	   <script type="text/javascript">$(window).load(initPanoramaViewer);$(window).load(_animate);</script>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: /main/trunk/greenstone3/web/interfaces/default/transform/layouts/main.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/layouts/main.xsl	(revision 26870)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/layouts/main.xsl	(revision 26871)
Index: /main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl	(revision 26870)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl	(revision 26871)
@@ -134,9 +134,17 @@
 			<xsl:call-template name="mapFeaturesJSONNodes"/>
 		</xsl:if>
+		
+		<xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
+			<xsl:call-template name="panoramaViewerFeaturesJSONNodes"/>
+		</xsl:if>
+		
 	</xsl:template>
 	
 	<xsl:template name="classifierResultsPre">
 		<xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
-			<xsl:call-template name="mapFeaturesMap"/>
+		  <xsl:call-template name="mapFeaturesMap"/>
+		</xsl:if>
+		<xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
+		  <xsl:call-template name="panoramaViewerFeatures"/>
 		</xsl:if>
 	</xsl:template>
@@ -167,6 +175,85 @@
 	
 	<xsl:template name="mapFeaturesMap">
-		<div id="map_canvas" class="map_canvas_half"><xsl:text> </xsl:text></div>
-	</xsl:template>
+	  <div id="map_canvas" class="map_canvas_half"><xsl:text> </xsl:text></div>
+	</xsl:template>
+
+	<xsl:template name="panoramaViewerFeaturesJSONNodes">
+                <div id="jsonPanoNodes" style="display:none;">
+                        <xsl:text>[</xsl:text>
+                        <xsl:for-each select="//documentNode">
+                                <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude'] and metadataList/metadata[@name = 'PhotoType']='Panorama'">
+                                        <xsl:text>{</xsl:text>
+                                        <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
+                                        <xsl:text disable-output-escaping="yes">"source":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Source']"/>"<xsl:text>,</xsl:text>
+                                        <xsl:text disable-output-escaping="yes">"lat":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/><xsl:text>,</xsl:text>
+                                        <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
+                                        <xsl:text>}</xsl:text>
+                                        <xsl:if test="not(position() = count(//documentNode))">
+                                                <xsl:text>,</xsl:text>
+                                        </xsl:if>
+                                </xsl:if>
+                        </xsl:for-each>
+                        <xsl:text>]</xsl:text>
+                </div>
+                <!-- Although these aren't visible, they are necessary because it forces Greenstone to include this metadata in the page xml -->
+                <gsf:metadata name="Latitude" hidden="true"/>
+                <gsf:metadata name="Longitude" hidden="true"/>
+                <gsf:metadata name="SourceFile" hidden="true"/>
+                <gsf:metadata name="assocfilepath" hidden="true"/>
+		<gsf:metadata name="PhotoType" hidden="true"/>
+		<gsf:metadata name="cv.rotation" hidden="true"/>
+        </xsl:template>
+	
+	<xsl:template name="panoramaViewerFeatures">
+
+
+	  <div id="asdf">
+	    <div id="pano-container" class="pano_canvas_half" style="position: relative">
+  	      <div style="position: absolute; top: 0px; right: 0px;"><a id="gofullscreen" style="background-color: #008000;" href="">Go Fullscreen</a></div>
+	      <xsl:text> </xsl:text>
+	    </div>
+	  </div>
+
+
+
+
+	  <gsf:script>
+<![CDATA[
+	    var cgiargs = '<xsl:template name="mainTemplate"> \
+		<html> \
+			<head> \
+				<xsl:call-template name="create-html-header"/> \
+			</head> \
+			\
+			<body><xsl:call-template name="textDirectionAttribute"/><xsl:call-template name="actionClass"/> \
+				<div id="containerXX"> \
+					<div id="gs_contentXX"> \
+						<xsl:apply-templates select="/page"/> \
+					</div> \
+				</div> \
+			</body> \
+		</html> \
+	      </xsl:template> \
+	      \
+   	      <xsl:template match="/page/pageResponse"> \
+		<xsl:call-template name="panoramaViewerFeaturesJSONNodes"/> \
+		<div id="asdf"> \
+	          <div id="pano-container" class="pano_canvas_fullscreen"> \
+	            <xsl:text> </xsl:text> \
+	         </div> \
+	       </div> \
+	      </xsl:template>';
+
+	      // encodeURIComponent(cgiargs);
+	      // cgiargs.replace(/ /g,"%20")
+
+	      var full_url = document.location + "?ilt=" + escape(cgiargs);
+	      $('#gofullscreen').attr('href',full_url);
+]]>
+	  </gsf:script>
+
+
+	</xsl:template>
+
 </xsl:stylesheet>
 
Index: /main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl	(revision 26870)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl	(revision 26871)
@@ -527,4 +527,11 @@
 			<xsl:call-template name="mapFeaturesIcon"/>
 		</xsl:if>
+
+		<xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
+		  <xsl:if test=" metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
+                    <xsl:call-template name="panoramaViewerFeaturesIcon"/>
+                  </xsl:if>
+		</xsl:if>
+
 	</xsl:template>
 
@@ -571,3 +578,11 @@
 		</td>
 	</xsl:template>
+
+	<xsl:template name="panoramaViewerFeaturesIcon">
+                <td style="padding-left:5px; padding-right:5px;" valign="top">
+                        <a href="javascript:switchPanorama('{@nodeID}');">
+                                <img src="interfaces/default/images/map_marker.png"/>
+                        </a>
+                </td>
+        </xsl:template>
 </xsl:stylesheet>
