Index: /main/trunk/greenstone3/web/interfaces/default/js/panoramaViewer.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/panoramaViewer.js	(revision 26882)
+++ /main/trunk/greenstone3/web/interfaces/default/js/panoramaViewer.js	(revision 26883)
@@ -28,5 +28,5 @@
 }
 
-    var panoContainer, camera, scene, renderer, projector;
+var panoContainer, camera, scene, renderer, projector;
 
 var mouse = { x: 0, y: 0 };
@@ -40,7 +40,6 @@
     phi = 0, theta = 0,
     mesh, sphereRadius = 500,
-    meshRotation =  Math.PI,
+    meshRotation =  Math.PI / 2 * 3,
     panoSelectionRadius = 40;
-
 
 var panoDocList = new Array();
@@ -52,9 +51,6 @@
 var nearbyPanoList = new Array();
 nearbyPanoList.ids = new Array();
-nearbyPanoList.pos = new Array();
-
 
 function initPanoramaViewer() {    
-    
     //Creating the document list to store data about the panoramams
     var jsonNodeDiv = $("#jsonPanoNodes");
@@ -73,13 +69,15 @@
 
     panoContainer = document.getElementById( 'pano-container' );
-
     // Creating the camera
     // Setting width and height variables as the container dimensions changes when fov is changed
-    width = panoContainer.offsetWidth;
-    height = panoContainer.offsetHeight;
-    aspect = width / height;
-    
-    // camera = new THREE.PerspectiveCamera( fov, window.innerWidth / window.innerHeight, 1, 1100 );
-    // camera = new THREE.PerspectiveCamera( fov, container.offsetWidth / container.offsetHeight, 1, 1100 );
+    if(panoContainer.className == "pano_canvas_fullscreen") {
+	width = window.innerWidth;
+	height = window.innerHeight;
+	aspect = width / height;
+    } else if(panoContainer.className == "pano_canvas_half") {
+	width = panoContainer.offsetWidth;
+	height = panoContainer.offsetHeight;
+	aspect = width / height;
+    }
     camera = new THREE.PerspectiveCamera( fov, aspect, 1, 1100 );
     camera.target = new THREE.Vector3(0, 0, 0 );
@@ -90,19 +88,24 @@
     projector = new THREE.Projector();
     
+    var sourceFile = gs.documentMetadata[panoDocList.ids[0]].Image;
+    var assocfilepath = gs.documentMetadata[panoDocList.ids[0]].assocfilepath;
+    var httpPath = gs.collectionMetadata.httpPath;
+
+    var fullPanoURL = httpPath + "/index/assoc/" + assocfilepath + "/" + sourceFile;
+
     // Creating a sphere with the panorama applied as a texture
     if (Detector.webgl) {
-	mesh = new THREE.Mesh( new THREE.SphereGeometry( sphereRadius, 60, 40 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( gs.collectionMetadata.httpPath + '/import/panorama/' + 'panorama0.jpg' ), wireframe: false } ) );
+	mesh = new THREE.Mesh( new THREE.SphereGeometry( sphereRadius, 60, 40 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( fullPanoURL ), wireframe: false, overdraw: true, opacity:0 } ) );
     } else {
-	mesh = new THREE.Mesh( new THREE.SphereGeometry( sphereRadius, 30, 20 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( gs.collectionMetadata.httpPath + '/import/panorama/' + 'panorama0.jpg' ), wireframe: false, overdraw: true } ) );
-    }
+	mesh = new THREE.Mesh( new THREE.SphereGeometry( sphereRadius, 30, 20 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( fullPanoURL ), wireframe: false, overdraw: true, opacity:0 } ) );
+    }
+    
     mesh.scale.x = -1;
-    // mesh.rotation.y = meshRotation + (90 * Math.PI / 180);
-    scene.add( mesh ); // Adding the sphere to the scene
+    // Adding the sphere to the scene
+    scene.add( mesh );
 
     switchPanorama(panoDocList.ids[0]);
 
     renderer = Detector.webgl? new THREE.WebGLRenderer(): new THREE.CanvasRenderer();
-    //renderer.setSize( window.innerWidth, window.innerHeight );
-    //renderer.setSize(container.offsetWidth,container.offsetHeight);
     renderer.setSize(width,height);
 
@@ -115,6 +118,7 @@
     panoContainer.addEventListener( 'mousewheel', onDocumentMouseWheel, false );
     panoContainer.addEventListener( 'DOMMouseScroll', onDocumentMouseWheel, false);
-    
-    // window.addEventListener( 'resize', onWindowResize, false );
+
+    if(panoContainer.className == "pano_canvas_fullscreen")
+	window.addEventListener( 'resize', onWindowResize, false );
 }
 
@@ -153,34 +157,7 @@
 }
 
-/*
-function fullscreenToggle () {
-    console.log("blah");
-    if( THREEx.FullScreen.activated() ){
-	THREEx.FullScreen.cancel();
-
-	camera.aspect = width / height;
-	camera.updateProjectionMatrix();
-
-	renderer.setSize( width, height );
-
-    }else{
-	console.log("Fullscreen");
-	THREEx.FullScreen.request(document.getElementById( 'asdf' ));
-
-	//THREEx.FullScreen.request(panoContainer);
-
-	// THREEx.FullScreen.request(document.getElementById( renderer ));
-	camera.aspect = window.innerWidth / window.innerHeight;
-	camera.updateProjectionMatrix();
-
-	//renderer.setSize( window.innerWidth, window.innerHeight );
-
-    }
-}
-*/
-
 function switchPanorama( panoramaID, destMarker ) {
     // Building the file path
-    var sourceFile = gs.documentMetadata[panoramaID].SourceFile;
+    var sourceFile = gs.documentMetadata[panoramaID].Image;
     var assocfilepath = gs.documentMetadata[panoramaID].assocfilepath;
     var httpPath = gs.collectionMetadata.httpPath;
@@ -188,6 +165,4 @@
     var fullPanoURL = httpPath + "/index/assoc/" + assocfilepath + "/" + sourceFile;
 
-    console.log("pano URL = " + fullPanoURL);
-    
     // Creating the material
     if (Detector.webgl) {
@@ -205,19 +180,22 @@
 	
     new TWEEN.Tween(mesh.materials[0]).to({opacity: 0}, 500).onComplete(function () {
+	    // Rotation
+	    if (gs.documentMetadata[panoramaID].Angle) {
+		var temp = 360 + parseFloat(gs.documentMetadata[panoramaID].Angle);
+		temp = temp % 360;
+		console.log(temp);
+		mesh.rotation.y =  meshRotation + (gs.documentMetadata[panoramaID].Angle * Math.PI / 180);
+	    } else if (gs.documentMetadata[panoramaID].cv_rotation) 
+		mesh.rotation.y =  meshRotation + (gs.documentMetadata[panoramaID].cv_rotation * Math.PI / 180);
+	    else
+		mesh.rotation.y = meshRotation;
+	    
 	    mesh.materials[0] = texture;		
 	    new TWEEN.Tween(mesh.materials[0]).to({opacity: 1}, 500).start();
     }).start();
     
-    // Setting the mesh material
-
-    
-    // Rotation
-    if (gs.documentMetadata[panoramaID].cv_rotation) 
-	mesh.rotation.y =  meshRotation + (gs.documentMetadata[panoramaID].cv_rotation * Math.PI / 180);
-    else
-	mesh.rotation.y = meshRotation;
-
+    
     // Checking if there are markers to remove
-    if (nearbyPanoList.length > 1) {
+    if (nearbyPanoList.length > 0) {
 	for(var i = 0; i < nearbyPanoList.length; i++) {
 	    panoContainer.removeChild(nearbyPanoList[i]);
@@ -241,5 +219,4 @@
 	if(calculateDistance(startPanoLonLat,endPanoLonLat) < panoSelectionRadius) {
 	    var bearing = calculateBearing(startPanoLonLat,endPanoLonLat); 
-	    console.log(bearing);
 	    var pos =  degreesToCoords(bearing, sphereRadius);
 	    var navMarker = NavMarker.create(panoDocList.ids[i],pos);	
@@ -260,5 +237,5 @@
 } 
 
-/*
+
 function onWindowResize() {
     camera.aspect = window.innerWidth / window.innerHeight;
@@ -267,14 +244,11 @@
     renderer.setSize( window.innerWidth, window.innerHeight );
 }
-*/
+
 
 function onDocumentMouseDown( event ) {
     event.preventDefault();
-    
     isUserInteracting = true;
-    
       onPointerDownPointerX = event.clientX;
       onPointerDownPointerY = event.clientY;
-      
       onPointerDownLon = lon;
       onPointerDownLat = lat;
@@ -284,5 +258,4 @@
 function onDocumentMouseMove( event ) {
     if ( isUserInteracting ) {
-	
 	lon = ( onPointerDownPointerX - event.clientX ) * 0.1 + onPointerDownLon;
 	lat = ( event.clientY - onPointerDownPointerY ) * 0.1 + onPointerDownLat;
@@ -297,23 +270,13 @@
 
 function onDocumentMouseWheel( event ) {
-    
-    // WebKit
-    
     if ( event.wheelDeltaY ) {
-	
+	// WebKit
 	fov -= event.wheelDeltaY * 0.05;
-	
-	// Opera / Explorer 9
-	
     } else if ( event.wheelDelta ) {
-	
+	// Opera / Explorer 9	
 	fov -= event.wheelDelta * 0.05;
-	
-	// Firefox
-	
     } else if ( event.detail ) {
-	
+	// Firefox	
 	fov += event.detail * 1.0;
-	
     }
 
@@ -324,12 +287,9 @@
     }
 
-    // camera.projectionMatrix.makePerspective( fov, container.offsetWidth / container.offsetHeight, 1, 1100 );
     camera.projectionMatrix = THREE.Matrix4.makePerspective( fov, aspect , 1, 1100 );
     _render();
-    
 }
 
 function _animate() {
-    
     requestAnimationFrame( _animate );
     _render();
@@ -339,10 +299,4 @@
 
 function _render() {
-    /*
-    lat = Math.max( - 85, Math.min( 85, lat ) );
-    phi = THREE.Math.degToRad( 90 - lat );
-    theta = THREE.Math.degToRad( lon );
-    */
-
     lat = Math.max( - 85, Math.min( 85, lat ) );
     phi = ( 90 - lat ) * Math.PI / 180;
@@ -365,4 +319,6 @@
     var i, angle, sameSide, p2D, marker;
 
+    // Snippet of code from Thanh Tran from in2ideas
+    // thanh.tran@in2ideas.com
     for (i = 0; i < nearbyPanoList.length; ++i) {
 	marker =  nearbyPanoList[i];
@@ -372,5 +328,4 @@
 	p2D.y = - (p2D.y - 1)/2 * height;
 	
-	//my trick
 	angle = Math.acos(camUnitVector.dot(marker.unitVector)) * 180 / 3.14;
 	sameSide = (angle < 90);
@@ -384,7 +339,4 @@
 	}
     }
-    
-    
     renderer.render( scene, camera );
-    
-}
+}
Index: /main/trunk/greenstone3/web/interfaces/default/style/core.css
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/style/core.css	(revision 26882)
+++ /main/trunk/greenstone3/web/interfaces/default/style/core.css	(revision 26883)
@@ -817,7 +817,8 @@
 
 .pano_canvas_fullscreen{
-	margin:0px auto;
-	width:1280px;
-	height:720px;
+	margin-left:0px auto;
+	margin-right:0px auto;
+	width:1024px;
+	height:768px;;
 }
 
Index: /main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl	(revision 26882)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl	(revision 26883)
@@ -157,7 +157,4 @@
 					<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">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/><xsl:text disable-output-escaping="yes">",</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))">
@@ -199,9 +196,13 @@
                 <gsf:metadata name="Latitude" hidden="true"/>
                 <gsf:metadata name="Longitude" hidden="true"/>
+                <gsf:metadata name="Image" 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>
+		<gsf:metadata name="ex.Angle" hidden="true"/>
+		<gsf:metadata name="Angle" hidden="true"/>
+        
+	</xsl:template>
 	
 	<xsl:template name="panoramaViewerFeatures">
Index: /main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl	(revision 26882)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl	(revision 26883)
@@ -569,4 +569,12 @@
 		<gsf:metadata name="Latitude" hidden="true"/>
 		<gsf:metadata name="Longitude" hidden="true"/>
+		<gsf:metadata name="Image" 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"/>
+		<gsf:metadata name="Angle" hidden="true"/>
+
+
 	</xsl:template>
 
