Index: /main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js	(revision 27128)
+++ /main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js	(revision 27129)
@@ -323,4 +323,24 @@
 	}
 	
+	var createFileAndTemplateSelectors = function(buttonDiv)
+	{
+		_templateSelector = $("<div>", {"id":"veTemplateSelector", "class":"ui-state-default ui-corner-all"});
+		_templateSelector.append($("<span>Templates: <span>"));
+		var templateSelectBox = $("<select>").append("<option>-- No templates --</option>");
+		templateSelectBox.change(function()
+		{
+			var selected = templateSelectBox.find(":selected");
+			var changeFunction = selected.data("changeFunction");
+			if(changeFunction)
+			{
+				changeFunction();
+			}
+		});
+		_templateSelector.append(templateSelectBox);
+		_fileSelector = $("<div>", {"id":"veFileSelector", "class":"ui-state-default ui-corner-all"});
+		buttonDiv.append(_fileSelector);
+		buttonDiv.append(_templateSelector);
+	}
+	
 	var createDebugDiv = function()
 	{
@@ -346,12 +366,6 @@
 		toolBarDiv.append(buttonDiv);
 		createButtonDiv(buttonDiv);
+		createFileAndTemplateSelectors(buttonDiv);
 		createXMLStatusBar(buttonDiv);
-		
-		_navArea = $("<div>", {"id":"veNavArea"});
-		_templateSelector = $("<div>", {"id":"veTemplateSelector"});
-		_fileSelector = $("<div>", {"id":"veFileSelector", "class":"ui-state-default ui-corner-all"});
-		_navArea.append(_fileSelector);
-		_navArea.append(_templateSelector);
-		_navArea.append("<div>", {style:"clear:both;"});
 		
 		//Populate the file selector
@@ -381,4 +395,9 @@
 			{
 				var selectedItem = selectBox.find(":selected");
+				
+				if(!selectedItem.data("fileItem"))
+				{
+					return;
+				}
 				
 				var getURL = gs.xsltParams.library_name + "?a=g&rt=r&s=GetTemplateListFromFile&s1.fileName=" + selectedItem.data("fileItem").path + "&s1.locationName=" + selectedItem.data("fileItem").location + "&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c;
@@ -392,4 +411,14 @@
 					
 					clearAll();
+					
+					_templateSelector.children("select").empty();
+					if(templateList.length == 0)
+					{
+						_templateSelector.children("select").append("<option>-- No templates --</option>");
+					}
+					else
+					{
+						_templateSelector.children("select").append("<option>-- Select a template --</option>");
+					}
 					
 					for(var i = 0; i < templateList.length; i++)
@@ -411,5 +440,5 @@
 						}
 						
-						var infoContainer = $("<div>", {"class":"gbTemplateContainer ui-state-default ui-corner-all"});
+						var infoContainer = $("<option>");
 						
 						_elements.push(infoContainer);
@@ -436,5 +465,5 @@
 						}
 						
-						_templateSelector.prepend(infoContainer);
+						_templateSelector.children("select").append(infoContainer);
 						
 						//resizeContainers();
@@ -560,5 +589,5 @@
 	var addMouseEventsToInfoContainer = function(infoContainer, fileName, location, nodename, namespace, name, match)
 	{
-		infoContainer.click(function()
+		infoContainer.data("changeFunction", function()
 		{
 			if(_selectedTemplate)
@@ -579,4 +608,5 @@
 			_greenbug.changeCurrentTemplate(location, fileName, nodename, namespace, name, match);
 		});
+		/*
 		infoContainer.mouseover(function()
 		{
@@ -589,4 +619,5 @@
 			$(this).removeClass("ui-state-active");
 		});
+		*/
 	}
 
@@ -670,5 +701,5 @@
 					}
 
-					var infoContainer = $("<div>", {"class":"gbTemplateContainer ui-state-default ui-corner-all"});
+					var infoContainer = $("<option>");
 
 					_elements.push(infoContainer);
@@ -696,5 +727,5 @@
 					}
 
-					_templateSelector.prepend(infoContainer);
+					_templateSelector.children("select").append(infoContainer);
 
 					//resizeContainers();
@@ -714,4 +745,6 @@
 			{
 				clearAll();
+				_templateSelector.children("select").empty();
+				_templateSelector.children("select").append("<option>-- Select a template --</option>");
 			}
 		});
@@ -723,4 +756,5 @@
 	}
 	
+	/*
 	var resizeContainers = function()
 	{
@@ -737,4 +771,5 @@
 		}
 	}
+	*/
 	
 	this.init = function()
Index: /main/trunk/greenstone3/web/interfaces/default/style/core.css
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/style/core.css	(revision 27128)
+++ /main/trunk/greenstone3/web/interfaces/default/style/core.css	(revision 27129)
@@ -918,11 +918,8 @@
 }
 
-#veNavArea{
-	width:100%;
-}
-
 #veTemplateSelector{
-	width:75%;
-	float:right;
+	float:left;
+	padding:0.5em;
+	margin:0 0.5em 0 0;
 }
 
@@ -930,4 +927,5 @@
 	float:left;
 	padding:0.5em;
+	margin:0 0.5em 0 0 ;
 }
 
