[mapguide-commits] r1063 - trunk/MgDev/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jan 19 14:08:41 EST 2007


Author: waltweltonlair
Date: 2007-01-19 14:08:41 -0500 (Fri, 19 Jan 2007)
New Revision: 1063

Modified:
   trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ
   trunk/MgDev/Web/src/viewerfiles/ajaxviewerabout.templ
   trunk/MgDev/Web/src/viewerfiles/arealayerdef.templ
   trunk/MgDev/Web/src/viewerfiles/arearule.templ
   trunk/MgDev/Web/src/viewerfiles/areatypestyle.templ
   trunk/MgDev/Web/src/viewerfiles/bufferreport.templ
   trunk/MgDev/Web/src/viewerfiles/bufferui.templ
   trunk/MgDev/Web/src/viewerfiles/colorpicker.templ
   trunk/MgDev/Web/src/viewerfiles/contextmenu.js
   trunk/MgDev/Web/src/viewerfiles/digitize.js
   trunk/MgDev/Web/src/viewerfiles/dwfmappane.templ
   trunk/MgDev/Web/src/viewerfiles/emaprelayer.html
   trunk/MgDev/Web/src/viewerfiles/errorpage.templ
   trunk/MgDev/Web/src/viewerfiles/formframe.templ
   trunk/MgDev/Web/src/viewerfiles/hashtable.js
   trunk/MgDev/Web/src/viewerfiles/initdwfctrl.js
   trunk/MgDev/Web/src/viewerfiles/layerdefinition.templ
   trunk/MgDev/Web/src/viewerfiles/legendctrl.templ
   trunk/MgDev/Web/src/viewerfiles/legendui.templ
   trunk/MgDev/Web/src/viewerfiles/legendupdate.templ
   trunk/MgDev/Web/src/viewerfiles/linelayerdef.templ
   trunk/MgDev/Web/src/viewerfiles/linerule.templ
   trunk/MgDev/Web/src/viewerfiles/linetypestyle.templ
   trunk/MgDev/Web/src/viewerfiles/mainframe.templ
   trunk/MgDev/Web/src/viewerfiles/marksymbol.templ
   trunk/MgDev/Web/src/viewerfiles/measureui.templ
   trunk/MgDev/Web/src/viewerfiles/numfmt.js
   trunk/MgDev/Web/src/viewerfiles/pngfix_map.js
   trunk/MgDev/Web/src/viewerfiles/pointrule.templ
   trunk/MgDev/Web/src/viewerfiles/pointtypestyle.templ
   trunk/MgDev/Web/src/viewerfiles/printablepage.templ
   trunk/MgDev/Web/src/viewerfiles/printablepageui.templ
   trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ
   trunk/MgDev/Web/src/viewerfiles/sarissa.js
   trunk/MgDev/Web/src/viewerfiles/scalerange.templ
   trunk/MgDev/Web/src/viewerfiles/search.templ
   trunk/MgDev/Web/src/viewerfiles/searchprompt.templ
   trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ
   trunk/MgDev/Web/src/viewerfiles/statusbar.templ
   trunk/MgDev/Web/src/viewerfiles/taskbar.templ
   trunk/MgDev/Web/src/viewerfiles/taskframe.templ
   trunk/MgDev/Web/src/viewerfiles/tasklist.templ
   trunk/MgDev/Web/src/viewerfiles/textsymbol.templ
   trunk/MgDev/Web/src/viewerfiles/toolbar.templ
   trunk/MgDev/Web/src/viewerfiles/viewer.css
   trunk/MgDev/Web/src/viewerfiles/viewoptions.templ
   trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js
Log:
I noticed yesterday that many of our .templ files were missing closing tags at the end.
There were numerous cases of unmatched instances of <html>, <body>, or <head>.  I went
through the files and fixed these.

I also noticed some problems with initdwfctrl.js
- it was incorrectly setting the ViewerParam PARAM and not ViewerParams
- it had a missing </object> closing tag

Finally, I did some cleanup of all of the .templ and .js files.  I mainly fixed line
spacing / indentation to be consistent for all of the files.  The code is now more
readable.


Modified: trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/ajaxmappane.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,8 +1,8 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     div.PopupMenu
     {
         position: absolute;
@@ -165,24 +165,28 @@
         font-size: __#@fontsize#__;
         font-weight: normal;
     }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language="javascript" src="../viewerfiles/contextmenu.js"></script>
-    <script type="text/javascript" src="../viewerfiles/wz_jsgraphics.js"></script>
-    <script type="text/javascript" src="../viewerfiles/hashtable.js"></script>
-    <script type="text/javascript" src="../viewerfiles/sarissa.js"></script>
-    <script type="text/javascript" src="../viewerfiles/digitize.js"></script>
-    <script language=javascript>
+</style>
+
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language="javascript" src="../viewerfiles/contextmenu.js"></script>
+<script type="text/javascript" src="../viewerfiles/wz_jsgraphics.js"></script>
+<script type="text/javascript" src="../viewerfiles/hashtable.js"></script>
+<script type="text/javascript" src="../viewerfiles/sarissa.js"></script>
+<script type="text/javascript" src="../viewerfiles/digitize.js"></script>
+<script language=javascript>
+
 function SelLayer(className)
 {
     this.className = className;
     this.featIds = new Hashtable();
 }
+
 function Selection()
 {
     this.layers = new Hashtable();
     this.count = 0;
 }
+
 function Envelope()
 {
     this.lowerLeft = new Point(0,0);
@@ -201,11 +205,13 @@
     this.xs = new Array();
     this.ys = new Array();
 }
+
 function MapRequest(reqObj, mapId)
 {
     this.reqObj = reqObj;
     this.mapId = mapId;
 }
+
 function HlRequest(id, x, y, req, exec)
 {
     this.id = id;
@@ -213,11 +219,13 @@
     this.y = y;
     this.req = req;
     this.exec = exec;
-    this.OnHl = function() {
+    this.OnHl = function()
+    {
         if(req.readyState == 4)
             ProcessHyperLinkdata(id, x, y, exec, req.responseXML.documentElement);
     }
 }
+
 function HlData()
 {
     this.reqId = 0;
@@ -226,12 +234,16 @@
     this.url = "";
     this.ttip = "";
 }
-function Property(name, value) {
+
+function Property(name, value)
+{
     this.name = name;
     this.value = value;
 }
 </script>
-<script language=javascript>
+
+<script language="javascript">
+
 var NONE=0, RESIZING=1, RESIZINGLEGEND=2, DRAGGING=3, PANNING=4, DRAGGINGCTRL=5;
 var RECT=1, CIRCLE=2, POLY=3, SLIDER=4, SCALE=6;
 var TILECX = 300, TILECY = 300;
@@ -313,26 +325,39 @@
 
 // public functions -----------------------------------------------
 //
-function ZoomToView(x,y,scale,refresh) {
+function ZoomToView(x,y,scale,refresh)
+{
     GotoView(x, y, scale, true, true);
 }
-function Refresh() {
+
+function Refresh()
+{
     GetLegendCtrl().Refresh();
     GotoView(extX1 + (extX2 - extX1) / 2, extY2 + (extY1 - extY2) / 2, curScale, false, false);
 }
-function GetMapWidth() {
+
+function GetMapWidth()
+{
     return extX2 - extX1;
 }
-function GetMapHeight() {
+
+function GetMapHeight()
+{
     return extY1 - extY2;
 }
-function GetSessionId() {
+
+function GetSessionId()
+{
     return sessionId;
 }
-function GetMapName() {
+
+function GetMapName()
+{
     return mapName;
 }
-function ScreenToMapUnits(x, y) {
+
+function ScreenToMapUnits(x, y)
+{
     if(x > mapDevW - 1) x = mapDevW - 1;
     else if(x < 0) x = 0;
 
@@ -343,93 +368,133 @@
     y = extY1 - (extY1 - extY2) * (y / mapDevH);
     return new Point(x, y);
 }
-function MapUnitsToLatLon(x, y) {
+
+function MapUnitsToLatLon(x, y)
+{
     return new Point(x, y);
 }
-function GetSelectedCount() {
+
+function GetSelectedCount()
+{
     return selection.count;
 }
-function GetSelectionXML() {
+
+function GetSelectionXML()
+{
     return selectionToXml();
 }
-function SetSelectionXML(xmlSet) {
+
+function SetSelectionXML(xmlSet)
+{
     xmlOut = SetSelection(xmlSet, true);
     xmlDoc = (new DOMParser()).parseFromString(xmlSet, "text/xml");
     ProcessFeatureInfo(xmlDoc.documentElement, false, 1);
     ProcessFeatureInfo(xmlOut, false, 2);
 }
-function IsEnglishUnits() {
+
+function IsEnglishUnits()
+{
     return us;
 }
-function IsLatLongDisplayUnits() {
+
+function IsLatLongDisplayUnits()
+{
     return false;
 }
-function SetEnglishUnits(isEnglish) {
+
+function SetEnglishUnits(isEnglish)
+{
     if(isEnglish != us)
     {
         us = isEnglish;
         SaveState();
     }
 }
-function SetLatLonDisplayUnits(isLatLon) {
+
+function SetLatLonDisplayUnits(isLatLon)
+{
 }
-function GetMapUnitsType() {
+
+function GetMapUnitsType()
+{
     return unitsType;
 }
-function GetMetersPerUnits() {
+
+function GetMetersPerUnits()
+{
     return metersPerUnit;
 }
-function GetCenter() {
+
+function GetCenter()
+{
     return new Point(extX1 + (extX2 - extX1) / 2, extY2 + (extY1 - extY2) / 2);
 }
-function GetScale() {
+
+function GetScale()
+{
     return curScale;
 }
-function DigitizePoint(handler) {
+
+function DigitizePoint(handler)
+{
     if(handler == null)
         return;
     StartDigitizing(new PointDigitizer(OnShapeDigitized, ScreenToMapUnits), handler);
 }
-function DigitizeLine(handler) {
+
+function DigitizeLine(handler)
+{
     if(handler == null)
         return;
     StartDigitizing(new LineDigitizer(OnShapeDigitized, ScreenToMapUnits, cancelTgt, shape, "shapeFeedback", "#000000", mapPosX, mapDevW, mapDevH), handler);
 }
-function DigitizeCircle(handler) {
+
+function DigitizeCircle(handler)
+{
     if(handler == null)
         return;
     StartDigitizing(new CircleDigitizer(OnShapeDigitized, ScreenToMapUnits, cancelTgt, shape, "shapeFeedback", "#000000", mapPosX, mapDevW, mapDevH), handler);
 }
-function DigitizeRectangle(handler) {
+
+function DigitizeRectangle(handler)
+{
     if(handler == null)
         return;
     StartDigitizing(new RectangleDigitizer(OnShapeDigitized, ScreenToMapUnits, cancelTgt, shape, "shapeFeedback", "#000000", mapPosX, mapDevW, mapDevH), handler);
 }
-function DigitizeLineString(handler) {
+
+function DigitizeLineString(handler)
+{
     if(handler == null)
         return;
     StartDigitizing(new LineStringDigitizer(OnShapeDigitized, ScreenToMapUnits, cancelTgt, shape, "shapeFeedback", "#000000", mapPosX, mapDevW, mapDevH, ShowSelectionTip, selTtipText, false), handler);
 }
-function DigitizePolygon(handler) {
+
+function DigitizePolygon(handler)
+{
     if(handler == null)
         return;
     StartDigitizing(new LineStringDigitizer(OnShapeDigitized, ScreenToMapUnits, cancelTgt, shape, "shapeFeedback", "#000000", mapPosX, mapDevW, mapDevH, ShowSelectionTip, selTtipText, true), handler);
 }
-function IsDigitizing() {
+
+function IsDigitizing()
+{
     return digitizing;
 }
 
 // private functions -----------------------------------------------
 //
-function InitDocument() {
+function InitDocument()
+{
     if(!msie)
         document.getElementById("InfoDiv").style.display = "block";
 
-    if((orgExtX1 - orgExtX2) == 0 || (orgExtY1 - orgExtY2) == 0) {
-        extX1 = orgExtX1 = -.1; extY1 = orgExtY1 = .1, 
+    if((orgExtX1 - orgExtX2) == 0 || (orgExtY1 - orgExtY2) == 0)
+    {
+        extX1 = orgExtX1 = -.1; extY1 = orgExtY1 = .1,
         extX2 = orgExtX2 = .1; extY2 = orgExtY2 = -.1;
-    }        
-        
+    }
+
     mapDataRequest = null;
     pancxu = orgExtX1 + (orgExtX2 - orgExtX1) / 2;
     pancyu = orgExtY2 + (orgExtY1 - orgExtY2) / 2;
@@ -443,22 +508,29 @@
 
     document.getElementById("LegendResizer").onmousedown = StartResizingLegend;
     window.onresize = OnSizeChanged;
-    
+
     document.getElementById("map").style.backgroundColor = bgColor;
     mapCell = document.getElementById("map");
 
     hlData = new HlData();
     moveTimer = 0;
-    
+
     cancelTgt = document.getElementById("KeyTarget");
-    
+
     initTimer = setInterval(delayedInit, 200);
 }
-function delayedInit() {
-    try {
+
+function delayedInit()
+{
+    try
+    {
         if(!GetLegendCtrl().InternalStateComplete())
             return;
-    } catch(e) { return; }
+    }
+    catch(e)
+    {
+        return;
+    }
 
     clearInterval(initTimer);
 
@@ -475,7 +547,8 @@
 
     shape = new jsGraphics("shapeFeedback");
 
-    if(!hasTiles) {
+    if(!hasTiles)
+    {
         if(scales.length == 0)
         {
             finscale = false;
@@ -493,7 +566,8 @@
             scales.reverse();
         }
     }
-    else {
+    else
+    {
         if(scales.length == 1)
             showSlider = false;
     }
@@ -510,27 +584,33 @@
     mapInit = true;
 
     parent.OnMapLoaded();
-    if(!parent.IsInitialView()) {
+    if(!parent.IsInitialView())
+    {
         scale = CalculateScale1(Math.abs(orgExtX2 - orgExtX1), Math.abs(orgExtY2 - orgExtY1), mapDevW, mapDevH);
         GotoView(orgExtX1 + (orgExtX2 - orgExtX1) / 2, orgExtY2 + (orgExtY1 - orgExtY2) / 2, scale, true, true);
     }
-    
 }
-function BuildGroupInfo() {
+
+function BuildGroupInfo()
+{
     if(!hasTiles)
         return;
     visGroups = GetLegendCtrl().GetBaseGroups(true);
     for(var i=0; i < visGroups.length; i++)
         visBaseGroups.setItem(visGroups[i], i);
 }
-function GotoView(x,y,scale,tohistory,moveovimg) {
+
+function GotoView(x,y,scale,tohistory,moveovimg)
+{
     scale = finscale? GetNearestFiniteScale(scale): NormalizeScale(scale);
     var zoom;
-    if(zoom = (scale != curScale)) {
+    if(zoom = (scale != curScale))
+    {
         HideMapImage();
         requestTiles = true;
     }
-    else {
+    else
+    {
         prevtilex = tilex, prevtiley = tiley;
 
         udiffx = x - pancxu; udiffy = y - pancyu;
@@ -538,7 +618,8 @@
         panX2 = panX1 + (extX2 - extX1); panY2 = panY1 - (extY1 - extY2);
         pancxu = x; pancyu = y;
 
-        if(moveovimg) {
+        if(moveovimg)
+        {
             diffx = parseInt(udiffx * metersPerUnit / curScale / metersPerPixel);
             diffy = parseInt(udiffy * metersPerUnit / curScale / metersPerPixel);
             MoveOverlayImage(-diffx, diffy);
@@ -551,7 +632,9 @@
     if(!zoom)
         UpdateTilesAfterPan(prevtilex, prevtiley, panX1, panY1, panX2, panY2);
 }
-function ExecuteMapAction(action) {
+
+function ExecuteMapAction(action)
+{
     if(!mapInit)
         return;
     CancelDigitization();
@@ -618,31 +701,31 @@
             break;
     }
 }
-function OnClick(e) {
+
+function OnClick(e)
+{
     if(msie)
         return true;
     button = e.which;
     if(button==3)
     {
-    
         x = e.clientX;
         y = e.clientY;
         if(IsInformationMenu(e))
-        {
             InformationContextMenu(x,y);
-        }
         else
         {
-            if(parent.IsContextMenu()) {
+            if(parent.IsContextMenu())
                 ContextMenu(x, y);
-            }
         }
         e.stopPropagation();
         return false;
     }
     return true;
 }
-function OnMouseDown(e) {
+
+function OnMouseDown(e)
+{
     if(!PopupMouseDown(e))
     {
         hidePopup(tbMenu);
@@ -652,16 +735,14 @@
     }
     else
         return false;
-        
+
     if(!mapInit)
         return false;
-        
+
     if(msie)
     {
         if(e.button != 1)
-        {
             return true;
-        }
     }
     else
     {
@@ -678,22 +759,29 @@
     var x = e.clientX - mapPosX;
     var y = e.clientY;
 
-    if(x < 0) {
-        if(safari && x > -5) {
+    if(x < 0)
+    {
+        if(safari && x > -5)
+        {
             moveType = RESIZING;
             return false;
         }
         return false;
     }
-    
-    if(digitizing) {
+
+    if(digitizing)
+    {
         digitizer.MouseDown(e, x, y);
         return false;
     }
 
     var processed = parent.ClickMap(x,y);
 
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
+
     if(!processed)
     {
         HideHyperlinkTip();
@@ -701,12 +789,14 @@
         {
             if(hlData.url != "")
                 ExecuteHyperlink(hlData.url);
-            else {
+            else
+            {
                 hlData.curx = x; hlData.cury = y;
                 RequestHyperLinkData(++ hlData.reqId, hlData.curx, hlData.cury, true);
             }
         }
-        else {
+        else
+        {
             switch(tool)
             {
                 case 1:
@@ -720,7 +810,7 @@
                     StartToolFeedback(x, y, RECT);
                     break;
                 case 4:
-                    StartPaning(e);
+                    StartPanning(e);
                     break;
                 case 5:
                     StartToolFeedback(x, y, CIRCLE);
@@ -739,9 +829,7 @@
                         }
                     }
                     else
-                    {
                         EndPolygonSelection(x, y);
-                    }
 
                     break;
             }
@@ -749,21 +837,24 @@
     }
     return false;
 }
-function EndPolygonSelection(x, y) {
+
+function EndPolygonSelection(x, y)
+{
     EndToolFeedback(x, y);
     ExecutePolygonTool();
 }
-function OnContextMenu(e) {
+
+function OnContextMenu(e)
+{
     x = e.clientX;
     y = e.clientY;
 
     if(IsInformationMenu(event))
-    {
         InformationContextMenu(x,y);
-    }
     else
     {
-        if(safari && tool == 6) {
+        if(safari && tool == 6)
+        {
             EndPolygonSelection(x - mapPosX, y);
             return false;
         }
@@ -773,12 +864,16 @@
     e.cancelBubble = true;
     return false;
 }
-function ContextMenu(x, y) {
+
+function ContextMenu(x, y)
+{
     hidePopup(tbMenu);
     hidePopup(infoMenu);
     showPopup(ctxMenu, true, x, y);
 }
-function InformationContextMenu(x, y) {
+
+function InformationContextMenu(x, y)
+{
     hidePopup(tbMenu);
     hidePopup(ctxMenu);
     infoMenu = new MenuData("InfoMenu", 20, 21, 50, 100, "", "", "", "", this, false, "white");
@@ -788,7 +883,9 @@
     endBuildMenuContent(infoMenu);
     showPopup(infoMenu, false, x, y);
 }
-function ExecuteCommand(option) {
+
+function ExecuteCommand(option)
+{
     lop = isLegend || isProperties;
     if(option == "0")
         isLegend = !isLegend;
@@ -814,7 +911,9 @@
     }
     LayoutControls();
 }
-function IsInformationMenu(e) {
+
+function IsInformationMenu(e)
+{
     var tgt = msie? e.srcElement: e.target;
 
     while(tgt && tgt.tagName != "BODY")
@@ -825,7 +924,9 @@
     }
     return false;
 }
-function InitToolbarFlyouts(items) {
+
+function InitToolbarFlyouts(items)
+{
     var divs = "";
     for(var i = 0; i < items.length; i++)
     {
@@ -838,7 +939,9 @@
     }
     return divs;
 }
-function BuildContextMenuObjects(menus, parentMenu, items, divName, nesting) {
+
+function BuildContextMenuObjects(menus, parentMenu, items, divName, nesting)
+{
     var menuObj = new MenuData(divName,20, 21, 50, 150, "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif", parent, false, "white");
     startBuildMenuContent(menuObj);
     var subIndex = 0;
@@ -864,7 +967,9 @@
     menus[menus.length] = menuObj;
     return menuObj;
 }
-function InitContextMenu(items) {
+
+function InitContextMenu(items)
+{
     var menus = new Array();
     ctxMenu = BuildContextMenuObjects(menus, null, items, 'CtxMenu', 0);
 
@@ -875,10 +980,11 @@
         divs += "<iframe id=\"IFr" + menu.menuName + "\" style=\"position:absolute;top:0px;left:0px;width:0px;height:0px;background-color:white;\" frameborder=\"0\"></iframe>\n";
         divs += "<div class=\"PopupMenu\" id=\"" + menu.menuName + "\"></div>\n";
     }
-
     return divs;
 }
-function OpenFlyout(xpos, tbItemIndex) {
+
+function OpenFlyout(xpos, tbItemIndex)
+{
     var tbItem = parent.toolbarItems[tbItemIndex];
     tbMenu = new MenuData(tbItem.htmlElt, 20, 21, 50, 150,
                         "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif",
@@ -901,31 +1007,45 @@
     endBuildMenuContent(tbMenu);
     showPopup(tbMenu, false, xpos, 0);
 }
-function OnForwardMouseDown(e) {
+
+function OnForwardMouseDown(e)
+{
     hidePopup(tbMenu);
     hidePopup(infoMenu);
     hidePopup(ctxMenu);
     GetLegendCtrl().OnForwardMouseDown(e);
 }
-function Print(layouts, title) {
+
+function Print(layouts, title)
+{
 }
-function PrepareSelectionSet() {
+
+function PrepareSelectionSet()
+{
 }
-function StartResizing(e) {
+
+function StartResizing(e)
+{
     moveType = RESIZING;
     if(msie)
         document.getElementById("mapSpace").setCapture();
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
     return false;
 }
-function OnMouseMove(e) {
+
+function OnMouseMove(e)
+{
     var x = e.clientX - mapPosX;
     var y = e.clientY;
     lastposx = x; lastposy = y;
 
     try { parent.OnCursorPosChanged(x, y); } catch(e) {}
-    
-    if(digitizing) {
+
+    if(digitizing)
+    {
         digitizer.MouseMove(e, x, y);
         return false;
     }
@@ -944,20 +1064,22 @@
     {
         if(mapInit)
         {
-            if(moveTimer > 0) {
+            if(moveTimer > 0)
+            {
                 clearInterval(moveTimer);
                 moveTimer = 0;
             }
             HideHyperlinkTip();
             hlData.ttip = "";
             hlData.url = "";
-            if(!IsInSliderSpace(x, y, true)) {
+            if(!IsInSliderSpace(x, y, true))
+            {
                 if(!parent.InMeasure())
                 {
-                    if(safari) {
+                    if(safari)
                         document.getElementById("tbMap").style.cursor = (x < 0 && x > -6? "w-resize" : "arrow");
-                    }
-                    if(x >= 0) {
+                    if(x >= 0)
+                    {
                         hlData.curx = x;
                         hlData.cury = y;
                         moveTimer = setInterval(OnMoveTimer, 400);
@@ -968,17 +1090,25 @@
     }
     return false;
 }
-function OnMoveTimer() {
+
+function OnMoveTimer()
+{
     clearInterval(moveTimer);
     moveTimer = 0;
     RequestHyperLinkData(++ hlData.reqId, hlData.curx, hlData.cury, false);
 }
-function OnMouseUp(e) {
+
+function OnMouseUp(e)
+{
     var x = e.clientX - mapPosX;
     var y = e.clientY;
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
-    
-    if(digitizing) {
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
+
+    if(digitizing)
+    {
         digitizer.MouseUp(e, x, y);
         return false;
     }
@@ -996,7 +1126,7 @@
     else if(moveType == RESIZINGLEGEND)
         EndResizingLegend(e);
     else if(moveType == PANNING)
-        EndPaning(e);
+        EndPanning(e);
     else if(moveType == DRAGGING)
     {
         if(dragElt != POLY)
@@ -1011,7 +1141,9 @@
     else if(moveType == DRAGGINGCTRL)
         ReleaseMapControls(e);
 }
-function ResizeTo(x) {
+
+function ResizeTo(x)
+{
     if(x < 0)
         x = 0;
     if((isLegend || isProperties) && x < minInfoWidth)
@@ -1042,7 +1174,9 @@
 
     ResizeMapSpace();
 }
-function ShowChildren(elt, state) {
+
+function ShowChildren(elt, state)
+{
     nodes = elt.childNodes;
     if(nodes)
         for(var i=0; i < nodes.length; i++)
@@ -1053,7 +1187,9 @@
         else
             elt.style.visibility = state;
 }
-function MoveMapControl(eltId, offsx, x, y) {
+
+function MoveMapControl(eltId, offsx, x, y)
+{
     if(!showSlider)
         return;
     var es = document.getElementById(eltId).style;
@@ -1061,7 +1197,9 @@
     es.top = y;
     es.visibility = "visible";
 }
-function DragMapControls(e, page) {
+
+function DragMapControls(e, page)
+{
     switch(dragElt)
     {
         case SLIDER:
@@ -1072,7 +1210,9 @@
             break;
     }
 }
-function ReleaseMapControls(e) {
+
+function ReleaseMapControls(e)
+{
     moveType = NONE;
     switch(dragElt)
     {
@@ -1085,7 +1225,9 @@
     }
     dragElt = NONE;
 }
-function DragSlider(y) {
+
+function DragSlider(y)
+{
     sliderPos = CalcSliderPos(y);
     document.getElementById("slider").style.top = sliderPos;
     scale = scales[ScaleIndexFromSliderPos(sliderPos)];
@@ -1111,7 +1253,9 @@
     ShowScaleTip(sliderx + mapPosX, sliderPos, scale);
     return false;
 }
-function DragSliderScale(e, page) {
+
+function DragSliderScale(e, page)
+{
     if(page)
         d = mapPosX;
     else
@@ -1128,7 +1272,9 @@
     MoveMapControl("sliderscale", mapPosX, sscalex + offsX, sscaley + offsY);
     MoveMapControl("slider", mapPosX, sliderx + offsX, slidery + offsY);
 }
-function ReleaseSlider(y) {
+
+function ReleaseSlider(y)
+{
     HideScaleTip();
     slidery = CalcSliderPos(y);
     document.getElementById("slider").style.top = slidery;
@@ -1136,12 +1282,16 @@
     HideMapImage();
     GotoView(extX1 + (extX2 - extX1) / 2, extY2 + (extY1 - extY2) / 2, scale, true, true);
 }
-function ScaleIndexFromSliderPos(pos) {
+
+function ScaleIndexFromSliderPos(pos)
+{
     sp = pos - sscaley - slidertop;
     index = parseInt(sp / slidercourse * (scales.length - 1));
     return index;
 }
-function ReleaseSliderScale(e) {
+
+function ReleaseSliderScale(e)
+{
     x = e.clientX;
     if(x < mapPosX + inctrlX)
         x = mapPosX + inctrlX;
@@ -1157,7 +1307,9 @@
     MoveMapControl("sliderscale", mapPosX, sscalex, sscaley);
     MoveMapControl("slider", mapPosX, sliderx, slidery);
 }
-function CalcSliderPos(y) {
+
+function CalcSliderPos(y)
+{
     offs = y - anchorY;
     newPos = slidery + offs;
     if(newPos < sscaley + slidertop)
@@ -1166,28 +1318,28 @@
         newPos = sscaley + slidertop + slidercourse;
     return newPos;
 }
-function IsInSliderSpace(x, y, utilsp) {
+
+function IsInSliderSpace(x, y, utilsp)
+{
     if(utilsp)
         return ((x >= sscalex + 6) && (x <= sscalex + 51 - 6) &&
                 (y >= sscaley + 5) && (y <= sscaley + 204 - 8));
-    else 
+    else
         return (x >= sscalex) && (x <= sscalex + 51) && (y >= sscaley) && (y <= sscaley + 204);
 }
-function LayoutControls() {
+
+function LayoutControls()
+{
     var legendCaption = document.getElementById("LayerCaption");
     var y = 0;
     if(isLegend)
     {
         if(infoWidth >= minInfoWidth)
-        {
             legendCaption.style.display = "block";
-        }
         y += 25;
     }
     else
-    {
         legendCaption.style.display = "none";
-    }
 
     var legendCtrlDiv = document.getElementById("LegendCtrlDiv");
     var legendCtrl = document.getElementById("LegendCtrl");
@@ -1244,17 +1396,23 @@
         propCtrlDiv.style.visibility = "hidden";
     }
 }
-function ToggleLegend() {
+
+function ToggleLegend()
+{
     legendExpanded = !legendExpanded;
     document.getElementById("legendIcon").src = legendExpanded? "../stdicons/nav_band_contract.gif": "../stdicons/nav_band_expand.gif";
     LayoutControls();
 }
-function ToggleProperties() {
+
+function ToggleProperties()
+{
     propExpanded = !propExpanded;
     document.getElementById("propIcon").src = propExpanded? "../stdicons/nav_band_contract.gif": "../stdicons/nav_band_expand.gif";
     LayoutControls();
 }
-function OnSizeChanged(e) {
+
+function OnSizeChanged(e)
+{
     ResizeMapSpace();
     LayoutControls();
 
@@ -1263,11 +1421,12 @@
     resizeTimer = setInterval(RequestMapAfterResizing, resizeTimeout);
 }
 
-function ResizeMapSpace() {
+function ResizeMapSpace()
+{
     vw = document.body.clientWidth;
     mapDevW = vw - mapPosX - 1;
     mapDevH = safari? document.body.offsetHeight: mapCell.offsetHeight;
-    
+
     if(mapDevW < 0) mapDevW = 0;
     if(mapDevH < 0) mapDevH = 0;
 
@@ -1291,17 +1450,19 @@
         imgs[i].width = mapDevW;
         imgs[i].height = mapDevH;
     }
-    
+
     slidoffs = slidery - sscaley;
     sscalex = mapDevW - 51, sscaley = 1;
     sliderx = sscalex + 10, slidery = sscaley + slidoffs;
-    
+
     MoveMapControl("sliderscale", mapPosX, sscalex, sscaley);
     MoveMapControl("slider", mapPosX, sliderx, slidery);
 
     LayoutControls();
 }
-function RequestMapAfterResizing() {
+
+function RequestMapAfterResizing()
+{
     clearInterval(resizeTimer);
     resizeTimer = 0;
 
@@ -1309,32 +1470,41 @@
     GotoView(extX1 + (extX2 - extX1) / 2, extY2 + (extY1 - extY2) / 2, curScale, false, true);
     requestTiles = true;
 }
-function GetWebAgent() {
+
+function GetWebAgent()
+{
     return webAgent;
 }
-function GetLegendCtrl() {
+
+function GetLegendCtrl()
+{
     return legendCtrl;
 }
-function GetPropertyCtrl() {
+
+function GetPropertyCtrl()
+{
     return propertyCtrl;
 }
-function CalculateScale() {
+
+function CalculateScale()
+{
     var mcsW = extX2 - extX1;
     var mcsH = extY1 - extY2;
-
     return CalculateScale1(mcsW, mcsH, mapDevW, mapDevH);
 }
-function CalculateScale1(mcsW, mcsH, devW, devH) {
+
+function CalculateScale1(mcsW, mcsH, devW, devH)
+{
     var mapScale;
-
     if (devH * mcsW > devW * mcsH)
         mapScale = mcsW * metersPerUnit / (devW * metersPerPixel); // width-limited
     else
         mapScale = mcsH * metersPerUnit / (devH * metersPerPixel); // height-limited
-
     return mapScale;
 }
-function OnMapRequested(reqResp, scale, centerX, centerY) {
+
+function OnMapRequested(reqResp, scale, centerX, centerY)
+{
     requestObj = reqResp.reqObj;
     reqId = reqResp.mapId;
     if(requestObj == null)
@@ -1375,7 +1545,9 @@
     else
         RequestFailed("No response");
 }
-function RequestMap(scale, centerX, centerY, showGroups, hideGroups, showLayers, hideLayers) {
+
+function RequestMap(scale, centerX, centerY, showGroups, hideGroups, showLayers, hideLayers)
+{
     var reqParams = "OPERATION=GETVISIBLEMAPEXTENT&VERSION=1.0.0&SESSION=" + sessionId + "&MAPNAME=" + encodeURIComponent(mapName) + "&SEQ=" + Math.random();
     reqParams += "&SETDISPLAYDPI=" + DPI + "&SETDISPLAYWIDTH=" + mapDevW + "&SETDISPLAYHEIGHT=" + mapDevH;
     reqParams += "&SETVIEWSCALE=" + scale + "&SETVIEWCENTERX=" + centerX + "&SETVIEWCENTERY=" + centerY;
@@ -1395,9 +1567,7 @@
     mr.onreadystatechange = function()
     {
         if(mr.readyState == 4)
-        {
             OnMapRequested(req, scale, centerX, centerY, mapId);
-        }
     }
 
     try
@@ -1409,40 +1579,52 @@
         return;
     }
 }
-function RequestMapImage(reqId) {
+
+function RequestMapImage(reqId)
+{
     url = webAgent + "?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FORMAT=PNG&VERSION=1.0.0&SESSION=" + sessionId + "&MAPNAME=" + encodeComponent(mapName) + "&SEQ=" + Math.random()
     document.getElementById("overlay").innerHTML =
             '<img class="mapImage" name="' + reqId + '" id="mapImage" src="' + url + '" width=' + mapDevW + ' height=' + mapDevH + ' border=0 vspace=0 hspace=0 style="visibility: hidden; width: ' + mapDevW + 'px; height: ' + mapDevH + 'px;" onload="return OnMapOverlayImageLoaded(event)">';
 }
-function encodeComponent(str) {
-    op = /\(/g; cp = /\)/g; 
+
+function encodeComponent(str)
+{
+    op = /\(/g; cp = /\)/g;
     return encodeURIComponent(str).replace(op, "%%28").replace(cp, "%%29");
 }
-function OnMapOverlayImageLoaded(e) {
+
+function OnMapOverlayImageLoaded(e)
+{
     ovimgloaded = true;
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
     overlayimg = document.getElementById("mapImage");
     if(safari)
         altimg = document.getElementById(curimg == "mapImage1"? "mapImage2": "mapImage1");
     else
         img = document.getElementById(curimg);
-    
+
     imgdiv = document.getElementById("img1");
 
-    if(parseInt(overlayimg.name) != mapId || moveType == PANNING) {
+    if(parseInt(overlayimg.name) != mapId || moveType == PANNING)
         return;
-    }
+
     lastMapRcv = mapId;
     overlayimg.onload = null;
     ovoffsx = 0; ovoffsy = 0;
     if(msie)
         imgdiv.innerHTML = "<div id=\"img1div\" style=\"visibility: visible; position: absolute; top: 0px; left: 0px; width: " + mapDevW + "px; height: " + mapDevH + "px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + encodeURI(overlayimg.src) + "', sizingMethod='scale')\"></div>";
-    else {
-        if(safari) {
+    else
+    {
+        if(safari)
+        {
             altimg.src = overlayimg.src;
             altimg.onload = OnAlternateImageLoaded;
         }
-        else {
+        else
+        {
             img.src = overlayimg.src;
             img.style.position = "absolute";
             img.style.visibility = "visible";
@@ -1457,7 +1639,9 @@
         curimg = (curimg == "mapImage1"? "mapImage2": "mapImage1");
     return false;
 }
-function OnAlternateImageLoaded() {
+
+function OnAlternateImageLoaded()
+{
     altimg = document.getElementById(curimg == "mapImage1"? "mapImage2": "mapImage1");
     img = document.getElementById(curimg);
 
@@ -1472,18 +1656,25 @@
     altimg.style.top = 0;
     return false;
 }
-function RequestFailed(text) {
+
+function RequestFailed(text)
+{
     //placeholder for debugging output
 }
-function DraggingShape(e) {
+
+function DraggingShape(e)
+{
     var x = e.pageX;
     var y = e.pageY;
 
     ToolFeedback(PageToMap(x), y);
     return false;
 }
-function ZoomIn(x, y) {
-    if(sci == 0) {
+
+function ZoomIn(x, y)
+{
+    if(sci == 0)
+    {
         if(finscale)
             return;
         scale /= 1.5;
@@ -1494,8 +1685,11 @@
     var pt = ScreenToMapUnits(x, y);
     GotoView(pt.X, pt.Y, scale, true, false);
 }
-function ZoomOut(x, y) {
-    if(sci == scales.length - 1) {
+
+function ZoomOut(x, y)
+{
+    if(sci == scales.length - 1)
+    {
         if(finscale)
             return false;
         scale *= 1.5;
@@ -1505,37 +1699,59 @@
     var pt = ScreenToMapUnits(x, y);
     GotoView(pt.X, pt.Y, scale, true, false);
 }
-function PanUp() {
+
+function PanUp()
+{
     Pan(extX1 + (extX2 - extX1) / 2, extY1 - (extY1 - extY2) / 3, true);
 }
-function PanLeft() {
+
+function PanLeft()
+{
     Pan(extX1 + (extX2 - extX1) / 3, extY2 + (extY1 - extY2) / 2, true);
 }
-function PanDown() {
+
+function PanDown()
+{
     Pan(extX1 + (extX2 - extX1) / 2, extY2 + (extY1 - extY2) / 3, true);
 }
-function PanRight() {
+
+function PanRight()
+{
     Pan(extX2 - (extX2 - extX1) / 3, extY2 + (extY1 - extY2) / 2, true);
 }
-function ZoomCloser(e) {
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
+
+function ZoomCloser(e)
+{
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
     if(sci == 0)
         return false;
     ZoomToScale(scales[sci - 1]);
     return false;
 }
-function ZoomFurther(e) {
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
+
+function ZoomFurther(e)
+{
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
     if(sci == scales.length - 1)
         return false;
     ZoomToScale(scales[sci + 1]);
     return false;
 }
-function ZoomToScale(scale) {
+
+function ZoomToScale(scale)
+{
     HideMapImage();
     GotoView(extX1 + (extX2 - extX1) / 2, extY2 + (extY1 - extY2) / 2, scale, true, true);
 }
-function StartToolFeedback(x, y, type) {
+
+function StartToolFeedback(x, y, type)
+{
     moveType = DRAGGING;
     if(msie)
         document.getElementById("mapSpace").setCapture();
@@ -1565,7 +1781,9 @@
         rd.clip = "rect(0px " + (mapDevW) + "px " + mapDevH + "px " + "0px)";
     }
 }
-function ToolFeedback(x, y) {
+
+function ToolFeedback(x, y)
+{
     if(x < 0)
         x  = 0;
     if(dragElt != POLY)
@@ -1581,7 +1799,9 @@
     }
     ShowToolFeedback(true);
 }
-function EndToolFeedback(x, y) {
+
+function EndToolFeedback(x, y)
+{
     moveType = NONE;
     if(msie)
         document.getElementById("mapSpace").releaseCapture();
@@ -1602,7 +1822,9 @@
     }
     ShowToolFeedback(false);
 }
-function StartPaning(e) {
+
+function StartPanning(e)
+{
     img = document.getElementById(msie? "img1div": curimg)
     if(!ovimgloaded || img == null)
         return;
@@ -1620,7 +1842,9 @@
     if(msie)
         document.getElementById("mapSpace").setCapture();
 }
-function MoveOverlayImage(x, y) {
+
+function MoveOverlayImage(x, y)
+{
     img = document.getElementById(msie? "img1div": curimg)
     if(img != null)
     {
@@ -1628,7 +1852,9 @@
         img.style.top = y + ovoffsy + "px";
     }
 }
-function PanFeedback(e) {
+
+function PanFeedback(e)
+{
     offx = e.clientX - mapPosX - anchorX;
     offy = e.clientY - anchorY;
 
@@ -1854,7 +2080,9 @@
         }
     }
 }
-function EndPaning(e) {
+
+function EndPanning(e)
+{
     moveType = NONE;
     if(msie)
         document.getElementById("mapSpace").releaseCapture();
@@ -1866,7 +2094,9 @@
 
     Pan(pancxu - (ptCur.X - ptAnchor.X), pancyu - (ptCur.Y - ptAnchor.Y), false);
 }
-function UpdateTilesAfterPan(prevtilex, prevtiley, nx1, ny1, nx2, ny2) {
+
+function UpdateTilesAfterPan(prevtilex, prevtiley, nx1, ny1, nx2, ny2)
+{
     if(!hasTiles)
         return;
     CalcTileMetrics(nx1, ny1, nx2, ny2);
@@ -1885,7 +2115,8 @@
     }
     if(addedColOrRow)
     {
-        for(var k=0; k < baseGroups.length; k++) {
+        for(var k=0; k < baseGroups.length; k++)
+        {
             var tbody = document.getElementById("gridbody" + k);
             for(var i = 0; i < GRIDCY; i++)
             {
@@ -1898,28 +2129,35 @@
         RequestVisibleTiles();
     }
 
-    for(var k=0; k < baseGroups.length; k++) {
+    for(var k=0; k < baseGroups.length; k++)
+    {
         gs = document.getElementById("tilegrid" + k).style;
         gs.position = "absolute";
         gs.left = gridOffsx;
         gs.top = gridOffsy;
     }
 }
-function AddColumns(count, left) {
-    for(var k=0; k < baseGroups.length; k++) {
+
+function AddColumns(count, left)
+{
+    for(var k=0; k < baseGroups.length; k++)
+    {
         var tbody = document.getElementById("gridbody" + k);
-        for(var i = 0; i < tbody.rows.length; i++) {
+        for(var i = 0; i < tbody.rows.length; i++)
+        {
             row = tbody.rows[i];
             if(left)
             {
-                for(var j=0; j < count; j++) {
+                for(var j=0; j < count; j++)
+                {
                     row.removeChild(row.childNodes[row.childNodes.length - 1]);
                     row.insertBefore(CreateEmptyCell(), row.childNodes[0]);
                 }
             }
             else
             {
-                for(var j=0; j < count; j++) {
+                for(var j=0; j < count; j++)
+                {
                     row.removeChild(row.childNodes[0]);
                     row.appendChild(CreateEmptyCell());
                 }
@@ -1927,12 +2165,16 @@
         }
     }
 }
-function AddRows(count, ttop) {
-    for(var k=0; k < baseGroups.length; k++) {
+
+function AddRows(count, ttop)
+{
+    for(var k=0; k < baseGroups.length; k++)
+    {
         var tbody = document.getElementById("gridbody" + k);
         if(ttop)
         {
-            for(var j=0; j < count; j++) {
+            for(var j=0; j < count; j++)
+            {
                 rows = tbody.rows;
                 tbody.removeChild(rows[rows.length - 1]);
                 tbody.insertBefore(CreateEmptyRow(), tbody.rows[0]);
@@ -1940,7 +2182,8 @@
         }
         else
         {
-            for(var j=0; j < count; j++) {
+            for(var j=0; j < count; j++)
+            {
                 rows = tbody.rows;
                 tbody.removeChild(rows[0]);
                 tbody.appendChild(CreateEmptyRow());
@@ -1948,14 +2191,18 @@
         }
     }
 }
-function CreateEmptyRow() {
+
+function CreateEmptyRow()
+{
     row = document.createElement("TR");
     row.style.height = TILECY + "px";
     for(var i=0; i < GRIDCX; i++)
         row.appendChild(CreateEmptyCell());
     return row;
 }
-function CreateEmptyCell() {
+
+function CreateEmptyCell()
+{
     cell = document.createElement("TD");
     cell.width = TILECX;
     cell.bgcolor = /*bgColor*/ "black";
@@ -1966,7 +2213,9 @@
     cell.appendChild(div);
     return cell;
 }
-function ShowToolFeedback(show) {
+
+function ShowToolFeedback(show)
+{
     switch(dragElt)
     {
     case RECT: ShowRectangle(show); break;
@@ -1974,7 +2223,9 @@
     case POLY: ShowPolygon(show); break;
     }
 }
-function ShowRectangle(show) {
+
+function ShowRectangle(show)
+{
     var rcFrame = document.getElementById("rcFrame");
     if(show)
     {
@@ -1983,19 +2234,24 @@
 
         if(rcx1 <= rcx2)
         {
-            x1 = rcx1; x2 = rcx2;
+            x1 = rcx1;
+            x2 = rcx2;
         }
         else
         {
-            x1 = rcx2; x2 = rcx1;
+            x1 = rcx2;
+            x2 = rcx1;
         }
+
         if(rcy1 <= rcy2)
         {
-            y1 = rcy1; y2 = rcy2;
+            y1 = rcy1;
+            y2 = rcy2;
         }
         else
         {
-            y1 = rcy2; y2 = rcy1;
+            y1 = rcy2;
+            y2 = rcy1;
         }
 
         rcFrame.style.position = "absolute";
@@ -2008,7 +2264,9 @@
     else
         rcFrame.style.visibility = "hidden";
 }
-function ShowCircle(show) {
+
+function ShowCircle(show)
+{
     var rcFrame = document.getElementById("shapeFeedback");
     if(show)
     {
@@ -2035,7 +2293,9 @@
         rcFrame.style.visibility = "hidden";
     }
 }
-function ShowPolygon(show) {
+
+function ShowPolygon(show)
+{
     var rcFrame = document.getElementById("shapeFeedback");
     if(show)
     {
@@ -2059,28 +2319,37 @@
         rcFrame.style.visibility = "hidden";
     }
 }
-function PageToMap(x) {
+
+function PageToMap(x)
+{
     return x - mapPosX;
 }
-function ExecuteRectangleTool() {
+
+function ExecuteRectangleTool()
+{
     var x1, x2;
     var y1, y2;
 
     if(rcx1 <= rcx2)
     {
-        x1 = rcx1; x2 = rcx2;
+        x1 = rcx1;
+        x2 = rcx2;
     }
     else
     {
-        x1 = rcx2; x2 = rcx1;
+        x1 = rcx2;
+        x2 = rcx1;
     }
+
     if(rcy1 <= rcy2)
     {
-        y1 = rcy1; y2 = rcy2;
+        y1 = rcy1;
+        y2 = rcy2;
     }
     else
     {
-        y1 = rcy2; y2 = rcy1;
+        y1 = rcy2;
+        y2 = rcy1;
     }
 
     if(tool == 3)
@@ -2116,7 +2385,9 @@
         }
     }
 }
-function ExecuteCircleTool() {
+
+function ExecuteCircleTool()
+{
     if(tool != 5)
         return;
 
@@ -2127,7 +2398,9 @@
 
     RequestCircleSelection(center.X, center.Y, r, appending);
 }
-function ExecutePolygonTool() {
+
+function ExecutePolygonTool()
+{
     cnum = polySel.xs.length;
     xs = new Array(cnum); ys = new Array(cnum);
     for(i = 0; i < cnum; i++) {
@@ -2139,31 +2412,46 @@
     polySel.xs = new Array();
     polySel.ys = new Array();
 }
-function Pan(centerX, centerY, moveimg) {
+
+function Pan(centerX, centerY, moveimg)
+{
     GotoView(centerX, centerY, curScale, true, moveimg);
 }
-function InitialMapView() {
+
+function InitialMapView()
+{
     var scale = CalculateScale1(orgExtX2 - orgExtX1, orgExtY1 - orgExtY2, mapDevW, mapDevH);
     GotoView(orgExtX1 + (orgExtX2 - orgExtX1) / 2, orgExtY2 + (orgExtY1 - orgExtY2) / 2, scale, true, true);
 }
-function CreateRequestHandler() {
+
+function CreateRequestHandler()
+{
     if(msie)
         return new ActiveXObject("Microsoft.XMLHTTP");
     else
         return new XMLHttpRequest();
 }
-function RequestPointSelection(x1, y1, x2, y2, append) {
+
+function RequestPointSelection(x1, y1, x2, y2, append)
+{
     QueryFeatureInfo(MakeWktPolygon(x1,y1,x2,y2), append, 1, 7);
 }
-function RequestRectSelection(x1, y1, x2, y2, append) {
+
+function RequestRectSelection(x1, y1, x2, y2, append)
+{
     QueryFeatureInfo(MakeWktPolygon(x1,y1,x2,y2), append, -1, 7);
 }
-function RequestCircleSelection(x, y, r, append) {
+
+function RequestCircleSelection(x, y, r, append)
+{
     QueryFeatureInfo("CURVEPOLYGON ((" + (x - r) + " " + y + " (CIRCULARARCSEGMENT (" + x + " " + (y - r) + ", " + (x + r) + " " + y + "), CIRCULARARCSEGMENT (" + x + " " + (y + r) + ", " + (x - r) + " " + y + "))))", append, 0, 7);
 }
-function RequestPolygonSelection(xs, ys, append) {
+
+function RequestPolygonSelection(xs, ys, append)
+{
     var wkt = "POLYGON((";
-    for(var i=0; i < xs.length; i++) {
+    for(var i=0; i < xs.length; i++)
+    {
         if(i > 0)
             wkt += ", ";
         wkt += xs[i] + " " + ys[i] + " ";
@@ -2171,10 +2459,14 @@
     wkt += "))";
     QueryFeatureInfo(wkt, append, 0, 7);
 }
-function MakeWktPolygon(x1,y1,x2,y2) {
+
+function MakeWktPolygon(x1,y1,x2,y2)
+{
     return "POLYGON((" + x1 + " " + y1 + ", " + x2 + " " + y1 + ", " + x2 + " " + y2 + ", " + x1 + " " + y2 + ", " + x1 + " " + y1 + "))";
 }
-function QueryFeatureInfo(geom, append, maxfeatures, which) {
+
+function QueryFeatureInfo(geom, append, maxfeatures, which)
+{
     var url = webAgent;
     var req = url + "?OPERATION=QUERYMAPFEATURES&VERSION=1.0.0&PERSIST=1&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SEQ=" + Math.random();
     req += "&LAYERNAMES=" + encodeURIComponent(GetVisSelLayers()) + "&GEOMETRY=" + geom + "&SELECTIONVARIANT=INTERSECTS";
@@ -2189,7 +2481,9 @@
     else
         RequestFailed("No response");
 }
-function CompareProperties(p1, p2) {
+
+function CompareProperties(p1, p2)
+{
     var n1 = p1.name;
     var n2 = p2.name;
     if(n1 < n2)
@@ -2198,7 +2492,9 @@
         return 1;
     return 0;
 }
-function ProcessFeatureInfo(xmlIn, append, which) {
+
+function ProcessFeatureInfo(xmlIn, append, which)
+{
     if(which & 1)
     {
         var selectionChanged = false;
@@ -2260,9 +2556,11 @@
         if(selectionChanged || prevCount != selection.count)
         {
             xmlSelection = null;
-            if(appending) {
+            if(appending)
+            {
                 fi = SetSelection(selectionToXml(), selection.count == 1);
-                if(selection.count == 1) {
+                if(selection.count == 1)
+                {
                     ProcessFeatureInfo(fi, false, 2);
                     which &= ~2;
                 }
@@ -2274,9 +2572,10 @@
     if(which & 2)
     {
         properties = new Array();
-        if(selection.count == 1) {
+        if(selection.count == 1)
+        {
             try
-            {                
+            {
                 var props = xmlIn.getElementsByTagName("Property");
                 if(props != null)
                 {
@@ -2288,8 +2587,7 @@
                     }
                 }
             }
-            catch(e) {
-            }
+            catch(e) {}
         }
         properties.sort(CompareProperties);
         GetPropertyCtrl().SetProperties(selection.count, properties);
@@ -2302,7 +2600,10 @@
             if(hlinkElt != null)
                 hlData.url = hlinkElt.childNodes[0].nodeValue;
         }
-        catch(e) { hlData.url = ""; }
+        catch(e)
+        {
+            hlData.url = "";
+        }
         try
         {
             var ttipElt = xmlIn.getElementsByTagName("Tooltip")[0];
@@ -2312,7 +2613,9 @@
         catch(e) {}
     }
 }
-function selectionToXml() {
+
+function selectionToXml()
+{
     if(xmlSelection == null)
     {
         xmlSelection = "";
@@ -2333,7 +2636,9 @@
     }
     return xmlSelection;
 }
-function ClearSelection() {
+
+function ClearSelection()
+{
     if(selection.length == 0)
         return;
 
@@ -2345,7 +2650,9 @@
 
     parent.OnSelectionChanged();
 }
-function SetSelection(selText, requery) {
+
+function SetSelection(selText, requery)
+{
     var reqParams = "SESSION=" + sessionId + "&MAPNAME=" + encodeURIComponent(mapName) + "&SEQ=" + Math.random() + "&SELECTION=" + encodeURIComponent(selText) + "&QUERYINFO=" + (requery? "1": "0");
     reqHandler = CreateRequestHandler();
     reqHandler.open("POST", setSelScript, false);
@@ -2354,7 +2661,9 @@
     if(requery)
         return reqHandler.responseXML;
 }
-function ZoomSelection() {
+
+function ZoomSelection()
+{
     if(selection.count == 0)
         return;
 
@@ -2375,14 +2684,14 @@
             var mcsH = env.upperRight.Y - env.lowerLeft.Y;
             var centerX = env.lowerLeft.X + mcsW / 2;
             var centerY = env.lowerLeft.Y + mcsH / 2;
-
             var scale = CalculateScale1(mcsW*2, mcsH*2, mapDevW, mapDevH);
-
             GotoView(centerX, centerY, scale, true, true);
         }
     }
 }
-function ParseEnvelope(xmlRoot) {
+
+function ParseEnvelope(xmlRoot)
+{
     try
     {
         if(xmlRoot.tagName != "Envelope")
@@ -2397,42 +2706,54 @@
         env.upperRight.Y = parseFloat(ys[1].childNodes[0].nodeValue);
         return env;
     }
-    catch(e)
-    {
-    }
+    catch(e) {}
     return null;
 }
-function AddView(view) {
+
+function AddView(view)
+{
     if(curView < views.length - 1)
         views.splice(curView + 1, views.length - curView - 1);
     views.push(view);
     curView ++;
 }
-function PreviousView() {
+
+function PreviousView()
+{
     if(curView <= 0)
         return;
     var view = views[-- curView];
     GotoView(view.cx, view.cy, view.scale, false, true);
 }
-function NextView() {
+
+function NextView()
+{
     if(curView >= views.length - 1)
         return;
     var view = views[++ curView];
     GotoView(view.cx, view.cy, view.scale, false, true);
 }
-function ShowGroupLayers(groupsShown, groupsHidden, layersShown, layersHidden) {
+
+function ShowGroupLayers(groupsShown, groupsHidden, layersShown, layersHidden)
+{
     ResetVisLayers();
     RequestMap(curScale, extX1 + (extX2 - extX1) / 2, extY2 + (extY1 - extY2) / 2, groupsShown, groupsHidden, layersShown, layersHidden);
 }
-function About() {
+
+function About()
+{
     var winAbout = window.open("%s?SESSION=" + sessionId + "&LOCALE=" + locale, "about", "width=700,height=440");
     if(winAbout != null)
         winAbout.focus();
 }
-function GetDPI() {
+
+function GetDPI()
+{
     return DPI;
 }
-function StartResizingLegend(e) {
+
+function StartResizingLegend(e)
+{
     if(moveType == RESIZINGLEGEND)
     {
         moveType = NONE;
@@ -2442,31 +2763,46 @@
     initLegendHeight = legendHeight;
     moveType = RESIZINGLEGEND;
     if(!msie)
-        if (e.stopPropagation) e.stopPropagation();
-    else {
+        if (e.stopPropagation)
+            e.stopPropagation();
+    else
+    {
         e.cancelBubble = true;
         document.getElementById("LegendResizer").setCapture();
     }
     return false;
 }
 
-function EndResizingLegend(e) {
+function EndResizingLegend(e)
+{
     moveType = NONE;
     if(msie)
         document.getElementById("LegendResizer").releaseCapture();
 }
-function ScaleSliding(e) {
-    if(mapInit) {
+
+function ScaleSliding(e)
+{
+    if(mapInit)
+    {
         moveType = DRAGGINGCTRL;
         dragElt = SLIDER;
         anchorY = e.screenY;
     }
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
     return false;
 }
-function OnPan(e, dir) {
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
-    switch(dir) {
+
+function OnPan(e, dir)
+{
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
+    switch(dir)
+    {
         case 0: PanUp(); break;
         case 1: PanRight(); break;
         case 2: PanDown(); break;
@@ -2474,10 +2810,15 @@
     }
     return false;
 }
-function ClickSliderScale(e) {
+
+function ClickSliderScale(e)
+{
     x = (msie?event.clientX: e.clientX) - mapPosX;
     y = (msie?event.clientY: e.clientY);
-    if(msie) e.cancelBubble = true; else e.stopPropagation();
+    if(msie)
+        e.cancelBubble = true;
+    else
+        e.stopPropagation();
 
     moveType = DRAGGINGCTRL;
     dragElt = SCALE;
@@ -2485,23 +2826,31 @@
     anchorY = y;
     return false;
 }
-function ResizeLegendTo(newY) {
+
+function ResizeLegendTo(newY)
+{
     legendHeight = initLegendHeight + (newY - rlAnchor);
     if(legendHeight < 1)
         legendHeight = 1;
     LayoutControls();
 }
-function ForwardMouseUp(e) {
+
+function ForwardMouseUp(e)
+{
     if(moveType == RESIZINGLEGEND)
         EndResizingLegend(e);
 }
-function SaveState() {
+
+function SaveState()
+{
     var exp = new Date();
     var in2Years = exp.getTime() + 2 * 31536000000;
     exp.setTime(in2Years);
     document.cookie = "asav=US:" + (us? "1": "0") + "; expires=" + exp.toGMTString();
 }
-function RestoreState() {
+
+function RestoreState()
+{
     var allData = document.cookie.split(";");
     for(var i=0; i < allData.length; i++)
     {
@@ -2523,10 +2872,14 @@
         }
     }
 }
-function GetLayers(onlyVisible, onlySelectable) {
+
+function GetLayers(onlyVisible, onlySelectable)
+{
     return GetLegendCtrl().GetLayers(onlyVisible, onlySelectable);
 }
-function GetSelectedLayers() {
+
+function GetSelectedLayers()
+{
     var layers = new Array();
     if(selection.count > 0)
     {
@@ -2539,7 +2892,9 @@
     }
     return layers;
 }
-function GetVisSelLayers() {
+
+function GetVisSelLayers()
+{
     if(visSelLayers != null)
         return visSelLayers;
     visSelLayers = "";
@@ -2552,7 +2907,9 @@
     }
     return visSelLayers;
 }
-function GetVisLayers() {
+
+function GetVisLayers()
+{
     if(visLayers != null)
         return visLayers;
     visLayers = "";
@@ -2565,11 +2922,15 @@
     }
     return visLayers;
 }
-function ResetVisLayers() {
+
+function ResetVisLayers()
+{
     visSelLayers = null;
     visLayers = null;
 }
-function SetScaleSliderPos() {
+
+function SetScaleSliderPos()
+{
     if(scales.length == 1)
         return;
     sci = GetFiniteScaleIndex(curScale);
@@ -2577,8 +2938,11 @@
     slidery = sscaley + slidertop + newPos;
     document.getElementById("slider").style.top = slidery;
 }
-function GetFiniteScaleIndex(scale) {
-    if(scales.length > 1) {
+
+function GetFiniteScaleIndex(scale)
+{
+    if(scales.length > 1)
+    {
         i = 0;
         if(scale > scales[scales.length - 1])
             i = scales.length - 1
@@ -2593,20 +2957,26 @@
         return 0;
     return i;
 }
-function GetNearestFiniteScale(scale) {
+
+function GetNearestFiniteScale(scale)
+{
     return scales[GetFiniteScaleIndex(scale)];
 }
-function NormalizeScale(scale) {
+
+function NormalizeScale(scale)
+{
     if(scale < minScale)
         return minScale;
     if(scale > maxScale)
         return maxScale;
     return scale;
 }
-function CalcTileMetrics(nx1, ny1, nx2, ny2) {
+
+function CalcTileMetrics(nx1, ny1, nx2, ny2)
+{
     tcxU = curScale * TILECX * metersPerPixel / metersPerUnit;
     tcyU = curScale * TILECY * metersPerPixel / metersPerUnit;
-    
+
     udistx = Math.abs(orgExtX1 - nx1); udisty = Math.abs(orgExtY1 - ny1);
     if(nx1 < orgExtX1)
     {
@@ -2618,8 +2988,7 @@
         leftmost = tilex = parseInt(udistx / tcxU);
         uoffsx = udistx - (tcxU * tilex);
     }
-    
-    
+
     if(ny1 > orgExtY1)
     {
         topmost = tiley = -parseInt(udisty / tcyU) - 1;
@@ -2640,7 +3009,9 @@
     iToDevx = fVisTilex - tilex; iToDevy = fVisTiley - tiley;
     ltilex = rightmost = leftmost + visTileCols; ltiley = bottommost = topmost + visTileRows;
 }
-function BuildTilePlanes(nx1, ny1, nx2, ny2) {
+
+function BuildTilePlanes(nx1, ny1, nx2, ny2)
+{
     if(!hasTiles)
         return;
 
@@ -2665,22 +3036,29 @@
     tilesDiv.innerHTML = tileCode;
     RequestVisibleTiles();
 }
-function RequestVisibleTiles() {
+
+function RequestVisibleTiles()
+{
     for(var i=fVisTilex; i <= lVisTilex; i++)
         for(var j=fVisTiley; j <= lVisTiley; j++)
             RequestTile(i, j, i - iToDevx, j - iToDevy)
 }
-function RequestTileAt(col, row) {
+
+function RequestTileAt(col, row)
+{
     RequestTile(col, row, col - iToDevx, row - iToDevy);
 }
-function RequestTile(col, row, tilex, tiley) {
+
+function RequestTile(col, row, tilex, tiley)
+{
     for(var k=0; k < baseGroups.length; k++)
     {
         if(visBaseGroups.getItem(baseGroups[k]) == null)
             continue;
         cellSpec = k + ":" + col + ":" + row;
         cell = document.getElementById(cellSpec);
-        if(cell == null) {
+        if(cell == null)
+        {
             if((cell = FindCell(k, cellSpec)) == null)
                 return 0;
         }
@@ -2694,40 +3072,51 @@
     }
     return 1;
 }
-function FindCell(plane, cellSpec) {
+
+function FindCell(plane, cellSpec)
+{
     var tbody = document.getElementById("gridbody" + plane);
-    for(var i = 0; i < GRIDCY; i++) {
+    for(var i = 0; i < GRIDCY; i++)
+    {
         row = tbody.rows[i];
         cols = row.childNodes;
-        for(var j = 0; j < GRIDCX; j++) {
-            if(cols[j].id == cellSpec) {
+        for(var j = 0; j < GRIDCX; j++)
+        {
+            if(cols[j].id == cellSpec)
                 return cols[j];
-            }
         }
     }
     return null;
 }
-function OnTileLoaded(imageId) {
+
+function OnTileLoaded(imageId)
+{
     img = document.getElementById(imageId);
     if(img)
     {
         if(msie)
             img.parentNode.innerHTML = "<div style=\"position: relative; width: " + TILECX + "px; height: " + TILECY + "px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src + "', sizingMethod='scale')\"></div>";
         else
-          img.style.visibility = "visible";
+            img.style.visibility = "visible";
     }
 }
-function HideMapImage() {
+
+function HideMapImage()
+{
     if(!HasVisibleBaseGroups())
         return;
     document.getElementById("img1").style.display = "none";
 }
-function HasVisibleBaseGroups() {
+
+function HasVisibleBaseGroups()
+{
     if(!hasTiles)
         return false
     return visBaseGroups.length > 0;
 }
-function ShowScaleTip(x, y, scale) {
+
+function ShowScaleTip(x, y, scale)
+{
     tip = document.getElementById("scaleTip").style;
     tip.visibility = "visible";
     tipText = document.getElementById("scaleTipText");
@@ -2735,10 +3124,14 @@
     w = tipText.offsetWidth;
     tip.top = y; tip.left = x - w - 3;
 }
-function HideScaleTip(x, y, scale) {
+
+function HideScaleTip(x, y, scale)
+{
     document.getElementById("scaleTip").style.visibility = "hidden";
 }
-function ShowBaseGroup(name, id, show) {
+
+function ShowBaseGroup(name, id, show)
+{
     ShowGroupLayers(show? id: "", show? "": id, "", "");
     if(!show)
     {
@@ -2790,7 +3183,8 @@
     if(Math.abs(x - hlData.curx) > 1 || Math.abs(y - hlData.cury) > 1)
         return;
     ProcessFeatureInfo(xml, false, 4);
-    if(hlData.url != "" || hlData.ttip != "") {
+    if(hlData.url != "" || hlData.ttip != "")
+    {
         if(!exec)
             DisplayHyperlinkTip(x + mapPosX, y);
         else
@@ -2800,7 +3194,8 @@
 
 function DisplayHyperlinkTip(x,y)
 {
-    if(hlData.ttip != "") {
+    if(hlData.ttip != "")
+    {
         ttinfo = "&nbsp;" + hlData.ttip + "&nbsp;";
         ttinfo = ttinfo.replace(/\\n/g, "<br>&nbsp;");
         if(hlData.url != "")
@@ -2833,23 +3228,29 @@
     tip = document.getElementById("hlTip");
     if(tip != null) tip.style.visibility = "hidden";
 }
-function ExecuteHyperlink(url) {
+
+function ExecuteHyperlink(url)
+{
     targetFrame = "";
     if(hlTgt == 1) targetFrame = "taskPaneFrame";
     else if(hlTgt == 3) targetFrame = hlTgtName;
     winRef = null;
     if(targetFrame != "")
         winRef = parent.GetFrame(targetFrame);
-    if(winRef != null) {
+    if(winRef != null)
+    {
         winRef.location.href = url;
         return winRef;
     }
     else
         window.open(url, targetFrame, "toolbar=no,width=500,height=800,resizable,scrollbars");
 }
-function OnSliderImageLoaded(imgName) {
+
+function OnSliderImageLoaded(imgName)
+{
     img = document.getElementById(imgName);
-    if(!showSlider) {
+    if(!showSlider)
+    {
         img.parentNode.style.visibility = "hidden";
         return;
     }
@@ -2859,18 +3260,19 @@
     var imgID = (img.id) ? "id='" + img.id + "' " : ""
     var imgClass = (img.className) ? "class='" + img.className + "' " : ""
     var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
-    var imgStyle = "display:inline-block;" + img.style.cssText 
+    var imgStyle = "display:inline-block;" + img.style.cssText
     if (img.align == "left") imgStyle = "float:left;" + imgStyle
     if (img.align == "right") imgStyle = "float:right;" + imgStyle
     if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
-    if (img.useMap) {
+    if (img.useMap)
         strAddMap = "<img style=\"position:absolute; left: 0px; top: 0px; height:" + img.height + "px; width:" + img.width + ";\" " + "src=\"" + strGif + "\" usemap=\"" + img.useMap  + "\" border=\"" + img.border + "\">";
-    }
-    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'" + img.src + "\', sizingMethod='crop');\"></span>" 
+    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'" + img.src + "\', sizingMethod='crop');\"></span>"
     if (img.useMap) strNewHTML += strAddMap
     img.outerHTML = strNewHTML
 }
-function ExitMap(e) {
+
+function ExitMap(e)
+{
     if(moveType != PANNING)
         return true;
     var x = e.clientX - mapPosX;
@@ -2878,13 +3280,16 @@
     if(IsInSliderSpace(x, y, false))
         return true;
     if(x > 0 && y > 0 && x < mapDevW && y <mapDevH)
-        return true;        
-    EndPaning(e);
+        return true;
+    EndPanning(e);
     return true;
 }
-function ShowSelectionTip(x, y, text, show) {
+
+function ShowSelectionTip(x, y, text, show)
+{
     tip = document.getElementById("scaleTip").style;
-    if(show) {
+    if(show)
+    {
         tip.visibility = "visible";
         tipText = document.getElementById("scaleTipText");
         tipText.innerHTML = "&nbsp;" + text + "&nbsp;";
@@ -2893,11 +3298,16 @@
      else
         tip.visibility = "hidden";
 }
-function OnLayersChanged(){
+
+function OnLayersChanged()
+{
     ResetVisLayers();
 }
-function StartDigitizing(digitizerTool, handler) {
-    if(parent.InMeasure()) {
+
+function StartDigitizing(digitizerTool, handler)
+{
+    if(parent.InMeasure())
+    {
         parent.SetStatusMsg("__#MEASALREADYRUNNING#__");
         return;
     }
@@ -2906,35 +3316,46 @@
     digitizing = true;
     document.getElementById("KeyTarget").focus();
 }
-function CancelDigitization() {
-    if(digitizing) {
+
+function CancelDigitization()
+{
+    if(digitizing)
+    {
         digitizer.Cancel();
         digitizing = false;
         digihandler = null;
     }
 }
-function OnShapeDigitized(shape) {
-    if(digitizing) {
+
+function OnShapeDigitized(shape)
+{
+    if(digitizing)
+    {
         digitizing = false;
-        if(digihandler != null) {
+        if(digihandler != null)
+        {
             digihandler(shape);
             digihandler = null;
         }
     }
 }
-function KeyPressed(e) {
-    if(e.keyCode == 27) {
+
+function KeyPressed(e)
+{
+    if(e.keyCode == 27)
+    {
         CancelDigitization();
         return false;
     }
     return true;
 }
-    </script>
 
-  </head>
-  <body id="body" onload="InitDocument()" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0 bgcolor=#d0d0d0
-                    onmousedown="return OnMouseDown(event)" onmousemove="return OnMouseMove(event)" onmouseup="OnMouseUp(event)"
-                    oncontextmenu = "return OnContextMenu(event)" onclick="return OnClick(event)">
+</script>
+
+</head>
+<body id="body" onload="InitDocument()" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0 bgcolor=#d0d0d0
+        onmousedown="return OnMouseDown(event)" onmousemove="return OnMouseMove(event)" onmouseup="OnMouseUp(event)"
+        oncontextmenu = "return OnContextMenu(event)" onclick="return OnClick(event)">
     <table id="tbMap" width="100%%" height="100%%" cellpadding="0" cellspacing="0" id="tb">
       <tr>
        <td id="InfoBand" align="left" valign="top" width="1" bgcolor="white">
@@ -3009,5 +3430,5 @@
     </div>
     <div class="PopupMenu" id="InfoMenu"></div>
     <input id="KeyTarget" type="text" onKeyDown="return KeyPressed(event);" style="position: absolute; left: 0px; right: 0px; width: 0px; height: 0px" >
-  </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/ajaxviewerabout.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/ajaxviewerabout.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/ajaxviewerabout.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,55 +1,61 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-        <title>__#HTMLABOUTTITLE#__</title>
-    
-        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
-        <meta http-equiv="content-script-type" content="text/javascript" />
-        <meta http-equiv="content-style-type" content="text/css" />
-    </head>
-    <style>
-        body {
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>__#HTMLABOUTTITLE#__</title>
+    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+    <meta http-equiv="content-script-type" content="text/javascript" />
+    <meta http-equiv="content-style-type" content="text/css" />
+</head>
+<style>
+    body
+    {
         margin: 0px 0px 0px 0px;
         color: #000000;
         font-family: arial,verdana,helvetica,sans-serif;
         background: white;
         font-size: 11px;
         height: 100%%;
-        }
-        table.AboutBox {
+    }
+    table.AboutBox
+    {
         width: 98%%;
         background-color:#FFFFFF;
-        }
-        .AboutBoxTitle {
+    }
+    .AboutBoxTitle
+    {
         font-size:18px;
         font-weight:bold;
         color:#0082B4;
         width: 100%%;
-        }
-        hr.AboutBoxSep {
+    }
+    hr.AboutBoxSep
+    {
         color:#0082B4;
         background-color:#0082B4;
         width: 100%%;
         height:3px;
         border: 0px;
-        }
-        .AboutBoxBanner {
+    }
+    .AboutBoxBanner
+    {
         background-color:#004282;
         width:100%%;
-        }
-        .AboutBoxText {
+    }
+    .AboutBoxText
+    {
         font-size:10pt;
         color:#000000;
         width:100%%;
-        }
-        .AboutBoxTextBold {
+    }
+    .AboutBoxTextBold
+    {
         font-weight:bold;
         font-size:12pt;
         color:#000000;
         width:100%%;
-        }
-    </style>
+    }
+</style>
 <body>
     <table cellpadding="5" cellspacing="0" border="0" class="AboutBox" align="center">
         <tr>
@@ -65,7 +71,7 @@
                     </tr>
                     <tr>
                         <td colspan="2">
-                            <hr class="AboutBoxSep" noshade> 
+                            <hr class="AboutBoxSep" noshade>
                         </td>
                     </tr>
                 </table>
@@ -85,6 +91,5 @@
             </td>
         </tr>
     </table>
-
 </body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/arealayerdef.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/arealayerdef.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/arealayerdef.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,29 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <LayerDefinition version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="LayerDefinition-1.0.0.xsd">
-  <VectorLayerDefinition>
-    <ResourceId>%s</ResourceId>
-    <FeatureName>%s</FeatureName>
-    <FeatureNameType>FeatureClass</FeatureNameType>
-    <Geometry>%s</Geometry>
-    <VectorScaleRange>
-      <AreaTypeStyle>
-        <AreaRule>
-          <LegendLabel/>
-          <AreaSymbolization2D>
-            <Fill>
-              <FillPattern>%s</FillPattern>
-              <ForegroundColor>%s</ForegroundColor>
-              <BackgroundColor>%s</BackgroundColor>
-            </Fill>
-            <Stroke>
-              <LineStyle>%s</LineStyle>
-              <Thickness>%s</Thickness>
-              <Color>%s</Color>
-              <Unit>Points</Unit>
-            </Stroke>
-          </AreaSymbolization2D>
-        </AreaRule>
-      </AreaTypeStyle>
-    </VectorScaleRange>
-  </VectorLayerDefinition>
+    <VectorLayerDefinition>
+        <ResourceId>%s</ResourceId>
+        <FeatureName>%s</FeatureName>
+        <FeatureNameType>FeatureClass</FeatureNameType>
+        <Geometry>%s</Geometry>
+        <VectorScaleRange>
+            <AreaTypeStyle>
+                <AreaRule>
+                    <LegendLabel/>
+                    <AreaSymbolization2D>
+                        <Fill>
+                            <FillPattern>%s</FillPattern>
+                            <ForegroundColor>%s</ForegroundColor>
+                            <BackgroundColor>%s</BackgroundColor>
+                        </Fill>
+                        <Stroke>
+                            <LineStyle>%s</LineStyle>
+                            <Thickness>%s</Thickness>
+                            <Color>%s</Color>
+                            <Unit>Points</Unit>
+                        </Stroke>
+                    </AreaSymbolization2D>
+                </AreaRule>
+            </AreaTypeStyle>
+        </VectorScaleRange>
+    </VectorLayerDefinition>
 </LayerDefinition>

Modified: trunk/MgDev/Web/src/viewerfiles/arearule.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/arearule.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/arearule.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,17 +1,17 @@
-          <AreaRule>
-            <LegendLabel>%s</LegendLabel>
-            <Filter>%s</Filter>
-            <AreaSymbolization2D>
-              <Fill>
-                <FillPattern>Solid</FillPattern>
-                <ForegroundColor>%s</ForegroundColor>
-                <BackgroundColor>FF000000</BackgroundColor>
-              </Fill>
-              <Stroke>
-                <LineStyle>Solid</LineStyle>
-                <Thickness>1</Thickness>
-                <Color>FF000000</Color>
-                <Unit>Points</Unit>
-              </Stroke>
-            </AreaSymbolization2D>
-          </AreaRule>
+<AreaRule>
+    <LegendLabel>%s</LegendLabel>
+    <Filter>%s</Filter>
+    <AreaSymbolization2D>
+        <Fill>
+            <FillPattern>Solid</FillPattern>
+            <ForegroundColor>%s</ForegroundColor>
+            <BackgroundColor>FF000000</BackgroundColor>
+        </Fill>
+        <Stroke>
+            <LineStyle>Solid</LineStyle>
+            <Thickness>1</Thickness>
+            <Color>FF000000</Color>
+            <Unit>Points</Unit>
+        </Stroke>
+    </AreaSymbolization2D>
+</AreaRule>

Modified: trunk/MgDev/Web/src/viewerfiles/areatypestyle.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/areatypestyle.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/areatypestyle.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,2 +1 @@
-        <AreaTypeStyle>
-%s        </AreaTypeStyle>
+<AreaTypeStyle>%s</AreaTypeStyle>

Modified: trunk/MgDev/Web/src/viewerfiles/bufferreport.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/bufferreport.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/bufferreport.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,50 +1,52 @@
 <html>
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <link rel="stylesheet" href="../viewerfiles/DwfViewer.css" type="text/css">
-  <style type="text/css">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/DwfViewer.css" type="text/css">
+<style type="text/css">
     td.Title
     {
-    font-family: __#@font#__;
-    font-weight: bold;
-    font-size: 13pt;
+        font-family: __#@font#__;
+        font-weight: bold;
+        font-size: 13pt;
     }
     .RegText
     {
-    font-family: __#@font#__;
-    font-size: __#@fontsize#__;
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
     }
     .Ctrl
     {
-    font-family: __#@font#__;
-    font-size: __#@fontsize#__;
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
     }
-  </style>
-    <script language=javascript>
-    var popup = %s;     
-    
-    function InitDocument()
-    {
-        GetParent().Refresh();    
-    }
+</style>
 
-    function Back()
-    {
-        if(popup)
-            history.back();
-        else
-            GetParent().GotoHomePage();
-    }
+<script language=javascript>
 
-    function GetParent()
-    {
-        if(popup)
-            return opener;
-        else
-            return parent.parent;
-    }
-    
-    </script>
+var popup = %s;
+
+function InitDocument()
+{
+    GetParent().Refresh();
+}
+
+function Back()
+{
+    if(popup)
+        history.back();
+    else
+        GetParent().GotoHomePage();
+}
+
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
+
+</script>
 </head>
 <body onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
 <table class="RegText" border="0" cellspacing="0" width="100%%">
@@ -54,3 +56,4 @@
   <tr><td><input type="button" value="__#BUTTONOK#__" style="width: 70px;" class="Ctrl" onclick="Back()"></td></tr>
 </table>
 </body>
+</html>

Modified: trunk/MgDev/Web/src/viewerfiles/bufferui.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/bufferui.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/bufferui.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,249 +1,250 @@
 <html>
 <head>
-    <title>__#BUFFERTITLE#__</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
-      td.Title
-      {
-      font-family: __#@font#__;
-      font-weight: bold;
-      font-size: 13pt;
-      }
-      td.SubTitle
-      {
-      font-family: __#@font#__;
-      font-weight: bold;
-      font-size: __#@fontsize#__;
-      background-color: #DCDCDC;
-      color: black;
-      height: 20px;
-      }
-      .BufferSwatch
-      {
-      border: black 1px solid;
-      height: 16px;
-      font-family: __#@font#__;
-      font-size: 7pt;
-      }
-      td.InfoText
-      {
-      background-color: #FFFFCC;
-      color: #666666;
-      font-family: __#@font#__;
-      font-size: __#@fontsize#__;
-      }
-      .RegText
-      {
-      font-family: __#@font#__;
-      font-size: __#@fontsize#__;
-      }
-      .Ctrl
-      {
-      font-family: __#@font#__;
-      font-size: __#@fontsize#__;
-      }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
-        var popup = %s;
-        var lcolor = "000000";
-        var ffcolor = "ff0000";
-        var fbcolor = "ffffff";
-        var transparent = 1;
-        var pickClr;
+<title>__#BUFFERTITLE#__</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
+    td.Title
+    {
+        font-family: __#@font#__;
+        font-weight: bold;
+        font-size: 13pt;
+    }
+    td.SubTitle
+    {
+        font-family: __#@font#__;
+        font-weight: bold;
+        font-size: __#@fontsize#__;
+        background-color: #DCDCDC;
+        color: black;
+        height: 20px;
+    }
+    .BufferSwatch
+    {
+        border: black 1px solid;
+        height: 16px;
+        font-family: __#@font#__;
+        font-size: 7pt;
+    }
+    td.InfoText
+    {
+        background-color: #FFFFCC;
+        color: #666666;
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
+    }
+    .RegText
+    {
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
+    }
+    .Ctrl
+    {
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
+    }
+</style>
 
-        function InitDocument()
-        {
-            document.getElementById("distance").focus();
-            var w = msie? document.body.clientWidth: window.innerWidth - 40;
-            document.getElementById("layers").style.width = (w > 200? 200: w) + "px";
-            FillLayerList();
-        }
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
 
-        function FillLayerList()
+var popup = %s;
+var lcolor = "000000";
+var ffcolor = "ff0000";
+var fbcolor = "ffffff";
+var transparent = 1;
+var pickClr;
+
+function InitDocument()
+{
+    document.getElementById("distance").focus();
+    var w = msie? document.body.clientWidth: window.innerWidth - 40;
+    document.getElementById("layers").style.width = (w > 200? 200: w) + "px";
+    FillLayerList();
+}
+
+function FillLayerList()
+{
+    var list = document.getElementById("layers");
+    var listNames = document.getElementById("layerNames");
+    list.options.length = 0;
+    var layers = GetParent().GetMapFrame().GetSelectedLayers();
+    if(layers.length > 0)
+    {
+        for(var i = 0; i < layers.length; i++)
         {
-            var list = document.getElementById("layers");
-            var listNames = document.getElementById("layerNames");
-            list.options.length = 0;
-            var layers = GetParent().GetMapFrame().GetSelectedLayers();
-            if(layers.length > 0)
-            {
-                for(var i = 0; i < layers.length; i++)
-                {
-                    var layer = layers[i];
-                    list.options[i] = new Option(layer.legend != ""? layer.legend: layer.name);
-                    if(i == 0)
-                        list.options[0].selected = true;
-                    listNames.options[i] = new Option(layer.name);
-                }
-            }
-            else
-                list.options[0] = new Option("__#BUFFERNOLAYER#__");
-            document.getElementById("Done").disabled = layers.length == 0;
+            var layer = layers[i];
+            list.options[i] = new Option(layer.legend != ""? layer.legend: layer.name);
+            if(i == 0)
+                list.options[0].selected = true;
+            listNames.options[i] = new Option(layer.name);
         }
+    }
+    else
+        list.options[0] = new Option("__#BUFFERNOLAYER#__");
+    document.getElementById("Done").disabled = layers.length == 0;
+}
 
-        function UpdateColors()
-        {
-            var elt;
-            document.getElementById("lcolor").value = lcolor;
-            elt = document.getElementById("lcolorswtach").style;
-            elt.backgroundColor = "#" + lcolor;
-            elt.color = "#" + lcolor;
+function UpdateColors()
+{
+    var elt;
+    document.getElementById("lcolor").value = lcolor;
+    elt = document.getElementById("lcolorswtach").style;
+    elt.backgroundColor = "#" + lcolor;
+    elt.color = "#" + lcolor;
 
-            document.getElementById("ffcolor").value = ffcolor;
-            elt = document.getElementById("ffcolorswtach").style;
-            elt.backgroundColor = "#" + ffcolor;
-            elt.color = "#" + ffcolor;
+    document.getElementById("ffcolor").value = ffcolor;
+    elt = document.getElementById("ffcolorswtach").style;
+    elt.backgroundColor = "#" + ffcolor;
+    elt.color = "#" + ffcolor;
 
-            document.getElementById("fbcolor").value = fbcolor;
-            document.getElementById("fbtransp").value = transparent;
-            elt = document.getElementById("fbcolorswtach").style;
-            elt.backgroundColor = transparent? "#ffffff": "#" + fbcolor;
-            elt.color = transparent? "black": "#" + fbcolor;
-        }
+    document.getElementById("fbcolor").value = fbcolor;
+    document.getElementById("fbtransp").value = transparent;
+    elt = document.getElementById("fbcolorswtach").style;
+    elt.backgroundColor = transparent? "#ffffff": "#" + fbcolor;
+    elt.color = transparent? "black": "#" + fbcolor;
+}
 
-        function Validate()
-        {
-            var field = document.getElementById("distance");
-            var num = parseFloat(field.value);
-            if(isNaN(num) || num == 0)
-            {
-                alert("__#BUFFERERRORZERODISTANCE#__");
-                field.focus();
-                return false;
-            }
-            field = document.getElementById("buffer");
-            if(field.value == "")
-            {
-                alert("__#BUFFERERRORNOLAYERNAME#__");
-                field.focus();
-                return false;
-            }
-            field = document.getElementById("thickness");
-            num = parseFloat(field.value);
-            if(isNaN(num) || num < 0)
-            {
-                alert("__#BUFFERERRORNEGATIVETHICKNESS#__");
-                field.focus();
-                return false;
-            }
-            UpdateColors();
-            return true;
-        }
+function Validate()
+{
+    var field = document.getElementById("distance");
+    var num = parseFloat(field.value);
+    if(isNaN(num) || num == 0)
+    {
+        alert("__#BUFFERERRORZERODISTANCE#__");
+        field.focus();
+        return false;
+    }
+    field = document.getElementById("buffer");
+    if(field.value == "")
+    {
+        alert("__#BUFFERERRORNOLAYERNAME#__");
+        field.focus();
+        return false;
+    }
+    field = document.getElementById("thickness");
+    num = parseFloat(field.value);
+    if(isNaN(num) || num < 0)
+    {
+        alert("__#BUFFERERRORNEGATIVETHICKNESS#__");
+        field.focus();
+        return false;
+    }
+    UpdateColors();
+    return true;
+}
 
-        function GetSelection()
-        {
-            var sel = GetParent().GetMapFrame().GetSelectionXML();
-            if(sel == "")
-            {
-                alert("__#BUFFERERRORNOSELECTION#__");
-                return false;
-            }
-            document.getElementById("selection").value = sel;
-            return true;
-        }
+function GetSelection()
+{
+    var sel = GetParent().GetMapFrame().GetSelectionXML();
+    if(sel == "")
+    {
+        alert("__#BUFFERERRORNOSELECTION#__");
+        return false;
+    }
+    document.getElementById("selection").value = sel;
+    return true;
+}
 
-        function GetInputLayers()
+function GetInputLayers()
+{
+    var layers = document.getElementById("layers");
+    var layerNames = document.getElementById("layerNames");
+    var lyrs = "";
+    for(var i = 0; i < layers.length; i++)
+    {
+        if(layers.options[i].selected)
         {
-            var layers = document.getElementById("layers");
-            var layerNames = document.getElementById("layerNames");
-            var lyrs = "";
-            for(var i = 0; i < layers.length; i++)
-            {
-                if(layers.options[i].selected)
-                {
-                    if(lyrs != "")
-                        lyrs += ",";
-                    lyrs += layerNames.options[i].text;
-                }
-            }
-            if(lyrs == "")
-                return false;
-            document.getElementById("inLayers").value = lyrs;
-            return true;
+            if(lyrs != "")
+                lyrs += ",";
+            lyrs += layerNames.options[i].text;
         }
+    }
+    if(lyrs == "")
+        return false;
+    document.getElementById("inLayers").value = lyrs;
+    return true;
+}
 
-        function GetParent()
-        {
-            if(popup)
-                return opener;
-            else
-                return parent.parent;
-        }
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
 
-        function PickColor(what, allowTransparency, transparent)
-        {
-            var clr;
-            if((pickClr = what) == 0)
-                clr = lcolor;
-            else if(pickClr == 1)
-                clr = ffcolor;
-            else if(pickClr == 2)
-                clr = fbcolor;
-           else
-                return;
-            height = allowTransparency? 470: 445;
-            w = window.open("%s?LOCALE=%s&CLR=" + clr + "&ALLOWTRANS=" + (allowTransparency? "1":"0") + "&TRANS=" + (transparent?"1":"0"), "colorPicker", "toolbar=no,status=no,width=355,height=" + height);
-            w.focus();
-        }
+function PickColor(what, allowTransparency, transparent)
+{
+    var clr;
+    if((pickClr = what) == 0)
+        clr = lcolor;
+    else if(pickClr == 1)
+        clr = ffcolor;
+    else if(pickClr == 2)
+        clr = fbcolor;
+   else
+        return;
+    height = allowTransparency? 470: 445;
+    w = window.open("%s?LOCALE=%s&CLR=" + clr + "&ALLOWTRANS=" + (allowTransparency? "1":"0") + "&TRANS=" + (transparent?"1":"0"), "colorPicker", "toolbar=no,status=no,width=355,height=" + height);
+    w.focus();
+}
 
-        function OnColorPicked(clr, trans)
-        {
-            if(pickClr == 0)
-                lcolor = clr;
-            else if(pickClr == 1)
-                ffcolor = clr;
-            else if(pickClr == 2)
-            {
-                fbcolor = clr;
-                transparent = trans? 1 : 0;
-            }
-            UpdateColors();
-        }
+function OnColorPicked(clr, trans)
+{
+    if(pickClr == 0)
+        lcolor = clr;
+    else if(pickClr == 1)
+        ffcolor = clr;
+    else if(pickClr == 2)
+    {
+        fbcolor = clr;
+        transparent = trans? 1 : 0;
+    }
+    UpdateColors();
+}
 
-        function RefreshLayers()
-        {
-            FillLayerList();
-        }
-        function OnCancel() {
-            mf = GetParent();
-            mf.mapFrame.ClearSelection();
-            mf.GotoHomePage();
-            
-        }
-    </script>
+function RefreshLayers()
+{
+    FillLayerList();
+}
+
+function OnCancel()
+{
+    mf = GetParent();
+    mf.mapFrame.ClearSelection();
+    mf.GotoHomePage();
+}
+
+</script>
 </head>
 <body onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
 <form id="Frm" method="post" action="%s" onsubmit="if(!Validate() || !GetSelection() || !GetInputLayers()) return false;">
     <table class="RegText" border="0" cellspacing="0" width="100%%">
         <tr><td class="Title">__#BUFFERTITLE#__<hr></td></tr>
-    <tr><td class="SubTitle">__#BUFFERSUBTITLE#__</td></tr>
-        <tr>
-            <td height="6">
-                <table border="0" cellspacing="0" cellpadding="3" width="100%%">
-                    <tr><td height="6"></td></tr>
-                    <tr><td class="InfoText">__#BUFFERINFOTEXT#__</td></tr>
-                </table>
-            </td>
-        </tr>
+        <tr><td class="SubTitle">__#BUFFERSUBTITLE#__</td></tr>
+        <tr><td height="6">
+          <table border="0" cellspacing="0" cellpadding="3" width="100%%">
+            <tr><td height="6"></td></tr>
+            <tr><td class="InfoText">__#BUFFERINFOTEXT#__</td></tr>
+          </table>
+        </td></tr>
         <tr><td height="6"></td></tr>
         <tr><td >__#BUFFERDISTANCE#__</td></tr>
         <tr><td><input type="edit" name="DISTANCE" id="distance" value="1" size="5" class="Ctrl">
-            <select name="UNITS" class="Ctrl">
-               <option value="mi" %s>__#DISTANCEMILES#__</option>
-               <option value="ki" %s>__#DISTANCEKILOMETERS#__</option>
-               <option value="fe">__#DISTANCEFEET#__</option>
-               <option value="me">__#DISTANCEMETERS#__</option>
-            </select></td>
-            </tr>
+          <select name="UNITS" class="Ctrl">
+            <option value="mi" %s>__#DISTANCEMILES#__</option>
+            <option value="ki" %s>__#DISTANCEKILOMETERS#__</option>
+            <option value="fe">__#DISTANCEFEET#__</option>
+            <option value="me">__#DISTANCEMETERS#__</option>
+          </select>
+        </td></tr>
         <tr><td height="6"></td></tr>
         <tr><td>__#BUFFERLAYERS#__</td></tr>
         <tr><td valign="top">
-            <select size="4" name="D1" multiple id="layers" class="Ctrl">
-            </select>
-            </td>
-            </tr>
+          <select size="4" name="D1" multiple id="layers" class="Ctrl">
+          </select>
+        </td></tr>
         <tr><td><input type="button" value="__#BUTTONREFRESH#__" style="width: 70px;" class="Ctrl" onclick="RefreshLayers()"></td></tr>
         <tr><td height="6"></td></tr>
         <tr><td>__#BUFFERNAME#__</td></tr>
@@ -253,7 +254,7 @@
 
         <tr><td>
           <table cellspacing=0 cellpadding=0 border=0 width="100%%" class="RegText">
-          <tr><td valign=top>
+            <tr><td valign=top>
             <table cellspacing=0 cellpadding=0 border=0 width="100%%" class="RegText">
               <tr><td class="SubTitle">__#BUFFERFILLSTYLE#__</td></tr>
               <tr><td height="6"></td></tr>
@@ -323,16 +324,16 @@
         <tr><td height="6"><hr></td></tr>
         <tr><td><input id="Done" type="submit" value="__#BUTTONDONE#__" style="width: 70px;" class="Ctrl">&nbsp;<input id="Cancel" type="button" value="__#BUTTONCANCEL#__" style="width: 70px;" class="Ctrl" onclick="OnCancel()"></td></tr>
         <tr><td height="6"></td></tr>
-        </table>
-        <table border="0" cellspacing="0" cellpadding="5" width="100%%" class="Regext">
+      </table>
+      <table border="0" cellspacing="0" cellpadding="5" width="100%%" class="Regext">
         <tr><td class="InfoText">
-        <div style="position: relative; left: -25px;">
-          <ul>
-            __#BUFFERHELP#__
-          </ul>
-        </div>
+          <div style="position: relative; left: -25px;">
+            <ul>
+              __#BUFFERHELP#__
+            </ul>
+          </div>
         </td></tr>
-        </table>
+    </table>
 
     <input type="hidden" name="MAPNAME" value="%s">
     <input type="hidden" name="SESSION" value="%s">

Modified: trunk/MgDev/Web/src/viewerfiles/colorpicker.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/colorpicker.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/colorpicker.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,270 +1,266 @@
 <html>
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>__#COLORPICKERDLGTITLE#__</title>
-    <style type="text/css">
-      td.SubTitle
-      {
-      font-family: __#@font#__;
-      font-weight: bold;
-      font-size: __#@fontsize#__;
-      background-color: #DCDCDC;
-      color: black;
-      height: 20px;
-      }
-      .RegText
-      {
-      font-family: __#@font#__;
-      font-size: __#@fontsize#__;
-      }
-      .Ctrl
-      {
-      font-family: __#@font#__;
-      font-size: __#@fontsize#__;
-      }
-      td.clr
-      {
-      border: 1px black solid;
-      width: 16px;
-      }
-      td.selswatch
-      {
-      border: 1px black solid;
-      }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
-    var imgspin = new Image(28,22);
-    imgspin.src = "../stdicons/cp_arr.gif";
-    var imgspindis = new Image(28,22);
-    imgspindis.src = "../stdicons/cp_arr_dis.gif";
-    var r = 0, g = 0, b = 0;
-    var initColor = "%s";
-    var allowTransparency = %s;
-    var transparent = %s;
-    var hex = false;
-    
-    function InitDocument()
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>__#COLORPICKERDLGTITLE#__</title>
+<style type="text/css">
+    td.SubTitle
     {
-        if(!allowTransparency)
-            transparent = false;
-            
-        document.getElementById("TransDiv").style.display = allowTransparency? "block": "none";
-        document.getElementById("trans").checked = transparent;
-        document.getElementById("hex").checked = hex;
-        
-        document.getElementById("R").onblur = OnValidateColorField;
-        document.getElementById("G").onblur = OnValidateColorField;
-        document.getElementById("B").onblur = OnValidateColorField;
-        
-        SelectColor(initColor);
-        
-        OnTransparencyChanged();
+        font-family: __#@font#__;
+        font-weight: bold;
+        font-size: __#@fontsize#__;
+        background-color: #DCDCDC;
+        color: black;
+        height: 20px;
     }
-    
-    function SelectColor(clr)
+    .RegText
     {
-        if(clr.length != 6)
-            clr = "000000";
-        SetSelectedColor(parseInt(clr.substr(0, 2), 16),
-                parseInt(clr.substr(2, 2), 16),
-                parseInt(clr.substr(4, 2), 16));
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
     }
-    
-    function EnableControls()
+    .Ctrl
     {
-        EnableSpinControls(!transparent);
-        document.getElementById("R").disabled = transparent;
-        document.getElementById("G").disabled = transparent;
-        document.getElementById("B").disabled = transparent;
-        document.getElementById("hex").disabled = transparent;
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
     }
-    
-    function SetSelectedColor(red,green,blue)
+    td.clr
     {
-        r = Normalize(red);
-        g = Normalize(green);
-        b = Normalize(blue);
-        
-        var rs = ToStr(r), gs = ToStr(g), bs = ToStr(b);
-        
-        document.getElementById("R").value = rs;
-        document.getElementById("G").value = gs;
-        document.getElementById("B").value = bs;
-
-        var swst = document.getElementById("selswatch").style;
-        if(!transparent)
-        {
-            if(hex)
-                swst.backgroundColor = "#" + rs + gs + bs;
-            else
-                swst.backgroundColor = "#" + MakeRgb(r,g,b);
-        }
-        else
-            swst.backgroundColor = "white";
+        border: 1px black solid;
+        width: 16px;
     }
-    
-    function MakeRgb(r,g,b)
+    td.selswatch
     {
-        return ToHexStr(r) + ToHexStr(g) + ToHexStr(b);
+        border: 1px black solid;
     }
-    
-    function Normalize(clr)
+</style>
+
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
+
+var imgspin = new Image(28,22);
+imgspin.src = "../stdicons/cp_arr.gif";
+var imgspindis = new Image(28,22);
+imgspindis.src = "../stdicons/cp_arr_dis.gif";
+var r = 0, g = 0, b = 0;
+var initColor = "%s";
+var allowTransparency = %s;
+var transparent = %s;
+var hex = false;
+
+function InitDocument()
+{
+    if(!allowTransparency)
+        transparent = false;
+
+    document.getElementById("TransDiv").style.display = allowTransparency? "block": "none";
+    document.getElementById("trans").checked = transparent;
+    document.getElementById("hex").checked = hex;
+
+    document.getElementById("R").onblur = OnValidateColorField;
+    document.getElementById("G").onblur = OnValidateColorField;
+    document.getElementById("B").onblur = OnValidateColorField;
+
+    SelectColor(initColor);
+    OnTransparencyChanged();
+}
+
+function SelectColor(clr)
+{
+    if(clr.length != 6)
+        clr = "000000";
+    SetSelectedColor(parseInt(clr.substr(0, 2), 16), parseInt(clr.substr(2, 2), 16), parseInt(clr.substr(4, 2), 16));
+}
+
+function EnableControls()
+{
+    EnableSpinControls(!transparent);
+    document.getElementById("R").disabled = transparent;
+    document.getElementById("G").disabled = transparent;
+    document.getElementById("B").disabled = transparent;
+    document.getElementById("hex").disabled = transparent;
+}
+
+function SetSelectedColor(red,green,blue)
+{
+    r = Normalize(red);
+    g = Normalize(green);
+    b = Normalize(blue);
+
+    var rs = ToStr(r), gs = ToStr(g), bs = ToStr(b);
+    document.getElementById("R").value = rs;
+    document.getElementById("G").value = gs;
+    document.getElementById("B").value = bs;
+
+    var swst = document.getElementById("selswatch").style;
+    if(!transparent)
     {
-        if(clr < 0)
-            return 0;
-        else if(clr > 255)
-            return 255;
+        if(hex)
+            swst.backgroundColor = "#" + rs + gs + bs;
         else
-            return clr;
+            swst.backgroundColor = "#" + MakeRgb(r,g,b);
     }
-    
-    
-    function ToStr(clr)
-    {
-        if(hex)
-            return ToHexStr(clr);
-            
-        return clr.toString(10);
-    }
-    
-    function ToHexStr(clr)
-    {
-        var cs = clr.toString(16);
-        if(cs.length == 1)
-            cs = "0" + cs;
-        return cs.toUpperCase();
-    }
+    else
+        swst.backgroundColor = "white";
+}
 
-    
-    function EnableSpinControls(enable)
-    {
-        document.getElementById("redspin").src = (enable? imgspin.src: imgspindis.src);
-        document.getElementById("greenspin").src = (enable? imgspin.src: imgspindis.src);
-        document.getElementById("bluespin").src = (enable? imgspin.src: imgspindis.src);
-    }
-    
-    function IncrRed()
-    {
-        if(transparent)
-            return;
-        r = IncrClr(r);
-        SetSelectedColor(r,g,b);
-    }
+function MakeRgb(r,g,b)
+{
+    return ToHexStr(r) + ToHexStr(g) + ToHexStr(b);
+}
 
-    function DecrRed()
-    {
-        if(transparent)
-            return;
-        r = DecrClr(r);
-        SetSelectedColor(r,g,b);
-    }
-    
-    function IncrClr(c)
-    {
-        if( ++ c >= 255)
-            c = 255;
-        return c;
-    }
+function Normalize(clr)
+{
+    if(clr < 0)
+        return 0;
+    else if(clr > 255)
+        return 255;
+    else
+        return clr;
+}
 
-    function DecrClr(c)
-    {
-        if(--c <= 0)
-            c = 0;
-        return c;
-    }
+function ToStr(clr)
+{
+    if(hex)
+        return ToHexStr(clr);
+    return clr.toString(10);
+}
 
-    function IncrGreen()
-    {
-        if(transparent)
-            return;
-        g = IncrClr(g);
-        SetSelectedColor(r,g,b);
-    }
+function ToHexStr(clr)
+{
+    var cs = clr.toString(16);
+    if(cs.length == 1)
+        cs = "0" + cs;
+    return cs.toUpperCase();
+}
 
-    function DecrGreen()
-    {
-        if(transparent)
-            return;
-        g = DecrClr(g);
-        SetSelectedColor(r,g,b);
-    }
+function EnableSpinControls(enable)
+{
+    document.getElementById("redspin").src = (enable? imgspin.src: imgspindis.src);
+    document.getElementById("greenspin").src = (enable? imgspin.src: imgspindis.src);
+    document.getElementById("bluespin").src = (enable? imgspin.src: imgspindis.src);
+}
 
-    function IncrBlue()
-    {
-        if(transparent)
-            return;
-        b = IncrClr(b);
-        SetSelectedColor(r,g,b);
-    }
+function IncrRed()
+{
+    if(transparent)
+        return;
+    r = IncrClr(r);
+    SetSelectedColor(r,g,b);
+}
 
-    function DecrBlue()
-    {
-        if(transparent)
-            return;
-        b = DecrClr(b);
-        SetSelectedColor(r,g,b);
-    }
+function DecrRed()
+{
+    if(transparent)
+        return;
+    r = DecrClr(r);
+    SetSelectedColor(r,g,b);
+}
 
-    function OnOk()
+function IncrClr(c)
+{
+    if( ++ c >= 255)
+        c = 255;
+    return c;
+}
+
+function DecrClr(c)
+{
+    if(--c <= 0)
+        c = 0;
+    return c;
+}
+
+function IncrGreen()
+{
+    if(transparent)
+        return;
+    g = IncrClr(g);
+    SetSelectedColor(r,g,b);
+}
+
+function DecrGreen()
+{
+    if(transparent)
+        return;
+    g = DecrClr(g);
+    SetSelectedColor(r,g,b);
+}
+
+function IncrBlue()
+{
+    if(transparent)
+        return;
+    b = IncrClr(b);
+    SetSelectedColor(r,g,b);
+}
+
+function DecrBlue()
+{
+    if(transparent)
+        return;
+    b = DecrClr(b);
+    SetSelectedColor(r,g,b);
+}
+
+function OnOk()
+{
+    try
     {
-        try
-        {
-            opener.OnColorPicked(MakeRgb(r,g,b), transparent);
-        }
-        catch(e){}
-        window.close();
+        opener.OnColorPicked(MakeRgb(r,g,b), transparent);
     }
-    
-    function OnCancel()
-    {
-        window.close();
-    }
-    
-    function OnTransparencyChanged()
-    {
-        transparent = document.getElementById("trans").checked;
-        EnableControls(transparent);
-        document.getElementById("selswatch").style.border = transparent? "0px": "1px black solid";
-        SetSelectedColor(r,g,b);
-    }
-    
-    function OnFormatChanged()
-    {
-        hex = document.getElementById("hex").checked;
-        SetSelectedColor(r,g,b);
-    }
-    
-    function OnValidateColorField(e)
-    {
-        if(msie)
-            tgt = event.srcElement;
-        else
-            tgt = e.target;
-            
-        v = tgt.value;
-        i = parseInt(v, hex? 16: 10);
-        i = Normalize(i);
-        
-        if(tgt.id == "R")
-            r = i;
-        else if(tgt.id == "G")
-            g = i;
-        else if(tgt.id == "B")
-            b = i;
-        else
-            return;
-            
-        SetSelectedColor(r,g,b);
-    }
-    
-    </script>
+    catch(e) {}
+    window.close();
+}
+
+function OnCancel()
+{
+    window.close();
+}
+
+function OnTransparencyChanged()
+{
+    transparent = document.getElementById("trans").checked;
+    EnableControls(transparent);
+    document.getElementById("selswatch").style.border = transparent? "0px": "1px black solid";
+    SetSelectedColor(r,g,b);
+}
+
+function OnFormatChanged()
+{
+    hex = document.getElementById("hex").checked;
+    SetSelectedColor(r,g,b);
+}
+
+function OnValidateColorField(e)
+{
+    if(msie)
+        tgt = event.srcElement;
+    else
+        tgt = e.target;
+
+    v = tgt.value;
+    i = parseInt(v, hex? 16: 10);
+    i = Normalize(i);
+
+    if(tgt.id == "R")
+        r = i;
+    else if(tgt.id == "G")
+        g = i;
+    else if(tgt.id == "B")
+        b = i;
+    else
+        return;
+
+    SetSelectedColor(r,g,b);
+}
+
+</script>
+
 </head>
 <body bgcolor="#FFFFFF" onload="InitDocument()">
   <table cellpadding="0" cellspacing="0" border="0">
     <tr><td colspan=18 class="SubTitle">__#COLORPICKERTITLE#__</td></tr>
     <tr height=10><td colspan=18 ></td></tr>
-    
+
     <tr height=16>
     <td class="clr" bgcolor="#330000" onclick="SelectColor('330000')">&nbsp;</td>
     <td class="clr" bgcolor="#333300" onclick="SelectColor('333300')">&nbsp;</td>
@@ -541,22 +537,21 @@
     <tr height=5><td colspan=18 > </td></tr>
     <tr class="RegText"><td colspan=18><input type="checkbox" id="hex" class="Ctrl" onclick="OnFormatChanged()">__#COLORPICKERHEXFORMAT#__</td></tr>
     <tr height=5><td colspan=18 > </td></tr>
-    <tr><td colspan=18><input class="Ctrl" type="button" value="__#BUTTONOK#__" style="width: 70px;" onclick="OnOk()"> <input class="Ctrl" type="button" value="__#BUTTONCANCEL#__" style="width: 70px;" onclick="OnCancel()"> 
+    <tr><td colspan=18><input class="Ctrl" type="button" value="__#BUTTONOK#__" style="width: 70px;" onclick="OnOk()"> <input class="Ctrl" type="button" value="__#BUTTONCANCEL#__" style="width: 70px;" onclick="OnCancel()">
     </td>
     </tr>
-</table>
-<map NAME="redspinmap">
-   <area shape="rect" coords="0,0,13,10"  onclick="IncrRed()">
-   <area shape="rect" coords="0,11,13,22"  onclick="DecrRed()">
-</map>
-<map NAME="greenspinmap">
-   <area shape="rect" coords="0,0,13,10"  onclick="IncrGreen()">
-   <area shape="rect" coords="0,11,13,22"  onclick="DecrGreen()">
-</map>
-<map NAME="bluespinmap">
-   <area shape="rect" coords="0,0,13,10"  onclick="IncrBlue()">
-   <area shape="rect" coords="0,11,13,22"  onclick="DecrBlue()">
-</map>
-
+  </table>
+  <map NAME="redspinmap">
+    <area shape="rect" coords="0,0,13,10"  onclick="IncrRed()">
+    <area shape="rect" coords="0,11,13,22"  onclick="DecrRed()">
+  </map>
+  <map NAME="greenspinmap">
+    <area shape="rect" coords="0,0,13,10"  onclick="IncrGreen()">
+    <area shape="rect" coords="0,11,13,22"  onclick="DecrGreen()">
+  </map>
+  <map NAME="bluespinmap">
+    <area shape="rect" coords="0,0,13,10"  onclick="IncrBlue()">
+    <area shape="rect" coords="0,11,13,22"  onclick="DecrBlue()">
+  </map>
 </body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/contextmenu.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/contextmenu.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/contextmenu.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -52,27 +52,26 @@
 
 function enableArrow(menuObj, enabled, up)
 {
-   if(up)
-      menuObj.scrollUpArrow.src = enabled? menuObj.iconScrollUp: menuObj.iconScrollUpDisabled;
-   else
-      menuObj.scrollDownArrow.src = enabled? menuObj.iconScrollDown: menuObj.iconScrollDownDisabled;
+    if(up)
+        menuObj.scrollUpArrow.src = enabled? menuObj.iconScrollUp: menuObj.iconScrollUpDisabled;
+    else
+        menuObj.scrollDownArrow.src = enabled? menuObj.iconScrollDown: menuObj.iconScrollDownDisabled;
 }
 
 function onEnterOption(e)
 {
     var bgcolor = "#dcdcdc";
     var color = "black";
-    
+
     var menuObj = this.menuObj;
     if(menuObj != null)
     {
         var name = firefox? this.attributes["name"].nodeValue: this.name;
-        
         if(name.indexOf("Sub:") == 0)
         {
             var subMenu = menuObj.subMenus[name.substr(4)];
-
             if(menuObj.currChildMenu)
+            {
                 if(subMenu.menuName == menuObj.currChildMenu.menuName)
                 {
                     this.style.backgroundColor = bgcolor;
@@ -84,6 +83,7 @@
                     hidePopup(menuObj.currChildMenu);
                     menuObj.currChildMenu = null;
                 }
+            }
             menuObj.mouseY = (msie? event.clientY: e.clientY);
             menuObj.currChildMenu = subMenu;
             showPopup(subMenu, true, -1, -1);
@@ -95,24 +95,24 @@
                 hidePopup(menuObj.currChildMenu);
                 menuObj.currChildMenu = null;
             }
-                
+
             if(menuObj.owner)
             {
                 try
                 {
                     menuObj.owner.OnCommandSelected(name);
-                } catch(e){}
+                }
+                catch(e) {}
             }
-                
+
             var enabled = firefox? this.attributes["state"].nodeValue: this.state;
             if(!enabled || enabled == "false")
                 return true;
-            
         }
     }
+
     this.style.backgroundColor = bgcolor;
     this.style.color = color;
-
     return true;
 }
 
@@ -130,7 +130,8 @@
             try
             {
                 menuObj.owner.OnCommandSelected(-1);
-            } catch(e) {}
+            }
+            catch(e) {}
         }
         name = firefox? this.attributes["name"].nodeValue: this.name;
         if(name.indexOf("Sub:") != 0)
@@ -143,7 +144,6 @@
 
     this.style.backgroundColor = bgcolor;
     this.style.color = color;
-
     return true;
 }
 
@@ -162,7 +162,7 @@
         scrollingMenu.scrolled = 0;
     scrollingMenu.innerListDiv.style.top = -scrollingMenu.scrolled +"px";
     enableArrow(scrollingMenu, true, false);
-    
+
     if(scrollingMenu.scrolled == 0)
     {
         clearInterval(scrollingMenu.scrollTimer);
@@ -178,7 +178,7 @@
         alert("No Menu object !!!");
         return;
     }
-        
+
     if(scrollingMenu.scrolled >= scrollingMenu.scrollAmount)
         return;
     scrollingMenu.scrolled += scrollingMenu.scrollInc;
@@ -199,13 +199,12 @@
 {
     var ev = (msie? event: e);
     var tgt = (msie? ev.srcElement: e.target);
-    
+
     var menuObj = tgt.menuObj;
     if(menuObj == null)
         return false;
-        
+
     scrollingMenu = menuObj;
-    
     if(!menuObj.scrolling)
     {
         menuObj.scrollTimer = setInterval(scrollUp, menuObj.scrollDelay);
@@ -218,13 +217,12 @@
 {
     var ev = (msie? event: e);
     var tgt = (msie? ev.srcElement: e.target);
-    
+
     var menuObj = tgt.menuObj;
     if(menuObj == null)
         return false;
 
     scrollingMenu = null;
-
     if(menuObj.scrolling)
     {
         clearInterval(menuObj.scrollTimer);
@@ -237,13 +235,12 @@
 {
     var ev = (msie? event: e);
     var tgt = (msie? ev.srcElement: e.target);
-    
+
     var menuObj = tgt.menuObj;
     if(menuObj == null)
         return false;
-    
+
     scrollingMenu = menuObj;
-    
     if(!menuObj.scrolling)
     {
         menuObj.scrollTimer = setInterval(scrollDown, menuObj.scrollDelay);
@@ -260,7 +257,8 @@
         if(menu.parentMenu == null)
             break;
         menu = menu.parentMenu;
-    } while(true);
+    }
+    while(true);
 
     hidePopup(menu);
     if(menu.owner)
@@ -268,7 +266,8 @@
         try
         {
             menu.owner.ExecuteCommand(option);
-        } catch(e){}
+        }
+        catch(e) {}
     }
 }
 
@@ -276,7 +275,7 @@
 {
     var ev = (msie? (e == null? event: e): e);
     var tgt = getOptionElement(msie? ev.srcElement: e.target);
-    
+
     var menuObj = tgt == null? null: tgt.menuObj;
     if(menuObj != null)
     {
@@ -289,15 +288,12 @@
         return false;
 }
 
-
 function getOptionElement(elt)
 {
     if(elt == null)
         return null;
-        
     while(elt && elt.nodeName != "TR")
         elt = elt.parentNode;
-        
     return elt;
 }
 
@@ -319,8 +315,8 @@
 
 function startBuildMenuContent(menuObj)
 {
-   resetContent(menuObj);
-   menuObj.content = "<div class=\"PopupScrollUpArea\" id=\"" + menuObj.menuName + "ScrollUpArea\" align=center style=\"height: 12px;\"><img id=\"" + menuObj.menuName + "ArrowUp\" src=\"" + menuObj.iconScrollUp + "\" width=16 height=16></div>" +
+    resetContent(menuObj);
+    menuObj.content = "<div class=\"PopupScrollUpArea\" id=\"" + menuObj.menuName + "ScrollUpArea\" align=center style=\"height: 12px;\"><img id=\"" + menuObj.menuName + "ArrowUp\" src=\"" + menuObj.iconScrollUp + "\" width=16 height=16></div>" +
         "<div class=\"PopupList\" id=\"" + menuObj.menuName + "List\" style=\"background-color: " + menuObj.bkColor + "\">\n" +
         "<div class=\"PopupInnerList\" id=\"" + menuObj.menuName + "InnerList\" style=\"background-color: " + menuObj.bkColor + "\">\n" +
         "<table class=\"PopupTableContent\" id=\"Tbl" + menuObj.menuName + "\" width=100% cellspacing=0 cellpadding=0 style=\"background-color: " + menuObj.bkColor + "\">\n";
@@ -346,7 +342,7 @@
             imgTag = "<img width=16 height=16 id=\"PMI" + param + "\" src=\"" + icon + "\" style=\"position: relative; top: 2px; left: 0px;\">";
         var optNum = menuObj.optionCount++ + 1;
 
-        if(type == 1)        
+        if(type == 1)
             menuObj.content += "<tr height=21 id=\"" + (menuObj.menuName + optNum) + "\" state=\"" + (enabled? "true": "false") + "\" icon=\"" + icon + "\" icond=\"" + iconDisabled +  "\" name=\"" + param + "\"><td width=24 align=center><div style=\"width: 100%; height: 21px;\">" + imgTag + "</td><td><span id=\"" + (menuObj.menuName + "T" + optNum) + "\">" + text + "</span></td><td width=8></div></td></tr>\n";
         else
             menuObj.content += "<tr height=21 id=\"" + (menuObj.menuName + optNum) + "\" name=\"" + param + "\"><td width=24 align=center><div style=\"width: 100%; height: 21px;\">" + imgTag + "</td><td><span id=\"" + (menuObj.menuName + "T" + optNum) + "\">" + text + "</span></td><td width=8><img src=\"" + iconCtxMenu + "\"></div></td></tr>\n";
@@ -371,16 +367,16 @@
     menuObj.scrollDownArea = document.getElementById(menuObj.menuName + "ScrollDownArea");
     menuObj.scrollUpArrow = document.getElementById(menuObj.menuName + "ArrowUp");
     menuObj.scrollDownArrow = document.getElementById(menuObj.menuName + "ArrowDown");
-    
+
     menuObj.scrollUpArea.menuObj = menuObj;
     menuObj.scrollDownArea.menuObj = menuObj;
-    
+
     for(var i=1; ; i++)
     {
         var obj = document.getElementById(menuObj.menuName + i);
         if(obj == null)
             break;
-            
+
         var name = firefox? obj.attributes["name"].nodeValue: obj.name;
         if(name.indexOf("Sub:") != 0)
         {
@@ -391,7 +387,8 @@
                 try
                 {
                     enabled = menuObj.owner.OnEnableCommand(name);
-                } catch(e) {}
+                }
+                catch(e) {}
             }
             if(state != enabled)
             {
@@ -405,20 +402,20 @@
                     iconElt.src = enabled? (firefox? obj.attributes["icon"].nodeValue: obj.icon): (firefox? obj.attributes["icond"].nodeValue: obj.icond);
             }
          }
-            
+
         obj.onmouseover = onEnterOption;
         obj.onmouseout = onLeaveOption;
         obj.menuObj = menuObj;
     }
-    
+
     menuObj.scrolled = 0;
     menuObj.scrolling = false;
-    
+
     menuObj.scrollUpArea.onmousemove = onStartScrollingUp
     menuObj.scrollUpArea.onmouseout = onStopScrolling
     menuObj.scrollDownArea.onmousemove = onStartScrollingDown
     menuObj.scrollDownArea.onmouseout = onStopScrolling
-    
+
     var w, h;
     if(msie)
     {
@@ -430,7 +427,7 @@
         w = window.innerWidth - 2;
         h = window.innerHeight - 2;
     }
-    
+
     //calculate menu width and x position
     var mw = menuObj.minSize;
     if(optimizeWidth)
@@ -439,7 +436,7 @@
         if(lenMax > mw)
             mw = lenMax;
     }
-    
+
     menuObj.width = mw;
     var xPos;
 
@@ -517,7 +514,7 @@
     menuObj.menuDiv.style.left = xPos + "px";
     menuObj.menuDiv.style.visibility = "visible";
     menuObj.menuDiv.style.top = yPos + "px";
-    
+
     if(menuObj.withIFrame)
     {
         var iframe = document.getElementById("IFr" + menuObj.menuName);
@@ -528,41 +525,42 @@
         iframe.style.zIndex = menuObj.nesting * 2 + 100;
         iframe.style.visibility = "visible";
     }
-    
+
     menuObj.menuDiv.style.zIndex = menuObj.nesting * 2 + 101;
-    
+
    if(menuObj.nesting == 0 && menuObj.owner)
    {
         try
         {
             menuObj.owner.OnMenuShown(true);
-        } catch(e){}
+        }
+        catch(e) {}
    }
-    
 }
 
 function hidePopup(menuObj)
 {
-   if(menuObj == null)
-       return;
+    if(menuObj == null)
+        return;
 
-   if(menuObj.currChildMenu)
-   {
+    if(menuObj.currChildMenu)
+    {
         hidePopup(menuObj.currChildMenu);
         menuObj.currChildMenu = null;
-   }
-   if(menuObj.menuDiv != null)
-      menuObj.menuDiv.style.visibility = "hidden";
-   if(menuObj.withIFrame)
+    }
+    if(menuObj.menuDiv != null)
+        menuObj.menuDiv.style.visibility = "hidden";
+    if(menuObj.withIFrame)
         document.getElementById("IFr" + menuObj.menuName).style.visibility = "hidden";
-   clearInterval(menuObj.scrollTimer);
-   if(menuObj.nesting == 0 && menuObj.owner)
-   {
+    clearInterval(menuObj.scrollTimer);
+    if(menuObj.nesting == 0 && menuObj.owner)
+    {
         try
         {
             menuObj.owner.OnMenuShown(false);
-        } catch(e){}
-   }
+        }
+        catch(e) {}
+    }
 }
 
 function isPopupOpen(menuObj)

Modified: trunk/MgDev/Web/src/viewerfiles/digitize.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/digitize.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/digitize.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -8,13 +8,15 @@
 {
     this.points = new Array();
     this.Count = 0;
-    
-    this.AddPoint = function(pt) {
+
+    this.AddPoint = function(pt)
+    {
         this.points.push(pt);
         this.Count ++;
     }
-    
-    this.Point = function(i) {
+
+    this.Point = function(i)
+    {
         if(i < 0 || i >= this.points.length)
             return null;
         return this.points[i];
@@ -25,8 +27,9 @@
 {
     this.Center = null;
     this.Radius = 0;
-    
-    this.SetRadius = function(pt) {
+
+    this.SetRadius = function(pt)
+    {
         dx = pt.X - this.Center.X;
         dy = pt.Y - this.Center.Y;
         this.Radius = Math.sqrt(dx*dx + dy*dy);
@@ -39,7 +42,8 @@
     this.Point2 = null;
 }
 
-function Polygon() {
+function Polygon()
+{
     this.LineStringInfo = LineString;
     this.LineStringInfo();
 }
@@ -57,8 +61,9 @@
     this.tiphandler = tiphandler;
     this.tiptext = tiptext;
     this.cancelTgt = cancelTgt;
-    
-    this.InitFeedback = function() {
+
+    this.InitFeedback = function()
+    {
         var rd = document.getElementById(this.fbDiv).style;
         rd.position = "absolute";
         rd.left = this.fbPos + "px";
@@ -68,22 +73,25 @@
         rd.visibility = "visible";
         rd.clip = "rect(0px " + this.fbW + "px " + this.fbH + "px " + "0px)";
     }
-    this.ClearFeedback = function() {
+    this.ClearFeedback = function()
+    {
         if(this.fbDiv)
             document.getElementById(this.fbDiv).style.visibility = "hidden";
         if(this.fbShape)
             this.fbShape.clear();
     }
-    this.DisplayTipFeedback = function(x, y, show) {
-        if(this.tiphandler != null) {
+    this.DisplayTipFeedback = function(x, y, show)
+    {
+        if(this.tiphandler != null)
             this.tiphandler(x + this.fbPos + 16, y + 16, this.tiptext, show);
-        }
     }
-    this.Cancel = function() {
+    this.Cancel = function()
+    {
         this.ClearFeedback();
         this.DisplayTipFeedback(0, 0, false);
     }
-    this.EnableCancel = function() {
+    this.EnableCancel = function()
+    {
         if(this.cancelTgt)
             this.cancelTgt.focus();
     }
@@ -94,12 +102,15 @@
     this.DigitizerInfo = Digitizer;
     this.DigitizerInfo(handler, cnvfunc, null, null, null, null, null, null);
 
-    this.MouseDown = function(e, x, y) {
+    this.MouseDown = function(e, x, y)
+    {
     }
-    this.MouseUp = function(e, x, y) {
+    this.MouseUp = function(e, x, y)
+    {
         this.handler(cnvfunc(x, y));
     }
-    this.MouseMove = function(e, x, y) {
+    this.MouseMove = function(e, x, y)
+    {
     }
 }
 
@@ -111,22 +122,26 @@
     this.xstart = 0;
     this.ystart = 0;
 
-    this.MouseDown = function(e, x, y) {
+    this.MouseDown = function(e, x, y)
+    {
         this.xstart = x;
         this.ystart = y;
         this.line.AddPoint(cnvfunc(x, y));
         this.InitFeedback();
     }
-    this.MouseUp = function(e, x, y) {
+    this.MouseUp = function(e, x, y)
+    {
         this.line.AddPoint(cnvfunc(x, y));
         this.ClearFeedback();
         this.handler(this.line);
     }
-    this.MouseMove = function(e, x, y) {
+    this.MouseMove = function(e, x, y)
+    {
         if(this.line.Count > 0)
             this.Feedback(x, y);
     }
-    this.Feedback = function(x, y) {
+    this.Feedback = function(x, y)
+    {
         this.fbShape.clear();
         this.fbShape.setColor(this.fbColor);
         this.fbShape.drawLine(this.xstart, this.ystart, x, y);
@@ -141,28 +156,33 @@
     this.circle = new Circle();
     this.xstart = -1;
     this.ystart = -1;
-    
-    this.MouseDown = function(e, x, y) {
+
+    this.MouseDown = function(e, x, y)
+    {
         this.xstart = x;
         this.ystart = y;
         this.circle.Center = cnvfunc(x, y);
         this.InitFeedback();
     }
-    this.MouseUp = function(e, x, y) {
+    this.MouseUp = function(e, x, y)
+    {
         this.ClearFeedback();
         this.circle.SetRadius(cnvfunc(x, y));
         this.handler(this.circle);
     }
-    this.MouseMove = function(e, x, y) {
+    this.MouseMove = function(e, x, y)
+    {
         if(this.xstart != -1)
             this.Feedback(x, y);
     }
-    this.GetRadius = function(x, y) {
+    this.GetRadius = function(x, y)
+    {
         dx = x - this.xstart;
         dy = y - this.ystart;
         return Math.sqrt(dx*dx + dy*dy);
     }
-    this.Feedback = function(x, y) {
+    this.Feedback = function(x, y)
+    {
         r = this.GetRadius(x, y);
         x1 = this.xstart - r;
         w = 2 * r;
@@ -182,29 +202,31 @@
     this.rect = new Rectangle();
     this.xstart = -1;
     this.ystart = -1;
-    
-    this.MouseDown = function(e, x, y) {
+
+    this.MouseDown = function(e, x, y)
+    {
         this.xstart = x;
         this.ystart = y;
         this.rect.Point1 = cnvfunc(x, y);
         this.InitFeedback();
     }
-    this.MouseMove = function(e, x, y) {
+    this.MouseMove = function(e, x, y)
+    {
         if(this.xstart != -1)
             this.Feedback(x, y);
     }
-    this.MouseUp = function(e, x, y) {
+    this.MouseUp = function(e, x, y)
+    {
         this.ClearFeedback();
         this.rect.Point2 = cnvfunc(x, y);
-        if(this.xstart > x) {
-            X = this.rect.Point1.X; this.rect.Point1.X = this.rect.Point2.X; this.rect.Point2.X = X;
-        }
-        if(this.ystart > y) {
-            Y = this.rect.Point1.Y; this.rect.Point1.Y = this.rect.Point2.Y; this.rect.Point2.Y = Y;
-        }
+        if(this.xstart > x)
+            x = this.rect.Point1.X; this.rect.Point1.X = this.rect.Point2.X; this.rect.Point2.X = X;
+        if(this.ystart > y)
+            y = this.rect.Point1.Y; this.rect.Point1.Y = this.rect.Point2.Y; this.rect.Point2.Y = Y;
         this.handler(this.rect);
     }
-    this.Feedback = function(x, y) {
+    this.Feedback = function(x, y)
+    {
         x1 = this.xstart < x? this.xstart: x;
         y1 = this.ystart < y? this.ystart: y;
         this.fbShape.clear();
@@ -222,15 +244,19 @@
     this.pline = closed? (new Polygon()) : (new LineString());
     this.xs = new Array();
     this.ys = new Array();
-    
-    this.MouseDown = function(e, x, y) {
+
+    this.MouseDown = function(e, x, y)
+    {
     }
-    this.MouseUp = function(e, x, y) {
+    this.MouseUp = function(e, x, y)
+    {
         if(this.xs.length == 0)
             this.InitFeedback();
         this.pline.AddPoint(cnvfunc(x, y));
-        if(!e.ctrlKey) {
-            if(this.xs.length == 0) {
+        if(!e.ctrlKey)
+        {
+            if(this.xs.length == 0)
+            {
                 this.xs.push(x); this.xs.push(x);
                 this.ys.push(y); this.ys.push(y);
             }
@@ -242,7 +268,8 @@
             }
             this.EnableCancel();
         }
-        else {
+        else
+        {
             this.ClearFeedback();
             this.DisplayTipFeedback(0, 0, false);
             if(closed)
@@ -250,20 +277,24 @@
             this.handler(this.pline);
         }
     }
-    this.MouseMove = function(e, x, y) {
-        if(this.xs.length > 0) {
+    this.MouseMove = function(e, x, y)
+    {
+        if(this.xs.length > 0)
+        {
             this.Feedback(x, y);
             this.DisplayTipFeedback(x, y, true);
         }
     }
-    this.Feedback = function(x, y) {
+    this.Feedback = function(x, y)
+    {
         this.xs[this.xs.length - 1] = x;
         this.ys[this.ys.length - 1] = y;
         this.fbShape.clear();
         this.fbShape.setColor(this.fbColor);
         if(this.xs.length == 2)
             this.fbShape.drawLine(this.xs[0], this.ys[0], this.xs[1], this.ys[1]);
-        else {
+        else
+        {
             if(closed)
                 this.fbShape.drawPolygon(this.xs, this.ys);
             else

Modified: trunk/MgDev/Web/src/viewerfiles/dwfmappane.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/dwfmappane.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/dwfmappane.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,59 +1,61 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
-        body.TaskPane
-        {
-            border-right-width: 1px;
-            border-right-style: solid;
-            border-right-color: #a0a0a0;
-        }
-        div.PopupMenu
-        {
-            position: absolute;
-            width: 200px;
-            background-color: white;
-            position: absolute;
-            left: -500px;
-            top: 1px;
-            border: solid 1px #a0a0a0;
-            overflow: hidden;
-            z-index: -1;
-        }
-        div.PopupScrollUpArea
-        {
-            position: absolute;
-            left: 0px;
-            top: 0px;
-            height: 12px; 
-            background: white;
-            width: 100%%;
-            cursor: hand;
-            visibility: hidden;
-        }
-        div.PopupScrollDownArea
-        {
-            position: absolute;
-            left: 0px;
-            top: 0px;
-            height: 12px; 
-            background: white;
-            width: 100%%;
-            cursor: hand;
-            visibility: hidden;
-        }
-        span.PopupMetrics
-        {
-            font-family: __#@font#__;
-            font-size: __#@fontsize#__;
-            font-weight: normal;
-        }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language="javascript" src="../viewerfiles/contextmenu.js"></script>
-    <script language="javascript" src="../viewerfiles/hashtable.js"></script>
-    <script language=javascript>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
+    body.TaskPane
+    {
+        border-right-width: 1px;
+        border-right-style: solid;
+        border-right-color: #a0a0a0;
+    }
+    div.PopupMenu
+    {
+        position: absolute;
+        width: 200px;
+        background-color: white;
+        position: absolute;
+        left: -500px;
+        top: 1px;
+        border: solid 1px #a0a0a0;
+        overflow: hidden;
+        z-index: -1;
+    }
+    div.PopupScrollUpArea
+    {
+        position: absolute;
+        left: 0px;
+        top: 0px;
+        height: 12px;
+        background: white;
+        width: 100%%;
+        cursor: hand;
+        visibility: hidden;
+    }
+    div.PopupScrollDownArea
+    {
+        position: absolute;
+        left: 0px;
+        top: 0px;
+        height: 12px;
+        background: white;
+        width: 100%%;
+        cursor: hand;
+        visibility: hidden;
+    }
+    span.PopupMetrics
+    {
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
+        font-weight: normal;
+    }
+</style>
+
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language="javascript" src="../viewerfiles/contextmenu.js"></script>
+<script language="javascript" src="../viewerfiles/hashtable.js"></script>
+<script language="javascript">
+
 function LayerDef(legend, name, objectId)
 {
     this.legend = legend;
@@ -73,41 +75,62 @@
 
 // public functions -----------------------------------------------
 //
-function ZoomToView(x,y,scale,refresh) {
+function ZoomToView(x,y,scale,refresh)
+{
     emapViewer.ZoomToView(x, y, scale);
     if(refresh == 1)
         emapViewer.Refresh();
 }
-function Refresh() {
+
+function Refresh()
+{
     emapViewer.Refresh();
 }
-function GetMapWidth() {
+
+function GetMapWidth()
+{
     return emapViewer.MapWidth;
 }
-function GetMapHeight() {
+
+function GetMapHeight()
+{
     return emapViewer.MapHeight;
 }
-function GetSessionId() {
+
+function GetSessionId()
+{
     return emapViewer.Document.Properties("_AW_Session").Value;
 }
-function GetMapName() {
+
+function GetMapName()
+{
     return emapViewer.Document.Properties("_AW_MapName").Value;
 }
-function ScreenToMapUnits(x, y) {
+
+function ScreenToMapUnits(x, y)
+{
     return emapViewer.ScreenToMapUnits(x, y);
 }
-function MapUnitsToLatLon(x, y) {
+
+function MapUnitsToLatLon(x, y)
+{
     return emapViewer.MapUnitsToLonLat(x, y);
 }
-function GetSelectedCount() {
+
+function GetSelectedCount()
+{
     if(selectionSet == null)
         selectionSet = emapViewer.SelectionSet;
     return selectionSet.Count;
 }
-function ClearSelection() {
+
+function ClearSelection()
+{
     emapViewer.ExecuteCommand("CLEARSELECTION");
 }
-function GetLayers(onlyVisible, onlySelectable) {
+
+function GetLayers(onlyVisible, onlySelectable)
+{
     var layers = new Array();
     var list = new Enumerator(emapViewer.Document.Layers);
     for (; !list.atEnd(); list.moveNext())
@@ -123,13 +146,15 @@
     }
     return layers;
 }
-function GetSelectedLayers() {
+
+function GetSelectedLayers()
+{
     var lyrId = "";
     var layers = new Array();
     var ht = new Hashtable();
     if(selectionSet == null)
         selectionSet = emapViewer.SelectionSet;
-    
+
     for(selEnumerator = new Enumerator(selectionSet); !selEnumerator.atEnd(); selEnumerator.moveNext())
     {
         var feature = selEnumerator.item();
@@ -150,76 +175,112 @@
     }
     return layers;
 }
-function GetSelectionXML() {
+
+function GetSelectionXML()
+{
     if(GetSelectedCount() == 0)
         return "";
     return emapViewer.SerializeSet(selectionSet);
 }
-function SetSelectionXML(xmlSet) {
+
+function SetSelectionXML(xmlSet)
+{
     emapViewer.ExecuteCommand("CLEARSELECTION");
     var set = emapViewer.DeserializeSet(xmlSet);
-    emapViewer.SelectionSet = set;   
+    emapViewer.SelectionSet = set;
 }
-function IsEnglishUnits() {
+
+function IsEnglishUnits()
+{
     return !emapViewer.MetricMapUnits;
 }
-function IsLatLongDisplayUnits() {
+
+function IsLatLongDisplayUnits()
+{
     return emapViewer.LonLatCoordinateUnits;
 }
-function SetEnglishUnits(isEnglish) {
+
+function SetEnglishUnits(isEnglish)
+{
     emapViewer.MetricMapUnits = !isEnglish;
 }
-function SetLatLonDisplayUnits(isLatLon) {
+
+function SetLatLonDisplayUnits(isLatLon)
+{
     emapViewer.LonLatCoordinateUnits = isLatLon;
 }
-function GetMapUnitsType() {
+
+function GetMapUnitsType()
+{
     return emapViewer.Document.CoordinateSpace.Units.UnitType;
 }
-function GetMetersPerUnits() {
+
+function GetMetersPerUnits()
+{
     return emapViewer.Document.CoordinateSpace.Units.ScaleFactor;
 }
-function GetCenter() {
+
+function GetCenter()
+{
     return emapViewer.MapCenter;
 }
-function GetScale() {
+
+function GetScale()
+{
     return emapViewer.MapScale;
 }
-function DigitizePoint(handler) {
+
+function DigitizePoint(handler)
+{
     if(!PrepareDigitization(handler))
         return;
     emapViewer.DocumentHandler.DigitizePoint();
 }
-function DigitizeLine(handler) {
+
+function DigitizeLine(handler)
+{
     if(!PrepareDigitization(handler))
         return;
     emapViewer.DocumentHandler.DigitizeLine();
 }
-function DigitizeLineString(handler) {
+
+function DigitizeLineString(handler)
+{
     if(!PrepareDigitization(handler))
         return;
     emapViewer.DocumentHandler.DigitizeLineString();
 }
-function DigitizePolygon(handler) {
+
+function DigitizePolygon(handler)
+{
     if(!PrepareDigitization(handler))
         return;
     emapViewer.DocumentHandler.DigitizePolygon();
 }
-function DigitizeCircle(handler) {
+
+function DigitizeCircle(handler)
+{
     if(!PrepareDigitization(handler))
         return;
     emapViewer.DocumentHandler.DigitizeCircle();
 }
-function DigitizeRectangle(handler) {
+
+function DigitizeRectangle(handler)
+{
     if(!PrepareDigitization(handler))
         return;
     emapViewer.DocumentHandler.DigitizeRectangle();
 }
-function IsDigitizing() {
+
+function IsDigitizing()
+{
     return digitizing;
 }
+
 // private functions -----------------------------------------------
 //
-function ExecuteMapAction(action) {
+function ExecuteMapAction(action)
+{
     switch(action)
     {
         case 1:
@@ -290,18 +351,20 @@
     }
     digitizing = false;
 }
-function InitDocument() {
+
+function InitDocument()
+{
     document.onmousedown = OnMouseDown;
 
     document.getElementById("FlyoutDivs").innerHTML = InitToolbarFlyouts(parent.toolbarItems);
     if(parent.IsContextMenu())
         document.getElementById("CtxMenuDivs").innerHTML = InitContextMenu(parent.ctxMenuItems);
-        
+
     // the current product (DWF Viewer or ADR)
     var productName = DWFViewer.ProductName;
 
     // create the event relayer object, accounting for the product
-    frdoc = frames["Relayer"].document;     
+    frdoc = frames["Relayer"].document;
     var object = frdoc.createElement("OBJECT");
     object.style.visibility = "hidden";
     object.id = 'EMapEventRelayer';
@@ -314,11 +377,15 @@
     // add the relayer to the viewer
     DWFViewer.AddEventRelayer(frdoc.EMapEventRelayer);
 }
-function ContextMenu(x, y) {
+
+function ContextMenu(x, y)
+{
     hidePopup(tbMenu);
     showPopup(ctxMenu, true, x, y);
 }
-function OnMouseDown(e) {
+
+function OnMouseDown(e)
+{
     if(!PopupMouseDown(e))
     {
         hidePopup(tbMenu)
@@ -326,7 +393,9 @@
         parent.ForwardMouseDown(document, e);
     }
 }
-function InitToolbarFlyouts(items) {
+
+function InitToolbarFlyouts(items)
+{
     var divs = "";
     for(var i = 0; i < items.length; i++)
     {
@@ -339,7 +408,9 @@
     }
     return divs;
 }
-function BuildContextMenuObjects(menus, parentMenu, items, divName, nesting) {
+
+function BuildContextMenuObjects(menus, parentMenu, items, divName, nesting)
+{
     var menuObj = new MenuData(divName,20, 21, 50, 150, "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif", parent, true, "white");
     startBuildMenuContent(menuObj);
     var subIndex = 0;
@@ -364,13 +435,15 @@
     menuObj.parentMenu = parentMenu;
     menuObj.nesting = nesting;
     menus[menus.length] = menuObj;
-    
+
     return menuObj;
 }
-function InitContextMenu(items) {
+
+function InitContextMenu(items)
+{
     var menus = new Array();
     ctxMenu = BuildContextMenuObjects(menus, null, items, 'CtxMenu', 0);
-    
+
     var divs = "";
     for(var i = 0; i < menus.length; i++)
     {
@@ -378,16 +451,18 @@
         divs += "<iframe id=\"IFr" + menu.menuName + "\" style=\"position:absolute;top:0px;left:0px;width:0px;height:0px;background-color:white;\" frameborder=\"0\"></iframe>\n";
         divs += "<div class=\"PopupMenu\" id=\"" + menu.menuName + "\"></div>\n";
     }
-    
+
     return divs;
 }
-function OpenFlyout(xpos, tbItemIndex) {
+
+function OpenFlyout(xpos, tbItemIndex)
+{
     var tbItem = parent.toolbarItems[tbItemIndex];
-    tbMenu = new MenuData(tbItem.htmlElt, 20, 21, 50, 150, 
-                        "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif",
-                        parent, true, "#f0f0f0");
+    tbMenu = new MenuData(tbItem.htmlElt, 20, 21, 50, 150,
+                          "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif",
+                          parent, true, "#f0f0f0");
     startBuildMenuContent(tbMenu);
-    
+
     var commands = parent.commands;
     var items = tbItem.subItems;
     for(var i = 0; i < items.length; i++)
@@ -399,16 +474,20 @@
         {
             var cmd = commands[item.cmdIndex];
             addMenuOption(tbMenu, cmd.name, item.cmdIndex, 1, cmd.icon, cmd.iconDisabled, cmd.enabled);
-        }    
-    }        
+        }
+    }
     endBuildMenuContent(tbMenu);
     showPopup(tbMenu, false, xpos, 0);
 }
-function OnForwardMouseDown(e) {
+
+function OnForwardMouseDown(e)
+{
     hidePopup(tbMenu);
     hidePopup(ctxMenu);
 }
-function Print(layouts, title) {
+
+function Print(layouts, title)
+{
     var layoutColl = new ActiveXObject("AdCommon.Collection2");
     var unitStr = emapViewer.MetricMapUnits? "Metric": "US-English";
 
@@ -426,23 +505,27 @@
             layout.UnitType = unitStr;
             layoutColl._Add(layout, name);
         }
-        catch(e)
-        {
-        }
+        catch(e) {}
     }
     emapViewer.ShowPrintDialog(layoutColl);
 }
-function OnDigitizeEnd(shape) {
-    if(digihandler != null) {
+
+function OnDigitizeEnd(shape)
+{
+    if(digihandler != null)
+    {
         digitizing = false;
         digihandler(shape);
         digihandler = null;
     }
 }
-function PrepareDigitization(handler) {
+
+function PrepareDigitization(handler)
+{
     if(handler == null)
         return false;
-    if(parent.InMeasure()) {
+    if(parent.InMeasure())
+    {
         parent.SetStatusMsg("__#MEASALREADYRUNNING#__");
         return false;
     }
@@ -458,22 +541,22 @@
 var PropertiesBandVisible="%s";
 var HyperlinkTarget="%s";
 
-    </script>
+</script>
 
-   <script src="../viewerfiles/initdwfctrl.js"></script>
-    
-    <script language=javascript for="DWFViewer" event="OnLButtonDown(x, y, handled)">
-        parent.ForwardMouseDown(document, null);
-        if(parent.ClickMap(x, y))
-            handled.State = true;
-    </script>
+<script src="../viewerfiles/initdwfctrl.js"></script>
 
-    <script language="javascript" for="DWFViewer" event="OnKeyDown(key, handled)">
-        if(key == 27 && digitizing)
-            digitizing = false;            
-    </script>
+<script language=javascript for="DWFViewer" event="OnLButtonDown(x, y, handled)">
+    parent.ForwardMouseDown(document, null);
+    if(parent.ClickMap(x, y))
+        handled.State = true;
+</script>
 
-    <script language=javascript for="DWFViewer" event="OnExecuteCommandEx(itemType, state, data, handled)">
+<script language="javascript" for="DWFViewer" event="OnKeyDown(key, handled)">
+    if(key == 27 && digitizing)
+        digitizing = false;
+</script>
+
+<script language=javascript for="DWFViewer" event="OnExecuteCommandEx(itemType, state, data, handled)">
     if(itemType == "CONTEXTMENU")
     {
         if(parent.IsContextMenu())
@@ -484,36 +567,35 @@
             handled.State = true;
             var x = data >> 16;
             var y = data %% 65536;
-            
+
             self.ContextMenu(x - self.screenLeft, y - self.screenTop);
         }
         else
             handled.State = true;
     }
-    </script>
+</script>
 
-    <script language=javascript for="DWFViewer" event="OnMouseMove(buttons, x, y, handled)">
-        if(!parent.OnCursorPosChanged(x, y))
-            handled.State = true;
-    </script>
+<script language=javascript for="DWFViewer" event="OnMouseMove(buttons, x, y, handled)">
+    if(!parent.OnCursorPosChanged(x, y))
+        handled.State = true;
+</script>
 
-    <script language=javascript for="DWFViewer" event="OnEndLoadItem(itemName, data, res)">
-        if(itemName == "DOCUMENT")
-        {
-            emapViewer = DWFViewer.DocumentHandler;
-            parent.OnMapLoaded();
-            parent.OnScaleChanged(emapViewer.MapScale);
-        }
-    </script>
+<script language=javascript for="DWFViewer" event="OnEndLoadItem(itemName, data, res)">
+    if(itemName == "DOCUMENT")
+    {
+        emapViewer = DWFViewer.DocumentHandler;
+        parent.OnMapLoaded();
+        parent.OnScaleChanged(emapViewer.MapScale);
+    }
+</script>
 
-  </head>
-  <body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0 bgcolor=#d0d0d0>
+</head>
+<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0 bgcolor=#d0d0d0>
     <iframe name="Relayer" width=0 height=0 src="../viewerfiles/emaprelayer.html"></iframe>
     <div class="PopupMetricsDiv" id="MetricsDiv"><span class="PopupMetrics" id="Metrics"></span></div>
     <span id="FlyoutDivs"></span>
     <span id="CtxMenuDivs"></span>
-   <div id="DWF"></div>
-   <script language="JScript">CreateDWFControl();</script>
-  </body>
+    <div id="DWF"></div>
+    <script language="JScript">CreateDWFControl();</script>
+</body>
 </html>
-

Modified: trunk/MgDev/Web/src/viewerfiles/emaprelayer.html
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/emaprelayer.html	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/emaprelayer.html	2007-01-19 19:08:41 UTC (rev 1063)
@@ -20,7 +20,8 @@
     </script>
 
     <script language="javascript" for="EMapEventRelayer" event="OnDigitizedRectangle(map, rect)">
-        if(parent.digihandler != null) {
+        if(parent.digihandler != null)
+        {
             y = rect.Y1; rect.Y1 = rect.Y2; rect.Y2 = y;
             parent.OnDigitizeEnd(rect);
         }

Modified: trunk/MgDev/Web/src/viewerfiles/errorpage.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/errorpage.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/errorpage.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,54 +1,57 @@
 <html>
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <title>__#REPORTTITLE#__</title>
-  <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-  <style type="text/css">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>__#REPORTTITLE#__</title>
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     td.Title
     {
-    font-family: __#@font#__;
-    font-weight: bold;
-    font-size: 13pt;
+        font-family: __#@font#__;
+        font-weight: bold;
+        font-size: 13pt;
     }
     .ErrorText
     {
-    font-family: __#@font#__;
-    font-weight: bold;
-    font-size: __#@fontsize#__;
-    color: #ff0000;
-    background-color: #FFFFCC;
+        font-family: __#@font#__;
+        font-weight: bold;
+        font-size: __#@fontsize#__;
+        color: #ff0000;
+        background-color: #FFFFCC;
     }
     .Ctrl
     {
-    font-family: __#@font#__;
-    font-size: __#@fontsize#__;
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
     }
-  </style>
-    <script language=javascript>
-    var popup = %s;     
-    
-    function InitDocument()
-    {
-        GetParent().Refresh();    
-    }
-    
-    function Back()
-    {
-        if(popup)
-            self.close();
-        else
-            GetParent().GotoHomePage();
-    }
+</style>
 
-    function GetParent()
-    {
-        if(popup)
-            return opener;
-        else
-            return parent.parent;
-    }
-    
-    </script>
+<script language=javascript>
+
+var popup = %s;
+
+function InitDocument()
+{
+    GetParent().Refresh();
+}
+
+function Back()
+{
+    if(popup)
+        self.close();
+    else
+        GetParent().GotoHomePage();
+}
+
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
+
+</script>
+
 </head>
 <body onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
 <table class="RegText" border="0" cellspacing="0" width="100%%">
@@ -58,3 +61,4 @@
   <tr><td><input type="button" value="OK" style="width: 70px;" class="Ctrl" onclick="history.back()"><input type="button" value="Cancel" style="width: 70px;" class="Ctrl" onclick="Back()"></td></tr>
 </table>
 </body>
+</html>

Modified: trunk/MgDev/Web/src/viewerfiles/formframe.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/formframe.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/formframe.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -2,15 +2,14 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <script language=javascript>
-// public functions -----------------------------------------------
-//
 function Submit(url, params, target)
 {
     document.getElementById("Params").innerHTML = "";
     form = document.getElementById("Frm");
     form.target = target;
     form.action = url;
-    if(params) {
+    if(params)
+    {
         pfields = "";
         for(i=0; i < params.length; i += 2)
             pfields += "<input id='f" + i + "' type='hidden' name='" + params[i] + "' value=''>\n";

Modified: trunk/MgDev/Web/src/viewerfiles/hashtable.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/hashtable.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/hashtable.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -2,39 +2,40 @@
 {
     this.length = 0;
     this.items = new Array();
-    for (var i = 0; i < arguments.length; i += 2) {
-        if (typeof(arguments[i + 1]) != 'undefined') {
+    for (var i = 0; i < arguments.length; i += 2)
+    {
+        if (typeof(arguments[i + 1]) != 'undefined')
+        {
             this.items[arguments[i]] = arguments[i + 1];
             this.length++;
         }
     }
-   
+
     this.removeItem = function(in_key)
     {
         var tmp_value;
-        if (typeof(this.items[in_key]) != 'undefined') {
+        if (typeof(this.items[in_key]) != 'undefined')
+        {
             this.length--;
             var tmp_value = this.items[in_key];
             delete this.items[in_key];
         }
-       
         return tmp_value;
     }
 
-    this.getItem = function(in_key) {
+    this.getItem = function(in_key)
+    {
         return this.items[in_key];
     }
 
     this.setItem = function(in_key, in_value)
     {
-        if (typeof(in_value) != 'undefined') {
-            if (typeof(this.items[in_key]) == 'undefined') {
+        if (typeof(in_value) != 'undefined')
+        {
+            if (typeof(this.items[in_key]) == 'undefined')
                 this.length++;
-            }
-
             this.items[in_key] = in_value;
         }
-       
         return in_value;
     }
 

Modified: trunk/MgDev/Web/src/viewerfiles/initdwfctrl.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/initdwfctrl.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/initdwfctrl.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,14 +1,15 @@
-function CreateDWFControl() 
+function CreateDWFControl()
 {
-var d = document.getElementById("DWF");
-d.innerHTML = '<object id="DWFViewer"\nclassid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF"\nborder=0\nwidth=100%\nheight=100%\nstyle="position: absolute; left: -1px; top: 0px;" >\n' +
-           '   <param name="Src" value="' + Src + '">\n' +
-           '   <param name="ToolbarVisible" value="False">\n' +
-           '   <param name="NavpaneWidth" value="' + NavpaneWidth + '">\n' +
-           '   <param name="NavpaneVisible" value="' + NavpaneVisible + '">\n' +
-           '   <param name="LayersBandVisible" value="' + LayersBandVisible + '">\n' +
-           '   <param name="PropertiesBandVisible" value="' + PropertiesBandVisible + '">\n' +
-           '   <param name="HyperlinkTarget" value="' + HyperlinkTarget + '">\n' +
-           "   <param name=\"ViewerParam\" value=\"?PreferredDefaultInterface='{69BD6A6D-F788-4A34-BAE9-76AB5F69EF9D}\" />";
-InitDocument();
+    var d = document.getElementById("DWF");
+    d.innerHTML = '<object id="DWFViewer"\nclassid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF"\nborder=0\nwidth=100%\nheight=100%\nstyle="position: absolute; left: -1px; top: 0px;" >\n' +
+                  '  <param name="Src" value="' + Src + '">\n' +
+                  '  <param name="ToolbarVisible" value="False">\n' +
+                  '  <param name="NavpaneWidth" value="' + NavpaneWidth + '">\n' +
+                  '  <param name="NavpaneVisible" value="' + NavpaneVisible + '">\n' +
+                  '  <param name="LayersBandVisible" value="' + LayersBandVisible + '">\n' +
+                  '  <param name="PropertiesBandVisible" value="' + PropertiesBandVisible + '">\n' +
+                  '  <param name="HyperlinkTarget" value="' + HyperlinkTarget + '">\n' +
+                  '  <param name="ViewerParams" value="?PreferredDefaultInterface=\'{69BD6A6D-F788-4A34-BAE9-76AB5F69EF9D}">\n' +
+                  '</object>';
+    InitDocument();
 }

Modified: trunk/MgDev/Web/src/viewerfiles/layerdefinition.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/layerdefinition.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/layerdefinition.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <LayerDefinition version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="LayerDefinition-1.0.0.xsd">
     <VectorLayerDefinition>
-      <ResourceId>%s</ResourceId>
-      <FeatureName>%s</FeatureName>
-      <FeatureNameType>FeatureClass</FeatureNameType>
-      <Geometry>%s</Geometry>
-%s    </VectorLayerDefinition>
-  </LayerDefinition>
+        <ResourceId>%s</ResourceId>
+        <FeatureName>%s</FeatureName>
+        <FeatureNameType>FeatureClass</FeatureNameType>
+        <Geometry>%s</Geometry>
+        %s
+    </VectorLayerDefinition>
+</LayerDefinition>

Modified: trunk/MgDev/Web/src/viewerfiles/legendctrl.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/legendctrl.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/legendctrl.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,51 +1,75 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
 <script language=javascript>
-    var ctrlLoaded = false;
-    var treeReady = false;
-    var intStateCompl = false;
-    var thisFrame = this;
-    var mapFrame = %s;
-    
+
+var ctrlLoaded = false;
+var treeReady = false;
+var intStateCompl = false;
+var thisFrame = this;
+var mapFrame = %s;
+
 // public functions -----------------------------------------------
 //
-function Refresh() {
+function Refresh()
+{
     thisFrame.legendScriptFrame.location.replace("%s?MAPNAME=" + encodeURIComponent(GetMapFrame().GetMapName()) + "&SESSION=" + GetMapFrame().GetSessionId() + "&SUMMARY=");
 }
-function InternalStateComplete() {
+
+function InternalStateComplete()
+{
     return thisFrame.intStateCompl;
 }
-function SetScale(scale) {
+
+function SetScale(scale)
+{
     thisFrame.legendUiFrame.SetScale(scale);
 }
-function GetLayer(layerId) {
+
+function GetLayer(layerId)
+{
     return thisFrame.legendUiFrame.GetLayer(layerId);
 }
-function GetLayers(onlyVisible, onlySelectable) {
+
+function GetLayers(onlyVisible, onlySelectable)
+{
     return thisFrame.legendUiFrame.GetLayers(onlyVisible, onlySelectable);
 }
-function GetBaseGroups(onlyVisible) {
+
+function GetBaseGroups(onlyVisible)
+{
     return thisFrame.legendUiFrame.GetBaseGroups(onlyVisible);
 }
+
 // private functions -----------------------------------------------
 //
-function IsUiReady() {
+function IsUiReady()
+{
     return thisFrame.ctrlLoaded;
 }
-function OnControlLoaded() {
+
+function OnControlLoaded()
+{
     thisFrame.ctrlLoaded = true;
 }
-function OnInternalStateComplete() {
+
+function OnInternalStateComplete()
+{
     thisFrame.intStateCompl = true;
 }
-function GetMapFrame() {
+
+function GetMapFrame()
+{
     return mapFrame;
 }
-function OnForwardMouseDown(e) {
+
+function OnForwardMouseDown(e)
+{
     thisFrame.legendUiFrame.OnForwardMouseDown(e);
 }
 
 </script>
+
 <frameset rows="0,*" frameborder=0 border=0>
     <frame name="legendScriptFrame" src="%s?MAPNAME=%s&LC=0&SESSION=%s" noresize>
     <frame name="legendUiFrame" src="%s?LOCALE=%s" noresize>

Modified: trunk/MgDev/Web/src/viewerfiles/legendui.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/legendui.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/legendui.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,8 +1,8 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     body,td
     {
         font-family: __#@font#__;
@@ -48,775 +48,786 @@
         font-size: __#@fontsize#__;
         font-weight: normal;
     }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language="javascript" src="../viewerfiles/contextmenu.js"></script>
-    <script language="javascript" src="../viewerfiles/legend.js"></script>
-    <script type="text/javascript" src="../viewerfiles/hashtable.js"></script>
-    <script language=javascript>
-    var thisFrame = this;
-    var tree = null;
-    var scale = -1;
-    var iconExpand = "../stdicons/lc_expand.gif";
-    var iconCollapse = "../stdicons/lc_collapse.gif";
-    var iconNoExpand = "../stdicons/lc_noexpand.gif";
-    var iconGroup = "../stdicons/lc_group.gif";
-    var iconBrokenLayer = "../stdicons/lc_broken.gif";
-    var iconRasterLayer = "../stdicons/lc_raster.gif";
-    var iconDrawingLayer = "../stdicons/lc_dwf.gif";
-    var iconThemeLayer = "../stdicons/lc_theme.gif";
-    var iconChecked = "../stdicons/lc_checked.gif";
-    var iconUnchecked = "../stdicons/lc_unchecked.gif";
-    var ctxMenu;
-    var cmdState;
-    var layerMap = null;
+</style>
 
-    function GroupStats()
-    {
-        this.lyrgrpCount = 0;
-        this.lyrgrpVisible = 0;
-    }
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language="javascript" src="../viewerfiles/contextmenu.js"></script>
+<script language="javascript" src="../viewerfiles/legend.js"></script>
+<script type="text/javascript" src="../viewerfiles/hashtable.js"></script>
+<script language=javascript>
 
-    function ShowGroupLayerCmd()
-    {
-        this.showGroups = new Array();
-        this.hideGroups = new Array();
-        this.showLayers = new Array();
-        this.hideLayers = new Array();
-    }
+var thisFrame = this;
+var tree = null;
+var scale = -1;
+var iconExpand = "../stdicons/lc_expand.gif";
+var iconCollapse = "../stdicons/lc_collapse.gif";
+var iconNoExpand = "../stdicons/lc_noexpand.gif";
+var iconGroup = "../stdicons/lc_group.gif";
+var iconBrokenLayer = "../stdicons/lc_broken.gif";
+var iconRasterLayer = "../stdicons/lc_raster.gif";
+var iconDrawingLayer = "../stdicons/lc_dwf.gif";
+var iconThemeLayer = "../stdicons/lc_theme.gif";
+var iconChecked = "../stdicons/lc_checked.gif";
+var iconUnchecked = "../stdicons/lc_unchecked.gif";
+var ctxMenu;
+var cmdState;
+var layerMap = null;
 
-    function InitDocument()
-    {
-        document.onmousemove = OnMouseMove;
-        if(msie || safari)
-            document.oncontextmenu = OnContextMenu;
-        document.onclick = OnClick;
-        document.onmousedown = OnMouseDown;
-        document.onmouseup = OnMouseUp;
-        parent.OnControlLoaded();
-    }
+function GroupStats()
+{
+    this.lyrgrpCount = 0;
+    this.lyrgrpVisible = 0;
+}
 
-    function SetTree(groupLayers)
-    {
-        tree = groupLayers;
-        BuildTreeUi(tree);
-        if(scale != -1)
-            SetScale(scale);
-        layerMap = new Hashtable();
-        BuildLayerMap(tree, layerMap);
-        parent.OnInternalStateComplete();
-        try { GetMapFrame().OnLayersChanged(); } catch(e) {}
-    }
+function ShowGroupLayerCmd()
+{
+    this.showGroups = new Array();
+    this.hideGroups = new Array();
+    this.showLayers = new Array();
+    this.hideLayers = new Array();
+}
 
-    function BuildTreeUi(tree)
-    {
-        var code = ""
-        for(var i=0; i < tree.length; i++)
-        {
-            code += BuildLayersAndGroups(tree[i]);
-        }
-        document.getElementById("Tree").innerHTML = code;
-    }
+function InitDocument()
+{
+    document.onmousemove = OnMouseMove;
+    if(msie || safari)
+        document.oncontextmenu = OnContextMenu;
+    document.onclick = OnClick;
+    document.onmousedown = OnMouseDown;
+    document.onmouseup = OnMouseUp;
+    parent.OnControlLoaded();
+}
 
-    function BuildLayersAndGroups(node)
-    {
-        var isGroup = node.type == 0;
-        var item = '<div id="' + node.objectId + '"><table border=0 cellspacing="0" cellpadding="0"><tr height=16>';
-        //expand/collapse icon
-        item += '<td width=16 id="Ex_' + node.objectId + '">' + (isGroup? MakeExpandCode(node) : '') + '</td>';
-        if(isGroup || !node.base)
-        {
-            //checkbox
-            item += '<td width=16 id="Chk_' + node.objectId + '">' + MakeCheckCode(node) + '</td>';
-        }
-        //icon
-        item += '<td width=23 id="Ic_' + node.objectId + '"><img width=16 height=16 src="';
-        if(isGroup)
-            item += iconGroup;
-        else
-            item += iconBrokenLayer;
-        item += '"></td>';
-        //legend text
-        item += '<td id="Lg_' + node.objectId +'">' + node.legend + '</td>';
-        item += '</tr></table>';
-        item += '<div id="ChildrenOf_' + node.objectId + '" style="margin-left: ' + (isGroup? 20: 32) + 'px; display:';
-        item += node.expanded? 'block">' : 'none">';
-        if(isGroup && node.children != null && node.children.length > 0)
-        {
-            for(var i=0; i < node.children.length; i++)
-                item += BuildLayersAndGroups(node.children[i]);
-        }
-        item += '</div>';
-        item += '</div>';
-        return item;
-    }
+function SetTree(groupLayers)
+{
+    tree = groupLayers;
+    BuildTreeUi(tree);
+    if(scale != -1)
+        SetScale(scale);
+    layerMap = new Hashtable();
+    BuildLayerMap(tree, layerMap);
+    parent.OnInternalStateComplete();
+    try { GetMapFrame().OnLayersChanged(); } catch(e) {}
+}
 
-    function RequestSymbolizationIcon(layer, scale)
-    {
-        return BuildIconRequest(layer.layerRes, scale, -1, -1);
-    }
+function BuildTreeUi(tree)
+{
+    var code = ""
+    for(var i=0; i < tree.length; i++)
+        code += BuildLayersAndGroups(tree[i]);
+    document.getElementById("Tree").innerHTML = code;
+}
 
-    function RequestThemeStyleIcon(layer, scale, themeIndex, geomtype)
+function BuildLayersAndGroups(node)
+{
+    var isGroup = node.type == 0;
+    var item = '<div id="' + node.objectId + '"><table border=0 cellspacing="0" cellpadding="0"><tr height=16>';
+    //expand/collapse icon
+    item += '<td width=16 id="Ex_' + node.objectId + '">' + (isGroup? MakeExpandCode(node) : '') + '</td>';
+    if(isGroup || !node.base)
     {
-        return BuildIconRequest(layer.layerRes, scale, themeIndex, geomtype);
+        //checkbox
+        item += '<td width=16 id="Chk_' + node.objectId + '">' + MakeCheckCode(node) + '</td>';
     }
-
-    function BuildIconRequest(layerDef, scale, themeIndex, geomtype)
+    //icon
+    item += '<td width=23 id="Ic_' + node.objectId + '"><img width=16 height=16 src="';
+    if(isGroup)
+        item += iconGroup;
+    else
+        item += iconBrokenLayer;
+    item += '"></td>';
+    //legend text
+    item += '<td id="Lg_' + node.objectId +'">' + node.legend + '</td>';
+    item += '</tr></table>';
+    item += '<div id="ChildrenOf_' + node.objectId + '" style="margin-left: ' + (isGroup? 20: 32) + 'px; display:';
+    item += node.expanded? 'block">' : 'none">';
+    if(isGroup && node.children != null && node.children.length > 0)
     {
-        return GetMapFrame().GetWebAgent() + "?OPERATION=GETLEGENDIMAGE&SESSION=" + GetMapFrame().GetSessionId() + "&VERSION=1.0.0&SCALE=" + scale + "&LAYERDEFINITION=" + encodeURIComponent(layerDef) + "&THEMECATEGORY=" + themeIndex + "&TYPE=" + geomtype;
+        for(var i=0; i < node.children.length; i++)
+            item += BuildLayersAndGroups(node.children[i]);
     }
+    item += '</div>';
+    item += '</div>';
+    return item;
+}
 
-    // Set the styles sub elements of a layer element
-    // Set the layer icon and the layer check as necessary
-    function SetLayerStyles(layer)
+function RequestSymbolizationIcon(layer, scale)
+{
+    return BuildIconRequest(layer.layerRes, scale, -1, -1);
+}
+
+function RequestThemeStyleIcon(layer, scale, themeIndex, geomtype)
+{
+    return BuildIconRequest(layer.layerRes, scale, themeIndex, geomtype);
+}
+
+function BuildIconRequest(layerDef, scale, themeIndex, geomtype)
+{
+    return GetMapFrame().GetWebAgent() + "?OPERATION=GETLEGENDIMAGE&SESSION=" + GetMapFrame().GetSessionId() + "&VERSION=1.0.0&SCALE=" + scale + "&LAYERDEFINITION=" + encodeURIComponent(layerDef) + "&THEMECATEGORY=" + themeIndex + "&TYPE=" + geomtype;
+}
+
+// Set the styles sub elements of a layer element
+// Set the layer icon and the layer check as necessary
+function SetLayerStyles(layer)
+{
+    var layerChildren = document.getElementById('ChildrenOf_' + layer.objectId);
+    var code = "";
+    var sc = layer.children[layer.curScale];
+    var styles = sc.children;
+    var hasThemes = styles.length > 1;
+    var layerIcon = "";
+    if(hasThemes)
     {
-        var layerChildren = document.getElementById('ChildrenOf_' + layer.objectId);
-        var code = "";
-        var sc = layer.children[layer.curScale];
-        var styles = sc.children;
-        var hasThemes = styles.length > 1;
-        var layerIcon = "";
-        if(hasThemes)
+        for(var j=0; j < styles.length; j++)
         {
-            for(var j=0; j < styles.length; j++)
+            var node = styles[j];
+            var icon = RequestThemeStyleIcon(layer, scale, node.catindex, node.geomtype);
+
+            code += '<table border=0 cellspacing="0" cellpadding="0"><tr height=16>';
+            //icon
+            code += '<td width=23><img width=16 height=16 src="' + icon + '"></td>';
+            //legend text
+            code += '<td>' + node.legend + '</td>';
+            code += '</tr></table>';
+
+            if(!sc.showlongtheme && styles.length > 10)
             {
-                var node = styles[j];
-                var icon = RequestThemeStyleIcon(layer, scale, node.catindex, node.geomtype);
-
+                if(j == styles.length - 1)
+                    break;
                 code += '<table border=0 cellspacing="0" cellpadding="0"><tr height=16>';
-                //icon
-                code += '<td width=23><img width=16 height=16 src="' + icon + '"></td>';
-                //legend text
-                code += '<td>' + node.legend + '</td>';
+                code += '<td width=23><img width=16 height=16 src="../stdicons/transparentpixel.gif"></td>';
+                code += '<td>...</td>';
                 code += '</tr></table>';
-                
-                if(!sc.showlongtheme && styles.length > 10) {
-                    if(j == styles.length - 1)
-                        break;
-                    code += '<table border=0 cellspacing="0" cellpadding="0"><tr height=16>';
-                    code += '<td width=23><img width=16 height=16 src="../stdicons/transparentpixel.gif"></td>';
-                    code += '<td>...</td>';
-                    code += '</tr></table>';
-                    j = styles.length - 2;
-                }
+                j = styles.length - 2;
             }
-            if(styles.length <= 10)
-                sc.showlongtheme = true;
-            layerChildren.innerHTML = code;
-            layerIcon = iconThemeLayer;
         }
-        else
-        {
-            if(layer.lyrtype == 1)
-                layerIcon = iconRasterLayer;
-            else if(layer.lyrtype == 2)
-                layerIcon = iconDrawingLayer;
-            else if(layer.curScale == -1)
-                layerIcon = iconBrokenLayer;
-            else
-                layerIcon = RequestSymbolizationIcon(layer, scale);
-        }
-        SetLayerIcon(layer, layerIcon);
-        SetLayerExpandBox(layer, hasThemes);
+        if(styles.length <= 10)
+            sc.showlongtheme = true;
+        layerChildren.innerHTML = code;
+        layerIcon = iconThemeLayer;
     }
-
-    function SetLayerIcon(layer, icon)
+    else
     {
-        var icElt = document.getElementById('Ic_' + layer.objectId);
-        if(icElt != null)
-            icElt.innerHTML = '<img width=16 height=16 src="' + icon + '">';
+        if(layer.lyrtype == 1)
+            layerIcon = iconRasterLayer;
+        else if(layer.lyrtype == 2)
+            layerIcon = iconDrawingLayer;
+        else if(layer.curScale == -1)
+            layerIcon = iconBrokenLayer;
+        else
+            layerIcon = RequestSymbolizationIcon(layer, scale);
     }
+    SetLayerIcon(layer, layerIcon);
+    SetLayerExpandBox(layer, hasThemes);
+}
 
-    function SetLayerExpandBox(layer, show)
-    {
-        var expElt = document.getElementById('Ex_' + layer.objectId);
-        if(expElt != null)
-        {
-            if(!show)
-                expElt.innerHTML = '';
-            else
-                expElt.innerHTML = MakeExpandCode(layer);
-        }
-    }
+function SetLayerIcon(layer, icon)
+{
+    var icElt = document.getElementById('Ic_' + layer.objectId);
+    if(icElt != null)
+        icElt.innerHTML = '<img width=16 height=16 src="' + icon + '">';
+}
 
-    function MakeExpandCode(node)
+function SetLayerExpandBox(layer, show)
+{
+    var expElt = document.getElementById('Ex_' + layer.objectId);
+    if(expElt != null)
     {
-        return '<img width=9 height=9 src="' + (node.expanded? iconCollapse: iconExpand) + '" onclick="Toggle(\'' + node.objectId +'\')">';
+        if(!show)
+            expElt.innerHTML = '';
+        else
+            expElt.innerHTML = MakeExpandCode(layer);
     }
+}
 
-    function MakeCheckCode(node)
-    {
-        return '<img width=13 height=13 src="' + (node.visible? iconChecked: iconUnchecked) + '" onClick="ChangeVisibility(\'' + node.objectId +'\')">';
-    }
+function MakeExpandCode(node)
+{
+    return '<img width=9 height=9 src="' + (node.expanded? iconCollapse: iconExpand) + '" onclick="Toggle(\'' + node.objectId +'\')">';
+}
 
-    function UpdateGroupLayerCheck(node)
-    {
-        var elt = document.getElementById('Chk_' + node.objectId);
-        if(elt != null)
-            elt.innerHTML = MakeCheckCode(node);
-    }
+function MakeCheckCode(node)
+{
+    return '<img width=13 height=13 src="' + (node.visible? iconChecked: iconUnchecked) + '" onClick="ChangeVisibility(\'' + node.objectId +'\')">';
+}
 
-    function Toggle(objectId)
-    {
-        var node = FindNode(tree, objectId);
-        if(node == null)
-            return;
-        if(node.expanded)
-            Collapse(node);
-        else
-            Expand(node);
-    }
+function UpdateGroupLayerCheck(node)
+{
+    var elt = document.getElementById('Chk_' + node.objectId);
+    if(elt != null)
+        elt.innerHTML = MakeCheckCode(node);
+}
 
-    function Expand(node)
-    {
-        var elt = document.getElementById('ChildrenOf_' + node.objectId);
-        if(elt != null)
-        {
-            node.expanded = true;
-            elt.style.display = "block";
-            if(node.type == 0 || HasLayerThemes(node))
-                ShowExpandedState(node);
-        }
-    }
+function Toggle(objectId)
+{
+    var node = FindNode(tree, objectId);
+    if(node == null)
+        return;
+    if(node.expanded)
+        Collapse(node);
+    else
+        Expand(node);
+}
 
-    function Collapse(node)
+function Expand(node)
+{
+    var elt = document.getElementById('ChildrenOf_' + node.objectId);
+    if(elt != null)
     {
-        var elt = document.getElementById('ChildrenOf_' + node.objectId);
-        if(elt != null)
-        {
-            node.expanded = false;
-            elt.style.display = "none";
-            if(node.type == 0 || HasLayerThemes(node))
-                ShowExpandedState(node);
-        }
+        node.expanded = true;
+        elt.style.display = "block";
+        if(node.type == 0 || HasLayerThemes(node))
+            ShowExpandedState(node);
     }
+}
 
-    function ShowExpandedState(node)
+function Collapse(node)
+{
+    var elt = document.getElementById('ChildrenOf_' + node.objectId);
+    if(elt != null)
     {
-        var expElt = document.getElementById('Ex_' + node.objectId);
-        if(expElt != null)
-            expElt.innerHTML = MakeExpandCode(node);
+        node.expanded = false;
+        elt.style.display = "none";
+        if(node.type == 0 || HasLayerThemes(node))
+            ShowExpandedState(node);
     }
+}
 
-    function ChangeVisibility(objectId)
-    {
-        var node = FindNode(tree, objectId);
-        if(node == null)
-            return;
-        var show = (node.visible = !node.visible);
-        var chkElt = document.getElementById('Chk_' + objectId);
-        if(chkElt != null)
-            chkElt.innerHTML = MakeCheckCode(node);
-        if(node.type == 0 && node.base)
-            GetMapFrame().ShowBaseGroup(node.name, node.objectId, show);
-        else
-            GetMapFrame().ShowGroupLayers(node.type == 0? (show? node.objectId: ""): "",
-                            node.type == 0? (show? "": node.objectId): "",
-                            node.type == 1? (show? node.objectId: ""): "",
-                            node.type == 1? (show? "": node.objectId): "");
-    }
+function ShowExpandedState(node)
+{
+    var expElt = document.getElementById('Ex_' + node.objectId);
+    if(expElt != null)
+        expElt.innerHTML = MakeExpandCode(node);
+}
 
-    function ShowHideNodes(nodes)
+function ChangeVisibility(objectId)
+{
+    var node = FindNode(tree, objectId);
+    if(node == null)
+        return;
+    var show = (node.visible = !node.visible);
+    var chkElt = document.getElementById('Chk_' + objectId);
+    if(chkElt != null)
+        chkElt.innerHTML = MakeCheckCode(node);
+    if(node.type == 0 && node.base)
+        GetMapFrame().ShowBaseGroup(node.name, node.objectId, show);
+    else
+        GetMapFrame().ShowGroupLayers(node.type == 0? (show? node.objectId: ""): "",
+                                      node.type == 0? (show? "": node.objectId): "",
+                                      node.type == 1? (show? node.objectId: ""): "",
+                                      node.type == 1? (show? "": node.objectId): "");
+}
+
+function ShowHideNodes(nodes)
+{
+    for(var i=0; i < nodes.length; i++)
     {
-        for(var i=0; i < nodes.length; i++)
+        var node = nodes[i];
+        if(node.type == 0)
         {
-            var node = nodes[i];
-            if(node.type == 0)
+            var grpElt = document.getElementById(node.objectId);
+            if(!node.isDisplayed)
+                grpElt.style.display = "none";
+            else
             {
-                var grpElt = document.getElementById(node.objectId);
-                if(!node.isDisplayed)
-                    grpElt.style.display = "none";
-                else
+                grpElt.style.display = "block";
+                if(node.children != null && node.children.length > 0)
                 {
-                    grpElt.style.display = "block";
-                    if(node.children != null && node.children.length > 0) {
-                        ShowHideNodes(node.children);
-                        hasVisibleChildren = false;
-                        for(var j=0; j < node.children.length; j++) {
-                            if(node.children[j].isDisplayed) {
-                                hasVisibleChildren = true;
-                            }
-                        }
-                        expElt = document.getElementById('Ex_' + node.objectId);
-                        if(expElt)
-                            expElt.style.visibility = hasVisibleChildren? "visible": "hidden";
+                    ShowHideNodes(node.children);
+                    hasVisibleChildren = false;
+                    for(var j=0; j < node.children.length; j++)
+                    {
+                        if(node.children[j].isDisplayed)
+                            hasVisibleChildren = true;
                     }
+                    expElt = document.getElementById('Ex_' + node.objectId);
+                    if(expElt)
+                        expElt.style.visibility = hasVisibleChildren? "visible": "hidden";
                 }
             }
-            else if(node.type == 1)
-            {
-                var lyrElt = document.getElementById(node.objectId);
-                lyrElt.style.display = node.isDisplayed? "block" : "none";
-            }
         }
+        else if(node.type == 1)
+        {
+            var lyrElt = document.getElementById(node.objectId);
+            lyrElt.style.display = node.isDisplayed? "block" : "none";
+        }
     }
+}
 
-    function OnMouseMove(e)
+function OnMouseMove(e)
+{
+    if(!msie)
     {
-        if(!msie)
-        {
-            try { GetMapFrame().OnMouseMove(e); } catch(e) {}
-        }
+        try { GetMapFrame().OnMouseMove(e); } catch(e) {}
     }
+}
 
-    function OnMouseDown(e)
+function OnMouseDown(e)
+{
+    if(!PopupMouseDown(e))
     {
-        if(!PopupMouseDown(e))
-        {
-            hidePopup(ctxMenu)
-            GetMainFrame().ForwardMouseDown(document, e);
-        }
-        return false;
+        hidePopup(ctxMenu)
+        GetMainFrame().ForwardMouseDown(document, e);
     }
+    return false;
+}
 
-    function OnMouseUp(e)
+function OnMouseUp(e)
+{
+    var tgt;
+    if(msie)
     {
-        var tgt;
-        if(msie)
-        {
-            e = event;
-            tgt = e.srcElement;
-        }
-        else
-            tgt = e.target;
-        if(e.button != 2)
-        {
-            GetMapFrame().ForwardMouseUp(e);
-            return false;
-        }
-        CheckContextMenu(tgt, e.clientX, e.clientY);
-
-        return false;
+        e = event;
+        tgt = e.srcElement;
     }
-
-    function OnContextMenu(e) {
-        if(safari)
-            CheckContextMenu(e.target, e.clientX, e.clientY);
+    else
+        tgt = e.target;
+    if(e.button != 2)
+    {
+        GetMapFrame().ForwardMouseUp(e);
         return false;
     }
-    
-    function CheckContextMenu(tgt, x, y) {
-        var tgname = tgt.tagName;
-        var id = "";
-        if(tgname == "TD")
-        {
-            id = tgt.id;
-            if(id.substr(0, 3) == "Lg_")
-                id = id.substr(3);
-            else
-                id = "";
-        }
-        else if(tgname == "IMG")
-        {
-            id = tgt.parentNode.id;
-            if(id.substr(0, 3) == "Ic_")
-                id = id.substr(3);
-            else
-                id = "";
-        }
+    CheckContextMenu(tgt, e.clientX, e.clientY);
 
-        var node = id != ""? FindNode(tree, id): null;
-        ContextMenu(x, y, node);
-    }
+    return false;
+}
 
-    function OnClick(e)
+function OnContextMenu(e)
+{
+    if(safari)
+        CheckContextMenu(e.target, e.clientX, e.clientY);
+    return false;
+}
+
+function CheckContextMenu(tgt, x, y)
+{
+    var tgname = tgt.tagName;
+    var id = "";
+    if(tgname == "TD")
     {
-        return false;
+        id = tgt.id;
+        if(id.substr(0, 3) == "Lg_")
+            id = id.substr(3);
+        else
+            id = "";
     }
-
-    function OnForwardMouseDown(e)
+    else if(tgname == "IMG")
     {
-        hidePopup(ctxMenu);
+        id = tgt.parentNode.id;
+        if(id.substr(0, 3) == "Ic_")
+            id = id.substr(3);
+        else
+            id = "";
     }
 
-    function ContextMenu(x, y, node)
-    {
-        cmdState = new Array();
-        var isLayer = node && node.type == 1;
-        var isGroup = node && node.type == 0;
+    var node = id != ""? FindNode(tree, id): null;
+    ContextMenu(x, y, node);
+}
 
-        ctxMenu = new MenuData('Legend',20, 21, 50, 150, "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif", this, false, "white");
-        startBuildMenuContent(ctxMenu);
+function OnClick(e)
+{
+    return false;
+}
 
-        if(isGroup && !node.base)
-        {
-            var grpStats = new GroupStats();
-            GetGroupStats(node, grpStats);
-            addMenuOption(ctxMenu, "__#DISPLAYALLINGROUP#__", 1 + ':' + node.objectId, 1, "", "", cmdState[1] = (grpStats.lyrgrpCount != grpStats.lyrgrpVisible));
-            addMenuOption(ctxMenu, "__#HIDEALLINGROUP#__", 2 + ':' + node.objectId, 1, "", "", cmdState[2] = (grpStats.lyrgrpVisible != 0));
-            addMenuOption(ctxMenu, "", 0, 2, "", "", false);
-        }
-        else if(isLayer)
-        {
-            if(node.curScale != -1) {
-                sc = node.children[node.curScale];
-                if(!sc.showlongtheme && sc.children.length > 1 && node.expanded) {
-                    addMenuOption(ctxMenu, "__#SHOWLONGTHEME#__", 6 + ':' + node.objectId, 1, "", "", cmdState[6] = true);
-                    addMenuOption(ctxMenu, "", 0, 2, "", "", false);
-                }
-            }
-        }
-        addMenuOption(ctxMenu, "__#REFRESH#__", 3, 1, "", "", cmdState[3] = true);
-        addMenuOption(ctxMenu, "__#EXPANDALL#__", 4, 1, "", "", cmdState[4] = true);
-        addMenuOption(ctxMenu, "__#COLLAPSEALL#__", 5, 1, "", "", cmdState[5] = true);
+function OnForwardMouseDown(e)
+{
+    hidePopup(ctxMenu);
+}
 
-        endBuildMenuContent(ctxMenu);
-        showPopup(ctxMenu, true, x, y);
-    }
+function ContextMenu(x, y, node)
+{
+    cmdState = new Array();
+    var isLayer = node && node.type == 1;
+    var isGroup = node && node.type == 0;
 
-    function ExecuteCommand(option)
+    ctxMenu = new MenuData('Legend',20, 21, 50, 150, "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif", this, false, "white");
+    startBuildMenuContent(ctxMenu);
+
+    if(isGroup && !node.base)
     {
-        var tok = option.split(":");
-        var cmd, objectId;
-        if(tok.length > 1)
-            objectId = tok[1];
-        switch(parseInt(tok[0]))
+        var grpStats = new GroupStats();
+        GetGroupStats(node, grpStats);
+        addMenuOption(ctxMenu, "__#DISPLAYALLINGROUP#__", 1 + ':' + node.objectId, 1, "", "", cmdState[1] = (grpStats.lyrgrpCount != grpStats.lyrgrpVisible));
+        addMenuOption(ctxMenu, "__#HIDEALLINGROUP#__", 2 + ':' + node.objectId, 1, "", "", cmdState[2] = (grpStats.lyrgrpVisible != 0));
+        addMenuOption(ctxMenu, "", 0, 2, "", "", false);
+    }
+    else if(isLayer)
+    {
+        if(node.curScale != -1)
         {
-            case 1:
-                ShowGroupLayers(FindNode(tree, objectId), true);
-                break;
-            case 2:
-                ShowGroupLayers(FindNode(tree, objectId), false);
-                break;
-            case 3:
-                GetMainFrame().Refresh();
-                break;
-            case 4:
-                ExpandNodes(tree, true);
-                break;
-            case 5:
-                ExpandNodes(tree, false);
-                break;
-            case 6: 
-                layer = FindNode(tree, objectId);
-                layer.children[layer.curScale].showlongtheme = true;
-                SetLayerStyles(layer);
-                break;
+            sc = node.children[node.curScale];
+            if(!sc.showlongtheme && sc.children.length > 1 && node.expanded)
+            {
+                addMenuOption(ctxMenu, "__#SHOWLONGTHEME#__", 6 + ':' + node.objectId, 1, "", "", cmdState[6] = true);
+                addMenuOption(ctxMenu, "", 0, 2, "", "", false);
+            }
         }
     }
+    addMenuOption(ctxMenu, "__#REFRESH#__", 3, 1, "", "", cmdState[3] = true);
+    addMenuOption(ctxMenu, "__#EXPANDALL#__", 4, 1, "", "", cmdState[4] = true);
+    addMenuOption(ctxMenu, "__#COLLAPSEALL#__", 5, 1, "", "", cmdState[5] = true);
 
-    function OnEnableCommand(option)
+    endBuildMenuContent(ctxMenu);
+    showPopup(ctxMenu, true, x, y);
+}
+
+function ExecuteCommand(option)
+{
+    var tok = option.split(":");
+    var cmd, objectId;
+    if(tok.length > 1)
+        objectId = tok[1];
+    switch(parseInt(tok[0]))
     {
-        var tok = option.split(":");
-        var cmd = parseInt(tok[0]);
-        return cmdState[cmd];
+        case 1:
+            ShowGroupLayers(FindNode(tree, objectId), true);
+            break;
+        case 2:
+            ShowGroupLayers(FindNode(tree, objectId), false);
+            break;
+        case 3:
+            GetMainFrame().Refresh();
+            break;
+        case 4:
+            ExpandNodes(tree, true);
+            break;
+        case 5:
+            ExpandNodes(tree, false);
+            break;
+        case 6:
+            layer = FindNode(tree, objectId);
+            layer.children[layer.curScale].showlongtheme = true;
+            SetLayerStyles(layer);
+            break;
     }
+}
 
-    function ShowGroupLayers(group, show)
+function OnEnableCommand(option)
+{
+    var tok = option.split(":");
+    var cmd = parseInt(tok[0]);
+    return cmdState[cmd];
+}
+
+function ShowGroupLayers(group, show)
+{
+    if(group == null)
+        return;
+    var cmd = new ShowGroupLayerCmd();
+    PrepareShowGroupLayers(group, show, cmd);
+    if(show)
     {
-        if(group == null)
+        if(cmd.showGroups.length == 0 && cmd.showLayers.length == 0)
             return;
-        var cmd = new ShowGroupLayerCmd();
-        PrepareShowGroupLayers(group, show, cmd);
-        if(show)
-        {
-            if(cmd.showGroups.length == 0 && cmd.showLayers.length == 0)
-          return;
-          GetMapFrame().ShowGroupLayers(cmd.showGroups.length > 0? cmd.showGroups.join('__#LEGENDLISTSEPARATOR#__'): "", "",
-          cmd.showLayers.length > 0? cmd.showLayers.join('__#LEGENDLISTSEPARATOR#__'): "", "");
-          }
-          else
-          {
-          if(cmd.hideGroups.length == 0 && cmd.hideLayers.length == 0)
-          return;
-          GetMapFrame().ShowGroupLayers("", cmd.hideGroups.length > 0? cmd.hideGroups.join('__#LEGENDLISTSEPARATOR#__'): "",
-          "", cmd.hideLayers.length > 0? cmd.hideLayers.join('__#LEGENDLISTSEPARATOR#__'): "");
-          }
-          }
+        GetMapFrame().ShowGroupLayers(cmd.showGroups.length > 0? cmd.showGroups.join('__#LEGENDLISTSEPARATOR#__'): "", "",
+        cmd.showLayers.length > 0? cmd.showLayers.join('__#LEGENDLISTSEPARATOR#__'): "", "");
+    }
+    else
+    {
+        if(cmd.hideGroups.length == 0 && cmd.hideLayers.length == 0)
+            return;
+        GetMapFrame().ShowGroupLayers("", cmd.hideGroups.length > 0? cmd.hideGroups.join('__#LEGENDLISTSEPARATOR#__'): "",
+            "", cmd.hideLayers.length > 0? cmd.hideLayers.join('__#LEGENDLISTSEPARATOR#__'): "");
+    }
+}
 
-          function PrepareShowGroupLayers(group, show, cmd)
-          {
-          if(!group.children)
-          return;
-          for(var i=0; i < group.children.length; i++)
+function PrepareShowGroupLayers(group, show, cmd)
+{
+    if(!group.children)
+        return;
+    for(var i=0; i < group.children.length; i++)
+    {
+        var node = group.children[i];
+        if(node.isDisplayed)
         {
-            var node = group.children[i];
-            if(node.isDisplayed)
+            if(show)
             {
-                if(show)
+                if(!node.visible)
                 {
-                    if(!node.visible)
-                    {
-                        node.visible = true;
-                        if(node.type == 0)
-                            cmd.showGroups.push(node.objectId);
-                        else
-                            cmd.showLayers.push(node.objectId);
-                        UpdateGroupLayerCheck(node);
-                    }
+                    node.visible = true;
+                    if(node.type == 0)
+                        cmd.showGroups.push(node.objectId);
+                    else
+                        cmd.showLayers.push(node.objectId);
+                    UpdateGroupLayerCheck(node);
                 }
-                else
+            }
+            else
+            {
+                if(node.visible)
                 {
-                    if(node.visible)
-                    {
-                        node.visible = false;
-                        if(node.type == 0)
-                            cmd.hideGroups.push(node.objectId);
-                        else
-                            cmd.hideLayers.push(node.objectId);
-                        UpdateGroupLayerCheck(node);
-                    }
+                    node.visible = false;
+                    if(node.type == 0)
+                        cmd.hideGroups.push(node.objectId);
+                    else
+                        cmd.hideLayers.push(node.objectId);
+                    UpdateGroupLayerCheck(node);
                 }
-                if(node.type == 0)
-                    PrepareShowGroupLayers(node, show, cmd);
             }
+            if(node.type == 0)
+                PrepareShowGroupLayers(node, show, cmd);
         }
     }
+}
 
-    function ExpandNodes(nodes, expand)
+function ExpandNodes(nodes, expand)
+{
+    for(var i=0; i < nodes.length; i++)
     {
-        for(var i=0; i < nodes.length; i++)
+        var node = nodes[i];
+        if(expand)
         {
-            var node = nodes[i];
-            if(expand)
-            {
-                if(!node.expanded)
-                    Expand(node);
-            }
-            else
-            {
-                if(node.expanded)
-                    Collapse(node);
-            }
-            if(node.type == 0 && node.children != null && node.children.length > 0)
-                ExpandNodes(node.children, expand);
+            if(!node.expanded)
+                Expand(node);
         }
+        else
+        {
+            if(node.expanded)
+                Collapse(node);
+        }
+        if(node.type == 0 && node.children != null && node.children.length > 0)
+            ExpandNodes(node.children, expand);
     }
+}
 
-    function GetGroupStats(group, grpStats)
+function GetGroupStats(group, grpStats)
+{
+    if(!group.children)
+        return;
+    for(var i=0; i < group.children.length; i++)
     {
-        if(!group.children)
-            return;
-        for(var i=0; i < group.children.length; i++)
+        var node = group.children[i];
+        if(node.isDisplayed)
         {
-            var node = group.children[i];
-            if(node.isDisplayed)
+            grpStats.lyrgrpCount ++;
+            if(node.visible)
             {
-                grpStats.lyrgrpCount ++;
-                if(node.visible)
-                {
-                    grpStats.lyrgrpVisible ++;
-                    if(node.type == 0)
-                        GetGroupStats(node, grpStats);
-                }
+                grpStats.lyrgrpVisible ++;
+                if(node.type == 0)
+                    GetGroupStats(node, grpStats);
             }
         }
     }
+}
 
-    function SetScale(newScale)
-    {
-        scale = newScale;
-        if(tree == null)
-            return;
-        UpdateScaleRanges(tree);
-        ShowHideNodes(tree);
-    }
+function SetScale(newScale)
+{
+    scale = newScale;
+    if(tree == null)
+        return;
+    UpdateScaleRanges(tree);
+    ShowHideNodes(tree);
+}
 
-    function HasLayerThemes(layer)
-    {
-        if(layer.curScale == -1)
-            return false;
-        return layer.children[layer.curScale].children.length > 1;
-    }
+function HasLayerThemes(layer)
+{
+    if(layer.curScale == -1)
+        return false;
+    return layer.children[layer.curScale].children.length > 1;
+}
 
-    // set the active scale ranges in layers, according to current scale, and set the display state for layers and groups
-    // update the layer styles if necessary
-    function UpdateScaleRanges(nodes)
+// set the active scale ranges in layers, according to current scale, and set the display state for layers and groups
+// update the layer styles if necessary
+function UpdateScaleRanges(nodes)
+{
+    for(var i=0; i < nodes.length; i++)
     {
-        for(var i=0; i < nodes.length; i++)
+        var node = nodes[i];
+        if(node.type == 0)
         {
-            var node = nodes[i];
-            if(node.type == 0)
-            {
-                var count = node.children != null? node.children.length: 0;
-                node.hasVisibleLayers = false;
-                if(count > 0) {
-                    UpdateScaleRanges(node.children);
-                    for(var j=0; j < node.children.length; j++) {
-                        child = node.children[j];
-                        if(child.type == 0) {
-                            if(child.hasVisibleLayers) {
-                                node.hasVisibleLayers = true;
-                                break;
-                            }
+            var count = node.children != null? node.children.length: 0;
+            node.hasVisibleLayers = false;
+            if(count > 0) {
+                UpdateScaleRanges(node.children);
+                for(var j=0; j < node.children.length; j++)
+                {
+                    child = node.children[j];
+                    if(child.type == 0)
+                    {
+                        if(child.hasVisibleLayers)
+                        {
+                            node.hasVisibleLayers = true;
+                            break;
                         }
-                        else {
-                            if(child.curScale != -1) {
-                                node.hasVisibleLayers = true;
-                                break;
-                            }
+                    }
+                    else {
+                        if(child.curScale != -1)
+                        {
+                            node.hasVisibleLayers = true;
+                            break;
                         }
                     }
                 }
-                node.isDisplayed = node.displayInLegend && node.hasVisibleLayers;
             }
-            else if(node.type == 1)
+            node.isDisplayed = node.displayInLegend && node.hasVisibleLayers;
+        }
+        else if(node.type == 1)
+        {
+            var rangeIndex = node.curScale;
+            var scaleRanges = node.children;
+            node.curScale = -1;
+            for(var j=0; j < scaleRanges.length; j++)
             {
-                var rangeIndex = node.curScale;
-                var scaleRanges = node.children;
-                node.curScale = -1;
-                for(var j=0; j < scaleRanges.length; j++)
+                var scaleRange = scaleRanges[j];
+                if(scale >= scaleRange.min && scale < scaleRange.max)
                 {
-                    var scaleRange = scaleRanges[j];
-                    if(scale >= scaleRange.min && scale < scaleRange.max)
-                    {
-                        node.curScale = j;
-                        break;
-                    }
+                    node.curScale = j;
+                    break;
                 }
-                if(node.displayInLegend && rangeIndex != node.curScale && node.curScale != -1)
-                    SetLayerStyles(node);
-                node.isDisplayed = node.displayInLegend && node.curScale != -1;
             }
+            if(node.displayInLegend && rangeIndex != node.curScale && node.curScale != -1)
+                SetLayerStyles(node);
+            node.isDisplayed = node.displayInLegend && node.curScale != -1;
         }
     }
+}
 
-    function FindNode(nodes, objectId)
+function FindNode(nodes, objectId)
+{
+    for(var i=0; i < nodes.length; i++)
     {
-        for(var i=0; i < nodes.length; i++)
+        var node = nodes[i];
+        if(node.objectId == objectId)
+            return node;
+        if(node.type == 0 && node.children != null)
         {
-            var node = nodes[i];
-            if(node.objectId == objectId)
-                return node;
-            if(node.type == 0 && node.children != null)
-            {
-                var child = FindNode(node.children, objectId);
-                if(child != null)
-                    return child;
-            }
+            var child = FindNode(node.children, objectId);
+            if(child != null)
+                return child;
         }
-        return null;
     }
+    return null;
+}
 
-    function GetMapFrame()
-    {
-        return parent.GetMapFrame();
-    }
+function GetMapFrame()
+{
+    return parent.GetMapFrame();
+}
 
-    function GetMainFrame()
-    {
-        return GetMapFrame().parent;
-    }
+function GetMainFrame()
+{
+    return GetMapFrame().parent;
+}
 
-    function UpdateTree(layerGroups)
-    {
-        if(!HasTreeChanged(tree, layerGroups))
-            return null;
+function UpdateTree(layerGroups)
+{
+    if(!HasTreeChanged(tree, layerGroups))
+        return null;
 
-        return new Array();
+    return new Array();
 
-        //For now, when the tree has changed, we query the whole content again.
-        //If we want an intelligent update of the tree, here is the place to
-        //implement it.
-    }
+    //For now, when the tree has changed, we query the whole content again.
+    //If we want an intelligent update of the tree, here is the place to
+    //implement it.
+}
 
-    function HasTreeChanged(current, lightTree)
+function HasTreeChanged(current, lightTree)
+{
+    if(current.length != lightTree.length)
+        return true;
+
+    for(var i = 0; i < current.length; i++)
     {
-        if(current.length != lightTree.length)
+        var node1 = current[i], node2 = lightTree[i];
+        if(node1.type != node2.type || node1.objectId != node2.objectId)
             return true;
-
-        for(var i = 0; i < current.length; i++)
+        if(node1.type == 1)
         {
-            var node1 = current[i], node2 = lightTree[i];
-            if(node1.type != node2.type || node1.objectId != node2.objectId)
+            if(node1.layerRes != node2.layerRes)
                 return true;
-            if(node1.type == 1)
+        }
+        else if(node1.type == 0)
+        {
+            if(node1.children != null)
             {
-                if(node1.layerRes != node2.layerRes)
+                if(node2.children == null)
                     return true;
+                if(HasTreeChanged(node1.children, node2.children))
+                    return true;
             }
-            else if(node1.type == 0)
-            {
-                if(node1.children != null)
-                {
-                    if(node2.children == null)
-                        return true;
-                    if(HasTreeChanged(node1.children, node2.children))
-                        return true;
-                }
-            }
         }
-        return false;
     }
+    return false;
+}
 
-    function BuildLayerMap(nodes, layerMap)
+function BuildLayerMap(nodes, layerMap)
+{
+    for(var i=0; i < nodes.length; i++)
     {
-        for(var i=0; i < nodes.length; i++)
+        var node = nodes[i];
+        if(node.type == 0)
         {
-            var node = nodes[i];
-            if(node.type == 0)
-            {
-                if(node.children != null && node.children.length > 0)
-                    BuildLayerMap(node.children, layerMap);
-            }
-            else if(node.type == 1)
-                layerMap.setItem(node.objectId, node);
+            if(node.children != null && node.children.length > 0)
+                BuildLayerMap(node.children, layerMap);
         }
+        else if(node.type == 1)
+            layerMap.setItem(node.objectId, node);
     }
+}
 
-    function GetLayer(layerId)
-    {
-        var lyr = layerMap.getItem(layerId);
-        if(lyr == null)
-            return null;
-        return new Layer(lyr.legend, lyr.name, layerId);
-    }
+function GetLayer(layerId)
+{
+    var lyr = layerMap.getItem(layerId);
+    if(lyr == null)
+        return null;
+    return new Layer(lyr.legend, lyr.name, layerId);
+}
 
-    function GetLayers(onlyVisible, onlySelectable)
-    {
-        var layers = new Array();
-        DoGetLayers(tree, layers, onlyVisible, onlySelectable);
-        return layers;
-    }
+function GetLayers(onlyVisible, onlySelectable)
+{
+    var layers = new Array();
+    DoGetLayers(tree, layers, onlyVisible, onlySelectable);
+    return layers;
+}
 
-    function DoGetLayers(nodes, layers, onlyVisible, onlySelectable)
+function DoGetLayers(nodes, layers, onlyVisible, onlySelectable)
+{
+    for(var i=0; i < nodes.length; i++)
     {
-        for(var i=0; i < nodes.length; i++)
+        var node = nodes[i];
+        if(node.type == 0)
         {
-            var node = nodes[i];
-            if(node.type == 0)
-            {
-                if(onlyVisible && !node.visible)
-                    continue;
-                if(node.children != null && node.children.length > 0)
-                    DoGetLayers(node.children, layers, onlyVisible, onlySelectable);
-            }
-            else if(node.type == 1)
-            {
-                if(onlyVisible && !node.visible)
-                    continue;
-                if(onlySelectable && !node.selectable)
-                    continue;
-                layers.push(new Layer(node.legend, node.name, node.objectId));
-            }
+            if(onlyVisible && !node.visible)
+                continue;
+            if(node.children != null && node.children.length > 0)
+                DoGetLayers(node.children, layers, onlyVisible, onlySelectable);
         }
+        else if(node.type == 1)
+        {
+            if(onlyVisible && !node.visible)
+                continue;
+            if(onlySelectable && !node.selectable)
+                continue;
+            layers.push(new Layer(node.legend, node.name, node.objectId));
+        }
     }
+}
 
-    function GetBaseGroups(visOnly)
+function GetBaseGroups(visOnly)
+{
+    if(tree == null)
+        return null;
+    groups = new Array();
+    for(var i=0; i < tree.length; i++)
     {
-        if(tree == null)
-            return null;
-        groups = new Array();
-        for(var i=0; i < tree.length; i++)
+        if(tree[i].type == 0)
         {
-            if(tree[i].type == 0)
+            if(tree[i].base)
             {
-                if(tree[i].base)
-                {
-                    if(visOnly && !tree[i].visible)
-                        continue;
-                    groups.push(tree[i].name);
-                }
+                if(visOnly && !tree[i].visible)
+                    continue;
+                groups.push(tree[i].name);
             }
         }
-        return groups;
     }
-    </script>
-  </head>
-  <body id="legendUi" onload="InitDocument()" leftmargin=3 topmargin=3 rightmargin=3 bottommargin=3 marginwidth=3 marginheight=3>
-    <div id="Tree">
-    </div>
+    return groups;
+}
+
+</script>
+
+</head>
+<body id="legendUi" onload="InitDocument()" leftmargin=3 topmargin=3 rightmargin=3 bottommargin=3 marginwidth=3 marginheight=3>
+    <div id="Tree"></div>
     <div class="PopupMenu" id="Legend"></div>
     <div class="PopupMetricsDiv" id="MetricsDiv" style="visibility:hidden;"><span class="PopupMetrics" id="Metrics"></span></div>
-  </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/legendupdate.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/legendupdate.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/legendupdate.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,61 +1,61 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <script language="javascript" src="../viewerfiles/legend.js"></script>
-    <script language=javascript>
-       var updateType = %s;
-       var timer = null;
-       
-       %s
-       
-       function InitDocument()
-       {
-          switch(updateType)
-          {
-            case 0:
-                var toBeRequested = this.parent.legendUiFrame.UpdateTree(layerData);
-                if(toBeRequested != null)
-                {
-                    var request = "%s?LC=" + toBeRequested.length + "&MAPNAME=" + encodeURIComponent(GetMapFrame().GetMapName()) + "&SESSION=" + GetMapFrame().GetSessionId() + "&LAYERS=";
-                    for(var i = 0; i < toBeRequested.length; i++)
-                    {
-                        if(i > 0)
-                            request += ",";
-                        request += toBeRequested[i];
-                    }
-                    document.location.replace(request);
-                }
-                break;
-            case 1:
-                timer = setInterval("InitializeControl()", 200);
-                break;
-            case 2:
-                this.parent.legendUiFrame.SetLayersData(layerData);
-                break;
-          }
-       }
-       
-       function InitializeControl()
-       {
-          try
-          {
-             if(!parent.IsUiReady())
-                return;
-             clearInterval(timer);
-             this.parent.legendUiFrame.SetTree(layerData, false);
-          }
-          catch(e)
-          {
-          }
-       }
-       
-       function GetMapFrame()
-       {
-           return parent.GetMapFrame();
-       }
-       
-    </script>
-  </head>
-  <body onload="InitDocument()" bgcolor=green>
-  </body>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
+<script language="javascript" src="../viewerfiles/legend.js"></script>
+<script language=javascript>
+
+var updateType = %s;
+var timer = null;
+%s
+
+function InitDocument()
+{
+    switch(updateType)
+    {
+    case 0:
+        var toBeRequested = this.parent.legendUiFrame.UpdateTree(layerData);
+        if(toBeRequested != null)
+        {
+            var request = "%s?LC=" + toBeRequested.length + "&MAPNAME=" + encodeURIComponent(GetMapFrame().GetMapName()) + "&SESSION=" + GetMapFrame().GetSessionId() + "&LAYERS=";
+            for(var i = 0; i < toBeRequested.length; i++)
+            {
+                if(i > 0)
+                    request += ",";
+                request += toBeRequested[i];
+            }
+            document.location.replace(request);
+        }
+        break;
+    case 1:
+        timer = setInterval("InitializeControl()", 200);
+        break;
+    case 2:
+        this.parent.legendUiFrame.SetLayersData(layerData);
+        break;
+    }
+}
+
+function InitializeControl()
+{
+    try
+    {
+        if(!parent.IsUiReady())
+            return;
+        clearInterval(timer);
+        this.parent.legendUiFrame.SetTree(layerData, false);
+    }
+    catch(e) {}
+}
+
+function GetMapFrame()
+{
+    return parent.GetMapFrame();
+}
+
+</script>
+
+</head>
+<body onload="InitDocument()" bgcolor=green>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/linelayerdef.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/linelayerdef.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/linelayerdef.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,23 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
-  <LayerDefinition version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="LayerDefinition-1.0.0.xsd">
+<LayerDefinition version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="LayerDefinition-1.0.0.xsd">
     <VectorLayerDefinition>
-      <ResourceId>%s</ResourceId>
-      <FeatureName>%s</FeatureName>
-      <FeatureNameType>FeatureClass</FeatureNameType>
-      <Geometry>%s</Geometry>
-      <ToolTip>%s</ToolTip>
-      <VectorScaleRange>
-        <LineTypeStyle>
-          <LineRule>
-          <LegendLabel/>
-            <LineSymbolization2D>              
-              <LineStyle>Solid</LineStyle>
-              <Thickness>%s</Thickness>
-              <Color>%s</Color>
-              <Unit>Points</Unit>
-            </LineSymbolization2D>
-          </LineRule>
-        </LineTypeStyle>
-      </VectorScaleRange>
+        <ResourceId>%s</ResourceId>
+        <FeatureName>%s</FeatureName>
+        <FeatureNameType>FeatureClass</FeatureNameType>
+        <Geometry>%s</Geometry>
+        <ToolTip>%s</ToolTip>
+        <VectorScaleRange>
+            <LineTypeStyle>
+                <LineRule>
+                    <LegendLabel/>
+                    <LineSymbolization2D>
+                        <LineStyle>Solid</LineStyle>
+                        <Thickness>%s</Thickness>
+                        <Color>%s</Color>
+                        <Unit>Points</Unit>
+                    </LineSymbolization2D>
+                </LineRule>
+            </LineTypeStyle>
+        </VectorScaleRange>
     </VectorLayerDefinition>
-  </LayerDefinition>
+</LayerDefinition>

Modified: trunk/MgDev/Web/src/viewerfiles/linerule.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/linerule.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/linerule.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,10 +1,10 @@
-          <LineRule>
-            <LegendLabel>%s</LegendLabel>
-            <Filter>%s</Filter>
-            <LineSymbolization2D>              
-              <LineStyle>Solid</LineStyle>
-              <Thickness>1</Thickness>
-              <Color>%s</Color>
-              <Unit>Points</Unit>
-            </LineSymbolization2D>
-          </LineRule>
+<LineRule>
+    <LegendLabel>%s</LegendLabel>
+    <Filter>%s</Filter>
+    <LineSymbolization2D>
+    <LineStyle>Solid</LineStyle>
+    <Thickness>1</Thickness>
+    <Color>%s</Color>
+    <Unit>Points</Unit>
+    </LineSymbolization2D>
+</LineRule>

Modified: trunk/MgDev/Web/src/viewerfiles/linetypestyle.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/linetypestyle.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/linetypestyle.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,2 +1 @@
-        <LineTypeStyle>
-%s        </LineTypeStyle>
+<LineTypeStyle>%s</LineTypeStyle>

Modified: trunk/MgDev/Web/src/viewerfiles/mainframe.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/mainframe.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/mainframe.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,189 +1,241 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>%s</title>
-    <script language="javascript" src="../viewerfiles/numfmt.js"></script>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language="javascript" src="../viewerfiles/contextmenu.js"></script>
-    <script language=javascript>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>%s</title>
 
-        var locale = '%s';
-        var hasToolbar = %s;
-        var hasStatusbar = %s;
-        var hasTaskpane = %s;
-        var hasTaskbar = %s;
-        var homePage = '%s';
-        var thisFrame = this;
-        var defHome = %s;
-        var webLayout = '%s';
-        var mapDefinition = '%s';
-        var taskWidth = %s;
-        var pointBegin= null;
-        var measureWinRef = null;
-        var inMeasure = false;
-        var segId = 1;
-        var center = %s;
-        var scale = %s;
-        var title = "%s";
-        var forwardMouse = false;
-        var menuOpen = false;
-        var curScale = 0;
-        var dwf = %s;
-        var mapUnitsType = "";
-        var newWindowIndex = 1;
+<script language="javascript" src="../viewerfiles/numfmt.js"></script>
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language="javascript" src="../viewerfiles/contextmenu.js"></script>
+<script language=javascript>
 
-        var commands = new Array();
-        var toolbarItems = new Array();
-        var taskItems = new Array();
-        var ctxMenuItems = new Array();
+var locale = '%s';
+var hasToolbar = %s;
+var hasStatusbar = %s;
+var hasTaskpane = %s;
+var hasTaskbar = %s;
+var homePage = '%s';
+var thisFrame = this;
+var defHome = %s;
+var webLayout = '%s';
+var mapDefinition = '%s';
+var taskWidth = %s;
+var pointBegin= null;
+var measureWinRef = null;
+var inMeasure = false;
+var segId = 1;
+var center = %s;
+var scale = %s;
+var title = "%s";
+var forwardMouse = false;
+var menuOpen = false;
+var curScale = 0;
+var dwf = %s;
+var mapUnitsType = "";
+var newWindowIndex = 1;
 
-        function BasicCommand(name, action, icon, iconDisabled, tooltip, description) {
-        this.name = name;
-        this.action = action;
-        this.icon = icon;
-        this.iconDisabled = iconDisabled;
-        this.tooltip = tooltip;
-        this.description = description;
-        this.enabled = true;
-        }
-        function UiTargetCommand(name, action, icon, iconDisabled, tooltip, description, targetType, target) {
-        this.targetType = targetType;
-        this.target = target;
-        this.BasicCommandInfo = BasicCommand;
-        this.BasicCommandInfo(name, action, icon, iconDisabled, tooltip, description);
-        }
-        function SearchCommand(name, label, action, icon, iconDisabled, tooltip, description, layer, prompt, resultColumns, filter, matchLimit, targetType, target) {
-        this.layer = layer;
-        this.prompt = prompt;
-        this.resultColumns = resultColumns;
-        this.filter = filter;
-        this.matchLimit = matchLimit;
-        this.label = label;
-        this.UiTargetCommandInfo = UiTargetCommand;
-        this.UiTargetCommandInfo(name, action, icon, iconDisabled, tooltip, description, targetType, target);
-        }
-        function InvokeUrlCommand(name, action, icon, iconDisabled, tooltip, description, url, params, disableIfSelEmpty, layerConstraints, targetType, target) {
-        this.url = url;
-        this.params = params;
-        this.disableIfSelEmpty = disableIfSelEmpty;
-        this.layerConstraints = layerConstraints;
-        this.UiTargetCommandInfo = UiTargetCommand;
-        this.UiTargetCommandInfo(name, action, icon, iconDisabled, tooltip, description, targetType, target);
-        }
-        function HelpCommand(name, action, icon, iconDisabled, tooltip, description, url, targetType, target) {
-        this.url = url;
-        this.UiTargetCommandInfo = UiTargetCommand;
-        this.UiTargetCommandInfo(name, action, icon, iconDisabled, tooltip, description, targetType, target);
-        }
-        function PrintCommand(name, action, icon, iconDisabled, tooltip, description, layouts) {
-        this.layouts = layouts;
-        this.BasicCommandInfo = BasicCommand;
-        this.BasicCommandInfo(name, action, icon, iconDisabled, tooltip, description);
-        }
-        function InvokeScriptCommand(name, action, icon, iconDisabled, tooltip, description, index) {
-        this.codeIndex = index;
-        this.BasicCommandInfo = BasicCommand;
-        this.BasicCommandInfo(name, action, icon, iconDisabled, tooltip, description);
-        }
-        function NavParam(key, value) {
-        this.key = key;
-        this.value = value;
-        }
-        function ResultColumn(displayName, propertyName) {
-        this.displayName = displayName;
-        this.propertyName = propertyName;
-        }
-        function UiItem(name) {
-        this.name = name;
-        this.type = 2;
-        }
-        function CommandItem(name, cmdIndex) {
-        this.cmdIndex = cmdIndex;
-        this.UiItemInfo = UiItem;
-        this.UiItemInfo(name);
-        this.type = 1;
-        }
-        function FlyoutItem(name, subItems, htmlEltName, iconUrl) {
-        this.subItems = subItems;
-        this.UiItemInfo = UiItem;
-        this.htmlElt = htmlEltName;
-        this.iconUrl = iconUrl;
-        this.UiItemInfo(name);
-        this.type = 3;
-        }
-        function Point(x,y) {
-        this.x = x;
-        this.y = y;
-        }
-        //Commands
-        %s
+var commands = new Array();
+var toolbarItems = new Array();
+var taskItems = new Array();
+var ctxMenuItems = new Array();
 
-        //Toolbar items
-        %s
+function BasicCommand(name, action, icon, iconDisabled, tooltip, description)
+{
+    this.name = name;
+    this.action = action;
+    this.icon = icon;
+    this.iconDisabled = iconDisabled;
+    this.tooltip = tooltip;
+    this.description = description;
+    this.enabled = true;
+}
 
-        //Task items
-        %s
+function UiTargetCommand(name, action, icon, iconDisabled, tooltip, description, targetType, target)
+{
+    this.targetType = targetType;
+    this.target = target;
+    this.BasicCommandInfo = BasicCommand;
+    this.BasicCommandInfo(name, action, icon, iconDisabled, tooltip, description);
+}
 
-        //Contextual menu
-        %s
+function SearchCommand(name, label, action, icon, iconDisabled, tooltip, description, layer, prompt, resultColumns, filter, matchLimit, targetType, target)
+{
+    this.layer = layer;
+    this.prompt = prompt;
+    this.resultColumns = resultColumns;
+    this.filter = filter;
+    this.matchLimit = matchLimit;
+    this.label = label;
+    this.UiTargetCommandInfo = UiTargetCommand;
+    this.UiTargetCommandInfo(name, action, icon, iconDisabled, tooltip, description, targetType, target);
+}
 
-        //User code
-        %s
+function InvokeUrlCommand(name, action, icon, iconDisabled, tooltip, description, url, params, disableIfSelEmpty, layerConstraints, targetType, target)
+{
+    this.url = url;
+    this.params = params;
+    this.disableIfSelEmpty = disableIfSelEmpty;
+    this.layerConstraints = layerConstraints;
+    this.UiTargetCommandInfo = UiTargetCommand;
+    this.UiTargetCommandInfo(name, action, icon, iconDisabled, tooltip, description, targetType, target);
+}
 
-        var taskItemTexts = new Array(%s);
-        var selectionAwareCmds = new Array();
-        %s
+function HelpCommand(name, action, icon, iconDisabled, tooltip, description, url, targetType, target)
+{
+    this.url = url;
+    this.UiTargetCommandInfo = UiTargetCommand;
+    this.UiTargetCommandInfo(name, action, icon, iconDisabled, tooltip, description, targetType, target);
+}
 
-        // public functions -----------------------------------------------
-        //
-        function ZoomToView(x,y,scale,refresh) {
-        mapFrame.ZoomToView(x,y,scale,refresh);
-        }
-        function Refresh() {
-        mapFrame.Refresh();
-        }
-        function SetStatusMsg(msg) {
-        if(msg == null)
+function PrintCommand(name, action, icon, iconDisabled, tooltip, description, layouts)
+{
+    this.layouts = layouts;
+    this.BasicCommandInfo = BasicCommand;
+    this.BasicCommandInfo(name, action, icon, iconDisabled, tooltip, description);
+}
+
+function InvokeScriptCommand(name, action, icon, iconDisabled, tooltip, description, index)
+{
+    this.codeIndex = index;
+    this.BasicCommandInfo = BasicCommand;
+    this.BasicCommandInfo(name, action, icon, iconDisabled, tooltip, description);
+}
+
+function NavParam(key, value)
+{
+    this.key = key;
+    this.value = value;
+}
+
+function ResultColumn(displayName, propertyName)
+{
+    this.displayName = displayName;
+    this.propertyName = propertyName;
+}
+
+function UiItem(name)
+{
+    this.name = name;
+    this.type = 2;
+}
+
+function CommandItem(name, cmdIndex)
+{
+    this.cmdIndex = cmdIndex;
+    this.UiItemInfo = UiItem;
+    this.UiItemInfo(name);
+    this.type = 1;
+}
+
+function FlyoutItem(name, subItems, htmlEltName, iconUrl)
+{
+    this.subItems = subItems;
+    this.UiItemInfo = UiItem;
+    this.htmlElt = htmlEltName;
+    this.iconUrl = iconUrl;
+    this.UiItemInfo(name);
+    this.type = 3;
+}
+
+function Point(x,y)
+{
+    this.x = x;
+    this.y = y;
+}
+
+//Commands
+%s
+
+//Toolbar items
+%s
+
+//Task items
+%s
+
+//Contextual menu
+%s
+
+//User code
+%s
+
+var taskItemTexts = new Array(%s);
+var selectionAwareCmds = new Array();
+%s
+
+// public functions -----------------------------------------------
+//
+
+function ZoomToView(x,y,scale,refresh)
+{
+    mapFrame.ZoomToView(x,y,scale,refresh);
+}
+
+function Refresh()
+{
+    mapFrame.Refresh();
+}
+
+function SetStatusMsg(msg)
+{
+    if(msg == null)
         msg = "";
-        window.status = msg;
-        }
-        function ExecuteMapAction(action) {
-        if(action == 14)
+    window.status = msg;
+}
+
+function ExecuteMapAction(action)
+{
+    if(action == 14)
         if(RestoreView())
-        return;
-        if(action < 2 || action >
-            8)
-            if(inMeasure)
+            return;
+
+    if(action < 2 || action > 8)
+        if(inMeasure)
             EndMeasure();
-            mapFrame.ExecuteMapAction(action);
-            if(hasToolbar == 1)
-            tbFrame.OnCommandExecuted(action);
-            }
-            function GetMapFrame() {
-            return mapFrame;
-            }
-            function GetScriptFrame() {
-            return scriptFrame;
-            }
-            function GetTaskFrame() {
-            return taskFrame;
-            }
-            function GetFormFrame() {
-            return formFrame;
-            }
-            function GotoHomePage() {
-                GetTaskFrame().GetTaskPane().location.href = GettingStartedURL();
+
+    mapFrame.ExecuteMapAction(action);
+    if(hasToolbar == 1)
+        tbFrame.OnCommandExecuted(action);
 }
-function GettingStartedURL () {
+
+function GetMapFrame()
+{
+    return mapFrame;
+}
+
+function GetScriptFrame()
+{
+    return scriptFrame;
+}
+
+function GetTaskFrame()
+{
+    return taskFrame;
+}
+
+function GetFormFrame()
+{
+    return formFrame;
+}
+
+function GotoHomePage()
+{
+    GetTaskFrame().GetTaskPane().location.href = GettingStartedURL();
+}
+
+function GettingStartedURL ()
+{
     if(defHome)
         return homePage + "?WEBLAYOUT=" + encodeURIComponent(webLayout) + "&LOCALE=" + locale + "&DWF=" + dwf;
     else
         return homePage + "?SESSION=" + mapFrame.GetSessionId() + "&LOCALE=" + locale + "&MAPNAME=" + encodeURIComponent(mapFrame.GetMapName());
 }
-function SetSelectionXML(xmlSet) {
+
+function SetSelectionXML(xmlSet)
+{
     mapFrame.SetSelectionXML(xmlSet);
 }
-function ExecuteCommand(index) {
+
+function ExecuteCommand(index)
+{
     if(index < 0 || index >= commands.length)
         return;
     var cmd = commands[index];
@@ -215,7 +267,9 @@
     else if(cmd.action == 33)
         ExecuteHelpCommand(index);
 }
-function ForwardMouseDown(doc, e) {
+
+function ForwardMouseDown(doc, e)
+{
     forwardMouse = true;
     var frs = window.frames;
     for(var i=0; i < frs.length; i++)
@@ -230,20 +284,31 @@
     }
     forwardMouse = false;
 }
-function GetCommands() {
+
+function GetCommands()
+{
     return commands;
 }
-function GetToolbarItems() {    
+
+function GetToolbarItems()
+{
     return toolbarItems;
 }
-function GetTaskListItems() {
+
+function GetTaskListItems()
+{
     return taskItems;
 }
-function GetContextMenuItems() {
+
+function GetContextMenuItems()
+{
     return ctxMenuItems;
 }
-function FormatMessage(fmt, params) {
-    if(params != null) {
+
+function FormatMessage(fmt, params)
+{
+    if(params != null)
+    {
         for(var i = 0; i < params.length; i++)
         {
             tag = "{" + i + "}";
@@ -251,97 +316,111 @@
             if(pos1 == -1)
                 break;
             if(pos1 > 0)
-            begin = fmt.substr(0, pos1);
+                begin = fmt.substr(0, pos1);
             else
-            begin = "";
+                begin = "";
             end = fmt.substr(pos1 + tag.length);
             fmt = begin + params[i] + end;
-            }
-            }
-            return fmt;
-            }
-            
-            // private functions -----------------------------------------------
-            //
-            function RestoreView() {
-            if(center == null)
-            return false;
+        }
+    }
+    return fmt;
+}
 
-            ZoomToView(center.x, center.y, scale, 1);
-            return true;
-            }
-            function OnCommandSelected(cmdIndex) {
-            if(cmdIndex != -1)
-            {
-            var cmd = commands[cmdIndex];
-            if(cmd)
-            SetStatusMsg(cmd.description);
-            }
-            else
-            SetStatusMsg("");
-            }
-            function OnEnableCommand(cmdIndex) {
-            return commands[cmdIndex].enabled;
-            }
-            function OnMenuShown(shown) {
-            menuOpen = shown;
-            }
-            function OnScaleChanged(scale) {
-            curScale = scale;
-            DisplayMapSize();
-            if(hasStatusbar == 1)
-            {
-                sbFrame.SetMapScaleMsg("1: " + FormatScale(scale));
-            }
-            }
-            function FormatScale(scale) {
-                if(scale >= 100000)
-                    return parseInt(scale);
-                else if(scale >= 1)
-                    return scale.toFixed(2);
-                else if(scale > 0.001)
-                    return scale.toFixed(3);
-                else
-                    return 0.001;
-            }
-            function OnMapLoaded() {
-            ExecuteMapAction(15);
-            RestoreView();
-            OnSelectionChanged();
-            DisplayMapSize();
-            }
-            function OnCursorPosChanged(x, y) {
-            if(menuOpen || hasStatusbar == 0)
-            return true;
-            try
-            {
-            var latlon = mapFrame.IsLatLongDisplayUnits();
-            var pt = mapFrame.ScreenToMapUnits(x, y);
-            if(latlon)
+// private functions -----------------------------------------------
+//
+function RestoreView()
+{
+    if(center == null)
+        return false;
+
+    ZoomToView(center.x, center.y, scale, 1);
+    return true;
+}
+
+function OnCommandSelected(cmdIndex)
+{
+    if(cmdIndex != -1)
+    {
+        var cmd = commands[cmdIndex];
+        if(cmd)
+        SetStatusMsg(cmd.description);
+    }
+    else
+        SetStatusMsg("");
+}
+
+function OnEnableCommand(cmdIndex)
+{
+    return commands[cmdIndex].enabled;
+}
+
+function OnMenuShown(shown)
+{
+    menuOpen = shown;
+}
+
+function OnScaleChanged(scale)
+{
+    curScale = scale;
+    DisplayMapSize();
+    if(hasStatusbar == 1)
+        sbFrame.SetMapScaleMsg("1: " + FormatScale(scale));
+}
+
+function FormatScale(scale)
+{
+    if(scale >= 100000)
+        return parseInt(scale);
+    else if(scale >= 1)
+        return scale.toFixed(2);
+    else if(scale > 0.001)
+        return scale.toFixed(3);
+    else
+        return 0.001;
+}
+
+function OnMapLoaded()
+{
+    ExecuteMapAction(15);
+    RestoreView();
+    OnSelectionChanged();
+    DisplayMapSize();
+}
+
+function OnCursorPosChanged(x, y)
+{
+    if(menuOpen || hasStatusbar == 0)
+        return true;
+    try
+    {
+        var latlon = mapFrame.IsLatLongDisplayUnits();
+        var pt = mapFrame.ScreenToMapUnits(x, y);
+        if(latlon)
             pt = mapFrame.MapUnitsToLatLon(pt.X, pt.Y);
+        x = pt.X.toFixed(6);
+        y = pt.Y.toFixed(6);
 
-            x = pt.X.toFixed(6);
-            y = pt.Y.toFixed(6);
+        var text;
+        if(latlon)
+            text = FormatMessage("__#LATLONCURPOS#__", new Array(x, y) );
+        else
+            text = FormatMessage("__#MAPUNITSCURPOS#__", new Array(x, y) ) + " (" + GetMapUnitsType() + ")";
 
-            var text;
-            if(latlon)
-                text = FormatMessage("__#LATLONCURPOS#__", new Array(x, y) );
-            else
-                text = FormatMessage("__#MAPUNITSCURPOS#__", new Array(x, y) ) + " (" + GetMapUnitsType() + ")";
+        sbFrame.SetCursorPositionMsg(text);
+    }
+    catch(e) {}
 
-            sbFrame.SetCursorPositionMsg(text);
-            }
-            catch(e){}
+    return true;
+}
 
-            return true;
-            }
-            function InitTaskMenu() {
-            var taskMenu = new MenuData("Task", 20, 21, 50, 200,
-            "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif",
-            thisFrame, true, "#f0f0f0");
-            startBuildMenuContent(taskMenu);
+function InitTaskMenu()
+{
+    var taskMenu = new MenuData("Task", 20, 21, 50, 200,
+    "../stdicons/icon_popupscrollup.gif", "../stdicons/icon_popupscrollup_disabled.gif", "../stdicons/icon_popupscrolldown.gif", "../stdicons/icon_popupscrolldown_disabled.gif",
+    thisFrame, true, "#f0f0f0");
+    startBuildMenuContent(taskMenu);
 
-            for(var i = 0; i < taskItems.length; i++)
+    for(var i = 0; i < taskItems.length; i++)
     {
         var task = taskItems[i];
         if(task.type == 2)
@@ -350,37 +429,50 @@
         {
             var cmd = commands[task.cmdIndex];
             addMenuOption(taskMenu, task.name, task.cmdIndex, 1, cmd.icon, cmd.iconDisabled, cmd.enabled);
-        }    
-    }        
+        }
+    }
     endBuildMenuContent(taskMenu);
     return taskMenu;
 }
-function EndMeasure() {
+
+function EndMeasure()
+{
     inMeasure = false;
     try
     {
         measureWinRef.MeasureEnded();
-    } catch(e){}
+    }
+    catch(e) {}
 }
-function ResumeMeasure() {
+
+function ResumeMeasure()
+{
     inMeasure = true;
     try
     {
         measureWinRef.MeasureResumed();
-    } catch(e){}
+    }
+    catch(e) {}
 }
 
-function InMeasure() {
+function InMeasure()
+{
     return inMeasure;
 }
-function StopMeasure() {
+
+function StopMeasure()
+{
     inMeasure = false;
 }
-function ClearMeasure() {
+
+function ClearMeasure()
+{
     pointBegin = null;
     segId = 1;
 }
-function ClickMap(x, y) {
+
+function ClickMap(x, y)
+{
     if(!inMeasure)
         return false;
     var newPoint = mapFrame.ScreenToMapUnits(x, y);
@@ -392,11 +484,14 @@
         {
             measureWinRef.AddMeasure(segId ++, pointBegin, newPoint);
             pointBegin = newPoint;
-        } catch(e){}
+        }
+        catch(e) {}
     }
     return true;
 }
-function OnSelectionChanged() {
+
+function OnSelectionChanged()
+{
     var selCount = mapFrame.GetSelectedCount();
     if(hasStatusbar == 1)
         sbFrame.SetFeatureSelectedMsg(FormatMessage((selCount > 1? "__#FEATURESSELECTED#__": "__#FEATURESELECTED#__"), new Array(selCount, "unused")));
@@ -408,7 +503,7 @@
         if(cmd.action == 26)
         {
             if(selCount > 0)
-            {   
+            {
                 var layers = cmd.layerConstraints;
                 if(layers.length > 0)
                 {
@@ -443,22 +538,22 @@
                     continue;
                 }
             }
-                
+
             if(EnableCommand(cmd, true))
                 stateChanged = true;
-            
         }
     }
     if(stateChanged && hasToolbar == 1)
         tbFrame.OnCmdStateChanged();
-        
 }
 
-function IsContextMenu() {
+function IsContextMenu()
+{
     return ctxMenuItems.length > 0;
 }
 
-function DisplayMapSize() {
+function DisplayMapSize()
+{
     if(hasStatusbar == 0)
         return;
     var mi = "__#MI#__", km = "__#KM#__", ft = "__#FT#__", i = "__#IN#__", mt = "__#MT#__",  cm = "__#CM#__";
@@ -469,54 +564,69 @@
     if(usEnglish) {
         w *= 3.28083988128;
         h *= 3.28083988128;
-        if(w >= 5279.7552 && h >= 5279.7552) {
+        if(w >= 5279.7552 && h >= 5279.7552)
+        {
             u = mi;
             w /= 5279.7552; h /= 5279.7552;
         }
-        else if(w < 1 && h < 1) {
+        else if(w < 1 && h < 1)
+        {
             u = i;
             w *= 12; h *= 12;
         }
-        else {
+        else
+        {
             u = ft;
         }
     }
     else {
-        if(w >= 1000 && h >= 1000) {
+        if(w >= 1000 && h >= 1000)
+        {
             u = km;
             w /= 1000; h /= 1000;
         }
-        else if (w < 1 && h < 1) {
+        else if (w < 1 && h < 1)
+        {
             u = cm;
             w *= 100; h *= 100;
         }
-        else {
+        else
+        {
             u = mt;
         }
     }
-    
+
     var text = w.toFixed(2) + " x " + h.toFixed(2) + " (" + u + ")";
     sbFrame.SetMapSizeMsg(text);
 }
 
-function SetOptions(engUnit, latLonUnit) {
+function SetOptions(engUnit, latLonUnit)
+{
     mapFrame.SetEnglishUnits(engUnit);
     mapFrame.SetLatLonDisplayUnits(latLonUnit);
     DisplayMapSize();
 }
-function IsInitialView() {
+
+function IsInitialView()
+{
     return center != null;
 }
-function ExecutePrintCommand(index) {
+
+function ExecutePrintCommand(index)
+{
     mapFrame.Print(commands[index].layouts, title);
 }
-function ExecutePrintablePageCommand(index) {
+
+function ExecutePrintablePageCommand(index)
+{
     if(inMeasure)
         EndMeasure();
     var center = mapFrame.GetCenter();
     OpenUrl("%s?SCALE=" + curScale + "&DPI=" + mapFrame.GetDPI() + "&CENTERX=" + center.X + "&CENTERY=" + center.Y, index);
 }
-function ExecuteMeasureCommand(index) {
+
+function ExecuteMeasureCommand(index)
+{
     if(mapFrame.IsDigitizing()) {
         SetStatusMsg("__#DIGALREADYRUNNING#__");
         return;
@@ -525,15 +635,15 @@
     pointBegin = null;
     measureWinRef = OpenUrl("%s?PARTIAL=0&TOTAL=0", index);
 }
-function ExecuteInvokeCommand(index) {
+
+function ExecuteInvokeCommand(index)
+{
     var cmd = commands[index];
     if(cmd.url.replace(" \t\n", "") == "")
-    {
         return;
-    }
     if(inMeasure)
         EndMeasure();
-        
+
     params = null;
     if(cmd.params != null)
     {
@@ -551,38 +661,50 @@
     }
     OpenUrlFromForm(cmd.url, params, index);
 }
-function ExecuteSearchCommand(index) {
+
+function ExecuteSearchCommand(index)
+{
     if(inMeasure)
         EndMeasure();
     var cmd = commands[index];
     OpenUrl("%s?LAYER=" + encodeURIComponent(cmd.layer) + "&FILTER=" + encodeURIComponent(cmd.filter) + "&MR=" + cmd.matchLimit, index);
 }
-function ExecuteBufferCommand(index) {
+
+function ExecuteBufferCommand(index)
+{
     if(inMeasure)
         EndMeasure();
     var cmd = commands[index];
     OpenUrl("%s?US=" + (mapFrame.IsEnglishUnits()? "1" : "0"), index);
 }
-function ExecuteSelectWithinCommand(index) {
+
+function ExecuteSelectWithinCommand(index)
+{
     if(inMeasure)
         EndMeasure();
     var cmd = commands[index];
     OpenUrl("%s?DWF=" + dwf, index);
 }
-function ExecuteHelpCommand(index) {
+
+function ExecuteHelpCommand(index)
+{
     if(inMeasure)
         EndMeasure();
     var cmd = commands[index];
     var url = cmd.url == ""? GettingStartedURL(): cmd.url + "?";
     OpenUrl(url, index);
 }
-function ExecuteScriptCommand(index) {
+
+function ExecuteScriptCommand(index)
+{
     if(inMeasure)
         EndMeasure();
     var funcIndex = commands[index].codeIndex;
     %s
 }
-function OpenUrl(url, index) {
+
+function OpenUrl(url, index)
+{
     url = MakeUrl(url, index);
     var cmd = commands[index];
     if(cmd.targetType == 1)
@@ -604,7 +726,9 @@
             return window.open(url, cmd.targetFrame + index, "toolbar=no,status=no,width=500,height=500,resizable,scrollbars");
     }
 }
-function OpenUrlFromForm(url, params, index) {
+
+function OpenUrlFromForm(url, params, index)
+{
     AddStdParams(params, index);
     var cmd = commands[index];
     targetName = "";
@@ -624,26 +748,30 @@
         {
             targetName = cmd.targetFrame + index;
             window.open("", targetName, "toolbar=no,status=no,width=500,height=500,resizable,scrollbars");
-            }
+        }
     }
     GetFormFrame().Submit(url, params, targetName);
 }
-function AddStdParams(params, index) {
+
+function AddStdParams(params, index)
+{
     var cmd = commands[index];
     var popup = (cmd.targetType == 2) || (cmd.targetType == 3 && GetFrame(cmd.target) == null);
-    params.push("WIDTH"); 
+    params.push("WIDTH");
     if(popup)
         params.push("400");
     else
         params.push(taskWidth);
-    params.push("LOCALE");  params.push(locale);  
-    params.push("SESSION");  params.push(mapFrame.GetSessionId());  
-    params.push("MAPNAME");  params.push(encodeURIComponent(mapFrame.GetMapName()));  
-    params.push("TGT");  params.push(cmd.targetType);  
-    params.push("POPUP");  params.push(popup?1:0);  
-    params.push("CMDINDEX");  params.push(index);  
+    params.push("LOCALE");  params.push(locale);
+    params.push("SESSION");  params.push(mapFrame.GetSessionId());
+    params.push("MAPNAME");  params.push(encodeURIComponent(mapFrame.GetMapName()));
+    params.push("TGT");  params.push(cmd.targetType);
+    params.push("POPUP");  params.push(popup?1:0);
+    params.push("CMDINDEX");  params.push(index);
 }
-function GetFrame(name) {
+
+function GetFrame(name)
+{
     var frs = window.frames;
     for(var i=0; i < frs.length; i++)
     {
@@ -652,7 +780,9 @@
     }
     return null;
 }
-function MakeUrl(url, index) {
+
+function MakeUrl(url, index)
+{
     if(url.lastIndexOf("?") != url.length - 1)
         url += "&";
     var cmd = commands[index];
@@ -664,26 +794,33 @@
     url += "&LOCALE=" + locale + "&SESSION=" + mapFrame.GetSessionId() + "&MAPNAME=" + encodeURIComponent(mapFrame.GetMapName()) + "&TGT=" + cmd.targetType + "&POPUP=" + (popup?1:0) + "&CMDINDEX=" + index;
     return url;
 }
-function ConfigureViewer(index) {
+
+function ConfigureViewer(index)
+{
     if(inMeasure)
         EndMeasure();
     OpenUrl("%s?DWF=" + dwf, index);
-} 
-function EnableCommand(cmd, enable) {
+}
+
+function EnableCommand(cmd, enable)
+{
     if(cmd.enabled == enable)
         return false;
     cmd.enabled = enable;
     return true;
 }
-function GetMapUnitsType() {
+
+function GetMapUnitsType()
+{
     if(mapUnitsType == "")
         mapUnitsType = mapFrame.GetMapUnitsType();
     return mapUnitsType;
 }
-   
-    </script>
-    %s
-  </head>
-  <body>
-  </body>
+
+</script>
+
+%s
+</head>
+<body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/marksymbol.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/marksymbol.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/marksymbol.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,15 +1,15 @@
-                <W2D>
-                  <Unit>Points</Unit>
-                  <SizeContext>DeviceUnits</SizeContext>
-                  <SizeX>%s</SizeX>
-                  <SizeY>%s</SizeY>
-                  <Rotation>0</Rotation>
-                  <MaintainAspect>true</MaintainAspect>
-                  <W2DSymbol>
-                    <ResourceId>%s</ResourceId>
-                    <LibraryItemName>%s</LibraryItemName>
-                  </W2DSymbol>
-                  <FillColor>%s</FillColor>
-                  <LineColor>FF000000</LineColor>
-                  <TextColor>FF000000</TextColor>
-                </W2D>
+<W2D>
+    <Unit>Points</Unit>
+    <SizeContext>DeviceUnits</SizeContext>
+    <SizeX>%s</SizeX>
+    <SizeY>%s</SizeY>
+    <Rotation>0</Rotation>
+    <MaintainAspect>true</MaintainAspect>
+    <W2DSymbol>
+        <ResourceId>%s</ResourceId>
+        <LibraryItemName>%s</LibraryItemName>
+    </W2DSymbol>
+    <FillColor>%s</FillColor>
+    <LineColor>FF000000</LineColor>
+    <TextColor>FF000000</TextColor>
+</W2D>

Modified: trunk/MgDev/Web/src/viewerfiles/measureui.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/measureui.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/measureui.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,161 +1,156 @@
 <html>
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>__#MEASURETITLE#__</title>
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
-        td.Title
-        {
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>__#MEASURETITLE#__</title>
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
+    td.Title
+    {
         font-family: __#@font#__;
         font-weight: bold;
         font-size: 13pt;
-        }
-        .RegText
-        {
+    }
+    .RegText
+    {
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
-        }
-        td.InfoText
-        {
+    }
+    td.InfoText
+    {
         background-color: #FFFFCC;
         color: #666666;
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
-        }
-        td.MeasureData
-        {
+    }
+    td.MeasureData
+    {
         background-color: #DCDCDC;
         color: black;
         font-family:__#@font#__;
         font-size: __#@fontsize#__;
-        }
-        .Ctrl
-        {
+    }
+    .Ctrl
+    {
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
-        }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language="javascript" src="../viewerfiles/contextmenu.js"></script>
-    <script language=javascript>
-        var locale = '%s';
-        var target = %s;
-        var popup = %s;
-        var mapName = "%s";
-        var sessionId = "%s";
-        var total = %s;
-        var partial = %s;
-        var refresh = %s;
-      
-        function InitDocument()
-        {
-            if(!popup)
-                document.onmousedown = OnMouseDown;    
-            SetMeasureResults(partial, total);
-            ShowUnits();
-            if(refresh)
-                GetParent().Refresh();
-        }
+    }
+</style>
 
-        function OnMouseDown(e)
-        {
-            GetParent().ForwardMouseDown(document, e);
-        }
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language="javascript" src="../viewerfiles/contextmenu.js"></script>
+<script language=javascript>
 
-        function AddMeasure(segId, begin, end)
-        {
-            var url = "%s?SEGID=" + segId + "&LOCALE=" + locale + "&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&X1=" + begin.X + "&Y1=" + begin.Y + "&X2=" + end.X + "&Y2=" + end.Y + "&TOTAL=" + total + "&US=" + (GetParent().GetMapFrame().IsEnglishUnits()? 1: 0) + "&TGT=" + target + "&POPUP=" + popup;
-            document.location.href = url;
-        } 
-        
-        function ClearMeasure()
-        {
-            GetParent().ClearMeasure();
-            var url = "%s?MAPNAME=" + encodeURIComponent(mapName) + "&LOCALE=" + locale + "&SESSION=" + sessionId + "&CLEAR=&TGT=" + target + "&POPUP=" + popup;
-            document.location.href = url;
-        }
-        
-        function ResumeStopMeasure()
-        {
-            var parentRef = GetParent();
-            if(parentRef.InMeasure())
-                parentRef.EndMeasure();
-            else
-                parentRef.ResumeMeasure();
-        }
-        
-        function MeasureEnded()
-        {
-            document.getElementById("stopresume").value = "__#RESUME#__";
-        }
+var locale = '%s';
+var target = %s;
+var popup = %s;
+var mapName = "%s";
+var sessionId = "%s";
+var total = %s;
+var partial = %s;
+var refresh = %s;
 
-        function MeasureResumed()
-        {
-            document.getElementById("stopresume").value = "__#STOP#__";
-        }
-        
-        function GetParent()
-        {
-            if(popup)
-                return opener;
-            else
-                return parent.parent;
-        }
-        
-        function SetMeasureResults(partial, total)
-        {
-            document.getElementById("partial").innerHTML = partial.toFixed(2);
-            document.getElementById("total").innerHTML = total.toFixed(2);
-        }
-        
-        function ShowUnits()
-        {
-            var units = GetParent().GetMapFrame().IsEnglishUnits()? "__#MILES#__": "__#KILOMETERS#__";
-            document.getElementById("units1").innerHTML = units;
-            document.getElementById("units2").innerHTML = units;
-        }
-        
-    </script>
+function InitDocument()
+{
+    if(!popup)
+        document.onmousedown = OnMouseDown;
+    SetMeasureResults(partial, total);
+    ShowUnits();
+    if(refresh)
+        GetParent().Refresh();
+}
+
+function OnMouseDown(e)
+{
+    GetParent().ForwardMouseDown(document, e);
+}
+
+function AddMeasure(segId, begin, end)
+{
+    var url = "%s?SEGID=" + segId + "&LOCALE=" + locale + "&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&X1=" + begin.X + "&Y1=" + begin.Y + "&X2=" + end.X + "&Y2=" + end.Y + "&TOTAL=" + total + "&US=" + (GetParent().GetMapFrame().IsEnglishUnits()? 1: 0) + "&TGT=" + target + "&POPUP=" + popup;
+    document.location.href = url;
+}
+
+function ClearMeasure()
+{
+    GetParent().ClearMeasure();
+    var url = "%s?MAPNAME=" + encodeURIComponent(mapName) + "&LOCALE=" + locale + "&SESSION=" + sessionId + "&CLEAR=&TGT=" + target + "&POPUP=" + popup;
+    document.location.href = url;
+}
+
+function ResumeStopMeasure()
+{
+    var parentRef = GetParent();
+    if(parentRef.InMeasure())
+        parentRef.EndMeasure();
+    else
+        parentRef.ResumeMeasure();
+}
+
+function MeasureEnded()
+{
+    document.getElementById("stopresume").value = "__#RESUME#__";
+}
+
+function MeasureResumed()
+{
+    document.getElementById("stopresume").value = "__#STOP#__";
+}
+
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
+
+function SetMeasureResults(partial, total)
+{
+    document.getElementById("partial").innerHTML = partial.toFixed(2);
+    document.getElementById("total").innerHTML = total.toFixed(2);
+}
+
+function ShowUnits()
+{
+    var units = GetParent().GetMapFrame().IsEnglishUnits()? "__#MILES#__": "__#KILOMETERS#__";
+    document.getElementById("units1").innerHTML = units;
+    document.getElementById("units2").innerHTML = units;
+}
+
+</script>
+
 </head>
 <body class="MeasureUi" onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
-<table border="0" cellspacing="0" cellpadding="3" width="100%%">
-  <tr>
-    <td class="Title">__#MEASURETITLE#__<hr></td>
-  </tr>
-  <tr>
-    <td class="InfoText">__#MEASUREINFO#__</td>
-  </tr>
-  <tr>
-    <td height="6"></td>
-  </tr>
-</table>
-<table border="0" cellpadding="5">
+  <table border="0" cellspacing="0" cellpadding="3" width="100%%">
+    <tr><td class="Title">__#MEASURETITLE#__<hr></td></tr>
+    <tr><td class="InfoText">__#MEASUREINFO#__</td></tr>
+    <tr><td height="6"></td></tr>
+  </table>
+  <table border="0" cellpadding="5">
     <tr class="RegText">
-        <td>__#SEGMENT#__:</td>
-        <td align="right" class="MeasureData"><span id="partial"></span></td>
-        <td>(<span id="units1"></span>)</td>
+      <td>__#SEGMENT#__:</td>
+      <td align="right" class="MeasureData"><span id="partial"></span></td>
+      <td>(<span id="units1"></span>)</td>
     </tr>
     <tr class="RegText">
-        <td>__#TOTAL#__:</td>
-        <td align="right" class="MeasureData"><span id="total"></span></td>
-        <td>(<span id="units2"></span>)</td>
+      <td>__#TOTAL#__:</td>
+      <td align="right" class="MeasureData"><span id="total"></span></td>
+      <td>(<span id="units2"></span>)</td>
     </tr>
-    </table>
-<table border="0" cellspacing="0" cellpadding="3" swidth="100%%">
-  <tr>
-    <td height="6"></td>
-  </tr>
-  <tr>
-    <td class="InfoText">
-      <div style="position: relative; left: -25px;">
-      <ul>
-        __#MEASUREHELP#__
-      </ul>
-      </div>
-    </td>
-  <tr><td height="12"></td></tr>
-  </tr>
-</table>
-<input class="Ctrl" type="button" value="__#CLEAR#__" style="width: 70px" onclick="ClearMeasure()">&nbsp;<input class="Ctrl" id="stopresume" type="button" value="__#STOP#__" style="width: 70px" onclick="ResumeStopMeasure()"></td></tr>
+  </table>
+  <table border="0" cellspacing="0" cellpadding="3" swidth="100%%">
+    <tr><td height="6"></td></tr>
+    <tr>
+      <td class="InfoText">
+        <div style="position: relative; left: -25px;">
+        <ul>
+          __#MEASUREHELP#__
+        </ul>
+        </div>
+      </td>
+      <tr><td height="12"></td></tr>
+    </tr>
+  </table>
+  <input class="Ctrl" type="button" value="__#CLEAR#__" style="width: 70px" onclick="ClearMeasure()">&nbsp;<input class="Ctrl" id="stopresume" type="button" value="__#STOP#__" style="width: 70px" onclick="ResumeStopMeasure()"></td></tr>
 </body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/numfmt.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/numfmt.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/numfmt.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -6,16 +6,16 @@
 var percent = "%";
 var currency = "$";  // use dollar sign for currency
 
-function formatNumber(number, format, print) 
+function formatNumber(number, format, print)
 {
-    if (number - 0 != number) 
+    if (number - 0 != number)
         return null;  // if number is NaN return null
     var useSeparator = format.indexOf(separator) != -1;  // use separators in number
     var usePercent = format.indexOf(percent) != -1;  // convert output to percentage
     var useCurrency = format.indexOf(currency) != -1;  // use currency format
     var isNegative = (number < 0);
     number = Math.abs (number);
-    if (usePercent) 
+    if (usePercent)
     number *= 100;
     format = strip(format, separator + percent + currency);  // remove key characters
     number = "" + number;  // convert number input to string
@@ -44,9 +44,9 @@
             nrightEnd = nrightEnd.substring(1);
             nleftEnd = (nleftEnd - 0) + 1;
         }
-    } 
+    }
     else {
-        for (var i=nrightEnd.length; srightEnd.length > nrightEnd.length; i++) 
+        for (var i=nrightEnd.length; srightEnd.length > nrightEnd.length; i++)
         {
             if (srightEnd.charAt(i) == "0") nrightEnd += "0";  // append zero to RHS of number
             else break;
@@ -78,11 +78,9 @@
     input = "" + input;
     var output = "";  // initialise output string
     for (var i=0; i < input.length; i++) {
-        if (i != 0 && (input.length - i) % 3 == 0) 
+        if (i != 0 && (input.length - i) % 3 == 0)
             output += separator;
         output += input.charAt(i);
     }
     return output;
 }
-
-

Modified: trunk/MgDev/Web/src/viewerfiles/pngfix_map.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/pngfix_map.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/pngfix_map.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,10 +1,9 @@
 /*
-
 Correctly handle PNG transparency in Win IE 5.5 and 6.
 http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2005.
 
 Use in <HEAD> section with DEFER keyword
-wrapped in conditional comments thus: 
+wrapped in conditional comments thus:
 
     <!--[if lt IE 7]>
     <script defer type="text/javascript" src="pngfix.js"></script>
@@ -12,63 +11,63 @@
 
 This extended version includes imagemap and input image functionality.
 It also requires a 1px transparent GIF.
- 
 */
 var strGif = "transparentpixel.gif"
 var strFilter = "progid:DXImageTransform.Microsoft.AlphaImageLoader"
 var arVersion = navigator.appVersion.split("MSIE")
 var version = parseFloat(arVersion[1])
 
-if ((version >= 5.5) && (document.body.filters)) 
+if ((version >= 5.5) && (document.body.filters))
 {
     for(var i=0; i<document.images.length; i++)
     {
-       var img = document.images[i]
-       var imgName = img.src.toUpperCase()
-       if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
-       {
-          var imgID = (img.id) ? "id='" + img.id + "' " : ""
-          var imgClass = (img.className) ? "class='" + img.className + "' " : ""
-          var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
-          var imgStyle = "display:inline-block;" + img.style.cssText 
-          if (img.align == "left") imgStyle = "float:left;" + imgStyle
-          if (img.align == "right") imgStyle = "float:right;" + imgStyle
-          if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
-          if (img.useMap)
-          {  
-             strAddMap = "<img style=\"position:relative; left:-" + img.width + "px;"
-             + "height:" + img.height + "px;width:" + img.width +"\" "
-             + "src=\"" + strGif + "\" usemap=\"" + img.useMap 
-             + "\" border=\"" + img.border + "\">"
-          }
-          var strNewHTML = "<span " + imgID + imgClass + imgTitle
-          + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
-          + "filter:" + strFilter
-          + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
-          if (img.useMap) strNewHTML += strAddMap
-          img.outerHTML = strNewHTML
-          i = i-1
-       }
+        var img = document.images[i]
+        var imgName = img.src.toUpperCase()
+        if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
+        {
+            var imgID = (img.id) ? "id='" + img.id + "' " : ""
+            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
+            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
+            var imgStyle = "display:inline-block;" + img.style.cssText
+            if (img.align == "left") imgStyle = "float:left;" + imgStyle
+            if (img.align == "right") imgStyle = "float:right;" + imgStyle
+            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
+            if (img.useMap)
+            {
+                strAddMap = "<img style=\"position:relative; left:-" + img.width + "px;"
+                + "height:" + img.height + "px;width:" + img.width +"\" "
+                + "src=\"" + strGif + "\" usemap=\"" + img.useMap
+                + "\" border=\"" + img.border + "\">"
+            }
+            var strNewHTML = "<span " + imgID + imgClass + imgTitle
+            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+            + "filter:" + strFilter
+            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
+            if (img.useMap) strNewHTML += strAddMap
+            img.outerHTML = strNewHTML
+            i = i-1
+        }
     }
 
-   for(i=0; i < document.forms.length; i++) findImgInputs(document.forms(i))
+    for(i=0; i < document.forms.length; i++)
+        findImgInputs(document.forms(i))
 }
 
 function findImgInputs(oParent)
 {
-   var oChildren = oParent.children
-   if (oChildren)
-   {
-      for (var i=0; i < oChildren.length; i++ )
-      {
-         var oChild = oChildren(i)
-         if ((oChild.type == 'image') && (oChild.src))
-         {
-             var origSrc = oChild.src
-             oChild.src = strGif
-             oChild.style.filter = strFilter + "(src='" + origSrc + "')"
-         }
-         findImgInputs(oChild)
-      }
-   }
+    var oChildren = oParent.children
+    if (oChildren)
+    {
+        for (var i=0; i < oChildren.length; i++ )
+        {
+            var oChild = oChildren(i)
+            if ((oChild.type == 'image') && (oChild.src))
+            {
+                var origSrc = oChild.src
+                oChild.src = strGif
+                oChild.style.filter = strFilter + "(src='" + origSrc + "')"
+            }
+            findImgInputs(oChild)
+        }
+    }
 }

Modified: trunk/MgDev/Web/src/viewerfiles/pointrule.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/pointrule.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/pointrule.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,10 +1,6 @@
-          <PointRule>          
-            <LegendLabel>%s</LegendLabel>
-            <Filter>%s</Filter>
-            <Label>
-%s
-            </Label>
-            <PointSymbolization2D>
-%s
-            </PointSymbolization2D>
-          </PointRule>
+<PointRule>
+    <LegendLabel>%s</LegendLabel>
+    <Filter>%s</Filter>
+    <Label>%s</Label>
+    <PointSymbolization2D>%s</PointSymbolization2D>
+</PointRule>

Modified: trunk/MgDev/Web/src/viewerfiles/pointtypestyle.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/pointtypestyle.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/pointtypestyle.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,5 +1,5 @@
-        <PointTypeStyle>
-          <DisplayAsText>false</DisplayAsText>
-          <AllowOverpost>false</AllowOverpost>
-%s       
-         </PointTypeStyle>
+<PointTypeStyle>
+    <DisplayAsText>false</DisplayAsText>
+    <AllowOverpost>false</AllowOverpost>
+    %s
+</PointTypeStyle>

Modified: trunk/MgDev/Web/src/viewerfiles/printablepage.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/printablepage.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/printablepage.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,105 +1,107 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>%s</title>
-    <style type="text/css">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>%s</title>
+<style type="text/css">
     span.Title
     {
         font-family: __#@font#__;
         font-size:22px;
         font-weight:bold;
     }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language="javascript">
-    var webAgent = '%s';
-    var scale = %s;
-    var centerX = %s;
-    var centerY = %s;
-    var dpi = %s;
-    var mapName = '%s';
-    var sessionId = '%s';
-    var isTitle = %s, isLegend= %s, isArrow = %s;
+</style>
 
-    function InitDocument()
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language="javascript">
+
+var webAgent = '%s';
+var scale = %s;
+var centerX = %s;
+var centerY = %s;
+var dpi = %s;
+var mapName = '%s';
+var sessionId = '%s';
+var isTitle = %s, isLegend= %s, isArrow = %s;
+
+function InitDocument()
+{
+    var mapWidth = 480, mapHeight = 580;
+    if(!isTitle)
     {
-        var mapWidth = 480, mapHeight = 580;
-        if(!isTitle)
-        {
-            document.getElementById("Title").style.height = "0px";
-            mapHeight += 27;
-        }
-        if(isLegend)
-        {
-            var legendElt = document.getElementById("Legend");
-            legendElt.style.width = "180px";
-            legendElt.innerHTML = "<img id=\"legendImage\" width=\"180\" height=\"" + mapHeight + "\" src=\"" + webAgent + "?OPERATION=GETMAPLEGENDIMAGE&VERSION=1.0.0&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&WIDTH=180&HEIGHT=" + mapHeight + "&FORMAT=PNG\" style=\"visibility: hidden\" onload=\"OnImageLoaded('legendImage');\">";
-        }
-        else
-            mapWidth += 180;
+        document.getElementById("Title").style.height = "0px";
+        mapHeight += 27;
+    }
+    if(isLegend)
+    {
+        var legendElt = document.getElementById("Legend");
+        legendElt.style.width = "180px";
+        legendElt.innerHTML = "<img id=\"legendImage\" width=\"180\" height=\"" + mapHeight + "\" src=\"" + webAgent + "?OPERATION=GETMAPLEGENDIMAGE&VERSION=1.0.0&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&WIDTH=180&HEIGHT=" + mapHeight + "&FORMAT=PNG\" style=\"visibility: hidden\" onload=\"OnImageLoaded('legendImage');\">";
+    }
+    else
+        mapWidth += 180;
 
-        if(!isArrow)
-        {
-            mapHeight += 58;
-            document.getElementById("ScaleAndArrow").style.height = "0px";
-        }
+    if(!isArrow)
+    {
+        mapHeight += 58;
+        document.getElementById("ScaleAndArrow").style.height = "0px";
+    }
 
-        var mapElt = document.getElementById("Map");
-        mapElt.style.width = mapWidth + "px";
-        mapElt.innerHTML = "<img id=\"mapImage\" width=\"" + mapWidth + "\" height=\"" + mapHeight + "\" src=\"\" style=\"visibility: hidden;\" onload=\"OnImageLoaded('mapImage');\">";
+    var mapElt = document.getElementById("Map");
+    mapElt.style.width = mapWidth + "px";
+    mapElt.innerHTML = "<img id=\"mapImage\" width=\"" + mapWidth + "\" height=\"" + mapHeight + "\" src=\"\" style=\"visibility: hidden;\" onload=\"OnImageLoaded('mapImage');\">";
 
-        if(isArrow)
-            document.getElementById("Arrow").innerHTML = "<img width=\"38\" height=\"58\" src=\"../stdicons/pr_north.gif\">";
+    if(isArrow)
+        document.getElementById("Arrow").innerHTML = "<img width=\"38\" height=\"58\" src=\"../stdicons/pr_north.gif\">";
 
-        var requester;
-        if(msie)
-            requester = new ActiveXObject("Microsoft.XMLHTTP");
-        else
-            requester = new XMLHttpRequest();
+    var requester;
+    if(msie)
+        requester = new ActiveXObject("Microsoft.XMLHTTP");
+    else
+        requester = new XMLHttpRequest();
 
-        var reqParams = "OPERATION=GETVISIBLEMAPEXTENT&VERSION=1.0.0&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SETDISPLAYWIDTH=" + mapWidth + "&SETDISPLAYHEIGHT=" + mapHeight + "&SETDISPLAYDPI=" + dpi + "&SETVIEWSCALE=" + scale + "&SETVIEWCENTERX=" + centerX + "&SETVIEWCENTERY=" + centerY + "&SEQ=" + Math.random();
+    var reqParams = "OPERATION=GETVISIBLEMAPEXTENT&VERSION=1.0.0&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SETDISPLAYWIDTH=" + mapWidth + "&SETDISPLAYHEIGHT=" + mapHeight + "&SETDISPLAYDPI=" + dpi + "&SETVIEWSCALE=" + scale + "&SETVIEWCENTERX=" + centerX + "&SETVIEWCENTERY=" + centerY + "&SEQ=" + Math.random();
 
-        requester.open("POST", webAgent, false);
-        requester.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-        requester.send(reqParams);
+    requester.open("POST", webAgent, false);
+    requester.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+    requester.send(reqParams);
 
-        if(requester.responseXML)
-        {
-            if(ValidateMapResponse(requester.responseXML.documentElement))
-                document.getElementById("mapImage").src = webAgent + "?OPERATION=GETMAPIMAGE&VERSION=1.0.0&SELECTION=&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId;
-        }
+    if(requester.responseXML)
+    {
+        if(ValidateMapResponse(requester.responseXML.documentElement))
+            document.getElementById("mapImage").src = webAgent + "?OPERATION=GETMAPIMAGE&VERSION=1.0.0&SELECTION=&MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId;
     }
+}
 
-    function ValidateMapResponse(xmlRoot)
+function ValidateMapResponse(xmlRoot)
+{
+    try
     {
-        try
-        {
-            if(xmlRoot.tagName != "Envelope")
-                return false;
+        if(xmlRoot.tagName != "Envelope")
+            return false;
 
-            var xs = xmlRoot.getElementsByTagName("X");
-            var ys = xmlRoot.getElementsByTagName("Y");
-            parseFloat(xs[0].childNodes[0].nodeValue);
-            parseFloat(ys[0].childNodes[0].nodeValue);
-            parseFloat(xs[1].childNodes[0].nodeValue);
-            parseFloat(ys[1].childNodes[0].nodeValue);
+        var xs = xmlRoot.getElementsByTagName("X");
+        var ys = xmlRoot.getElementsByTagName("Y");
+        parseFloat(xs[0].childNodes[0].nodeValue);
+        parseFloat(ys[0].childNodes[0].nodeValue);
+        parseFloat(xs[1].childNodes[0].nodeValue);
+        parseFloat(ys[1].childNodes[0].nodeValue);
 
-            return true;
-        }
-        catch(e)
-        {
-        }
-        return false;
+        return true;
     }
+    catch(e) {}
 
-    function OnImageLoaded(id)
-    {
-        document.getElementById(id).style.visibility = "visible";
-    }
+    return false;
+}
 
-    </script>
-  </head>
-  <body topmargin="5" bottommargin="5" leftmargin="5" rightmargin="5" marginwidth="5" marginheight="5" onload="InitDocument()">
+function OnImageLoaded(id)
+{
+    document.getElementById(id).style.visibility = "visible";
+}
+
+</script>
+
+</head>
+<body topmargin="5" bottommargin="5" leftmargin="5" rightmargin="5" marginwidth="5" marginheight="5" onload="InitDocument()">
     <table border="0" cellpadding="0" cellspacing="0">
       <tr id="Title" height="27">
         <td colspan="2" align="center"><span class="Title">%s</span></td>
@@ -115,5 +117,5 @@
          <td id="Arrow" align="center" width="38"></td>
       </tr>
     </table>
-  </body>
 </body>
+</html>

Modified: trunk/MgDev/Web/src/viewerfiles/printablepageui.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/printablepageui.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/printablepageui.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,9 +1,9 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>__#PRINTTITLE#__</title>
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>__#PRINTTITLE#__</title>
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     table#Ui
     {
         font-family: __#@font#__;
@@ -42,66 +42,69 @@
     {
         width: 95px;
     }
-    </style>
-    <script language=javascript>
-        var popup = %s;
-        var width = %s;
-        var sessionId = '%s';
-        var mapName = '%s';
-        var scale = %s;
-        var centerX = %s;
-        var centerY = %s;
-        var dpi = %s;
-        
-        function InitDocument()
-        {
-            if(!popup)
-            {
-                document.onmousedown = OnMouseDown;  
-                document.getElementById("back").style.visibility = "visible";
-            }
-            var fldCell = document.getElementById("fldCell");
-            var field = document.getElementById("Fld");
-            field.style.width = (fldCell.offsetWidth - 25 - 10) + "px";
-            field.style.position = "relative";
-            field.style.left = "25px";
-            field.value = mapName;
-            field.focus();
-        }
+</style>
 
-        function OnMouseDown(e)
-        {
-            GetParent().ForwardMouseDown(document, e);
-        }
+<script language=javascript>
 
-        function GetParent()
-        {
-            if(popup)
-                return opener;
-            else
-                return parent.parent;
-        }
-        
-        function GetPrintablePage()
-        {
-            var title = document.getElementById("Fld").value;
-            var win = window.open("%s?SESSION=" + sessionId + "&MAPNAME=" + encodeURIComponent(mapName) + "&TITLE=" + encodeURIComponent(title) + "&DPI=" + dpi + "&SCALE=" + scale +
-                                    "&CENTERX=" + centerX + "&CENTERY=" + centerY +
-                                    "&ISTITLE=" + (document.getElementById("isTitle").checked? "1":"0") +
-                                    "&ISLEGEND=" + (document.getElementById("isLegend").checked? "1":"0") +
-                                    "&ISARROW=" + (document.getElementById("isArrow").checked? "1":"0"), 
-                        "", "width=675,height=695,toolbar, menubar");
-            if(win != null)
-                win.focus();
-        }
-        
-        function GoBack()
-        {
-            GetParent().GotoHomePage();
-        }
-        
-    </script>
-  </head>
+var popup = %s;
+var width = %s;
+var sessionId = '%s';
+var mapName = '%s';
+var scale = %s;
+var centerX = %s;
+var centerY = %s;
+var dpi = %s;
+
+function InitDocument()
+{
+    if(!popup)
+    {
+        document.onmousedown = OnMouseDown;
+        document.getElementById("back").style.visibility = "visible";
+    }
+    var fldCell = document.getElementById("fldCell");
+    var field = document.getElementById("Fld");
+    field.style.width = (fldCell.offsetWidth - 25 - 10) + "px";
+    field.style.position = "relative";
+    field.style.left = "25px";
+    field.value = mapName;
+    field.focus();
+}
+
+function OnMouseDown(e)
+{
+    GetParent().ForwardMouseDown(document, e);
+}
+
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
+
+function GetPrintablePage()
+{
+    var title = document.getElementById("Fld").value;
+    var win = window.open("%s?SESSION=" + sessionId + "&MAPNAME=" + encodeURIComponent(mapName) + "&TITLE=" + encodeURIComponent(title) + "&DPI=" + dpi + "&SCALE=" + scale +
+                            "&CENTERX=" + centerX + "&CENTERY=" + centerY +
+                            "&ISTITLE=" + (document.getElementById("isTitle").checked? "1":"0") +
+                            "&ISLEGEND=" + (document.getElementById("isLegend").checked? "1":"0") +
+                            "&ISARROW=" + (document.getElementById("isArrow").checked? "1":"0"),
+                "", "width=675,height=695,toolbar, menubar");
+    if(win != null)
+        win.focus();
+}
+
+function GoBack()
+{
+    GetParent().GotoHomePage();
+}
+
+</script>
+
+</head>
 <body class="PrintablePage" onload="InitDocument()" topmargin=7 bottommargin=0 leftmargin=7 rightmargin=7 marginwidth=7 >
     <table id="Ui" width="100%%" border="0" cellspacing="0" cellpadding="0">
       <tr><td id="MainTitle">__#PRINTTITLE#__</td></tr>
@@ -111,13 +114,13 @@
       <tr id="Spacer"><td></td></tr>
       <tr><td id="HelpText">__#PRINTELEMENTS#__</td></tr>
       <tr id="Spacer"><td></td></tr>
-      <tr id="RegText"><td><input type="checkbox" id="isTitle" checked> __#PRINTPAGETITLE#__</td></tr>
+      <tr id="RegText"><td><input type="checkbox" id="isTitle" checked>__#PRINTPAGETITLE#__</td></tr>
       <tr><td id="fldCell"><input type="edit" id="Fld"></td></tr>
-      <tr id="RegText"><td><input type="checkbox" id="isLegend" checked> __#PRINTLEGEND#__</td></tr>
-      <tr id="RegText"><td><input type="checkbox" id="isArrow" checked> __#PRINTNORTHARROW#__</td></tr>
+      <tr id="RegText"><td><input type="checkbox" id="isLegend" checked>__#PRINTLEGEND#__</td></tr>
+      <tr id="RegText"><td><input type="checkbox" id="isArrow" checked>__#PRINTNORTHARROW#__</td></tr>
       <tr id="Spacer"><td></td></tr>
       <tr id="Spacer"><td></td></tr>
       <tr id="RegText"><td><input class="Btn" type="button" value="__#PRINTCREATEPAGE#__" onClick="GetPrintablePage()"> <input class="Btn" type="button" value="__#BUTTONCANCEL#__" id="back" onClick="GoBack()" style="visibility: hidden"></td></tr>
     </table>
-    </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,11 +1,10 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     td.Info
     {
-    
         font-family: __#@font#__;
         font-size: 10pt;
         font-weight: bold;
@@ -39,19 +38,22 @@
         font-family: __#@font#__
         font-size: __#@fontsize#__;
     }
-    .GridCell 
+    .GridCell
     {
         height: 14px;
     }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
+</style>
+
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
+
 var resizing = false;
 var mapFrame = %s;
 
 // public functions -----------------------------------------------
 //
-function SetProperties(count, properties) {
+function SetProperties(count, properties)
+{
     var code;
     propCount = count;
     if(count != 1)
@@ -66,47 +68,58 @@
     else
     {
         code = '<table id="Grid" cellspacing=0 cellpadding=0 border=0><tr class="Header"><td id="Name" class="Name" width=65><span style="font-family: __#@font#__; font-size: __#@fontsize#__;">&nbsp;__#PROPERTIESNAME#__</span></td><td class="CellSplitter" width=1 onmousedown="StartResizing()"></td><td class="Value"><span style="font-family: __#@font#__; font-size: __#@fontsize#__;">&nbsp;__#PROPERTIESVALUE#__</span></td></tr>';
-
         for(var i=0; i < properties.length; i++)
-        {
             code += '<tr class="GridCell"><td><span style="font-family: __#@font#__; font-size: __#@fontsize#__;">&nbsp;' + properties[i].name + '</span></td><td></td><td><span style="font-family: __#@font#__; font-size: __#@fontsize#__;">' + properties[i].value + '</span></td></tr>';
-        }
-        
         code += '</table>';
     }
-    
+
     var content = document.getElementById("Content");
     content.innerHTML = code; //SAFARI
     OnResizeGrid();
 }
+
 // private functions -----------------------------------------------
 //
-function InitDocument() {
+function InitDocument()
+{
     document.onmousedown = OnMouseDown;
     document.onmousemove = OnMouseMove;
     document.onmouseup = OnMouseUp;
 }
-function OnMouseDown(e) {
+
+function OnMouseDown(e)
+{
     GetMainFrame().ForwardMouseDown(document, e);
 }
-function OnMouseMove(e) {
-    try { GetMapFrame().OnMouseMove(e); } catch(e) {}
+
+function OnMouseMove(e)
+{
+    try
+    {
+        GetMapFrame().OnMouseMove(e);
+    }
+    catch(e) {}
     if(resizing)
     {
         ResizeTo(msie?event.clientX: e.pageX);
         return false;
     }
 }
-function OnMouseUp(e) {
+
+function OnMouseUp(e)
+{
     if(resizing)
     {
         resizing = false;
         ResizeTo(msie?event.clientX: e.pageX);
     }
 }
-function OnResizeGrid(e) {
-    grid = document.getElementById("Grid"); 
-    if(grid) {
+
+function OnResizeGrid(e)
+{
+    grid = document.getElementById("Grid");
+    if(grid)
+    {
         width = msie? document.body.clientWidth: window.innerWidth - 2;
         if(propCount != 1)
             height = msie? document.body.clientHeight: window.innerHeight - 2;
@@ -117,13 +130,19 @@
     }
     return true;
 }
-function GetMapFrame() {
-    return mapFrame; 
+
+function GetMapFrame()
+{
+    return mapFrame;
 }
-function GetMainFrame() {
+
+function GetMainFrame()
+{
     return GetMapFrame().parent;
 }
-function StartResizing() {
+
+function StartResizing()
+{
     if(resizing)
     {
         resizing = false;
@@ -131,7 +150,9 @@
     }
     resizing = true;
 }
-function ResizeTo(width) {
+
+function ResizeTo(width)
+{
     var ww = msie? document.body.clientWidth: window.innerWidth - 2;
     if(width > ww - 20)
         width = ww -20;
@@ -139,11 +160,11 @@
         width = 20;
     document.getElementById("Name").style.width = width;
 }
-    
-    </script>
-  </head>
-  <body onload="InitDocument()" marginwidth=0 marginheight=0 leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 onresize="OnResizeGrid()">
-    <div class="Content" id="Content">
-    </div>
-  </body>
+
+</script>
+
+</head>
+<body onload="InitDocument()" marginwidth=0 marginheight=0 leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 onresize="OnResizeGrid()">
+    <div class="Content" id="Content"></div>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/sarissa.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/sarissa.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/sarissa.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -26,14 +26,17 @@
  * or visit http://www.gnu.org
  *
  */
+
 /**
- * <p>Sarissa is a utility class. Provides "static" methods for DOMDocument and 
+ * <p>Sarissa is a utility class. Provides "static" methods for DOMDocument and
  * XMLHTTP objects, DOM Node serializatrion to XML strings and other goodies.</p>
  * @constructor
  */
 function Sarissa(){};
+
 /** @private */
 Sarissa.PARSED_OK = "Document contains no parsing errors";
+
 /**
  * Tells you whether transformNode and transformNodeToObject are available. This functionality
  * is contained in sarissa_ieemu_xslt.js and is deprecated. If you want to control XSLT transformations
@@ -42,11 +45,13 @@
  * @type boolean
  */
 Sarissa.IS_ENABLED_TRANSFORM_NODE = false;
+
 /**
  * tells you whether XMLHttpRequest (or equivalent) is available
  * @type boolean
  */
 Sarissa.IS_ENABLED_XMLHTTP = false;
+
 /**
  * tells you whether selectNodes/selectSingleNode is available
  * @type boolean
@@ -126,14 +131,14 @@
         };
         return oDoc;
     };
-    // see non-IE version   
+    // see non-IE version
     Sarissa.getParseErrorText = function (oDoc) {
         var parseErrorText = Sarissa.PARSED_OK;
         if(oDoc.parseError != 0){
-            parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason + 
-                "\nLocation: " + oDoc.parseError.url + 
-                "\nLine Number " + oDoc.parseError.line + ", Column " + 
-                oDoc.parseError.linepos + 
+            parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason +
+                "\nLocation: " + oDoc.parseError.url +
+                "\nLine Number " + oDoc.parseError.line + ", Column " +
+                oDoc.parseError.linepos +
                 ":\n" + oDoc.parseError.srcText +
                 "\n";
             for(var i = 0;  i < oDoc.parseError.linepos;i++){
@@ -147,9 +152,9 @@
     Sarissa.setXpathNamespaces = function(oDoc, sNsSet) {
         oDoc.setProperty("SelectionLanguage", "XPath");
         oDoc.setProperty("SelectionNamespaces", sNsSet);
-    };   
+    };
     /**
-     * Basic implementation of Mozilla's XSLTProcessor for IE. 
+     * Basic implementation of Mozilla's XSLTProcessor for IE.
      * Reuses the same XSLT stylesheet for multiple transforms
      * @constructor
      */
@@ -163,7 +168,7 @@
      */
     XSLTProcessor.prototype.importStylesheet = function(xslDoc){
         // convert stylesheet to free threaded
-        var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); 
+        var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);
         converted.loadXML(xslDoc.xml);
         this.template.stylesheet = converted;
         this.processor = this.template.createProcessor();
@@ -178,7 +183,7 @@
     XSLTProcessor.prototype.transformToDocument = function(sourceDoc){
         this.processor.input = sourceDoc;
         var outDoc = new ActiveXObject(_SARISSA_DOM_PROGID);
-        this.processor.output = outDoc; 
+        this.processor.output = outDoc;
         this.processor.transform();
         return outDoc;
     };
@@ -320,8 +325,6 @@
                 };
                 return oDoc;
             };
-            
-            
         }//if(window.XMLDocument)
         else if(document.implementation && document.implementation.hasFeature && document.implementation.hasFeature('LS', '3.0')){
             Document.prototype.async = true;
@@ -331,13 +334,13 @@
                 var parser = document.implementation.createLSParser(this.async ? document.implementation.MODE_ASYNCHRONOUS : document.implementation.MODE_SYNCHRONOUS, null);
                 if(this.async){
                     var self = this;
-                    parser.addEventListener("load", 
-                        function(e) { 
+                    parser.addEventListener("load",
+                        function(e) {
                             self.readyState = 4;
                             Sarissa.copyChildNodes(e.newDocument, self.documentElement, false);
-                            self.onreadystatechange.call(); 
-                        }, 
-                        false); 
+                            self.onreadystatechange.call();
+                        },
+                        false);
                 };
                 try {
                     var oDoc = parser.parseURI(sURI);
@@ -357,10 +360,11 @@
             */
             Sarissa.getDomDocument = function(sUri, sName){
                 return document.implementation.createDocument(sUri?sUri:"", sName?sName:"", null);
-            };        
+            };
         };
     };//if(_SARISSA_HAS_DOM_CREATE_DOCUMENT)
 };
+
 //==========================================
 // Common stuff
 //==========================================
@@ -372,10 +376,10 @@
     DOMParser = function() {
     };
     if(_SARISSA_IS_SAFARI){
-        /** 
+        /**
         * Construct a new DOM Document from the given XMLstring
         * @param sXml the given XML string
-        * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml). 
+        * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml).
         * @return a new DOM Document from the given XML string
         */
         DOMParser.prototype.parseFromString = function(sXml, contentType){
@@ -431,6 +435,7 @@
         };
         }catch(e){};
 };
+
 if(!Sarissa.getParseErrorText){
     /**
      * <p>Returns a human readable description of the parsing error. Usefull
@@ -458,6 +463,7 @@
         return parseErrorText;
     };
 };
+
 Sarissa.getText = function(oNode, deep){
     var s = "";
     var nodes = oNode.childNodes;
@@ -475,6 +481,7 @@
     };
     return s;
 };
+
 if(window.XMLSerializer){
     /**
      * <p>Factory method to obtain the serialization of a DOM Node</p>
@@ -518,6 +525,7 @@
 Sarissa.stripTags = function (s) {
     return s.replace(/<[^>]+>/g,"");
 };
+
 /**
  * <p>Deletes all child nodes of the given node</p>
  * @argument oNode the Node to empty
@@ -528,9 +536,10 @@
         oNode.removeChild(oNode.firstChild);
     };
 };
+
 /**
  * <p> Copies the childNodes of nodeFrom to nodeTo</p>
- * <p> <b>Note:</b> The second object's original content is deleted before 
+ * <p> <b>Note:</b> The second object's original content is deleted before
  * the copy operation, unless you supply a true third parameter</p>
  * @argument nodeFrom the Node to copy the childNodes from
  * @argument nodeTo the Node to copy the childNodes to
@@ -559,12 +568,12 @@
 
 /**
  * <p> Moves the childNodes of nodeFrom to nodeTo</p>
- * <p> <b>Note:</b> The second object's original content is deleted before 
+ * <p> <b>Note:</b> The second object's original content is deleted before
  * the move operation, unless you supply a true third parameter</p>
  * @argument nodeFrom the Node to copy the childNodes from
  * @argument nodeTo the Node to copy the childNodes to
  * @argument bPreserveExisting whether to preserve the original content of nodeTo, default is
- */ 
+ */
 Sarissa.moveChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) {
     if((!nodeFrom) || (!nodeTo)){
         throw "Both source and destination nodes must be provided";
@@ -593,9 +602,9 @@
     };
 };
 
-/** 
+/**
  * <p>Serialize any object to an XML string. All properties are serialized using the property name
- * as the XML element name. Array elements are rendered as <code>array-item</code> elements, 
+ * as the XML element name. Array elements are rendered as <code>array-item</code> elements,
  * using their index/key as the value of the <code>key</code> attribute.</p>
  * @argument anyObject the object to serialize
  * @argument objectName a name for that object
@@ -605,7 +614,7 @@
     indentSpace = indentSpace?indentSpace:'';
     var s = indentSpace  + '<' + objectName + '>';
     var isLeaf = false;
-    if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String 
+    if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String
         || anyObject instanceof Boolean || anyObject instanceof Date){
         s += Sarissa.escape(""+anyObject);
         isLeaf = true;
@@ -621,7 +630,7 @@
     return s += (objectName.indexOf(' ')!=-1?"</array-item>\n":"</" + objectName + ">\n");
 };
 
-/** 
+/**
  * Escape the given string chacters that correspond to the five predefined XML entities
  * @param sXml the string to escape
  */
@@ -633,8 +642,8 @@
         .replace(/'/g, "&apos;");
 };
 
-/** 
- * Unescape the given string. This turns the occurences of the predefined XML 
+/**
+ * Unescape the given string. This turns the occurences of the predefined XML
  * entities to become the characters they represent correspond to the five predefined XML entities
  * @param sXml the string to unescape
  */

Modified: trunk/MgDev/Web/src/viewerfiles/scalerange.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/scalerange.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/scalerange.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,4 +1,5 @@
-      <VectorScaleRange>
-        <MinScale>%s</MinScale>
-        <MaxScale>%s</MaxScale>
-%s      </VectorScaleRange>
+<VectorScaleRange>
+    <MinScale>%s</MinScale>
+    <MaxScale>%s</MaxScale>
+    %s
+</VectorScaleRange>

Modified: trunk/MgDev/Web/src/viewerfiles/search.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/search.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/search.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,9 +1,9 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>__#SEARCHDLGTITLE#__</title>
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>__#SEARCHDLGTITLE#__</title>
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     td.Title
     {
         font-family: __#@font#__;
@@ -50,68 +50,71 @@
         font-size: __#@fontsize#__;
         cursor: hand;
     }
-    </style>
-    <script language=javascript>
-        var colCount = %s;
-        var curRow = -1;
-        var target = %s;
-        var popup = %s;
-        
-        function InitDocument()
-        {
-            document.onmousedown = OnMouseDown;
-        }
+</style>
 
-        function OnMouseDown(e)
-        {
-            GetParent().ForwardMouseDown(document, e);
-        }
+<script language=javascript>
 
-        function SelectRow(index)
+var colCount = %s;
+var curRow = -1;
+var target = %s;
+var popup = %s;
+
+function InitDocument()
+{
+    document.onmousedown = OnMouseDown;
+}
+
+function OnMouseDown(e)
+{
+    GetParent().ForwardMouseDown(document, e);
+}
+
+function SelectRow(index)
+{
+    if(index == curRow)
+        return;
+    if(curRow != -1)
+        highlightRow(curRow, 0);
+    if((curRow = index) != -1)
+        highlightRow(curRow, 1);
+}
+
+function CellClicked(sel)
+{
+    GetParent().SetSelectionXML(sel);
+    GetParent().ExecuteMapAction(10);
+}
+
+function highlightRow(index, mode)
+{
+    for(var i=0; i < colCount; i++)
+    {
+        var cell = document.getElementById(index + ":" + i);
+        if(mode == 1)
         {
-            if(index == curRow)
-                return;
-            if(curRow != -1)
-                highlightRow(curRow, 0);
-            if((curRow = index) != -1)
-                highlightRow(curRow, 1);
+            cell.style.backgroundColor = "#0066cc";
+            cell.style.color = "white";
         }
-        
-        function CellClicked(sel)
+        else
         {
-            GetParent().SetSelectionXML(sel);
-            GetParent().ExecuteMapAction(10);
+            cell.style.backgroundColor = index%%2? "#fffff2": "white";
+            cell.style.color = "black";
         }
-        
-        function highlightRow(index, mode)
-        {
-            for(var i=0; i < colCount; i++)
-            {
-                var cell = document.getElementById(index + ":" + i);
-                if(mode == 1)
-                {
-                    cell.style.backgroundColor = "#0066cc";
-                    cell.style.color = "white";
-                }
-                else
-                {
-                    cell.style.backgroundColor = index%%2? "#fffff2": "white";
-                    cell.style.color = "black";
-                }
-            }
-        }
+    }
+}
 
-        function GetParent()
-        {
-            if(popup)
-                return opener;
-            else
-                return parent.parent;
-        }
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
 
-    </script>
-  </head>
-    <body class="Search" onload="InitDocument()"  marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5 scroll=yes onmouseout="SelectRow(-1)">
+</script>
+
+</head>
+<body class="Search" onload="InitDocument()"  marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5 scroll=yes onmouseout="SelectRow(-1)">
     <div class="PopupMenu" id="Task"></div>
     <div class="PopupMetricsDiv" id="MetricsDiv"><span class="PopupMetrics" id="Metrics"></span></div>
     <iframe id="IFrTask" style="position:absolute;top:0px;left:0px;width:0px;height:0px;background-color:white;" frameborder="0"></iframe>
@@ -127,3 +130,5 @@
         </tr>
     </table>
     <table cellspacing=0 cellpadding=0 width="100%%">
+</body>
+</html>

Modified: trunk/MgDev/Web/src/viewerfiles/searchprompt.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/searchprompt.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/searchprompt.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,9 +1,9 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>__#SEARCHDLGTITLE#__</title>
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>__#SEARCHDLGTITLE#__</title>
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     td.Title
     {
         font-family: __#@font#__;
@@ -31,58 +31,61 @@
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
     }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
-        var target = %s;
-        var popup = %s;
-        var cmdIndex = %s;
-        var width = %s;
-        
-        function InitDocument()
-        {
-            var cmd = GetParent().commands[cmdIndex];
-            document.getElementById("title").innerHTML = cmd.label;
-            document.getElementById("prompt").innerHTML = cmd.prompt;
-            if(!msie)
-                document.getElementById("lf").innerHTML = "<br>";
-                
-            if(!popup)
-                document.onmousedown = OnMouseDown;  
+</style>
 
-            var field = document.getElementById("Fld")
-            field.style.width = (width - 25) + "px";
-            field.focus();
-        }
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
 
-        function OnMouseDown(e)
-        {
-            GetParent().ForwardMouseDown(document, e);
-        }
+var target = %s;
+var popup = %s;
+var cmdIndex = %s;
+var width = %s;
 
-        function GetParent()
-        {
-            if(popup)
-                return opener;
-            else
-                return parent.parent;
-        }
-        
-        function SetMatchLabel()
-        {
-            var cmd = GetParent().commands[cmdIndex];
-            var colDef = "<input type=\"hidden\" name=\"COLS\" value=\"" + cmd.resultColumns.length + "\">";
-            for(var i = 0; i < cmd.resultColumns.length; i++)
-            {
-                colDef += "<input type=\"hidden\" name=\"CN" + i + "\" value=\"" + cmd.resultColumns[i].displayName + "\">";
-                colDef += "<input type=\"hidden\" name=\"CP" + i + "\" value=\"" + cmd.resultColumns[i].propertyName + "\">";
-            }
-            document.getElementById("MatchLabel").innerHTML = colDef;
-        }
-        
-    </script>
-  </head>
-  <body class="SearchPrompt" onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
+function InitDocument()
+{
+    var cmd = GetParent().commands[cmdIndex];
+    document.getElementById("title").innerHTML = cmd.label;
+    document.getElementById("prompt").innerHTML = cmd.prompt;
+    if(!msie)
+        document.getElementById("lf").innerHTML = "<br>";
+
+    if(!popup)
+        document.onmousedown = OnMouseDown;
+
+    var field = document.getElementById("Fld")
+    field.style.width = (width - 25) + "px";
+    field.focus();
+}
+
+function OnMouseDown(e)
+{
+    GetParent().ForwardMouseDown(document, e);
+}
+
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
+
+function SetMatchLabel()
+{
+    var cmd = GetParent().commands[cmdIndex];
+    var colDef = "<input type=\"hidden\" name=\"COLS\" value=\"" + cmd.resultColumns.length + "\">";
+    for(var i = 0; i < cmd.resultColumns.length; i++)
+    {
+        colDef += "<input type=\"hidden\" name=\"CN" + i + "\" value=\"" + cmd.resultColumns[i].displayName + "\">";
+        colDef += "<input type=\"hidden\" name=\"CP" + i + "\" value=\"" + cmd.resultColumns[i].propertyName + "\">";
+    }
+    document.getElementById("MatchLabel").innerHTML = colDef;
+}
+
+</script>
+
+</head>
+<body class="SearchPrompt" onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
     <table class="RegText" border="0" cellspacing="0" width="100%%">
         <tr><td class="Title"><span id="title"></span><hr></td></tr>
         <tr><td class="InfoText" id="prompt"></td></tr>
@@ -103,5 +106,5 @@
         <br><br>
         <input class="Ctrl" style="width: 70px;" type="submit" value="__#SEARCHPROMPTFIND#__">
     </form>
-    </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,9 +1,9 @@
 <html>
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>__#SELECTWITHINTITLE#__</title>
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>__#SELECTWITHINTITLE#__</title>
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
     td.Title
     {
         font-family: __#@font#__;
@@ -27,165 +27,154 @@
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
     }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
-        var popup = %s;
-        var cmd = "";
-        var layerSet = "";
-        var webAgent = '%s';
-        var mapName = '%s';
-        var sessionId = '%s';
-        var dwf = %s;
-      
-        function InitDocument()
-        {
-            if(!popup)
-                document.onmousedown = OnMouseDown;    
-            var w = msie? document.body.clientWidth: window.innerWidth - 20;
-            document.getElementById("layers").style.width = (w > 200? 200: w) + "px";
-            FillLayerList();
-        }
+</style>
 
-        function OnMouseDown(e)
-        {
-            GetParent().ForwardMouseDown(document, e);
-        }
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
 
-        function ExecuteCommand()
-        {
-            //build the destination layer set
-            layerSet = "";
-            var list = document.getElementById("layers");
-            var layerNames = document.getElementById("layerNames");
-            var count = list.options.length;
-            var selIndex = 0;
-            for(var i = 0; i < count; i++)
-            {
-                var opt = list.options[i];
-                if(opt.selected)
-                {
-                    if(selIndex > 0)
-                        layerSet = "," + layerSet;
-                    layerSet += layerNames.options[i].text;
-                    selIndex ++;
-                }
-            }
-            if(layerSet == "")
-                return;
+var popup = %s;
+var cmd = "";
+var layerSet = "";
+var webAgent = '%s';
+var mapName = '%s';
+var sessionId = '%s';
+var dwf = %s;
 
-            reqParams = "MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&LAYERS=" + encodeURIComponent(layerSet) + "&SELECTION=" + encodeURIComponent(GetParent().GetMapFrame().GetSelectionXML()) + "&DWF=" + dwf;
-            
-            if(msie)
-                reqHandler = new ActiveXObject("Microsoft.XMLHTTP");
-            else
-                reqHandler = new XMLHttpRequest();
-                
-            reqHandler.open("POST", webAgent, false);
-            reqHandler.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-            try
-            {
-                reqHandler.send(reqParams);
-                if(reqHandler.responseXML)
-                {
-                    GetParent().SetSelectionXML(reqHandler.responseText);
-                }
-            }
-            catch(e)
-            {
-            }
-            GetParent().GotoHomePage();
-        }
-        
-        function Clear()
+function InitDocument()
+{
+    if(!popup)
+        document.onmousedown = OnMouseDown;
+    var w = msie? document.body.clientWidth: window.innerWidth - 20;
+    document.getElementById("layers").style.width = (w > 200? 200: w) + "px";
+    FillLayerList();
+}
+
+function OnMouseDown(e)
+{
+    GetParent().ForwardMouseDown(document, e);
+}
+
+function ExecuteCommand()
+{
+    //build the destination layer set
+    layerSet = "";
+    var list = document.getElementById("layers");
+    var layerNames = document.getElementById("layerNames");
+    var count = list.options.length;
+    var selIndex = 0;
+    for(var i = 0; i < count; i++)
+    {
+        var opt = list.options[i];
+        if(opt.selected)
         {
-            GetParent().GetMapFrame().ClearSelection();
-            list = document.getElementById("layers");
-            for(var i = 0; i < list.options.length; i++)
-            {
-                opt = list.options[i];
-                if(opt.selected)
-                    opt.selected = false;
-            }
+            if(selIndex > 0)
+                layerSet = "," + layerSet;
+            layerSet += layerNames.options[i].text;
+            selIndex ++;
         }
-        
-        function FillLayerList()
-        {
-            var list = document.getElementById("layers");
-            var listNames = document.getElementById("layerNames");
-            list.options.length = 0;
-            var layers = GetParent().GetMapFrame().GetLayers(false, true);
-            for(var i = 0; i < layers.length; i++)
-            {
-                var layer = layers[i];
-                list.options[i] = new Option(layer.legend != ""? layer.legend: layer.name);
-                listNames.options[i] = new Option(layer.name);
-            }
-                
-            document.getElementById("Done").disabled = layers.length == 0;
-        }
-        
-        function RefreshLayers()
-        {
-            FillLayerList();
-        }
-        
-        function GetParent()
-        {
-            if(popup)
-                return opener;
-            else
-                return parent.parent;
-        }
-        
-    </script>
+    }
+    if(layerSet == "")
+        return;
+
+    reqParams = "MAPNAME=" + encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&LAYERS=" + encodeURIComponent(layerSet) + "&SELECTION=" + encodeURIComponent(GetParent().GetMapFrame().GetSelectionXML()) + "&DWF=" + dwf;
+
+    if(msie)
+        reqHandler = new ActiveXObject("Microsoft.XMLHTTP");
+    else
+        reqHandler = new XMLHttpRequest();
+
+    reqHandler.open("POST", webAgent, false);
+    reqHandler.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+    try
+    {
+        reqHandler.send(reqParams);
+        if(reqHandler.responseXML)
+            GetParent().SetSelectionXML(reqHandler.responseText);
+    }
+    catch(e) {}
+    GetParent().GotoHomePage();
+}
+
+function Clear()
+{
+    GetParent().GetMapFrame().ClearSelection();
+    list = document.getElementById("layers");
+    for(var i = 0; i < list.options.length; i++)
+    {
+        opt = list.options[i];
+        if(opt.selected)
+            opt.selected = false;
+    }
+}
+
+function FillLayerList()
+{
+    var list = document.getElementById("layers");
+    var listNames = document.getElementById("layerNames");
+    list.options.length = 0;
+    var layers = GetParent().GetMapFrame().GetLayers(false, true);
+    for(var i = 0; i < layers.length; i++)
+    {
+        var layer = layers[i];
+        list.options[i] = new Option(layer.legend != ""? layer.legend: layer.name);
+        listNames.options[i] = new Option(layer.name);
+    }
+
+    document.getElementById("Done").disabled = layers.length == 0;
+}
+
+function RefreshLayers()
+{
+    FillLayerList();
+}
+
+function GetParent()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
+
+</script>
+
 </head>
 <body onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
-<table border="0" cellspacing="0" cellpadding="3" width="100%%">
-  <tr>
-    <td class="Title">__#SELECTWITHINTITLE#__<hr></td>
-  </tr>
-  <tr>
-    <td class="InfoText">__#SELECTWITHINAREAS#__</td>
-  </tr>
-  <tr>
-    <td height="6"></td>
-  </tr>
-</table>
-<table border="0" cellpadding="3" cellspacing="0">
-  <tr class="RegText">
-    <td>__#SELECTWITHINRESTRICTION#__</td>
-  </tr>
-  <tr class="RegText">
-    <td valign="top">
-      <select class="RegText" size="9" id="layers" multiple>
-      </select>
-    </td>
-  </tr>
-  <tr>
-    <td>
-      <input type="button" value="__#BUTTONREFRESH#__" class="Ctrl" style="width: 70px" onclick="RefreshLayers()">
-    </td>
-  </tr>
-</table>
-<table border="0" cellspacing="0" cellpadding="3" width="100%%">
-  <tr>
-    <td height="6"></td>
-  </tr>
-  <tr>
-    <td class="InfoText">
-      <div style="position: relative; left: -25px;">
-      <ul>
-        __#SELECTWITHINTEXT#__
-      </ul>
-      </div>
-    </td>
-  </tr>
-</table>
-<p> 
-<input class="Ctrl" type="button" id="Done" value="__#BUTTONDONE#__" style="width: 70px" onclick="ExecuteCommand()"> <input class="Ctrl" type="button" id="clear" value="__#BUTTONCLEAR#__" style=" width: 70px" onclick="Clear()">
-</p>
-<select id="layerNames" style="visibility: hidden">
-</select>
+  <table border="0" cellspacing="0" cellpadding="3" width="100%%">
+    <tr><td class="Title">__#SELECTWITHINTITLE#__<hr></td></tr>
+    <tr><td class="InfoText">__#SELECTWITHINAREAS#__</td></tr>
+    <tr><td height="6"></td></tr>
+  </table>
+  <table border="0" cellpadding="3" cellspacing="0">
+    <tr class="RegText"><td>__#SELECTWITHINRESTRICTION#__</td></tr>
+    <tr class="RegText">
+      <td valign="top">
+        <select class="RegText" size="9" id="layers" multiple>
+        </select>
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <input type="button" value="__#BUTTONREFRESH#__" class="Ctrl" style="width: 70px" onclick="RefreshLayers()">
+      </td>
+    </tr>
+  </table>
+  <table border="0" cellspacing="0" cellpadding="3" width="100%%">
+    <tr><td height="6"></td></tr>
+    <tr>
+      <td class="InfoText">
+        <div style="position: relative; left: -25px;">
+        <ul>
+          __#SELECTWITHINTEXT#__
+        </ul>
+        </div>
+      </td>
+    </tr>
+  </table>
+  <p>
+  <input class="Ctrl" type="button" id="Done" value="__#BUTTONDONE#__" style="width: 70px" onclick="ExecuteCommand()"> <input class="Ctrl" type="button" id="clear" value="__#BUTTONCLEAR#__" style=" width: 70px" onclick="Clear()">
+  </p>
+  <select id="layerNames" style="visibility: hidden">
+  </select>
 </body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/statusbar.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/statusbar.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/statusbar.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,79 +1,94 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style>
-        body.StatusBar
-        {
-            background-color: #f0f0f0; 
-            border-style: solid; 
-            border-width: 1px; 
-            border-bottom-color: #808080; 
-            border-right-color: #808080; 
-            border-left-color: #ffffff; 
-            border-top-color: #ffffff;        
-        }
-        input.StatusField
-        {
-            background-color: #f0f0f0; 
-            height: 20px;
-            border-left: 1px solid #c0c0c0;
-            border-top: 1px solid #c0c0c0;
-            border-bottom: 1px solid white;
-            border-right: 1px solid white;
-            position: absolute;
-            top: 3px;
-            font-family: __#@font#__;
-            font-size: __#@fontsize#__;
-        }
-        img.StatusLogo
-        {
-            border-left: 1px solid #c0c0c0;
-            border-top: 1px solid #c0c0c0;
-            border-bottom: 1px solid white;
-            border-right: 1px solid white;
-            position: absolute;
-            top: 3px;
-        }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style>
+    body.StatusBar
+    {
+        background-color: #f0f0f0;
+        border-style: solid;
+        border-width: 1px;
+        border-bottom-color: #808080;
+        border-right-color: #808080;
+        border-left-color: #ffffff;
+        border-top-color: #ffffff;
+    }
+    input.StatusField
+    {
+        background-color: #f0f0f0;
+        height: 20px;
+        border-left: 1px solid #c0c0c0;
+        border-top: 1px solid #c0c0c0;
+        border-bottom: 1px solid white;
+        border-right: 1px solid white;
+        position: absolute;
+        top: 3px;
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
+    }
+    img.StatusLogo
+    {
+        border-left: 1px solid #c0c0c0;
+        border-top: 1px solid #c0c0c0;
+        border-bottom: 1px solid white;
+        border-right: 1px solid white;
+        position: absolute;
+        top: 3px;
+    }
+</style>
+
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
+
 var intId;
 var fieldSizes = new Array(200, 120, 175);
 var fieldsW = 200+120+175;
-        
+
 // public functions -----------------------------------------------
 //
-function SetCursorPositionMsg(msg) {
+function SetCursorPositionMsg(msg)
+{
     SetFieldText(msg, 1);
 }
-function SetFeatureSelectedMsg(msg) {
+
+function SetFeatureSelectedMsg(msg)
+{
     SetFieldText(msg, 2);
 }
-function SetMapScaleMsg(msg) {
+
+function SetMapScaleMsg(msg)
+{
     SetFieldText(msg, 3);
 }
-function SetMapSizeMsg(msg) {
+
+function SetMapSizeMsg(msg)
+{
     SetFieldText(msg, 4);
 }
+
 // private functions -----------------------------------------------
 //
-function InitDocument() {
+function InitDocument()
+{
     document.onmousedown = OnMouseDown;
     OnStatusResized();
 }
-function OnMouseDown(e) {
+
+function OnMouseDown(e)
+{
     parent.ForwardMouseDown(document, e);
     return false;
 }
-function OnStatusResized() {
+
+function OnStatusResized()
+{
     var width = msie? document.body.clientWidth - 3: window.innerWidth - 4;
     var logoW = 137;
-    
+
     var leftFieldW = width - logoW - fieldsW - 3;
     if(leftFieldW < 10)
         leftFieldW = 10;
-    
+
     var posX = 2;
     var elt;
     for(var i=1; i < 5; i++)
@@ -92,17 +107,21 @@
             posX += w;
         }
     }
-    
+
     elt = document.getElementById("5");
     elt.style.left = (width - logoW - 1) + "px";
     return false;
 }
-function SetFieldText(msg, index) {
+
+function SetFieldText(msg, index)
+{
     document.getElementById(index).value = msg;
 }
-    </script>
-  </head>
-  <body class="StatusBar" onload="InitDocument()" onResize="return OnStatusResized();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0 >
+
+</script>
+
+</head>
+<body class="StatusBar" onload="InitDocument()" onResize="return OnStatusResized();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0 >
     <table width=100% height=100% cellspacing=0 cellpadding=0 border=0>
       <tr><td valign=center>
         <input class="StatusField" id="1" type="text" readonly >
@@ -112,5 +131,5 @@
         <img src="../localized/__#POWEREDBYICON#__" width="137" height="18" class="StatusLogo" id="5">
       </td></tr>
     </table>
-  </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/taskbar.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/taskbar.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/taskbar.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,25 +1,25 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
-        body.Toolbar
-        {
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
+    body.Toolbar
+    {
         background-color: #f0f0f0;
         border-bottom-width: 1px;
         border-bottom-style: solid;
         border-bottom-color: #a0a0a0;
-        }
-        img.btnImg
-        {
+    }
+    img.btnImg
+    {
         border-color: #f0f0f0;
         border-width: 1px;
         position: absolute;
         left: 4px;
         top: 3px;
-        }
-        span.btn
-        {
+    }
+    span.btn
+    {
         border-width: 1px;
         border-style: solid;
         border-color: #f0f0f0;
@@ -29,178 +29,178 @@
         cursor: hand;
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
-        }
-        .MetricsDiv
-        {
-            position: absolute;
-            visibility: hidden; 
-            top: 0px; 
-            left: 0px;
-        }
-        .Metrics
-        {
-            font-family: __#@font#__;
-            font-size: __#@fontsize#__;
-            font-weight: normal;
-        }
-    </style>
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
-
-    var hovered = "";
-    var active = "";
-    var intId;
-    var imgOpenArrow = new Image(16,16);
-    imgOpenArrow.src = "../stdicons/icon_menuarrow.gif";
-    var imgCloseArrow = new Image(16,16);
-    imgCloseArrow.src = "../stdicons/icon_menuarrowup.gif";
-
-    function InitDocument()
+    }
+    .MetricsDiv
     {
-        if(active != "")
-            document.getElementById(active).style.border = "solid gray 1px";
-        document.onmousedown = OnMouseDown;       
-        
-        var taskText = "__#TASKS#__";
-        var taskLen = GetTextLen(taskText);
-        var btnLen = taskLen + 10 + 16 + 13;
-        document.getElementById("btnTask").style.width = btnLen;
-        document.getElementById("btnTask").style.visibility = "visible";
-        document.getElementById("imgOpenClose").style.left = btnLen - 20;
-        
-        var width = msie? document.body.clientWidth: window.innerWidth;
-        document.getElementById("taskCell").style.left = (width - btnLen - 5) + "px";
-        var btn = document.getElementById("imgHome");
-        btn.title = parent.taskItemTexts[1];
-        btn.src = parent.taskItemTexts[3];
-        btn = document.getElementById("imgBack");
-        btn.title = parent.taskItemTexts[6];
-        btn.src = parent.taskItemTexts[8];
-        btn = document.getElementById("imgForward");
-        btn.title = parent.taskItemTexts[11];
-        btn.src = parent.taskItemTexts[13];
-        document.getElementById("btnTask").title = parent.taskItemTexts[16];
-        btn = document.getElementById("imgTask");
-        btn.title = parent.taskItemTexts[16];
-        btn.src = parent.taskItemTexts[18];
-
-        document.getElementById("imgOpenClose").src = imgOpenArrow.src;
+        position: absolute;
+        visibility: hidden;
+        top: 0px;
+        left: 0px;
     }
-    
-    function OnMouseDown(e)
+    .Metrics
     {
-       parent.ForwardMouseDown(document, e);
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
+        font-weight: normal;
     }
+</style>
 
-    function HoverButton(eltId, description)
-    {
-        if(hovered != "")
-            document.getElementById(hovered).style.border = "solid #f0f0f0 1px";
-            
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
+
+var hovered = "";
+var active = "";
+var intId;
+var imgOpenArrow = new Image(16,16);
+imgOpenArrow.src = "../stdicons/icon_menuarrow.gif";
+var imgCloseArrow = new Image(16,16);
+imgCloseArrow.src = "../stdicons/icon_menuarrowup.gif";
+
+function InitDocument()
+{
+    if(active != "")
+        document.getElementById(active).style.border = "solid gray 1px";
+    document.onmousedown = OnMouseDown;
+
+    var taskText = "__#TASKS#__";
+    var taskLen = GetTextLen(taskText);
+    var btnLen = taskLen + 10 + 16 + 13;
+    document.getElementById("btnTask").style.width = btnLen;
+    document.getElementById("btnTask").style.visibility = "visible";
+    document.getElementById("imgOpenClose").style.left = btnLen - 20;
+
+    var width = msie? document.body.clientWidth: window.innerWidth;
+    document.getElementById("taskCell").style.left = (width - btnLen - 5) + "px";
+    var btn = document.getElementById("imgHome");
+    btn.title = parent.taskItemTexts[1];
+    btn.src = parent.taskItemTexts[3];
+    btn = document.getElementById("imgBack");
+    btn.title = parent.taskItemTexts[6];
+    btn.src = parent.taskItemTexts[8];
+    btn = document.getElementById("imgForward");
+    btn.title = parent.taskItemTexts[11];
+    btn.src = parent.taskItemTexts[13];
+    document.getElementById("btnTask").title = parent.taskItemTexts[16];
+    btn = document.getElementById("imgTask");
+    btn.title = parent.taskItemTexts[16];
+    btn.src = parent.taskItemTexts[18];
+
+    document.getElementById("imgOpenClose").src = imgOpenArrow.src;
+}
+
+function OnMouseDown(e)
+{
+   parent.ForwardMouseDown(document, e);
+}
+
+function HoverButton(eltId, description)
+{
+    if(hovered != "")
+        document.getElementById(hovered).style.border = "solid #f0f0f0 1px";
+
+    document.getElementById(eltId).style.border = "solid #99B5CA 1px";
+    hovered = eltId;
+
+    var txtIndex = -1;
+    if(eltId == 'btnHome')
+        parent.SetStatusMsg(parent.taskItemTexts[2]);
+    else if(eltId == 'btnBack')
+        parent.SetStatusMsg(parent.taskItemTexts[7]);
+    else if(eltId == 'btnForward')
+        parent.SetStatusMsg(parent.taskItemTexts[12]);
+    else if(eltId == 'btnTask')
+        parent.SetStatusMsg(parent.taskItemTexts[17]);
+}
+
+function LeaveButton(eltId)
+{
+    if(eltId == active)
         document.getElementById(eltId).style.border = "solid #99B5CA 1px";
-        
-        hovered = eltId;
-        
-        var txtIndex = -1;
-        if(eltId == 'btnHome')
-            parent.SetStatusMsg(parent.taskItemTexts[2]);
-        else if(eltId == 'btnBack')
-            parent.SetStatusMsg(parent.taskItemTexts[7]);
-        else if(eltId == 'btnForward')
-            parent.SetStatusMsg(parent.taskItemTexts[12]);
-        else if(eltId == 'btnTask')
-            parent.SetStatusMsg(parent.taskItemTexts[17]);
-    }
+    else
+        document.getElementById(eltId).style.border = "solid #f0f0f0 1px";
+    hovered = "";
 
-    function LeaveButton(eltId)
-    {
-        if(eltId == active)
-            document.getElementById(eltId).style.border = "solid #99B5CA 1px";
-        else
-            document.getElementById(eltId).style.border = "solid #f0f0f0 1px";
-        hovered = "";
+    parent.SetStatusMsg('');
+}
 
-        parent.SetStatusMsg('');
-    }
+function ToggleButton(eltId)
+{
+    if(eltId == active)
+        return;
 
-    function ToggleButton(eltId)
+    var elt;
+    if(active != "")
     {
-        if(eltId == active)
-            return;
-        
-        var elt;    
-        if(active != "")
-        {
-            elt = document.getElementById(active);
-            elt.style.border = "solid #f0f0f0 1px";
-            elt.style.background = "#f0f0f0";
-        }
+        elt = document.getElementById(active);
+        elt.style.border = "solid #f0f0f0 1px";
+        elt.style.background = "#f0f0f0";
+    }
 
-        elt = document.getElementById(eltId);
-        elt.style.border = "solid #99B5CA 1px";
-        elt.style.background = "#bac8f1";
-        
-        active = eltId;
-    }
-    
-    function OpenTaskMenu()
+    elt = document.getElementById(eltId);
+    elt.style.border = "solid #99B5CA 1px";
+    elt.style.background = "#bac8f1";
+
+    active = eltId;
+}
+
+function OpenTaskMenu()
+{
+    try
     {
-        try
-        {
-            parent.GetTaskFrame().OpenTaskMenu();
-        }
-        catch(e){}
+        parent.GetTaskFrame().OpenTaskMenu();
     }
-    
-    function GotoHomePage()
-    {
-        parent.GotoHomePage();
-    }
-    
-    function OnListOpen(open)
-    {
-        document.getElementById("imgOpenClose").src = open? imgCloseArrow.src: imgOpenArrow.src;
-    }
-    
-    function GetTextLen(text)
-    {
-        var metrics = document.getElementById("Metrics");
-        metrics.innerHTML = text;
-        return metrics.offsetWidth;
-    }
-    
-    </script>
+    catch(e){}
+}
 
-  </head>
-  <body class="Toolbar" onload="InitDocument()" leftmargin=10 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 >
-      <table height=30 border=0 cellpadding=0 cellspacing=0>
-          <tr height=30>
-             <td align=center valign=center>
-               <span class="btn" id="btnHome" style="position: absolute; left: 5px;" onmouseover="HoverButton('btnHome', '')" onmouseout="LeaveButton('btnHome', '')" onclick="GotoHomePage()">
-                 <img class="btnImg" id="imgHome" title="" src="../stdicons/transparentpixel.gif" width=16 height=16>
-               </span>
-             </td>
-             <td align=center valign=center>
-               <span class="btn" id="btnBack" style="position: absolute; left: 39px;" onmouseover="HoverButton('btnBack', '')" onmouseout="LeaveButton('btnBack', '')" onclick="history.back()">
-                 <img class="btnImg" id="imgBack" title="" src="../stdicons/transparentpixel.gif" width=16 height=16>
-               </span>
-             </td>
-             <td align=center valign=center>
-               <span class="btn" id="btnForward" style="position: absolute; left: 67px;" onmouseover="HoverButton('btnForward', '')" onmouseout="LeaveButton('btnForward', '')" onclick="history.forward()">
-                 <img class="btnImg" id="imgForward" title="" src="../stdicons/transparentpixel.gif" width=16 height=16>
-               </span>
-             </td>
-             <td id="taskCell" align=right valign=top style="position: absolute; left: 225px;">
-               <span class="btn" id="btnTask" style="position: absolute; left: 1px; height: 22; width: 70; cursor: hand; visibility: hidden"  onmouseover="HoverButton('btnTask', '')" onmouseout="LeaveButton('btnTask', '')" onclick="OpenTaskMenu()">
-                  <img title="" id="imgTask" src="../stdicons/transparentpixel.gif" style="position: absolute; left: 2px;" width=16 height=16 Hspace=2 VSpace=2>
-                  <span style="position: absolute; left: 22px; top: 4px;">
-                       __#TASKS#__
-                   </span>
-                   <img id="imgOpenClose" src="../stdicons/icon_menuarrow.gif" style="position: absolute; left: 50px;" width=16 height=16 Hspace=2 VSpace=2>
-               </span>
-             </td>
-          </tr>
-      </table>
+function GotoHomePage()
+{
+    parent.GotoHomePage();
+}
+
+function OnListOpen(open)
+{
+    document.getElementById("imgOpenClose").src = open? imgCloseArrow.src: imgOpenArrow.src;
+}
+
+function GetTextLen(text)
+{
+    var metrics = document.getElementById("Metrics");
+    metrics.innerHTML = text;
+    return metrics.offsetWidth;
+}
+
+</script>
+
+</head>
+<body class="Toolbar" onload="InitDocument()" leftmargin=10 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 >
+    <table height=30 border=0 cellpadding=0 cellspacing=0>
+        <tr height=30>
+          <td align=center valign=center>
+            <span class="btn" id="btnHome" style="position: absolute; left: 5px;" onmouseover="HoverButton('btnHome', '')" onmouseout="LeaveButton('btnHome', '')" onclick="GotoHomePage()">
+              <img class="btnImg" id="imgHome" title="" src="../stdicons/transparentpixel.gif" width=16 height=16>
+            </span>
+          </td>
+          <td align=center valign=center>
+            <span class="btn" id="btnBack" style="position: absolute; left: 39px;" onmouseover="HoverButton('btnBack', '')" onmouseout="LeaveButton('btnBack', '')" onclick="history.back()">
+              <img class="btnImg" id="imgBack" title="" src="../stdicons/transparentpixel.gif" width=16 height=16>
+            </span>
+          </td>
+          <td align=center valign=center>
+            <span class="btn" id="btnForward" style="position: absolute; left: 67px;" onmouseover="HoverButton('btnForward', '')" onmouseout="LeaveButton('btnForward', '')" onclick="history.forward()">
+              <img class="btnImg" id="imgForward" title="" src="../stdicons/transparentpixel.gif" width=16 height=16>
+            </span>
+          </td>
+          <td id="taskCell" align=right valign=top style="position: absolute; left: 225px;">
+            <span class="btn" id="btnTask" style="position: absolute; left: 1px; height: 22; width: 70; cursor: hand; visibility: hidden"  onmouseover="HoverButton('btnTask', '')" onmouseout="LeaveButton('btnTask', '')" onclick="OpenTaskMenu()">
+               <img title="" id="imgTask" src="../stdicons/transparentpixel.gif" style="position: absolute; left: 2px;" width=16 height=16 Hspace=2 VSpace=2>
+               <span style="position: absolute; left: 22px; top: 4px;">
+                    __#TASKS#__
+                </span>
+                <img id="imgOpenClose" src="../stdicons/icon_menuarrow.gif" style="position: absolute; left: 50px;" width=16 height=16 Hspace=2 VSpace=2>
+            </span>
+          </td>
+        </tr>
+    </table>
     <div class="MetricsDiv"><span class="Metrics" id="Metrics"></span></div>
-  </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/taskframe.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/taskframe.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/taskframe.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,54 +1,56 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
-    <script language=javascript>
-    var thisFrame = this;
-    var listClosed = 1;
-    
-    function OpenTaskMenu()
-    {
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
+<script language="javascript" src="../viewerfiles/browserdetect.js"></script>
+<script language=javascript>
+
+var thisFrame = this;
+var listClosed = 1;
+
+function OpenTaskMenu()
+{
+    ToggleTaskList();
+}
+
+function ToggleTaskList()
+{
+    var listHeight;
+    var docHeight = msie?document.body.clientHeight: window.innerHeight;
+    var docWidth = msie?document.body.clientWidth: window.innerWidth;
+    if(listClosed)
+        listHeight = thisFrame.frames[0].BuildList(docWidth, docHeight / 3, parent);
+    else
+        listHeight = 0;
+    document.getElementById("taskFrameSet").rows = listHeight + ",*";
+    listClosed = !listClosed;
+    parent.taskBar.OnListOpen(!listClosed);
+}
+
+function OnListIdle()
+{
+    if(!listClosed)
         ToggleTaskList();
-    }
-    
-    function ToggleTaskList()
+}
+
+function OnForwardMouseDown(doc, e)
+{
+    if(doc != parent.taskBar.document)
     {
-        var listHeight;
-        var docHeight = msie?document.body.clientHeight: window.innerHeight;
-        var docWidth = msie?document.body.clientWidth: window.innerWidth;
-        if(listClosed)
-            listHeight = thisFrame.frames[0].BuildList(docWidth, docHeight / 3, parent);
-        else
-            listHeight = 0;
-        document.getElementById("taskFrameSet").rows = listHeight + ",*";
-        listClosed = !listClosed;
-        parent.taskBar.OnListOpen(!listClosed);
-    }
-    
-    function OnListIdle()
-    {
         if(!listClosed)
             ToggleTaskList();
     }
-    
-    function OnForwardMouseDown(doc, e)
-    {
-        if(doc != parent.taskBar.document)
-        {
-            if(!listClosed)
-                ToggleTaskList();
-        }
-    }
-    
-    function GetTaskPane()
-    {
-        return taskPaneFrame;
-    }
-    
-    </script>
-    <frameset id="taskFrameSet" name="taskFrameSet" rows="0,*" frameborder=0 border=0>
-      <frame name="taskListFrame" src="%s?LOCALE=%s" noresize scrolling=no>
-      <frame name="taskPaneFrame" src="%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s" noresize>
-    </frameset>
-  </head>
+}
+
+function GetTaskPane()
+{
+    return taskPaneFrame;
+}
+
+</script>
+<frameset id="taskFrameSet" name="taskFrameSet" rows="0,*" frameborder=0 border=0>
+    <frame name="taskListFrame" src="%s?LOCALE=%s" noresize scrolling=no>
+    <frame name="taskPaneFrame" src="%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s" noresize>
+</frameset>
+</head>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/tasklist.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/tasklist.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/tasklist.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,7 +1,9 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
 <script language="javascript" src="../viewerfiles/browserdetect.js"></script>
 <script language=javascript>
+
 var scrollable = 0;
 var tc;
 var tcTimer = null;
@@ -15,7 +17,7 @@
     var taskItems = ref.taskItems;
     var commands = ref.commands;
     var fullHeight = 2;
-    
+
     owner = ownerRef;
     for(var i=0; i < taskItems.length; i++)
     {
@@ -31,13 +33,11 @@
     html += "<div class=\"TList\" id=\"TList\">\n" +
             "<div class=\"TInnerList\" id=\"TInnerList\">\n" +
             "<table class=\"TContent\" id=\"TContent\" width=100% cellspacing=0 cellpadding=0>\n";
-    
+
     for(var i=0; i < taskItems.length; i++)
     {
         if(taskItems[i].type == 2)
-        {
             html += "<tr height=3><td colspan=2 align=center valign=center><div style=\"width: 95%; height: 2px; border-bottom: #a0a0a0 1px solid;\"><span></span></div></td></tr>\n";
-        }
         else if(taskItems[i].type == 1)
         {
             var cmdIndex = taskItems[i].cmdIndex;
@@ -53,17 +53,17 @@
             html += "<tr height=21 id=\"" + i + "\" state=\"" + (cmd.enabled? "true": "false") + "\" icon=\"" + icon + "\" icond=\"" + icond +  "\" name=\"" + cmdIndex + "\" onmousemove=\"OnEnterItem(this)\" onmouseout=\"OnLeaveItem(this)\" onclick=\"OnClickItem(this)\"" + (cmd.enabled? "": " style=\"color: #b4b4b4\"") + "><td width=24 align=center>" + imgTag + "</td><td><span id=\"T" + i + "\">" + taskItems[i].name + "</span></td></tr>\n";
         }
     }
-            
+
     html += "</table></div></div>";
     html += "</div>\n<div class=\"TScrollDnArea\" id=\"TScrollDnArea\" align=center style=\"height: 16px;\"><img id=\"ArrowDn\" src=\"../stdicons/mn_scrolldown.gif\" width=16 height=16></div>\n";
     //alert(html);
-    
+
     outerList = document.getElementById("TaskList");
     xHeight = scrollable? 32: 0;
     outerList.innerHTML = html;
     outerList.style.height = actualHeight + xHeight + (scrollable? msie? 2: 0: 0);
     scrollAmount = fullHeight - actualHeight;
-    
+
     su = document.getElementById("TScrollUpArea");
     if(scrollable) {
         su.style.position = "absolute";
@@ -73,7 +73,7 @@
     }
     else
         su.style.display = "none";
-    
+
     list = document.getElementById("TList");
     list.style.position = "absolute";
     list.style.width = maxWidth;
@@ -86,25 +86,25 @@
     innerlist.style.width = maxWidth;
     innerlist.style.left = 0;
     innerlist.style.top = 0;
-    
+
     sd = document.getElementById("TScrollDnArea");
     if(scrollable) {
         sd.style.position = "absolute";
         sd.style.top = actualHeight + 16;
         sd.style.left = 0;
         sd.style.width = maxWidth;
-    }        
+    }
     else
         sd.style.display = "none";
-        
+
     if(scrollable) {
         su.onmousemove = onStartScrollingUp
         su.onmouseout = onStopScrolling
         sd.onmousemove = onStartScrollingDown
         sd.onmouseout = onStopScrolling
-    }            
+    }
     enableArrow(false, true);
-    
+
     tc = (new Date()).getTime();
     tcTimer = setInterval(CheckActivity, 3000);
 
@@ -115,23 +115,24 @@
 {
     var bgcolor = "#dcdcdc";
     var color = "black";
-    
+
     var name = firefox? obj.attributes["name"].nodeValue: obj.name;
     try
     {
         owner.OnCommandSelected(name);
-    } catch(e){}
-        
+    }
+    catch(e) {}
+
     var enabled = (firefox? obj.attributes["state"].nodeValue: obj.state) != "false";
     if(!enabled)
     {
         bgcolor = "#f0f0f0";
         color = "#b4b4b4";
     }
-            
+
     obj.style.backgroundColor = bgcolor;
     obj.style.color = color;
-    
+
     clearInterval(tcTimer);
     tcTimer = setInterval(CheckActivity, 3000);
     tc = (new Date()).getTime();
@@ -158,31 +159,42 @@
 
     obj.style.backgroundColor = bgcolor;
     obj.style.color = color;
-    
+
     return false;
 }
-function onStartScrollingUp(e) {
-    if(!scrolling) {
+
+function onStartScrollingUp(e)
+{
+    if(!scrolling)
+    {
         scrollTimer = setInterval(scrollUp, 50);
         scrolling = true;
     }
     return false;
 }
-function onStopScrolling(e) {
-    if(scrolling) {
+
+function onStopScrolling(e)
+{
+    if(scrolling)
+    {
         clearInterval(scrollTimer);
         scrolling = false;
     }
     return false;
 }
-function onStartScrollingDown(e) {
-    if(!scrolling) {
+
+function onStartScrollingDown(e)
+{
+    if(!scrolling)
+    {
         scrollTimer = setInterval(scrollDown, 50);
         scrolling = true;
     }
     return false;
 }
-function scrollUp() {
+
+function scrollUp()
+{
     if(scrolled == 0)
         return;
     scrolled -= scrollInc;
@@ -190,14 +202,17 @@
         scrolled = 0;
     document.getElementById("TInnerList").style.top = -scrolled +"px";
     enableArrow(true, false);
-    
-    if(scrolled == 0) {
+
+    if(scrolled == 0)
+    {
         clearInterval(scrollTimer);
         scrolling = false;
         enableArrow(false, true);
     }
 }
-function scrollDown() {
+
+function scrollDown()
+{
     if(scrolled >= scrollAmount)
         return;
     scrolled += scrollInc;
@@ -206,28 +221,36 @@
     document.getElementById("TInnerList").style.top = -scrolled +"px";
     enableArrow(true, true);
 
-    if(scrolled == scrollAmount) {
+    if(scrolled == scrollAmount)
+    {
         clearInterval(scrollTimer);
         scrolling = false;
         enableArrow(false, false);
     }
 }
-function enableArrow(enabled, up) {
+
+function enableArrow(enabled, up)
+{
    if(up)
       document.getElementById("ArrowUp").src = enabled? "../stdicons/mn_scrollup.gif": "../stdicons/mn_scrollup_disabled.gif";
    else
       document.getElementById("ArrowDn").src = enabled? "../stdicons/mn_scrolldown.gif": "../stdicons/mn_scrolldown_disabled.gif";
 }
-function OnClickItem(obj) {
+
+function OnClickItem(obj)
+{
     var name = firefox? obj.attributes["name"].nodeValue: obj.name;
     try
     {
         owner.ExecuteCommand(name);
         parent.OnListIdle();
-    } catch(e) {}
+    }
+    catch(e) {}
     return false;
 }
-function CheckActivity() {
+
+function CheckActivity()
+{
     var now = (new Date()).getTime();
     if(now - tc >= 5000)
     {
@@ -235,9 +258,10 @@
         parent.OnListIdle();
     }
 }
-    
-  </script>
-    <style>
+
+</script>
+
+<style>
     div.TaskList
     {
         border-bottom-width: 2px;
@@ -257,7 +281,7 @@
         position: absolute;
         left: 0px;
         top: 0px;
-        height: 16px; 
+        height: 16px;
         background: #f0f0f0;
         width: 100%;
         cursor: hand;
@@ -267,7 +291,7 @@
         position: absolute;
         left: 0px;
         top: 0px;
-        height: 16px; 
+        height: 16px;
         background: #f0f0f0;
         width: 100%;
         cursor: hand;
@@ -280,9 +304,9 @@
         color: black;
         background-color: #f0f0f0;
     }
-    </style>
+</style>
 </head>
 <body bgcolor=#f0f0f0 marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bottommargin=0 rightmargin=0>
-<div class="TaskList" id="TaskList" style="width: 100%" >
-</div>
+    <div class="TaskList" id="TaskList" style="width: 100%" >
+    </div>
 </body>

Modified: trunk/MgDev/Web/src/viewerfiles/textsymbol.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/textsymbol.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/textsymbol.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,15 +1,15 @@
-                <Unit>Points</Unit>
-                <SizeContext>DeviceUnits</SizeContext>
-                <SizeX>%s</SizeX>
-                <SizeY>%s</SizeY>
-                <Rotation>0</Rotation>
-                <Text>%s</Text>
-                <FontName>Arial</FontName>
-                <ForegroundColor>%s</ForegroundColor>
-                <BackgroundColor>FF000000</BackgroundColor>
-                <BackgroundStyle>Transparent</BackgroundStyle>
-                <HorizontalAlignment>Center</HorizontalAlignment>
-                <VerticalAlignment>Baseline</VerticalAlignment>
-                <Bold>false</Bold>
-                <Italic>false</Italic>
-                <Underlined>false</Underlined>
+<Unit>Points</Unit>
+<SizeContext>DeviceUnits</SizeContext>
+<SizeX>%s</SizeX>
+<SizeY>%s</SizeY>
+<Rotation>0</Rotation>
+<Text>%s</Text>
+<FontName>Arial</FontName>
+<ForegroundColor>%s</ForegroundColor>
+<BackgroundColor>FF000000</BackgroundColor>
+<BackgroundStyle>Transparent</BackgroundStyle>
+<HorizontalAlignment>Center</HorizontalAlignment>
+<VerticalAlignment>Baseline</VerticalAlignment>
+<Bold>false</Bold>
+<Italic>false</Italic>
+<Underlined>false</Underlined>

Modified: trunk/MgDev/Web/src/viewerfiles/toolbar.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/toolbar.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/toolbar.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,47 +1,49 @@
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
-    <style type="text/css">
-        body.Toolbar
-        {
-            background-color: #f0f0f0;
-            border-right-width: 1px;
-            border-right-style: solid;
-            border-right-color: #a0a0a0;
-        }
-        img.btnImg
-        { 
-            border-color: #f0f0f0;
-            border-width: 1px;
-            position: absolute; 
-            left: 4px; 
-            top: 3px;
-        }
-        span.btn
-        {
-            border-width: 1px;
-            border-style: solid;
-            border-color: #f0f0f0;
-            width: 26;
-            height: %s;
-            top: 3px;
-            cursor: hand;
-            font-family: __#@font#__;
-            font-size: __#@fontsize#__;
-        }
-    </style>
-    <script language=javascript>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="../viewerfiles/viewer.css" type="text/css">
+<style type="text/css">
+    body.Toolbar
+    {
+        background-color: #f0f0f0;
+        border-right-width: 1px;
+        border-right-style: solid;
+        border-right-color: #a0a0a0;
+    }
+    img.btnImg
+    {
+        border-color: #f0f0f0;
+        border-width: 1px;
+        position: absolute;
+        left: 4px;
+        top: 3px;
+    }
+    span.btn
+    {
+        border-width: 1px;
+        border-style: solid;
+        border-color: #f0f0f0;
+        width: 26;
+        height: %s;
+        top: 3px;
+        cursor: hand;
+        font-family: __#@font#__;
+        font-size: __#@fontsize#__;
+    }
+</style>
 
-    var hovered = "";
-    var active = "";
-    var intId;
-    var btnActions = new Array();
-    var btnStates = new Array();
+<script language=javascript>
 
+var hovered = "";
+var active = "";
+var intId;
+var btnActions = new Array();
+var btnStates = new Array();
+
 // public functions -----------------------------------------------
 //
-function OnCommandExecuted(action) {
+function OnCommandExecuted(action)
+{
     if(IsToggle(action))
     {
         intb = false;
@@ -58,10 +60,12 @@
             ToggleButton("");
     }
 }
-function OnCmdStateChanged() {
+
+function OnCmdStateChanged()
+{
     var commands = parent.commands;
     var toolbarDef = parent.toolbarItems;
-    
+
     for(var i = 0; i < toolbarDef.length; i++)
     {
         if(toolbarDef[i].type == 1)
@@ -77,47 +81,46 @@
             if(img != null)
                 img.src = icon;
         }
-    }        
+    }
 }
+
 // private functions -----------------------------------------------
 //
-function InitDocument() {
+function InitDocument()
+{
     if(active != "")
-    {
         document.getElementById(active).style.border = "solid gray 1px";
-    }
     InitToolbar();
     document.onmousedown = OnMouseDown;
 }
-function HoverButton(eltId, cmdId) {
+
+function HoverButton(eltId, cmdId)
+{
     if(hovered != "")
         document.getElementById(hovered).style.border = "solid #f0f0f0 1px";
-        
+
     document.getElementById(eltId).style.border = "solid #a0a0a0 1px";
-    
     hovered = eltId;
-    
     parent.SetStatusMsg(cmdId!=null? parent.commands[cmdId].description: '');
 }
-function LeaveButton(eltId) {
+
+function LeaveButton(eltId)
+{
     var elt = document.getElementById(eltId);
     if(eltId == active)
-    {
         elt.style.border = "solid #a0a0a0 1px";
-    }
     else
-    {
         elt.style.border = "solid #f0f0f0 1px";
-    }
     hovered = "";
-
     parent.SetStatusMsg('');
 }
-function ToggleButton(eltId) {
+
+function ToggleButton(eltId)
+{
     if(eltId == active)
         return;
-    
-    var elt;    
+
+    var elt;
     if(active != "")
     {
         elt = document.getElementById(active);
@@ -133,29 +136,38 @@
             elt.style.border = "solid #a0a0a0 1px";
             elt.style.background = "#dcdcdc";
         }
-    }    
+    }
     active = eltId;
 }
-function ExecuteCommand(index, toggle, eltId) {
+
+function ExecuteCommand(index, toggle, eltId)
+{
     parent.ExecuteCommand(index);
 }
-function IsToggle(action) {
+
+function IsToggle(action)
+{
     return action == 1 || (action >= 6 && action <= 9) || (action >= 15 && action <= 18);
 }
-function OnMouseDown(e) {
+
+function OnMouseDown(e)
+{
     parent.ForwardMouseDown(document, e);
     return false;
 }
-function MeasureText(t) {
+
+function MeasureText(t)
+{
     var metrics = document.getElementById("Metrics");
     metrics.innerHTML = t;
-    
     return metrics.offsetWidth;
 }
-function InitToolbar() {
+
+function InitToolbar()
+{
     var commands = parent.commands;
     var toolbarDef = parent.toolbarItems;
-    
+
     var cell = "";
     var table = "<table height=26 border=0 cellpadding=0 cellspacing=0><tr>";
     var curPosX = 5;
@@ -166,10 +178,10 @@
         if(tbItem.type == 2)
         {
             cell = "<td align=center valign=center>\n" +
-                    "<span class=\"separator\" style=\"position: absolute; left: " + curPosX + "px;\">\n" +
-                    "</span>\n" +
-                    "</td>\n";
-                    
+                   "  <span class=\"separator\" style=\"position: absolute; left: " + curPosX + "px;\">\n" +
+                   "  </span>\n" +
+                   "</td>\n";
+
             btnActions[i] = -1;
             btnStates[i] = false;
             curPosX += 6;
@@ -179,51 +191,51 @@
             var cmd = commands[tbItem.cmdIndex];
             var execCall = "ExecuteCommand(" + tbItem.cmdIndex + ", IsToggle(" + cmd.action + "), '" + i + "')";
             var icon = cmd.enabled? cmd.icon: (cmd.iconDisabled != ""? cmd.iconDisabled: cmd.icon);
-            
+
             cell = "<td align=center width=30 valign=center>\n" +
-                    "  <span class=\"btn\" id=\"" + i + "\" style=\"position: absolute; left: " + curPosX + "px;\" onclick=\"javascript: void " + execCall + ";\" onmouseover=\"HoverButton('" + i + "', " + tbItem.cmdIndex + "); return true;\" onmouseout=\"LeaveButton('" + i + "')\"  >\n" +
-                    "   <a name=\"\">\n" +
-                    "    <img class=\"btnImg\" id=\"I" + tbItem.cmdIndex + "\" title=\"" + cmd.tooltip + "\" src=\"" + encodeURI(icon) + "\" width=16 height=16>\n" +
-                    "   </a>\n" +
-                    "  </span>\n" +
-                    "</td>\n";
-                    
+                   "  <span class=\"btn\" id=\"" + i + "\" style=\"position: absolute; left: " + curPosX + "px;\" onclick=\"javascript: void " + execCall + ";\" onmouseover=\"HoverButton('" + i + "', " + tbItem.cmdIndex + "); return true;\" onmouseout=\"LeaveButton('" + i + "')\"  >\n" +
+                   "   <a name=\"\">\n" +
+                   "    <img class=\"btnImg\" id=\"I" + tbItem.cmdIndex + "\" title=\"" + cmd.tooltip + "\" src=\"" + encodeURI(icon) + "\" width=16 height=16>\n" +
+                   "   </a>\n" +
+                   "  </span>\n" +
+                   "</td>\n";
+
                 btnActions[i] = cmd.action;
                 btnStates[i] = cmd.enabled;
                 curPosX += 28;
-        }    
+        }
         else if(tbItem.type == 3)
         {
             var hasIcon = tbItem.iconUrl != "";
             var cellW = MeasureText(tbItem.name) + (hasIcon? 42: 26);
-            
-            cell = 
-            "<td id=\"cell" + i + "\" align=right valign=top width=" + cellW + " style=\"position: absolute; left: " + curPosX + "px;\">\n" +
-            "<span class=\"btnFlyout\" id=\"btn" + i + "\" style=\"width: " + cellW + "; cursor: hand;\"  onmouseover=\"HoverButton('btn" + i + "', null)\" onmouseout=\"LeaveButton('btn" + i + "', '')\" onclick=\"OpenFlyout('cell" + i + "', " + i + ")\">\n" +
-            (hasIcon ? "    <img class=\"iconFlyout\" title=\"\" id=\"" + i + "\" src=\"" + encodeURI(tbItem.iconUrl) + "\" width=16 height=16 Hspace=2 VSpace=2>\n" : "\n") +
-            "    <span class=\"txtFlyout\" style=\"left: " +  (hasIcon? 24: 4) +  "px;\"> " + tbItem.name + " </span>\n" +
-            "    <img class=\"arrowFlyout\" src=\"../stdicons/icon_menuarrow.gif\" style=\"left: " + (cellW - 20) + "px;\" width=16 height=16 Hspace=2 VSpace=2>\n" +
-            "</span>\n" +
-            "</td>\n";
 
+            cell = "<td id=\"cell" + i + "\" align=right valign=top width=" + cellW + " style=\"position: absolute; left: " + curPosX + "px;\">\n" +
+                   "  <span class=\"btnFlyout\" id=\"btn" + i + "\" style=\"width: " + cellW + "; cursor: hand;\"  onmouseover=\"HoverButton('btn" + i + "', null)\" onmouseout=\"LeaveButton('btn" + i + "', '')\" onclick=\"OpenFlyout('cell" + i + "', " + i + ")\">\n" +
+                      (hasIcon ? "    <img class=\"iconFlyout\" title=\"\" id=\"" + i + "\" src=\"" + encodeURI(tbItem.iconUrl) + "\" width=16 height=16 Hspace=2 VSpace=2>\n" : "\n") +
+                   "    <span class=\"txtFlyout\" style=\"left: " +  (hasIcon? 24: 4) +  "px;\"> " + tbItem.name + " </span>\n" +
+                   "    <img class=\"arrowFlyout\" src=\"../stdicons/icon_menuarrow.gif\" style=\"left: " + (cellW - 20) + "px;\" width=16 height=16 Hspace=2 VSpace=2>\n" +
+                   "  </span>\n" +
+                   "</td>\n";
+
             btnActions[i] = -1;
             btnStates[i] = false;
             curPosX += (cellW + 12);
         }
         table += cell;
-    }        
+    }
     table += "</tr></table>";
     document.getElementById("ToolbarContent").innerHTML = table;
 }
-function OpenFlyout(elt, tbItemIndex) {
+
+function OpenFlyout(elt, tbItemIndex)
+{
     parent.mapFrame.OpenFlyout(parseInt(document.getElementById(elt).style.left), tbItemIndex);
 }
+</script>
 
-    </script>
-
-  </head>
-  <body class="Toolbar" onload="InitDocument()" leftmargin=10 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0>
+</head>
+<body class="Toolbar" onload="InitDocument()" leftmargin=10 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0>
     <span id="ToolbarContent"><td></td></span>
     <div class="TextMetricsDiv" id="TextMetricsDiv"><span class="TextMetrics" id="Metrics"></span></div>
-  </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/viewer.css
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/viewer.css	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/viewer.css	2007-01-19 19:08:41 UTC (rev 1063)
@@ -16,6 +16,7 @@
     font-weight: normal;
     color: black;
 }
+
 /*
     Task pane styles
 */
@@ -24,6 +25,7 @@
     font-family: arial, helvetica, sans-serif;
     font-size: 10pt;
 }
+
 /*
    Toolbar styles
 */
@@ -108,4 +110,3 @@
     font-family: arial, helvetica, sans-serif;
     font-size: 7pt;
 }
-

Modified: trunk/MgDev/Web/src/viewerfiles/viewoptions.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/viewoptions.templ	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/viewoptions.templ	2007-01-19 19:08:41 UTC (rev 1063)
@@ -1,97 +1,96 @@
 <html>
-  <head>
-    <title>__#OPTIONSTITLE#__</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <style type="text/css">
-        td.Title
-        {
+<head>
+<title>__#OPTIONSTITLE#__</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+    td.Title
+    {
         font-family: __#@font#__;
         font-weight: bold;
         font-size: 13pt;
-        }
-        td.SubTitle
-        {
+    }
+    td.SubTitle
+    {
         font-family: __#@font#__;
         font-weight: bold;
         font-size: __#@fontsize#__;
         background-color: #DCDCDC;
         color: black;
         height: 20px;
-        }
-        td.InfoText
-        {
+    }
+    td.InfoText
+    {
         background-color: #FFFFCC;
         color: #666666;
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
-        }
-        .RegText
-        {
+    }
+    .RegText
+    {
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
-        }
-        .Ctrl
-        {
+    }
+    .Ctrl
+    {
         font-family: __#@font#__;
         font-size: __#@fontsize#__;
-        }
-    </style>
-    <script language=javascript>
-    var target=%s;
-    var popup=%s;
-    var dwf=%s;
-
-    function ParentRef()
-    {
-        if(popup)
-            return opener;
-        else
-            return parent.parent;
     }
-        
-    function InitDocument()
-    {
-        if(!popup)    
-        {            
-            document.onmousedown = OnMouseDown;       
-        }
-        var parentRef = ParentRef();
-            
-        if(parentRef.GetMapFrame().IsEnglishUnits())
-            document.getElementById("USEnglish").checked = true;
-        else
-            document.getElementById("Metric").checked = true;
+</style>
 
-        if(dwf)
-        {
-            if(parentRef.GetMapFrame().IsLatLongDisplayUnits())
-                document.getElementById("LatLon").checked = true;
-            else
-                document.getElementById("MCS").checked = true;
-        }
-        else
-        {
-            document.getElementById("DwfSpecific").style.display = "none";
-        }
-    }
-    
-    function OnMouseDown(e)
-    {
-        ParentRef().ForwardMouseDown(document, e);
-    }
+<script language=javascript>
 
-    function Save()
+var target=%s;
+var popup=%s;
+var dwf=%s;
+
+function ParentRef()
+{
+    if(popup)
+        return opener;
+    else
+        return parent.parent;
+}
+
+function InitDocument()
+{
+    if(!popup)
+        document.onmousedown = OnMouseDown;
+
+    var parentRef = ParentRef();
+    if(parentRef.GetMapFrame().IsEnglishUnits())
+        document.getElementById("USEnglish").checked = true;
+    else
+        document.getElementById("Metric").checked = true;
+
+    if(dwf)
     {
-        ParentRef().SetOptions(document.getElementById("USEnglish").checked, document.getElementById("LatLon").checked);
-        if(popup)
-            self.close();
+        if(parentRef.GetMapFrame().IsLatLongDisplayUnits())
+            document.getElementById("LatLon").checked = true;
         else
-            ParentRef().GotoHomePage();
+            document.getElementById("MCS").checked = true;
     }
-    
-    </script>
-    </head>
-    <body onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
+    else
+        document.getElementById("DwfSpecific").style.display = "none";
+}
+
+function OnMouseDown(e)
+{
+    ParentRef().ForwardMouseDown(document, e);
+}
+
+function Save()
+{
+    ParentRef().SetOptions(document.getElementById("USEnglish").checked, document.getElementById("LatLon").checked);
+    if(popup)
+        self.close();
+    else
+        ParentRef().GotoHomePage();
+}
+
+</script>
+
+</head>
+<body onload="InitDocument()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
     <table cellspacing=0 border=0 width="100%%">
         <tr><td class="Title">__#OPTIONSTITLE#__<hr></td></tr>
         <tr><td class="InfoText">__#OPTIONSINFOTEXT#__</td></tr>
@@ -119,5 +118,5 @@
         <tr><td height="6"></td></tr>
         <tr><td><input type="button" class="Ctrl" name="Save" id="Save" value="__#BUTTONSAVE#__" onclick="Save()" style="width: 70px" ></td></tr>
     </table>
-    </body>
+</body>
 </html>

Modified: trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js	2007-01-19 14:29:22 UTC (rev 1062)
+++ trunk/MgDev/Web/src/viewerfiles/wz_jsgraphics.js	2007-01-19 19:08:41 UTC (rev 1063)
@@ -41,11 +41,9 @@
 or see http://www.gnu.org/copyleft/lesser.html
 */
 
-
 var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz,
 jg_n4 = (document.layers && typeof document.classes != "undefined");
 
-
 function chkDHTM(x, i)
 {
     x = document.body || null;
@@ -935,7 +933,6 @@
 }
 
 
-
 function integer_compare(x,y)
 {
     return (x < y) ? -1 : ((x > y)*1);



More information about the mapguide-commits mailing list