[mapguide-commits] r5117 - in trunk/MgDev: . Common/Geometry/Spatial Doc/viewerapi Server/src/Core Server/src/Wms Web/src/localized/help/en/style Web/src/mapviewerjava Web/src/mapviewernet Web/src/mapviewerphp Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Sep 6 21:26:17 EDT 2010


Author: waltweltonlair
Date: 2010-09-07 01:26:17 +0000 (Tue, 07 Sep 2010)
New Revision: 5117

Modified:
   trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityStatus.h
   trunk/MgDev/Doc/viewerapi/index.htm
   trunk/MgDev/License.txt
   trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.cpp
   trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.h
   trunk/MgDev/Server/src/Wms/1.3.0.xml.awd
   trunk/MgDev/Web/src/localized/help/en/style/adsk.cpm.css
   trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp
   trunk/MgDev/Web/src/mapviewerjava/quickplotgeneratepicture.jsp
   trunk/MgDev/Web/src/mapviewerjava/quickplotpanel.jsp
   trunk/MgDev/Web/src/mapviewerjava/quickplotpreviewinner.jsp
   trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx
   trunk/MgDev/Web/src/mapviewernet/quickplotgeneratepicture.aspx
   trunk/MgDev/Web/src/mapviewernet/quickplotpanel.aspx
   trunk/MgDev/Web/src/mapviewernet/quickplotpreviewinner.aspx
   trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php
   trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php
   trunk/MgDev/Web/src/mapviewerphp/quickplotpanel.php
   trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php
   trunk/MgDev/Web/src/viewerfiles/floatingmessage.js
   trunk/MgDev/Web/src/viewerfiles/jxlib.js
   trunk/MgDev/Web/src/viewerfiles/jxtheme.css
   trunk/MgDev/Web/src/viewerfiles/quickplot.js
   trunk/MgDev/Web/src/viewerfiles/quickplotpanel.js
   trunk/MgDev/Web/src/viewerfiles/quickplotpanel.templ
   trunk/MgDev/Web/src/viewerfiles/quickplotpreview.js
   trunk/MgDev/Web/src/viewerfiles/quickplotpreviewinner.templ
   trunk/MgDev/build64.bat
   trunk/MgDev/dotnetapi_excludes.txt
Log:
The svn:eol-style attribute should be set to native for all files.

Modified: trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityStatus.h
===================================================================
--- trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityStatus.h	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityStatus.h	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,183 +1,183 @@
-//
-//  Copyright (C) 2004-2010 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MgSpatialUtilityStatusValues_H
-#define MgSpatialUtilityStatusValues_H
-
-/// \cond INTERNAL
-/// \brief
-/// Spatial Utility Status Values.
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Defines the status values returned by various methods belonging to the
-/// MgSpatialUtility class.
-class MG_GEOMETRY_API MgSpatialUtilityStatus
-{
-public:
-    //=========================================================================
-    // Intersection status is returned as a bit map.  The bit map
-    // consists of four sub bit maps, we'll call them groups.
-    // Group 1 -> Segment Status
-    //     If any bits in this group are set, an intersection point
-    //     does not exist.  If all bits in this group are zero, an
-    //     intersection does exists and the point is returned.
-    // Group 2 -> Intersection Status
-    //     The bits in this group indicate if the intersection point
-    //     resides on weither (or both) segments.
-    // Group 3 -> Intersection Point Status
-    //     The bits in this group indicate the intersection points
-    //     relationship to the end points of the two segments.
-    // Group 4 -> Collinear Segment Status
-    //     In the case of collinear segments, the bits in this
-    //     section indicate to what extent the collinear lines
-    //     actually overlap.
-
-    //=========================================================================
-    // Group 1 -> Segment Status
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Set if the segments are parallel but _NOT_ collinear.
-    static const INT32 SegmentsParallel   = 0x0010;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Set only if the segments are collinear.
-    static const INT32 SegmentsCollinear   = 0x0020;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Set if segment one is a null segement.
-    static const INT32 DegenerateSeg1       = 0x0040;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Set if segment two is a null segement.
-    static const INT32 DegenerateSeg2       = 0x0080;
-
-    //=========================================================================
-    // Group 2 -> Intersection Status
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Set if the intersection point resides on segment one, end
-    /// points included.
-    static const INT32 IntersectOnSeg1      = 0x0001;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// The intersection point resides on segment two, end
-    /// points included.
-    static const INT32 IntersectOnSeg2      = 0x0002;
-
-    //=========================================================================
-    // Group Three -> Intersection Point Status
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Intersection at segment 1 start point
-    static const INT32 IntersectIsSeg1Start = 0x0100;
-    ///////////////////////////////////////////////////////////////
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Intersection at segment 1 end point
-    static const INT32 IntersectIsSeg1End   = 0x0200;
-    ///////////////////////////////////////////////////////////////
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Intersection at segment 2 start point
-    static const INT32 IntersectIsSeg2Start = 0x0400;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// Intersection at segment 2 end point
-    static const INT32 IntersectIsSeg2End   = 0x0800;
-
-    //=========================================================================
-    // Group 4 -> Collinear Status
-    // Note that in the case where there is no overlap of the
-    // collinear lines, all four of these bits will be zero.
-    // In the case of overlap, at least two of these bits must be
-    // set; one indicating the start position of the overlap and
-    // one indicating the end position of the overlap.  It is
-    // (actually) possible for just one bit to be set, indicating that
-    // the end of one segment is the beginning of the other.
-
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// This bit is set if the segments are collinear, there is
-    /// segment overlap, and the overlapping portion starts at the
-    /// initial point of segment 1.
-    static const INT32 CollinearSeg1Start   = 0x1000;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// This bit is set if the segments are collinear, there is
-    /// segment overlap, and the overlapping portion starts at the
-    /// initial point of segment 2.
-    static const INT32 CollinearSeg2Start   = 0x2000;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// This bit is set if the segments are collinear, there is
-    /// segment overlap, and the overlapping portion ends at the
-    /// end point of segment 1.
-    static const INT32 CollinearSeg1End     = 0x4000;
-    /// \brief
-    /// This constant defines the significance of a specific a
-    /// bit in the bit map returned by the SegmentIntersection.
-    /// This bit is set if the segments are collinear, there is
-    /// segment overlap, and the overlapping portion ends at the
-    /// end point of segment 2.
-    static const INT32 CollinearSeg2End     = 0x8000;
-
-    ///////////////////////////////////////////////////////////////
-    /// \brief
-    /// A mask for testing for extracting Segment Status from the
-    /// bit map returned by the SegmentIntersection method.
-    static const INT32 SegmentStatusMask    = SegmentsParallel  |
-                                              SegmentsCollinear |
-                                              DegenerateSeg1    |
-                                              DegenerateSeg2;
-    /// \brief
-    /// A mask for testing for extracting Collinear Status from
-    /// the bit map returned by the SegmentIntersection method.
-    static const INT32 CollinearStatusMask  = CollinearSeg1Start |
-                                              CollinearSeg1End   |
-                                              CollinearSeg2Start |
-                                              CollinearSeg2End;
-
-    //=========================================================================
-    /// \brief
-    /// Value returned by the PointIsInPolygon method when the quesry point is
-    /// outside of the provided polygon (outer ring only).
-    static const INT32 PointIsOutside = 0;
-    /// \brief
-    /// Value returned by the PointIsInPolygon method when the quesry point is
-    /// outside of the provided polygon (outer ring only).
-    static const INT32 PointIsOnBoundary = 1;
-    /// \brief
-    /// Value returned by the PointIsInPolygon method when the quesry point is
-    /// outside of the provided polygon (outer ring only).
-    static const INT32 PointIsInside = 2;
-};
-
-#endif //_MGCOORDINATESYSTEMTYPE_H_
+//
+//  Copyright (C) 2004-2010 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef MgSpatialUtilityStatusValues_H
+#define MgSpatialUtilityStatusValues_H
+
+/// \cond INTERNAL
+/// \brief
+/// Spatial Utility Status Values.
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Defines the status values returned by various methods belonging to the
+/// MgSpatialUtility class.
+class MG_GEOMETRY_API MgSpatialUtilityStatus
+{
+public:
+    //=========================================================================
+    // Intersection status is returned as a bit map.  The bit map
+    // consists of four sub bit maps, we'll call them groups.
+    // Group 1 -> Segment Status
+    //     If any bits in this group are set, an intersection point
+    //     does not exist.  If all bits in this group are zero, an
+    //     intersection does exists and the point is returned.
+    // Group 2 -> Intersection Status
+    //     The bits in this group indicate if the intersection point
+    //     resides on weither (or both) segments.
+    // Group 3 -> Intersection Point Status
+    //     The bits in this group indicate the intersection points
+    //     relationship to the end points of the two segments.
+    // Group 4 -> Collinear Segment Status
+    //     In the case of collinear segments, the bits in this
+    //     section indicate to what extent the collinear lines
+    //     actually overlap.
+
+    //=========================================================================
+    // Group 1 -> Segment Status
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Set if the segments are parallel but _NOT_ collinear.
+    static const INT32 SegmentsParallel   = 0x0010;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Set only if the segments are collinear.
+    static const INT32 SegmentsCollinear   = 0x0020;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Set if segment one is a null segement.
+    static const INT32 DegenerateSeg1       = 0x0040;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Set if segment two is a null segement.
+    static const INT32 DegenerateSeg2       = 0x0080;
+
+    //=========================================================================
+    // Group 2 -> Intersection Status
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Set if the intersection point resides on segment one, end
+    /// points included.
+    static const INT32 IntersectOnSeg1      = 0x0001;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// The intersection point resides on segment two, end
+    /// points included.
+    static const INT32 IntersectOnSeg2      = 0x0002;
+
+    //=========================================================================
+    // Group Three -> Intersection Point Status
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Intersection at segment 1 start point
+    static const INT32 IntersectIsSeg1Start = 0x0100;
+    ///////////////////////////////////////////////////////////////
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Intersection at segment 1 end point
+    static const INT32 IntersectIsSeg1End   = 0x0200;
+    ///////////////////////////////////////////////////////////////
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Intersection at segment 2 start point
+    static const INT32 IntersectIsSeg2Start = 0x0400;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// Intersection at segment 2 end point
+    static const INT32 IntersectIsSeg2End   = 0x0800;
+
+    //=========================================================================
+    // Group 4 -> Collinear Status
+    // Note that in the case where there is no overlap of the
+    // collinear lines, all four of these bits will be zero.
+    // In the case of overlap, at least two of these bits must be
+    // set; one indicating the start position of the overlap and
+    // one indicating the end position of the overlap.  It is
+    // (actually) possible for just one bit to be set, indicating that
+    // the end of one segment is the beginning of the other.
+
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// This bit is set if the segments are collinear, there is
+    /// segment overlap, and the overlapping portion starts at the
+    /// initial point of segment 1.
+    static const INT32 CollinearSeg1Start   = 0x1000;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// This bit is set if the segments are collinear, there is
+    /// segment overlap, and the overlapping portion starts at the
+    /// initial point of segment 2.
+    static const INT32 CollinearSeg2Start   = 0x2000;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// This bit is set if the segments are collinear, there is
+    /// segment overlap, and the overlapping portion ends at the
+    /// end point of segment 1.
+    static const INT32 CollinearSeg1End     = 0x4000;
+    /// \brief
+    /// This constant defines the significance of a specific a
+    /// bit in the bit map returned by the SegmentIntersection.
+    /// This bit is set if the segments are collinear, there is
+    /// segment overlap, and the overlapping portion ends at the
+    /// end point of segment 2.
+    static const INT32 CollinearSeg2End     = 0x8000;
+
+    ///////////////////////////////////////////////////////////////
+    /// \brief
+    /// A mask for testing for extracting Segment Status from the
+    /// bit map returned by the SegmentIntersection method.
+    static const INT32 SegmentStatusMask    = SegmentsParallel  |
+                                              SegmentsCollinear |
+                                              DegenerateSeg1    |
+                                              DegenerateSeg2;
+    /// \brief
+    /// A mask for testing for extracting Collinear Status from
+    /// the bit map returned by the SegmentIntersection method.
+    static const INT32 CollinearStatusMask  = CollinearSeg1Start |
+                                              CollinearSeg1End   |
+                                              CollinearSeg2Start |
+                                              CollinearSeg2End;
+
+    //=========================================================================
+    /// \brief
+    /// Value returned by the PointIsInPolygon method when the quesry point is
+    /// outside of the provided polygon (outer ring only).
+    static const INT32 PointIsOutside = 0;
+    /// \brief
+    /// Value returned by the PointIsInPolygon method when the quesry point is
+    /// outside of the provided polygon (outer ring only).
+    static const INT32 PointIsOnBoundary = 1;
+    /// \brief
+    /// Value returned by the PointIsInPolygon method when the quesry point is
+    /// outside of the provided polygon (outer ring only).
+    static const INT32 PointIsInside = 2;
+};
+
+#endif //_MGCOORDINATESYSTEMTYPE_H_


Property changes on: trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityStatus.h
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: trunk/MgDev/Doc/viewerapi/index.htm
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/License.txt
===================================================================
--- trunk/MgDev/License.txt	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/License.txt	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,1329 +1,1329 @@
-Copyright and Licensing Information for MapGuide Open Source
-
-Copyright (C) 2004-2010 by Autodesk, Inc.
-
-  MapGuide Open Source is free software; you can redistribute it
-  and/or modify it under the terms of version 2.1 of the GNU Lesser
-  General Public License (LGPL) as published by the Free Software
-  Foundation.  It is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-  The full text of the LGPL can be found at the bottom of this file.
-
-  "Autodesk MapGuide" is a registered trademark of Autodesk, Inc.
-  and nothing herein shall grant any license or permission to use 
-  such trademark.
-
-
-***Third Party Credits***
-
-MapGuide Open Source also contains third party software that is
-licensed by the copyright holder on terms specific to that software.
-You are responsible for complying with the terms of these licenses.
-For ease of reference, this file contains information on all of these
-third party licenses.
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Simplified Wrapper and Interface Generator  (SWIG)
- 
- SWIG is distributed under the following terms:
- =================================================
- 
- I. 
- 
- This software includes contributions that are Copyright (c) 1998-2002
- University of Chicago.
- All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
- 
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.  Redistributions
- in binary form must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or
- other materials provided with the distribution.  Neither the name of
- the University of Chicago nor the names of its contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
- 
- THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF CHICAGO AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF
- CHICAGO OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- 
- II.  
- 
- Copyright (c) 1995-1998
- The University of Utah and the Regents of the University of California
- All Rights Reserved
- 
- Permission is hereby granted, without written agreement and without
- license or royalty fees, to use, copy, modify, and distribute this
- software and its documentation for any purpose, provided that 
- (1) The above copyright notice and the following two paragraphs
- appear in all copies of the source code and (2) redistributions
- including binaries reproduces these notices in the supporting
- documentation.   Substantial modifications to this software may be
- copyrighted by their authors and need not follow the licensing terms
- described here, provided that the new terms are clearly indicated in
- all files where they apply.
- 
- IN NO EVENT SHALL THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, THE 
- UNIVERSITY OF UTAH OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY
- PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
- DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
- EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF
- THE POSSIBILITY OF SUCH DAMAGE.
- 
- THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, AND THE UNIVERSITY OF UTAH
- SPECIFICALLY DISCLAIM ANY WARRANTIES,INCLUDING, BUT NOT LIMITED TO, 
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND 
- THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE,
- SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Copyright and Licensing Information for ACE(TM)
-
-ACE(TM), TAO(TM), CIAO(TM), and CoSMIC(TM) (henceforth referred to as "DOC 
-software") are copyrighted by Douglas C. Schmidt and his research group at 
-Washington University, University of California, Irvine, and Vanderbilt 
-University, Copyright (c) 1993-2005, all rights reserved. Since DOC software is 
-open-source, freely available software, you are free to use, modify, copy, and 
-distribute--perpetually and irrevocably--the DOC software source code and object 
-code produced from the source, as well as copy and distribute modified versions 
-of this software. You must, however, include this copyright statement along with 
-code built using DOC software. 
-
-You can use DOC software in commercial and/or binary software releases and are 
-under no obligation to redistribute any of your source code that is built using 
-DOC software. Note, however, that you may not do anything to the DOC software 
-code, such as copyrighting it yourself or claiming authorship of the DOC 
-software code, that will prevent DOC software from being distributed freely 
-using an open-source development model. You needn't inform anyone that you're 
-using DOC software in your software, though we encourage you to let us know so 
-we can promote your project in the DOC software success stories. 
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Berkeley DB
- 
-/*
- * Copyright (c) 1990-2004
- *	Sleepycat Software.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Redistributions in any form must be accompanied by information on
- *    how to obtain complete source code for the DB software and any
- *    accompanying software that uses the DB software.  The source code
- *    must either be included in the distribution or be available for no
- *    more than the cost of distribution plus a nominal fee, and must be
- *    freely redistributable under reasonable conditions.  For an
- *    executable file, complete source code means the source code for all
- *    modules it contains.  It does not include source code for modules or
- *    files that typically accompany the major components of the operating
- *    system on which the executable file runs.
- *
- * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
- * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL SLEEPYCAT SOFTWARE
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Copyright (c) 1990, 1993, 1994, 1995
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/*
- * Copyright (c) 1995, 1996
- *	The President and Fellows of Harvard University.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Berkeley DB XML
-
-/*
- * Copyright (c) 2001-2005
- *    Sleepycat Software.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Redistributions in any form must be accompanied by information on
- *    how to obtain complete source code for the DB software and any
- *    accompanying software that uses the DB software.  The source code
- *    must either be included in the distribution or be available for no
- *    more than the cost of distribution plus a nominal fee, and must be
- *    freely redistributable under reasonable conditions.  For an
- *    executable file, complete source code means the source code for all
- *    modules it contains.  It does not include source code for modules or
- *    files that typically accompany the major components of the operating
- *    system on which the executable file runs.
- *
- * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
- * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL SLEEPYCAT SOFTWARE
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2000 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache at apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * .
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
- */
-
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Xerxes, Xalan & Apache Tomcat
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Pathan
- 
-The DecisionSoft Open Source Licence
-
-This licence is based on the BSD Licence template.
-
-Copyright (c) 2001, DecisionSoft Limited
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-* Neither the name of DecisionSoft Limited nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Berkeley DB XML XQuery
-
-/*
- * Copyright (c) 2001-2005
- *	Sleepycat Software.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Redistributions in any form must be accompanied by information on
- *    how to obtain complete source code for the DB software and any
- *    accompanying software that uses the DB software.  The source code
- *    must either be included in the distribution or be available for no
- *    more than the cost of distribution plus a nominal fee, and must be
- *    freely redistributable under reasonable conditions.  For an
- *    executable file, complete source code means the source code for all
- *    modules it contains.  It does not include source code for modules or
- *    files that typically accompany the major components of the operating
- *    system on which the executable file runs.
- *
- * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
- * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL SLEEPYCAT SOFTWARE
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Copyright (c) 2005
- *	Progress Software Corporation.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The end-user documentation included with the redistribution, if any,
- *    must include the following acknowledgment: "This product includes
- *    software developed by Progress Software Corporation." Alternately,
- *    this acknowledgment may appear in the software itself, if and wherever
- *    such third-party acknowledgments normally appear.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- * NO EVENT SHALL PROGRESS SOFTWARE CORPORATION BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-Proj.4 and GDAL
-
-
-Copyright (c) 2000, Frank Warmerdam
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-GD Graphics Library
-
-
-Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-2003, 2004 by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188
-by the National Institutes of Health. 
-
-Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-by Boutell.Com, Inc. 
-
-Portions relating to GD2 format copyright 1999, 2000, 2001, 2002, 2003,
-2004 Philip Warner. 
-
-Portions relating to PNG copyright 1999, 2000, 2001, 2002, 2003, 2004
-Greg Roelofs. 
-
-Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002, 2003,
-2004 John Ellson (ellson at graphviz.org). 
-
-Portions relating to gdft.c copyright 2001, 2002, 2003, 2004 John Ellson
-(ellson at graphviz.org). 
-
-Portions relating to JPEG and to color quantization copyright 2000, 2001,
-2002, 2003, 2004, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004 Thomas G. Lane.
-
-This software is based in part on the work of the Independent JPEG Group.
-See the file README-JPEG.TXT in the GD Source Code for more information. 
-
-Portions relating to GIF compression copyright 1989 by Jef Poskanzer and
-David Rowley, with modifications for thread safety by Thomas Boutell. 
-
-Portions relating to GIF decompression copyright 1990, 1991, 1993 by
-David Koblas, with modifications for thread safety by Thomas Boutell. 
-
-Portions relating to WBMP copyright 2000, 2001, 2002, 2003, 2004
-Maurice Szmurlo and Johan Van den Brande. 
-
-Portions relating to GIF animations copyright 2004 Jaakko Hyvätti
-(jaakko.hyvatti at iki.fi) 
-
-Permission has been granted to copy, distribute and modify gd in any context
-without fee, including a commercial application, provided that this notice
-is present in user-accessible supporting documentation. 
-
-This does not affect your ownership of the derived work itself, and the
-intent is to assure proper credit for the authors of gd, not to interfere
-with your productive use of gd. If you have questions, ask. "Derived works"
-includes all programs that utilize the library. Credit must be given in
-user-accessible documentation. 
-
-This software is provided "AS IS." The copyright holders disclaim all warranties,
-either express or implied, including but not limited to implied warranties
-of merchantability and fitness for a particular purpose, with respect to this 
-code and accompanying documentation. 
-
-Although their code does not appear in the current release, the authors also
-wish to thank Hutchison Avenue Software Corporation for their prior contributions. 
-
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-FastCGI
-
-This FastCGI application library source and object code (the
-"Software") and its documentation (the "Documentation") are
-copyrighted by Open Market, Inc ("Open Market").  The following terms
-apply to all files associated with the Software and Documentation
-unless explicitly disclaimed in individual files.
-
-Open Market permits you to use, copy, modify, distribute, and license
-this Software and the Documentation solely for the purpose of
-implementing the FastCGI specification defined by Open Market or
-derivative specifications publicly endorsed by Open Market and
-promulgated by an open standards organization and for no other
-purpose, provided that existing copyright notices are retained in all
-copies and that this notice is included verbatim in any distributions.
-
-No written agreement, license, or royalty fee is required for any of
-the authorized uses.  Modifications to this Software and Documentation
-may be copyrighted by their authors and need not follow the licensing
-terms described here, but the modified Software and Documentation must
-be used for the sole purpose of implementing the FastCGI specification
-defined by Open Market or derivative specifications publicly endorsed
-by Open Market and promulgated by an open standards organization and
-for no other purpose.  If modifications to this Software and
-Documentation have new licensing terms, the new terms must protect Open
-Market's proprietary rights in the Software and Documentation to the
-same extent as these licensing terms and must be clearly indicated on
-the first page of each file where they apply.
-
-Open Market shall retain all right, title and interest in and to the
-Software and Documentation, including without limitation all patent,
-copyright, trade secret and other proprietary rights.
-
-OPEN MARKET MAKES NO EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE
-SOFTWARE OR THE DOCUMENTATION, INCLUDING WITHOUT LIMITATION ANY
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  IN
-NO EVENT SHALL OPEN MARKET BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY
-DAMAGES ARISING FROM OR RELATING TO THIS SOFTWARE OR THE
-DOCUMENTATION, INCLUDING, WITHOUT LIMITATION, ANY INDIRECT, SPECIAL OR
-CONSEQUENTIAL DAMAGES OR SIMILAR DAMAGES, INCLUDING LOST PROFITS OR
-LOST DATA, EVEN IF OPEN MARKET HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.  THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS".
-OPEN MARKET HAS NO LIABILITY IN CONTRACT, TORT, NEGLIGENCE OR
-OTHERWISE ARISING OUT OF THIS SOFTWARE OR THE DOCUMENTATION.
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-PHP
-
-                  The PHP License, version 3.0
-Copyright (c) 1999 - 2005 The PHP Group. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, is permitted provided that the following conditions
-are met:
-
-  1. Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
- 
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
- 
-  3. The name "PHP" must not be used to endorse or promote products
-     derived from this software without prior written permission. For
-     written permission, please contact group at php.net.
-  
-  4. Products derived from this software may not be called "PHP", nor
-     may "PHP" appear in their name, without prior written permission
-     from group at php.net.  You may indicate that your software works in
-     conjunction with PHP by saying "Foo for PHP" instead of calling
-     it "PHP Foo" or "phpfoo"
- 
-  5. The PHP Group may publish revised and/or new versions of the
-     license from time to time. Each version will be given a
-     distinguishing version number.
-     Once covered code has been published under a particular version
-     of the license, you may always continue to use it under the terms
-     of that version. You may also choose to use such covered code
-     under the terms of any subsequent version of the license
-     published by the PHP Group. No one other than the PHP Group has
-     the right to modify the terms applicable to covered code created
-     under this License.
-
-  6. Redistributions of any form whatsoever must retain the following
-     acknowledgment:
-     "This product includes PHP, freely available from
-     <http://www.php.net/>".
-
-THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 
-ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
-PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP
-DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the PHP Group.
-
-The PHP Group can be contacted via Email at group at php.net.
-
-For more information on the PHP Group and the PHP project, 
-please see <http://www.php.net>.
-
-This product includes the Zend Engine, freely available at
-<http://www.zend.com>.
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-StampVer
-
-StampVer - Win32 Version Resource Stamping
-Written by Paul Dixon (paul at elphin.com) Jan 1998
-http://www.elphin.com/products/stampver.html
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-MapGuide Open Source, CppUnit, GEOS, SQLite, FDO and the Javascript Vector Graphics 
-Library are each licensed under the GNU Lesser General Public License.
-
-
-GNU Lesser General Public License
-
-		  GNU LESSER GENERAL PUBLIC LICENSE
-		       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-
-		  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-			    NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-
-===================================================================== 
-License for DWF Toolkit 7
-NOTICE TO USER:
-THIS LICENSE AGREEMENT ("AGREEMENT") IS A LEGAL AGREEMENT BETWEEN YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) AND AUTODESK, INC. FOR THE DWF TOOLKIT 7, WHICH INCLUDES COMPUTER SOFTWARE AND MAY INCLUDE ASSOCIATED MEDIA, PRINTED MATERIALS AND ONLINE OR ELECTRONIC DOCUMENTATION ("LICENSED SOFTWARE"). BY INSTALLING THE LICENSED SOFTWARE YOU ACCEPT ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT, DO NOT INSTALL OR USE THE LICENSED SOFTWARE. 
- 
-1 LICENSE GRANT
-1.1 Autodesk grants to you ("Licensee") a perpetual, nontransferable, nonexclusive, royalty-free, limited license to: 
-1.1.1 (a) Use the Licensed Software for development, research, internal, educational, or commercial purposes; (b) Modify the Licensed Software to create derivative works and applications, including ports; and (c) Compile the Licensed Software, derivative works and applications prepared in accordance with subsection 1.1.1(b) into binary code. 
-
-1.1.2 Reproduce, distribute and sublicense free of charge or for a fee the Licensed Software in binary code form in conjunction with derivative works or applications created by Licensee or licensed from third parties by Licensee, provided, that: (a) Licensee makes no use of Autodesk’s trademarks, trade names, or trade dress; (b) In the event Licensee makes any modification to the Licensed Software, Licensee must publish the specification for such modifications for use by third party developers and provide Autodesk with a copy thereof; and (c) The Licensee must sublicense the Licensed Software “as is”, without warranty of any kind. 
-1.1.3 Reproduce, distribute and sublicense free of charge to sublicensees the source code of the unmodified Licensed Software, provided that (a) Licensee must state in its sublicenses that the Licensed Software is being distributed pursuant to a license granted by Autodesk, Inc.; (b)The terms of sublicenses granted by Licensee must (i) contain all applicable terms of this Agreement, and (ii) not be broader than the terms of the license granted by this Agreement; (c) Licensee must exactly reproduce Autodesk’s copyright and other proprietary rights notices which accompany the copy of the Licensed Software licensed by Autodesk to Licensee; and (d) Licensee shall conspicuously state in its sublicenses that the Licensed Software is offered “as is”, without warranty of any kind. 
-1.1.4 Reproduce, distribute and sublicense the source code of the Licensed Software as modified by Licensee, provided that (a) Licensee must state in its sublicense that the Licensed Software has been modified by Licensee; (b) Licensee must exactly reproduce Autodesk’s copyright and other proprietary rights notices which accompany the copy of the Licensed Software licensed by Autodesk to Licensee; (c) As to the unmodified portions of the Licensed Software, the terms of the sublicenses granted by Licensee must (i) contain all applicable terms of this Agreement, and (ii) not be broader than the terms of the license granted by this Agreement; (d) Licensee must conspicuously state in its sublicenses that the original, unmodified portions of the Licensed Software are offered “as is”, without warranty of any kind; and (e) Licensee must (i) publish the modified Licensed Software to the Worldwide Web, (ii) make available with the modified Licensed Software documentation which descri
 bes in detail the modifications which Licensee has made to the Licensed Software, and (iii) provide to Autodesk a copy of the modified Licensed Software and the documentation. 
- 
-1.2 Licensee acquires no right, title, or interest in or to the Licensed Software,
-1.3 Licensee shall retain all rights to any independently developed software, such as applications, developed by or for Licensee.
-1.4 Autodesk is under no obligation to provide maintenance, support, or upgrades for the Licensed Software.
-2 COPYRIGHTS AND TRADEMARKS
-Licensee shall reproduce and apply any copyright or other proprietary rights notices included on or embedded in the Licensed Software to any copies of the Licensed Software or to applications created using the Licensed Software, in any form. Licensee shall have no right to use any Autodesk trademarks, trade names or trade dress absent a separate written agreement between Autodesk and Licensee. Licensee hereby understands and agrees that Autodesk is not granting any rights to Autodesk patents, copyrights, trademarks or trade secret information to Licensee by this Agreement.
-3 FEES
-Use of the Licensed Software in accordance with the terms of this Agreement shall not require payment of a license fee.
-4 TERM AND TERMINATION
-The grant of a perpetual license notwithstanding, Autodesk may immediately terminate this Agreement and revoke the license granted to Licensee upon written notice to Licensee if Licensee fails to comply with any of the terms or conditions of this Agreement. Upon termination of this Agreement, Licensee shall immediately cease using, reproducing and distributing the Licensed Software, the license and rights granted hereunder shall expire, and Licensee shall immediately destroy or return to Autodesk the Licensed Software and all related documentation, materials or copies thereof.
-5 DISCLAIMER OF WARRANTY
-5.1 The Licensed Software is provided "AS IS" and without any warranty of any kind. 
-5.2 AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. 
-6 LIMITATION OF LIABILITY
-6.1 In no event will Autodesk be liable for any lost revenues, data, or profits, or special, indirect, or consequential damages, even if Autodesk has been advised of the possibility or probability of such damages. Autodesk’s maximum liability for damages shall be limited to the fees, if any, required under Section 3 for the particular Licensed Software which caused the damages. 
-6.2 The Licensed Software is not fault-tolerant and is not designed, manufactured, or intended for use or resale as online control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of the Licensed Software or derived binaries could lead directly to death, personal injury, or severe physical or environmental damage ("High Risk Activities"). Autodesk specifically disclaims any express or implied warranty of fitness for High Risk Activities. Licensee will not knowingly use, distribute, or sublicense the Licensed Software or derived binaries for High Risk Activities and will ensure that its customers and end-users of Licensee's products are provided with a copy of the notice specified in the first sentence of this Section 6.2. 
-7 PROPRIETARY INFORMATION
-The Licensed Software is the proprietary information of Autodesk, Inc. ("Confidential Information"). Except as permitted by this Agreement, Licensee shall not disclose Confidential Information and shall use it only for purposes specifically contemplated by this Agreement. This Agreement will not affect any non-disclosure agreement between the parties.
-8 EXPORT
-Unless properly authorized by the U.S. Government, Licensee shall not export, re-export or transfer, whether directly or indirectly, the Licensed Software or binary derivative or direct products thereof, to any person or company who is (a) present in or controlled by a legal resident of any proscribed country listed in the U.S. Export Administration Regulations (or any equivalent thereof ), or (b) a person or entity named in the entity lists, denied persons lists or specially designated nationals lists maintained by the U.S. Government. 
-9 U.S. GOVERNMENT RESTRICTED RIGHTS
-This Licensed Software is provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software Clause as DFARS 252.227-7013 and FAR 52.227-19 as applicable. Manufacturer is Autodesk, Inc., 111 McInnis Parkway, San Rafael, California 94903.
-10 GOVERNING LAW
-Any action related to this Agreement will be governed by California law, excluding choice of law rules.
- 
+Copyright and Licensing Information for MapGuide Open Source
+
+Copyright (C) 2004-2010 by Autodesk, Inc.
+
+  MapGuide Open Source is free software; you can redistribute it
+  and/or modify it under the terms of version 2.1 of the GNU Lesser
+  General Public License (LGPL) as published by the Free Software
+  Foundation.  It is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+  The full text of the LGPL can be found at the bottom of this file.
+
+  "Autodesk MapGuide" is a registered trademark of Autodesk, Inc.
+  and nothing herein shall grant any license or permission to use 
+  such trademark.
+
+
+***Third Party Credits***
+
+MapGuide Open Source also contains third party software that is
+licensed by the copyright holder on terms specific to that software.
+You are responsible for complying with the terms of these licenses.
+For ease of reference, this file contains information on all of these
+third party licenses.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Simplified Wrapper and Interface Generator  (SWIG)
+ 
+ SWIG is distributed under the following terms:
+ =================================================
+ 
+ I. 
+ 
+ This software includes contributions that are Copyright (c) 1998-2002
+ University of Chicago.
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ 
+ Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.  Redistributions
+ in binary form must reproduce the above copyright notice, this list of
+ conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.  Neither the name of
+ the University of Chicago nor the names of its contributors may be
+ used to endorse or promote products derived from this software without
+ specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF CHICAGO AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF
+ CHICAGO OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ II.  
+ 
+ Copyright (c) 1995-1998
+ The University of Utah and the Regents of the University of California
+ All Rights Reserved
+ 
+ Permission is hereby granted, without written agreement and without
+ license or royalty fees, to use, copy, modify, and distribute this
+ software and its documentation for any purpose, provided that 
+ (1) The above copyright notice and the following two paragraphs
+ appear in all copies of the source code and (2) redistributions
+ including binaries reproduces these notices in the supporting
+ documentation.   Substantial modifications to this software may be
+ copyrighted by their authors and need not follow the licensing terms
+ described here, provided that the new terms are clearly indicated in
+ all files where they apply.
+ 
+ IN NO EVENT SHALL THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, THE 
+ UNIVERSITY OF UTAH OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY
+ PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
+ EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, AND THE UNIVERSITY OF UTAH
+ SPECIFICALLY DISCLAIM ANY WARRANTIES,INCLUDING, BUT NOT LIMITED TO, 
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND 
+ THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE,
+ SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Copyright and Licensing Information for ACE(TM)
+
+ACE(TM), TAO(TM), CIAO(TM), and CoSMIC(TM) (henceforth referred to as "DOC 
+software") are copyrighted by Douglas C. Schmidt and his research group at 
+Washington University, University of California, Irvine, and Vanderbilt 
+University, Copyright (c) 1993-2005, all rights reserved. Since DOC software is 
+open-source, freely available software, you are free to use, modify, copy, and 
+distribute--perpetually and irrevocably--the DOC software source code and object 
+code produced from the source, as well as copy and distribute modified versions 
+of this software. You must, however, include this copyright statement along with 
+code built using DOC software. 
+
+You can use DOC software in commercial and/or binary software releases and are 
+under no obligation to redistribute any of your source code that is built using 
+DOC software. Note, however, that you may not do anything to the DOC software 
+code, such as copyrighting it yourself or claiming authorship of the DOC 
+software code, that will prevent DOC software from being distributed freely 
+using an open-source development model. You needn't inform anyone that you're 
+using DOC software in your software, though we encourage you to let us know so 
+we can promote your project in the DOC software success stories. 
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Berkeley DB
+ 
+/*
+ * Copyright (c) 1990-2004
+ *	Sleepycat Software.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Redistributions in any form must be accompanied by information on
+ *    how to obtain complete source code for the DB software and any
+ *    accompanying software that uses the DB software.  The source code
+ *    must either be included in the distribution or be available for no
+ *    more than the cost of distribution plus a nominal fee, and must be
+ *    freely redistributable under reasonable conditions.  For an
+ *    executable file, complete source code means the source code for all
+ *    modules it contains.  It does not include source code for modules or
+ *    files that typically accompany the major components of the operating
+ *    system on which the executable file runs.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL SLEEPYCAT SOFTWARE
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Copyright (c) 1990, 1993, 1994, 1995
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*
+ * Copyright (c) 1995, 1996
+ *	The President and Fellows of Harvard University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Berkeley DB XML
+
+/*
+ * Copyright (c) 2001-2005
+ *    Sleepycat Software.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Redistributions in any form must be accompanied by information on
+ *    how to obtain complete source code for the DB software and any
+ *    accompanying software that uses the DB software.  The source code
+ *    must either be included in the distribution or be available for no
+ *    more than the cost of distribution plus a nominal fee, and must be
+ *    freely redistributable under reasonable conditions.  For an
+ *    executable file, complete source code means the source code for all
+ *    modules it contains.  It does not include source code for modules or
+ *    files that typically accompany the major components of the operating
+ *    system on which the executable file runs.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL SLEEPYCAT SOFTWARE
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache at apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
+ */
+
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Xerxes, Xalan & Apache Tomcat
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Pathan
+ 
+The DecisionSoft Open Source Licence
+
+This licence is based on the BSD Licence template.
+
+Copyright (c) 2001, DecisionSoft Limited
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+* Neither the name of DecisionSoft Limited nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Berkeley DB XML XQuery
+
+/*
+ * Copyright (c) 2001-2005
+ *	Sleepycat Software.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Redistributions in any form must be accompanied by information on
+ *    how to obtain complete source code for the DB software and any
+ *    accompanying software that uses the DB software.  The source code
+ *    must either be included in the distribution or be available for no
+ *    more than the cost of distribution plus a nominal fee, and must be
+ *    freely redistributable under reasonable conditions.  For an
+ *    executable file, complete source code means the source code for all
+ *    modules it contains.  It does not include source code for modules or
+ *    files that typically accompany the major components of the operating
+ *    system on which the executable file runs.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL SLEEPYCAT SOFTWARE
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Copyright (c) 2005
+ *	Progress Software Corporation.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowledgment: "This product includes
+ *    software developed by Progress Software Corporation." Alternately,
+ *    this acknowledgment may appear in the software itself, if and wherever
+ *    such third-party acknowledgments normally appear.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ * NO EVENT SHALL PROGRESS SOFTWARE CORPORATION BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Proj.4 and GDAL
+
+
+Copyright (c) 2000, Frank Warmerdam
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+GD Graphics Library
+
+
+Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+2003, 2004 by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188
+by the National Institutes of Health. 
+
+Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+by Boutell.Com, Inc. 
+
+Portions relating to GD2 format copyright 1999, 2000, 2001, 2002, 2003,
+2004 Philip Warner. 
+
+Portions relating to PNG copyright 1999, 2000, 2001, 2002, 2003, 2004
+Greg Roelofs. 
+
+Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002, 2003,
+2004 John Ellson (ellson at graphviz.org). 
+
+Portions relating to gdft.c copyright 2001, 2002, 2003, 2004 John Ellson
+(ellson at graphviz.org). 
+
+Portions relating to JPEG and to color quantization copyright 2000, 2001,
+2002, 2003, 2004, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
+1998, 1999, 2000, 2001, 2002, 2003, 2004 Thomas G. Lane.
+
+This software is based in part on the work of the Independent JPEG Group.
+See the file README-JPEG.TXT in the GD Source Code for more information. 
+
+Portions relating to GIF compression copyright 1989 by Jef Poskanzer and
+David Rowley, with modifications for thread safety by Thomas Boutell. 
+
+Portions relating to GIF decompression copyright 1990, 1991, 1993 by
+David Koblas, with modifications for thread safety by Thomas Boutell. 
+
+Portions relating to WBMP copyright 2000, 2001, 2002, 2003, 2004
+Maurice Szmurlo and Johan Van den Brande. 
+
+Portions relating to GIF animations copyright 2004 Jaakko Hyvätti
+(jaakko.hyvatti at iki.fi) 
+
+Permission has been granted to copy, distribute and modify gd in any context
+without fee, including a commercial application, provided that this notice
+is present in user-accessible supporting documentation. 
+
+This does not affect your ownership of the derived work itself, and the
+intent is to assure proper credit for the authors of gd, not to interfere
+with your productive use of gd. If you have questions, ask. "Derived works"
+includes all programs that utilize the library. Credit must be given in
+user-accessible documentation. 
+
+This software is provided "AS IS." The copyright holders disclaim all warranties,
+either express or implied, including but not limited to implied warranties
+of merchantability and fitness for a particular purpose, with respect to this 
+code and accompanying documentation. 
+
+Although their code does not appear in the current release, the authors also
+wish to thank Hutchison Avenue Software Corporation for their prior contributions. 
+
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+FastCGI
+
+This FastCGI application library source and object code (the
+"Software") and its documentation (the "Documentation") are
+copyrighted by Open Market, Inc ("Open Market").  The following terms
+apply to all files associated with the Software and Documentation
+unless explicitly disclaimed in individual files.
+
+Open Market permits you to use, copy, modify, distribute, and license
+this Software and the Documentation solely for the purpose of
+implementing the FastCGI specification defined by Open Market or
+derivative specifications publicly endorsed by Open Market and
+promulgated by an open standards organization and for no other
+purpose, provided that existing copyright notices are retained in all
+copies and that this notice is included verbatim in any distributions.
+
+No written agreement, license, or royalty fee is required for any of
+the authorized uses.  Modifications to this Software and Documentation
+may be copyrighted by their authors and need not follow the licensing
+terms described here, but the modified Software and Documentation must
+be used for the sole purpose of implementing the FastCGI specification
+defined by Open Market or derivative specifications publicly endorsed
+by Open Market and promulgated by an open standards organization and
+for no other purpose.  If modifications to this Software and
+Documentation have new licensing terms, the new terms must protect Open
+Market's proprietary rights in the Software and Documentation to the
+same extent as these licensing terms and must be clearly indicated on
+the first page of each file where they apply.
+
+Open Market shall retain all right, title and interest in and to the
+Software and Documentation, including without limitation all patent,
+copyright, trade secret and other proprietary rights.
+
+OPEN MARKET MAKES NO EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE
+SOFTWARE OR THE DOCUMENTATION, INCLUDING WITHOUT LIMITATION ANY
+WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  IN
+NO EVENT SHALL OPEN MARKET BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY
+DAMAGES ARISING FROM OR RELATING TO THIS SOFTWARE OR THE
+DOCUMENTATION, INCLUDING, WITHOUT LIMITATION, ANY INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES OR SIMILAR DAMAGES, INCLUDING LOST PROFITS OR
+LOST DATA, EVEN IF OPEN MARKET HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.  THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS".
+OPEN MARKET HAS NO LIABILITY IN CONTRACT, TORT, NEGLIGENCE OR
+OTHERWISE ARISING OUT OF THIS SOFTWARE OR THE DOCUMENTATION.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+PHP
+
+                  The PHP License, version 3.0
+Copyright (c) 1999 - 2005 The PHP Group. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, is permitted provided that the following conditions
+are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+ 
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+ 
+  3. The name "PHP" must not be used to endorse or promote products
+     derived from this software without prior written permission. For
+     written permission, please contact group at php.net.
+  
+  4. Products derived from this software may not be called "PHP", nor
+     may "PHP" appear in their name, without prior written permission
+     from group at php.net.  You may indicate that your software works in
+     conjunction with PHP by saying "Foo for PHP" instead of calling
+     it "PHP Foo" or "phpfoo"
+ 
+  5. The PHP Group may publish revised and/or new versions of the
+     license from time to time. Each version will be given a
+     distinguishing version number.
+     Once covered code has been published under a particular version
+     of the license, you may always continue to use it under the terms
+     of that version. You may also choose to use such covered code
+     under the terms of any subsequent version of the license
+     published by the PHP Group. No one other than the PHP Group has
+     the right to modify the terms applicable to covered code created
+     under this License.
+
+  6. Redistributions of any form whatsoever must retain the following
+     acknowledgment:
+     "This product includes PHP, freely available from
+     <http://www.php.net/>".
+
+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
+PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP
+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the PHP Group.
+
+The PHP Group can be contacted via Email at group at php.net.
+
+For more information on the PHP Group and the PHP project, 
+please see <http://www.php.net>.
+
+This product includes the Zend Engine, freely available at
+<http://www.zend.com>.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+StampVer
+
+StampVer - Win32 Version Resource Stamping
+Written by Paul Dixon (paul at elphin.com) Jan 1998
+http://www.elphin.com/products/stampver.html
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+MapGuide Open Source, CppUnit, GEOS, SQLite, FDO and the Javascript Vector Graphics 
+Library are each licensed under the GNU Lesser General Public License.
+
+
+GNU Lesser General Public License
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+===================================================================== 
+License for DWF Toolkit 7
+NOTICE TO USER:
+THIS LICENSE AGREEMENT ("AGREEMENT") IS A LEGAL AGREEMENT BETWEEN YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) AND AUTODESK, INC. FOR THE DWF TOOLKIT 7, WHICH INCLUDES COMPUTER SOFTWARE AND MAY INCLUDE ASSOCIATED MEDIA, PRINTED MATERIALS AND ONLINE OR ELECTRONIC DOCUMENTATION ("LICENSED SOFTWARE"). BY INSTALLING THE LICENSED SOFTWARE YOU ACCEPT ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT, DO NOT INSTALL OR USE THE LICENSED SOFTWARE. 
+ 
+1 LICENSE GRANT
+1.1 Autodesk grants to you ("Licensee") a perpetual, nontransferable, nonexclusive, royalty-free, limited license to: 
+1.1.1 (a) Use the Licensed Software for development, research, internal, educational, or commercial purposes; (b) Modify the Licensed Software to create derivative works and applications, including ports; and (c) Compile the Licensed Software, derivative works and applications prepared in accordance with subsection 1.1.1(b) into binary code. 
+
+1.1.2 Reproduce, distribute and sublicense free of charge or for a fee the Licensed Software in binary code form in conjunction with derivative works or applications created by Licensee or licensed from third parties by Licensee, provided, that: (a) Licensee makes no use of Autodesk’s trademarks, trade names, or trade dress; (b) In the event Licensee makes any modification to the Licensed Software, Licensee must publish the specification for such modifications for use by third party developers and provide Autodesk with a copy thereof; and (c) The Licensee must sublicense the Licensed Software “as is”, without warranty of any kind. 
+1.1.3 Reproduce, distribute and sublicense free of charge to sublicensees the source code of the unmodified Licensed Software, provided that (a) Licensee must state in its sublicenses that the Licensed Software is being distributed pursuant to a license granted by Autodesk, Inc.; (b)The terms of sublicenses granted by Licensee must (i) contain all applicable terms of this Agreement, and (ii) not be broader than the terms of the license granted by this Agreement; (c) Licensee must exactly reproduce Autodesk’s copyright and other proprietary rights notices which accompany the copy of the Licensed Software licensed by Autodesk to Licensee; and (d) Licensee shall conspicuously state in its sublicenses that the Licensed Software is offered “as is”, without warranty of any kind. 
+1.1.4 Reproduce, distribute and sublicense the source code of the Licensed Software as modified by Licensee, provided that (a) Licensee must state in its sublicense that the Licensed Software has been modified by Licensee; (b) Licensee must exactly reproduce Autodesk’s copyright and other proprietary rights notices which accompany the copy of the Licensed Software licensed by Autodesk to Licensee; (c) As to the unmodified portions of the Licensed Software, the terms of the sublicenses granted by Licensee must (i) contain all applicable terms of this Agreement, and (ii) not be broader than the terms of the license granted by this Agreement; (d) Licensee must conspicuously state in its sublicenses that the original, unmodified portions of the Licensed Software are offered “as is”, without warranty of any kind; and (e) Licensee must (i) publish the modified Licensed Software to the Worldwide Web, (ii) make available with the modified Licensed Software documentation which descri
 bes in detail the modifications which Licensee has made to the Licensed Software, and (iii) provide to Autodesk a copy of the modified Licensed Software and the documentation. 
+ 
+1.2 Licensee acquires no right, title, or interest in or to the Licensed Software,
+1.3 Licensee shall retain all rights to any independently developed software, such as applications, developed by or for Licensee.
+1.4 Autodesk is under no obligation to provide maintenance, support, or upgrades for the Licensed Software.
+2 COPYRIGHTS AND TRADEMARKS
+Licensee shall reproduce and apply any copyright or other proprietary rights notices included on or embedded in the Licensed Software to any copies of the Licensed Software or to applications created using the Licensed Software, in any form. Licensee shall have no right to use any Autodesk trademarks, trade names or trade dress absent a separate written agreement between Autodesk and Licensee. Licensee hereby understands and agrees that Autodesk is not granting any rights to Autodesk patents, copyrights, trademarks or trade secret information to Licensee by this Agreement.
+3 FEES
+Use of the Licensed Software in accordance with the terms of this Agreement shall not require payment of a license fee.
+4 TERM AND TERMINATION
+The grant of a perpetual license notwithstanding, Autodesk may immediately terminate this Agreement and revoke the license granted to Licensee upon written notice to Licensee if Licensee fails to comply with any of the terms or conditions of this Agreement. Upon termination of this Agreement, Licensee shall immediately cease using, reproducing and distributing the Licensed Software, the license and rights granted hereunder shall expire, and Licensee shall immediately destroy or return to Autodesk the Licensed Software and all related documentation, materials or copies thereof.
+5 DISCLAIMER OF WARRANTY
+5.1 The Licensed Software is provided "AS IS" and without any warranty of any kind. 
+5.2 AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. 
+6 LIMITATION OF LIABILITY
+6.1 In no event will Autodesk be liable for any lost revenues, data, or profits, or special, indirect, or consequential damages, even if Autodesk has been advised of the possibility or probability of such damages. Autodesk’s maximum liability for damages shall be limited to the fees, if any, required under Section 3 for the particular Licensed Software which caused the damages. 
+6.2 The Licensed Software is not fault-tolerant and is not designed, manufactured, or intended for use or resale as online control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of the Licensed Software or derived binaries could lead directly to death, personal injury, or severe physical or environmental damage ("High Risk Activities"). Autodesk specifically disclaims any express or implied warranty of fitness for High Risk Activities. Licensee will not knowingly use, distribute, or sublicense the Licensed Software or derived binaries for High Risk Activities and will ensure that its customers and end-users of Licensee's products are provided with a copy of the notice specified in the first sentence of this Section 6.2. 
+7 PROPRIETARY INFORMATION
+The Licensed Software is the proprietary information of Autodesk, Inc. ("Confidential Information"). Except as permitted by this Agreement, Licensee shall not disclose Confidential Information and shall use it only for purposes specifically contemplated by this Agreement. This Agreement will not affect any non-disclosure agreement between the parties.
+8 EXPORT
+Unless properly authorized by the U.S. Government, Licensee shall not export, re-export or transfer, whether directly or indirectly, the Licensed Software or binary derivative or direct products thereof, to any person or company who is (a) present in or controlled by a legal resident of any proscribed country listed in the U.S. Export Administration Regulations (or any equivalent thereof ), or (b) a person or entity named in the entity lists, denied persons lists or specially designated nationals lists maintained by the U.S. Government. 
+9 U.S. GOVERNMENT RESTRICTED RIGHTS
+This Licensed Software is provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software Clause as DFARS 252.227-7013 and FAR 52.227-19 as applicable. Manufacturer is Autodesk, Inc., 111 McInnis Parkway, San Rafael, California 94903.
+10 GOVERNING LAW
+Any action related to this Agreement will be governed by California law, excluding choice of law rules.
+ 


Property changes on: trunk/MgDev/License.txt
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.cpp	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.cpp	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,89 +1,89 @@
-//
-//  Copyright (C) 2004-2010 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "MapGuideCommon.h"
-#include "PerformanceLoggingEventHandler.h"
-#include "ServiceManager.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Constructs the object.
-///
-MgPerformanceLoggingEventHandler::MgPerformanceLoggingEventHandler(MgEventTimer& timer) :
-    MgTimedEventHandler(timer)
-{
-    MgConfiguration* configuration = MgConfiguration::GetInstance();
-    ACE_ASSERT(NULL != configuration);
-    INT32 interval = MgConfigProperties::DefaultPerformanceLogPropertyInterval;
-    m_bPerformanceLogEnabled = MgConfigProperties::DefaultPerformanceLogPropertyEnabled;
-
-    if (NULL != configuration)
-    {
-        configuration->GetIntValue(
-            MgConfigProperties::PerformanceLogPropertiesSection,
-            MgConfigProperties::PerformanceLogPropertyInterval,
-            interval,
-            MgConfigProperties::DefaultPerformanceLogPropertyInterval);
-
-        configuration->GetBoolValue(
-            MgConfigProperties::PerformanceLogPropertiesSection,
-            MgConfigProperties::PerformanceLogPropertyEnabled,
-            m_bPerformanceLogEnabled,
-            MgConfigProperties::DefaultPerformanceLogPropertyEnabled);
-    }
-
-    m_timer.SetInterval(interval);
-    m_event.SetId(MgTimedEvent::PerformanceLogging);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destructs the object.
-///
-MgPerformanceLoggingEventHandler::~MgPerformanceLoggingEventHandler()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Handles the specified event.
-///
-void MgPerformanceLoggingEventHandler::HandleEvent(long eventId)
-{
-    MG_TRY()
-
-    // Perform performance statistics logging.
-    if (MgTimedEvent::PerformanceLogging == eventId)
-    {
-        MgServerManager* serverManager = MgServerManager::GetInstance();
-        ACE_ASSERT(NULL != serverManager);
-
-        if (NULL != serverManager)
-        {
-            // We check to see if the log is enabled here as an optimization because the GetInformationProperties() API call can be expensive.
-            if(m_bPerformanceLogEnabled)
-            {
-                Ptr<MgPropertyCollection> properties = serverManager->GetInformationProperties();
-
-                // Log the statistics
-                MG_LOG_PERFORMANCE_PROPERTIES_ENTRY(properties);
-            }
-        }
-    }
-
-    MG_CATCH_AND_THROW(L"MgPerformanceLoggingEventHandler.HandleEvent")
-}
+//
+//  Copyright (C) 2004-2010 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#include "MapGuideCommon.h"
+#include "PerformanceLoggingEventHandler.h"
+#include "ServiceManager.h"
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Constructs the object.
+///
+MgPerformanceLoggingEventHandler::MgPerformanceLoggingEventHandler(MgEventTimer& timer) :
+    MgTimedEventHandler(timer)
+{
+    MgConfiguration* configuration = MgConfiguration::GetInstance();
+    ACE_ASSERT(NULL != configuration);
+    INT32 interval = MgConfigProperties::DefaultPerformanceLogPropertyInterval;
+    m_bPerformanceLogEnabled = MgConfigProperties::DefaultPerformanceLogPropertyEnabled;
+
+    if (NULL != configuration)
+    {
+        configuration->GetIntValue(
+            MgConfigProperties::PerformanceLogPropertiesSection,
+            MgConfigProperties::PerformanceLogPropertyInterval,
+            interval,
+            MgConfigProperties::DefaultPerformanceLogPropertyInterval);
+
+        configuration->GetBoolValue(
+            MgConfigProperties::PerformanceLogPropertiesSection,
+            MgConfigProperties::PerformanceLogPropertyEnabled,
+            m_bPerformanceLogEnabled,
+            MgConfigProperties::DefaultPerformanceLogPropertyEnabled);
+    }
+
+    m_timer.SetInterval(interval);
+    m_event.SetId(MgTimedEvent::PerformanceLogging);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Destructs the object.
+///
+MgPerformanceLoggingEventHandler::~MgPerformanceLoggingEventHandler()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Handles the specified event.
+///
+void MgPerformanceLoggingEventHandler::HandleEvent(long eventId)
+{
+    MG_TRY()
+
+    // Perform performance statistics logging.
+    if (MgTimedEvent::PerformanceLogging == eventId)
+    {
+        MgServerManager* serverManager = MgServerManager::GetInstance();
+        ACE_ASSERT(NULL != serverManager);
+
+        if (NULL != serverManager)
+        {
+            // We check to see if the log is enabled here as an optimization because the GetInformationProperties() API call can be expensive.
+            if(m_bPerformanceLogEnabled)
+            {
+                Ptr<MgPropertyCollection> properties = serverManager->GetInformationProperties();
+
+                // Log the statistics
+                MG_LOG_PERFORMANCE_PROPERTIES_ENTRY(properties);
+            }
+        }
+    }
+
+    MG_CATCH_AND_THROW(L"MgPerformanceLoggingEventHandler.HandleEvent")
+}


Property changes on: trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.cpp
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.h
===================================================================
--- trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.h	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.h	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,59 +1,59 @@
-//
-//  Copyright (C) 2004-2010 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MGPERFORMANCELOGGINGEVENTHANDLER_H_
-#define MGPERFORMANCELOGGINGEVENTHANDLER_H_
-
-#include "TimedEventHandler.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Derived Event Handler class to perform performance logging.
-///
-class MgPerformanceLoggingEventHandler : public MgTimedEventHandler
-{
-/// Constructors/Destructor
-
-public:
-
-    MgPerformanceLoggingEventHandler(MgEventTimer& timer);
-    virtual ~MgPerformanceLoggingEventHandler();
-
-private:
-
-    // Unimplemented Constructors/Methods
-
-    MgPerformanceLoggingEventHandler();
-    MgPerformanceLoggingEventHandler(const MgPerformanceLoggingEventHandler&);
-    MgPerformanceLoggingEventHandler& operator=(const MgPerformanceLoggingEventHandler&);
-
-/// Methods
-
-protected:
-
-    virtual void HandleEvent(long eventId);
-
-/// Data Members
-
-private:
-    bool m_bPerformanceLogEnabled;
-
-};
-
-/// Inline Methods
-
-#endif
+//
+//  Copyright (C) 2004-2010 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef MGPERFORMANCELOGGINGEVENTHANDLER_H_
+#define MGPERFORMANCELOGGINGEVENTHANDLER_H_
+
+#include "TimedEventHandler.h"
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Derived Event Handler class to perform performance logging.
+///
+class MgPerformanceLoggingEventHandler : public MgTimedEventHandler
+{
+/// Constructors/Destructor
+
+public:
+
+    MgPerformanceLoggingEventHandler(MgEventTimer& timer);
+    virtual ~MgPerformanceLoggingEventHandler();
+
+private:
+
+    // Unimplemented Constructors/Methods
+
+    MgPerformanceLoggingEventHandler();
+    MgPerformanceLoggingEventHandler(const MgPerformanceLoggingEventHandler&);
+    MgPerformanceLoggingEventHandler& operator=(const MgPerformanceLoggingEventHandler&);
+
+/// Methods
+
+protected:
+
+    virtual void HandleEvent(long eventId);
+
+/// Data Members
+
+private:
+    bool m_bPerformanceLogEnabled;
+
+};
+
+/// Inline Methods
+
+#endif


Property changes on: trunk/MgDev/Server/src/Core/PerformanceLoggingEventHandler.h
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Server/src/Wms/1.3.0.xml.awd
===================================================================
--- trunk/MgDev/Server/src/Wms/1.3.0.xml.awd	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Server/src/Wms/1.3.0.xml.awd	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,410 +1,410 @@
-<?xml version='1.0'?>
-<Template service="WMS" version="1.3.0">
-
-<Definitions>
-
-  <!-- This defines the format of each individual layer
-      advertised by GetCapabilities                    -->
-  <!-- Note: Studio published the following metadata fields                                -->
-  <!-- Layer.Name      - The canonical machine-readable name for a layer                   -->
-  <!-- Layer.Abstract  - Free-form human readable description for the layer                -->
-  <!-- Layer.Bounds    - Structured XML in the form of one or more of these elements       -->
-  <!--                     <Bounds CRS= north= south= east= west=/>                        -->
-  <!--                     (Note: Studio currently publishes this as plain text, which     -->
-  <!--                     the template engine converts to an XML fragment; future work    -->
-  <!--                     in Studio is expected to remedy this.)                          -->
-  <!--                     (An example is shown below in Layer.BoundingBox.default)        -->
-  <!-- Layer.Cascaded  - the WMS "cascade" value, indicating whether the data came from    -->
-  <!--                     another server, or originated on this server                    -->
-  <!-- Layer.ExtendedMetadata - like Layer.Bounds, should be structured XML, but Studio    -->
-  <!--                            just writes it out as plain text.  Format: zero or more  -->
-  <!--                            <Link href= type= format= /> elements.  Currently not    -->
-  <!--                            implemented in templates.                                -->
-  <!-- Layer.Keywords  - A comma-separated list of keywords associated with this layer.    -->
-  <!-- Layer.Opaque    - boolean indicating whether the layer is opaque or transparent.    -->
-  <!-- Layer.Queryable - boolean indicating whether the layer supports GetFeatureInfo.     -->
-  <!-- Layer.Title     - The user-provided human-readable name for the layer.              -->
-  <!--                                                                                     -->
-  <!-- Layer.NoSubsets is currently not emitted by Studio, its value is defaulted within   -->
-  <!-- the OwsWmsService.config.awd file.                                                  -->
-  <Define item="Layer.xml">
-  <!-- Published Layer #&Layer.iteration; -->
-  <Layer queryable="&Layer.Queryable;" cascaded="&Layer.Cascaded;" noSubsets="&Layer.NoSubsets;" opaque="&Layer.Opaque;">
-   <Name>&Layer.Name;</Name>
-   <Title>&Layer.Title;</Title>
-   <?Ifdef item="Layer.Abstract"?><Abstract>&Layer.Abstract;</Abstract><?Endif?>
-   <?Ifdef item="Layer.Keywords"?>
-   <KeywordList>
-     <?EnumDelim list="&Layer.Keywords;" using="&Service.Keywords.xml;"?>
-   </KeywordList>
-   <?Endif?>
-   <?Ifdef item="Layer.Bounds"?>
-    <?Enum list="&Layer.Bounds;" item="Bounds" using="&CRS.xml;"?>
-    <?Enum list="&Layer.Bounds;" item="Bounds" using="&EX_GeographicBoundingBox.xml;"?>
-    <?Enum list="&Layer.Bounds;" item="Bounds" using="&BoundingBox.xml;"?>
-   <?Else?>
-    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&CRS.xml;"?>
-    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&EX_GeographicBoundingBox.xml;" ?>
-    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&BoundingBox.xml;" ?>
-   <?Endif?>
-  </Layer>
- </Define>
-
- <!-- An example of what can be expected in the Layer.Bounds definition -->
- <Define item="Layer.BoundingBox.default">
-  <Bounds CRS="EPSG:4326" west="-180" south="-90" east="180" north="90"/>
- </Define>
-
- <!-- This pair of definitions works around a current limitation that -->
- <!-- <?If...?><?Endif?> cannot be nested.                            -->
- <Define item="EX_GeographicBoundingBox.xml">
-    <?Translate text="&Enum.item.CRS;" with="&EX_GeographicBoundingBox.translate.xml;"?>
- </Define>
-
- <Define item="EX_GeographicBoundingBox.translate.xml">
-    <translate from="EPSG:4326" ?>
-        <EX_GeographicBoundingBox>
-            <westBoundLongitude>&Enum.item.west;</westBoundLongitude>
-            <eastBoundLongitude>&Enum.item.east;</eastBoundLongitude>
-            <southBoundLatitude>&Enum.item.south;</southBoundLatitude>
-            <northBoundLatitude>&Enum.item.north;</northBoundLatitude>
-        </EX_GeographicBoundingBox>
-    </translate>
-    <translate></translate>
-</Define>
-
- <Define item="BoundingBox.xml">
-  <BoundingBox CRS="&Enum.item.CRS;" minx="&Enum.item.west;" miny="&Enum.item.south;" maxx="&Enum.item.east;" maxy="&Enum.item.north;"/>
- </Define>
-
- <Define item="CRS.xml">
-  <CRS>&Enum.item.CRS;</CRS>
- </Define>
-
- <Define item="FeatureInfo.xml">
-  <?Ifdef item="FeatureInfo.LayerName"?>
-  <FeatureInfo layer="&FeatureInfo.LayerName;">
-  <?Else?>
-  <FeatureInfo>
-  <?Endif?>
-  <?EnumFeatureProperties using="&FeatureProperty.xml;" ?>
-  </FeatureInfo>
- </Define>
-
- <Define item="FeatureInfo.html">
-  <tr>
-   <td>
-    <table>
-     <?EnumFeatureProperties using="&FeatureProperty.html;" ?>
-    </table>
-   </td>
-  </tr>
- </Define>
-
- <Define item="FeatureInfo.text">
-  FeatureInfo:
-  <?EnumFeatureProperties using="&FeatureProperty.text;" ?>
-
- </Define>
-
- <Define item="FeatureProperty.xml">
-  <Property name="&FeatureProperty.Name;" value="&FeatureProperty.Value;"></Property>
- </Define>
-
- <Define item="FeatureProperty.html">
-  <tr><td class="name">&FeatureProperty.Name;</td><td>&FeatureProperty.Value;</td></tr>
- </Define>
-
- <Define item="FeatureProperty.text">
-  &FeatureProperty.Name;=&FeatureProperty.Value;
- </Define>
-
- <!-- We're currently not supporting child layers... -->
- <Define item="Layer.Sublayers"></Define>
-
- <!-- In this version, keywords are enumerated enclosed in Keyword elements -->
- <Define item="Service.Keywords.xml"><Keyword>&Enum.item;</Keyword>
- </Define>
-
- <!-- Overrides of default Exception formats
-  specific to this version template -->
- <Define item="Formats.Exception">
-  <item>XML</item>
- </Define>
-
- <!-- These are the supported (Get)Capabilities formats
-  for version 1.1.1.     -->
- <Define item="Formats.GetCapabilities">
-  <item>text/xml</item>
-  <item>text/html</item>
- </Define>
-
- <Define item="GetCapabilities.xml">
-  <WMS_Capabilities version="&TemplateVersion;"
-    xmlns="http://www.opengis.net/wms"
-    xmlns:xlink="http://www.w3.org/1999/xlink"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd">
-   <!--
-
-   SERVICE METADATA
-
-   -->
-   <Service>
-    <Name>&Service.Name;</Name>
-    <Title>&Service.Title;</Title>
-    <?Ifdef item="Service.Abstract"?>
-    <Abstract>&Service.Abstract;</Abstract>
-    <?Endif?>
-    <?Ifdef item="Service.Keywords"?>
-    <KeywordList>
-     <?Enum list="&Service.Keywords;" using="&Service.Keywords.xml"?>
-    </KeywordList>
-    <?Endif?>
-    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.OnlineResource;"></OnlineResource>
-
-    <ContactInformation>
-     <ContactPersonPrimary>
-      <ContactPerson>&Service.Contact.Name;</ContactPerson>
-      <ContactOrganization>&Service.Contact.Organization;</ContactOrganization>
-     </ContactPersonPrimary>
-     <?Ifdef item="Service.Contact.Position"?>
-     <ContactPosition>&Service.Contact.Position;</ContactPosition>
-     <?Endif?>
-     <?Ifdef item="Service.Contact.Address.Type"?>
-     <ContactAddress>
-      <AddressType>&Service.Contact.Address.Type;</AddressType>
-      <Address>&Service.Contact.Address.Street;</Address>
-      <City>&Service.Contact.Address.City;</City>
-      <StateOrProvince>&Service.Contact.Address.StateProv;</StateOrProvince>
-      <PostCode>&Service.Contact.Address.PostCode;</PostCode>
-      <Country>&Service.Contact.Address.Country;</Country>
-     </ContactAddress>
-     <?Endif?>
-     <?Ifdef item="Service.Contact.Phone"?>
-     <ContactVoiceTelephone>&Service.Contact.Phone;</ContactVoiceTelephone>
-     <?Endif?>
-     <?Ifdef item="Service.Contact.Fax"?>
-     <ContactFacsimileTelephone>&Service.Contact.Fax;</ContactFacsimileTelephone>
-     <?Endif?>
-     <?Ifdef item="Service.Contact.Email"?>
-     <ContactElectronicMailAddress>&Service.Contact.Email;</ContactElectronicMailAddress>
-     <?Endif?>
-    </ContactInformation>
-
-    <Fees>&Service.Fees;</Fees>
-    <AccessConstraints>&Service.AccessConstraints;</AccessConstraints>
-   </Service>
-
-   <!--
-
-   SERVICE CAPABILITIES
-
-   -->
-   <Capability>
-
-    <Request>
-     <GetCapabilities>
-      <?Enum list="&Formats.GetCapabilities;" using="&Format.xml;" ?>
-      <DCPType>
-       <HTTP>
-        <Get>
-        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetCapabilities;?"/>
-        </Get>
-       </HTTP>
-      </DCPType>
-     </GetCapabilities>
-
-     <GetMap>
-      <?Enum list="&Formats.GetMap;" using="&Format.xml;" ?>
-      <DCPType>
-       <HTTP>
-        <Get>
-        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetMap;?"/>
-        </Get>
-       </HTTP>
-      </DCPType>
-     </GetMap>
-
-     <GetFeatureInfo>
-      <?Enum list="&Formats.GetFeatureInfo;" using="&Format.xml;" ?>
-      <DCPType>
-       <HTTP>
-        <Get>
-        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetFeatureInfo;?"/>
-        </Get>
-       </HTTP>
-      </DCPType>
-     </GetFeatureInfo>
-
-    </Request>
-
-    <Exception>
-     <?Enum list="&Formats.Exception;" using="&Format.xml;" ?>
-    </Exception>
-
-    <!-- No VendorSpecificCapabilities -->
-    <!-- No UserDefinedSymbolization -->
-
-    <!--
-
-    PUBLISHED LAYERS
-
-    -->
-    <Layer>
-     <Title>&Service.Title;</Title>
-     <?Enum list="&ReferenceSystems;" using="&RS_CRS.xml;"?>
-     <EX_GeographicBoundingBox>
-        <westBoundLongitude>-180</westBoundLongitude>
-        <eastBoundLongitude>180</eastBoundLongitude>
-        <southBoundLatitude>-90</southBoundLatitude>
-        <northBoundLatitude>90</northBoundLatitude>
-    </EX_GeographicBoundingBox>
-     <?EnumLayers using="&Layer.xml;" ?>
-    </Layer>
-   </Capability>
-  </WMS_Capabilities>
- </Define>
-
-</Definitions>
-
-<!--
-
-  WMS GetCapabilities  - XML as text/xml
-
--->
-<Response request="GetCapabilities" content-type="text/xml">
-&GetCapabilities.xml;
-</Response>
-
-<!--
-
-  WMS GetCapabilities  - XML as application/vnd.ogc.wms_xml
-
--->
-<Response request="GetCapabilities" content-type="application/vnd.ogc.wms_xml">
-&GetCapabilities.xml;
-</Response>
-
-<!--
-
-  WMS GetCapabilities  - HTML
-
--->
-<Response request="GetCapabilities" content-type="text/html">
-<html>
- <head>
-  <title>GetCapabilities Response for &Service.Title;</title>
-  &html.stylesheet;
- </head>
- <body>
-  <table border="1">
-   <tr><td class="title" colspan="2">Service Metadata - version &TemplateVersion;</td></tr>
-   <tr><td class="name">Name</td><td>&Service.Name;</td></tr>
-   <tr><td class="name">Title</td><td>&Service.Title;</td></tr>
-  <?Ifdef item="Service.Abstract"?>
-   <tr><td class="name">Abstract</td><td>&Service.Abstract;</td></tr>
-  <?Endif?>
-  <?Ifdef item="Service.Keywords"?>
-   <tr><td class="name">Keywords</td><td>
-    <?Enum list="&Service.Keywords;" using="&Format.html;"?>
-   </td></tr>
-  <?Endif?>
-   <tr><td class="name">Online Resource</td><td>&Url.OnlineResource;</td></tr>
-   <tr><td class="name">Contact Information</td><td>
-     &Service.Contact.Name;<br/>
-     &Service.Contact.Organization<br/>
-   <?Ifdef item="Service.Contact.Position"?>&Service.Contact.Position;<br/><?Endif?>
-   <?Ifdef item="Service.Contact.Address.Type"?>
-     &Service.Contact.Address.Street;<br/>
-     &Service.Contact.Address.City;, &Service.Contact.Address.StateProv;<br/>
-     &Service.Contact.Address.PostCode;<br/>
-     &Service.Contact.Address.Country;
-   <?Ifdef item="Service.Contact.Phone"?>Phone: &Service.Contact.Phone;<br/><?Endif?>
-   <?Ifdef item="Service.Contact.Fax"?>Fax: &Service.Contact.Fax;<br/><?Endif?>
-   <?Ifdef item="Service.Contact.Email"?>Email: &Service.Contact.Email;<br/><?Endif?>
-    </tr></td>
-    <?Endif?>
-  <tr><td class="name">Fees</td><td>&Service.Fees;</td></tr>
-  <tr><td class="name">Access Constraints</td><td>&Service.AccessConstraints;</td></tr>
-  <tr><td class="title" colspan="2">Capbilities</td></tr>
-  <tr><td class="name">GetCapabilities</td><td>
-   URL: &Url.GetCapabilities;<br/>
-   Formats:
-   <?Enum list="&Formats.GetCapability;" using="&Format.html;"?>
-  </td></tr>
-  <tr><td class="name">GetMap</td><td>
-   URL: &Url.GetMap;<br/>
-   Formats:
-   <?Enum list="&Formats.GetMap;" using="&Format.html;"?>
-  </td></tr>
-  <tr><td class="name">GetFeatureInfo</td><td>
-   URL: &Url.GetFeatureInfo;<br/>
-   Formats:
-   <?Enum list="&Formats.GetFeatureInfo;" using="&Format.html;"?>
-  </td></tr>
-  <tr><td class="title" colspan="2">Published Layers</td></tr>
-  <?EnumLayers using="&EnumLayer.html;"?>
-  </table>
- </body>
-</html>
-</Response>
-
-<!--
-
-  WMS GetFeatureInfo  - XML
-
--->
-<Response request="GetFeatureInfo" content-type="text/xml">
- <FeatureInfoCollection>
-  <?EnumFeatureInfo using="&FeatureInfo.xml;" ?>
- </FeatureInfoCollection>
-</Response>
-
-
-<!--
-
-  WMS GetFeatureInfo  - HTML
-
--->
-<Response request="GetFeatureInfo" content-type="text/html">
-<html>
-<head>
-<title>GetFeatureInfo</title>
-</head>
-<body>
-<table border="1">
- <?EnumFeatureInfo using="&FeatureInfo.html;" ?>
-</table>
-</body>
-</html>
-</Response>
-
-
-<!--
-
-  WMS GetFeatureInfo  - TEXT
-
--->
-<Response request="GetFeatureInfo" content-type="text/plain">
- <?EnumFeatureInfo using="&FeatureInfo.text;" ?>
-</Response>
-
-
-<!--
-
-  Exception format - XML
-
--->
-<Response request="Exception" content-type="text/xml">
-<ServiceExceptionReport version="&TemplateVersion;" 
-   xmlns="http://www.opengis.net/ogc"
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
- <ServiceException code="&Exception.Type;">
-  &Exception.message;
- </ServiceException>
-</ServiceExceptionReport>
-</Response>
-
-</Template>
+<?xml version='1.0'?>
+<Template service="WMS" version="1.3.0">
+
+<Definitions>
+
+  <!-- This defines the format of each individual layer
+      advertised by GetCapabilities                    -->
+  <!-- Note: Studio published the following metadata fields                                -->
+  <!-- Layer.Name      - The canonical machine-readable name for a layer                   -->
+  <!-- Layer.Abstract  - Free-form human readable description for the layer                -->
+  <!-- Layer.Bounds    - Structured XML in the form of one or more of these elements       -->
+  <!--                     <Bounds CRS= north= south= east= west=/>                        -->
+  <!--                     (Note: Studio currently publishes this as plain text, which     -->
+  <!--                     the template engine converts to an XML fragment; future work    -->
+  <!--                     in Studio is expected to remedy this.)                          -->
+  <!--                     (An example is shown below in Layer.BoundingBox.default)        -->
+  <!-- Layer.Cascaded  - the WMS "cascade" value, indicating whether the data came from    -->
+  <!--                     another server, or originated on this server                    -->
+  <!-- Layer.ExtendedMetadata - like Layer.Bounds, should be structured XML, but Studio    -->
+  <!--                            just writes it out as plain text.  Format: zero or more  -->
+  <!--                            <Link href= type= format= /> elements.  Currently not    -->
+  <!--                            implemented in templates.                                -->
+  <!-- Layer.Keywords  - A comma-separated list of keywords associated with this layer.    -->
+  <!-- Layer.Opaque    - boolean indicating whether the layer is opaque or transparent.    -->
+  <!-- Layer.Queryable - boolean indicating whether the layer supports GetFeatureInfo.     -->
+  <!-- Layer.Title     - The user-provided human-readable name for the layer.              -->
+  <!--                                                                                     -->
+  <!-- Layer.NoSubsets is currently not emitted by Studio, its value is defaulted within   -->
+  <!-- the OwsWmsService.config.awd file.                                                  -->
+  <Define item="Layer.xml">
+  <!-- Published Layer #&Layer.iteration; -->
+  <Layer queryable="&Layer.Queryable;" cascaded="&Layer.Cascaded;" noSubsets="&Layer.NoSubsets;" opaque="&Layer.Opaque;">
+   <Name>&Layer.Name;</Name>
+   <Title>&Layer.Title;</Title>
+   <?Ifdef item="Layer.Abstract"?><Abstract>&Layer.Abstract;</Abstract><?Endif?>
+   <?Ifdef item="Layer.Keywords"?>
+   <KeywordList>
+     <?EnumDelim list="&Layer.Keywords;" using="&Service.Keywords.xml;"?>
+   </KeywordList>
+   <?Endif?>
+   <?Ifdef item="Layer.Bounds"?>
+    <?Enum list="&Layer.Bounds;" item="Bounds" using="&CRS.xml;"?>
+    <?Enum list="&Layer.Bounds;" item="Bounds" using="&EX_GeographicBoundingBox.xml;"?>
+    <?Enum list="&Layer.Bounds;" item="Bounds" using="&BoundingBox.xml;"?>
+   <?Else?>
+    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&CRS.xml;"?>
+    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&EX_GeographicBoundingBox.xml;" ?>
+    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&BoundingBox.xml;" ?>
+   <?Endif?>
+  </Layer>
+ </Define>
+
+ <!-- An example of what can be expected in the Layer.Bounds definition -->
+ <Define item="Layer.BoundingBox.default">
+  <Bounds CRS="EPSG:4326" west="-180" south="-90" east="180" north="90"/>
+ </Define>
+
+ <!-- This pair of definitions works around a current limitation that -->
+ <!-- <?If...?><?Endif?> cannot be nested.                            -->
+ <Define item="EX_GeographicBoundingBox.xml">
+    <?Translate text="&Enum.item.CRS;" with="&EX_GeographicBoundingBox.translate.xml;"?>
+ </Define>
+
+ <Define item="EX_GeographicBoundingBox.translate.xml">
+    <translate from="EPSG:4326" ?>
+        <EX_GeographicBoundingBox>
+            <westBoundLongitude>&Enum.item.west;</westBoundLongitude>
+            <eastBoundLongitude>&Enum.item.east;</eastBoundLongitude>
+            <southBoundLatitude>&Enum.item.south;</southBoundLatitude>
+            <northBoundLatitude>&Enum.item.north;</northBoundLatitude>
+        </EX_GeographicBoundingBox>
+    </translate>
+    <translate></translate>
+</Define>
+
+ <Define item="BoundingBox.xml">
+  <BoundingBox CRS="&Enum.item.CRS;" minx="&Enum.item.west;" miny="&Enum.item.south;" maxx="&Enum.item.east;" maxy="&Enum.item.north;"/>
+ </Define>
+
+ <Define item="CRS.xml">
+  <CRS>&Enum.item.CRS;</CRS>
+ </Define>
+
+ <Define item="FeatureInfo.xml">
+  <?Ifdef item="FeatureInfo.LayerName"?>
+  <FeatureInfo layer="&FeatureInfo.LayerName;">
+  <?Else?>
+  <FeatureInfo>
+  <?Endif?>
+  <?EnumFeatureProperties using="&FeatureProperty.xml;" ?>
+  </FeatureInfo>
+ </Define>
+
+ <Define item="FeatureInfo.html">
+  <tr>
+   <td>
+    <table>
+     <?EnumFeatureProperties using="&FeatureProperty.html;" ?>
+    </table>
+   </td>
+  </tr>
+ </Define>
+
+ <Define item="FeatureInfo.text">
+  FeatureInfo:
+  <?EnumFeatureProperties using="&FeatureProperty.text;" ?>
+
+ </Define>
+
+ <Define item="FeatureProperty.xml">
+  <Property name="&FeatureProperty.Name;" value="&FeatureProperty.Value;"></Property>
+ </Define>
+
+ <Define item="FeatureProperty.html">
+  <tr><td class="name">&FeatureProperty.Name;</td><td>&FeatureProperty.Value;</td></tr>
+ </Define>
+
+ <Define item="FeatureProperty.text">
+  &FeatureProperty.Name;=&FeatureProperty.Value;
+ </Define>
+
+ <!-- We're currently not supporting child layers... -->
+ <Define item="Layer.Sublayers"></Define>
+
+ <!-- In this version, keywords are enumerated enclosed in Keyword elements -->
+ <Define item="Service.Keywords.xml"><Keyword>&Enum.item;</Keyword>
+ </Define>
+
+ <!-- Overrides of default Exception formats
+  specific to this version template -->
+ <Define item="Formats.Exception">
+  <item>XML</item>
+ </Define>
+
+ <!-- These are the supported (Get)Capabilities formats
+  for version 1.1.1.     -->
+ <Define item="Formats.GetCapabilities">
+  <item>text/xml</item>
+  <item>text/html</item>
+ </Define>
+
+ <Define item="GetCapabilities.xml">
+  <WMS_Capabilities version="&TemplateVersion;"
+    xmlns="http://www.opengis.net/wms"
+    xmlns:xlink="http://www.w3.org/1999/xlink"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd">
+   <!--
+
+   SERVICE METADATA
+
+   -->
+   <Service>
+    <Name>&Service.Name;</Name>
+    <Title>&Service.Title;</Title>
+    <?Ifdef item="Service.Abstract"?>
+    <Abstract>&Service.Abstract;</Abstract>
+    <?Endif?>
+    <?Ifdef item="Service.Keywords"?>
+    <KeywordList>
+     <?Enum list="&Service.Keywords;" using="&Service.Keywords.xml"?>
+    </KeywordList>
+    <?Endif?>
+    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.OnlineResource;"></OnlineResource>
+
+    <ContactInformation>
+     <ContactPersonPrimary>
+      <ContactPerson>&Service.Contact.Name;</ContactPerson>
+      <ContactOrganization>&Service.Contact.Organization;</ContactOrganization>
+     </ContactPersonPrimary>
+     <?Ifdef item="Service.Contact.Position"?>
+     <ContactPosition>&Service.Contact.Position;</ContactPosition>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Address.Type"?>
+     <ContactAddress>
+      <AddressType>&Service.Contact.Address.Type;</AddressType>
+      <Address>&Service.Contact.Address.Street;</Address>
+      <City>&Service.Contact.Address.City;</City>
+      <StateOrProvince>&Service.Contact.Address.StateProv;</StateOrProvince>
+      <PostCode>&Service.Contact.Address.PostCode;</PostCode>
+      <Country>&Service.Contact.Address.Country;</Country>
+     </ContactAddress>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Phone"?>
+     <ContactVoiceTelephone>&Service.Contact.Phone;</ContactVoiceTelephone>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Fax"?>
+     <ContactFacsimileTelephone>&Service.Contact.Fax;</ContactFacsimileTelephone>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Email"?>
+     <ContactElectronicMailAddress>&Service.Contact.Email;</ContactElectronicMailAddress>
+     <?Endif?>
+    </ContactInformation>
+
+    <Fees>&Service.Fees;</Fees>
+    <AccessConstraints>&Service.AccessConstraints;</AccessConstraints>
+   </Service>
+
+   <!--
+
+   SERVICE CAPABILITIES
+
+   -->
+   <Capability>
+
+    <Request>
+     <GetCapabilities>
+      <?Enum list="&Formats.GetCapabilities;" using="&Format.xml;" ?>
+      <DCPType>
+       <HTTP>
+        <Get>
+        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetCapabilities;?"/>
+        </Get>
+       </HTTP>
+      </DCPType>
+     </GetCapabilities>
+
+     <GetMap>
+      <?Enum list="&Formats.GetMap;" using="&Format.xml;" ?>
+      <DCPType>
+       <HTTP>
+        <Get>
+        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetMap;?"/>
+        </Get>
+       </HTTP>
+      </DCPType>
+     </GetMap>
+
+     <GetFeatureInfo>
+      <?Enum list="&Formats.GetFeatureInfo;" using="&Format.xml;" ?>
+      <DCPType>
+       <HTTP>
+        <Get>
+        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetFeatureInfo;?"/>
+        </Get>
+       </HTTP>
+      </DCPType>
+     </GetFeatureInfo>
+
+    </Request>
+
+    <Exception>
+     <?Enum list="&Formats.Exception;" using="&Format.xml;" ?>
+    </Exception>
+
+    <!-- No VendorSpecificCapabilities -->
+    <!-- No UserDefinedSymbolization -->
+
+    <!--
+
+    PUBLISHED LAYERS
+
+    -->
+    <Layer>
+     <Title>&Service.Title;</Title>
+     <?Enum list="&ReferenceSystems;" using="&RS_CRS.xml;"?>
+     <EX_GeographicBoundingBox>
+        <westBoundLongitude>-180</westBoundLongitude>
+        <eastBoundLongitude>180</eastBoundLongitude>
+        <southBoundLatitude>-90</southBoundLatitude>
+        <northBoundLatitude>90</northBoundLatitude>
+    </EX_GeographicBoundingBox>
+     <?EnumLayers using="&Layer.xml;" ?>
+    </Layer>
+   </Capability>
+  </WMS_Capabilities>
+ </Define>
+
+</Definitions>
+
+<!--
+
+  WMS GetCapabilities  - XML as text/xml
+
+-->
+<Response request="GetCapabilities" content-type="text/xml">
+&GetCapabilities.xml;
+</Response>
+
+<!--
+
+  WMS GetCapabilities  - XML as application/vnd.ogc.wms_xml
+
+-->
+<Response request="GetCapabilities" content-type="application/vnd.ogc.wms_xml">
+&GetCapabilities.xml;
+</Response>
+
+<!--
+
+  WMS GetCapabilities  - HTML
+
+-->
+<Response request="GetCapabilities" content-type="text/html">
+<html>
+ <head>
+  <title>GetCapabilities Response for &Service.Title;</title>
+  &html.stylesheet;
+ </head>
+ <body>
+  <table border="1">
+   <tr><td class="title" colspan="2">Service Metadata - version &TemplateVersion;</td></tr>
+   <tr><td class="name">Name</td><td>&Service.Name;</td></tr>
+   <tr><td class="name">Title</td><td>&Service.Title;</td></tr>
+  <?Ifdef item="Service.Abstract"?>
+   <tr><td class="name">Abstract</td><td>&Service.Abstract;</td></tr>
+  <?Endif?>
+  <?Ifdef item="Service.Keywords"?>
+   <tr><td class="name">Keywords</td><td>
+    <?Enum list="&Service.Keywords;" using="&Format.html;"?>
+   </td></tr>
+  <?Endif?>
+   <tr><td class="name">Online Resource</td><td>&Url.OnlineResource;</td></tr>
+   <tr><td class="name">Contact Information</td><td>
+     &Service.Contact.Name;<br/>
+     &Service.Contact.Organization<br/>
+   <?Ifdef item="Service.Contact.Position"?>&Service.Contact.Position;<br/><?Endif?>
+   <?Ifdef item="Service.Contact.Address.Type"?>
+     &Service.Contact.Address.Street;<br/>
+     &Service.Contact.Address.City;, &Service.Contact.Address.StateProv;<br/>
+     &Service.Contact.Address.PostCode;<br/>
+     &Service.Contact.Address.Country;
+   <?Ifdef item="Service.Contact.Phone"?>Phone: &Service.Contact.Phone;<br/><?Endif?>
+   <?Ifdef item="Service.Contact.Fax"?>Fax: &Service.Contact.Fax;<br/><?Endif?>
+   <?Ifdef item="Service.Contact.Email"?>Email: &Service.Contact.Email;<br/><?Endif?>
+    </tr></td>
+    <?Endif?>
+  <tr><td class="name">Fees</td><td>&Service.Fees;</td></tr>
+  <tr><td class="name">Access Constraints</td><td>&Service.AccessConstraints;</td></tr>
+  <tr><td class="title" colspan="2">Capbilities</td></tr>
+  <tr><td class="name">GetCapabilities</td><td>
+   URL: &Url.GetCapabilities;<br/>
+   Formats:
+   <?Enum list="&Formats.GetCapability;" using="&Format.html;"?>
+  </td></tr>
+  <tr><td class="name">GetMap</td><td>
+   URL: &Url.GetMap;<br/>
+   Formats:
+   <?Enum list="&Formats.GetMap;" using="&Format.html;"?>
+  </td></tr>
+  <tr><td class="name">GetFeatureInfo</td><td>
+   URL: &Url.GetFeatureInfo;<br/>
+   Formats:
+   <?Enum list="&Formats.GetFeatureInfo;" using="&Format.html;"?>
+  </td></tr>
+  <tr><td class="title" colspan="2">Published Layers</td></tr>
+  <?EnumLayers using="&EnumLayer.html;"?>
+  </table>
+ </body>
+</html>
+</Response>
+
+<!--
+
+  WMS GetFeatureInfo  - XML
+
+-->
+<Response request="GetFeatureInfo" content-type="text/xml">
+ <FeatureInfoCollection>
+  <?EnumFeatureInfo using="&FeatureInfo.xml;" ?>
+ </FeatureInfoCollection>
+</Response>
+
+
+<!--
+
+  WMS GetFeatureInfo  - HTML
+
+-->
+<Response request="GetFeatureInfo" content-type="text/html">
+<html>
+<head>
+<title>GetFeatureInfo</title>
+</head>
+<body>
+<table border="1">
+ <?EnumFeatureInfo using="&FeatureInfo.html;" ?>
+</table>
+</body>
+</html>
+</Response>
+
+
+<!--
+
+  WMS GetFeatureInfo  - TEXT
+
+-->
+<Response request="GetFeatureInfo" content-type="text/plain">
+ <?EnumFeatureInfo using="&FeatureInfo.text;" ?>
+</Response>
+
+
+<!--
+
+  Exception format - XML
+
+-->
+<Response request="Exception" content-type="text/xml">
+<ServiceExceptionReport version="&TemplateVersion;" 
+   xmlns="http://www.opengis.net/ogc"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
+ <ServiceException code="&Exception.Type;">
+  &Exception.message;
+ </ServiceException>
+</ServiceExceptionReport>
+</Response>
+
+</Template>


Property changes on: trunk/MgDev/Server/src/Wms/1.3.0.xml.awd
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/localized/help/en/style/adsk.cpm.css
===================================================================
--- trunk/MgDev/Web/src/localized/help/en/style/adsk.cpm.css	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/localized/help/en/style/adsk.cpm.css	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,1453 +1,1453 @@
-/* Consolidation of many .css files. Controls the pages in the files folder */
-
-
-body {
-background-color: #fff;
-font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
-font-size: 10pt;
-font-style: normal;
-font-weight: normal;
-color: #000;
-letter-spacing: normal;
-word-spacing: normal;
-text-align: left;
-text-indent: 0pt;
-margin: 0;
-height: 100%;
-}
-
-p {
-margin-bottom: 0px;
-}
-
-div.body_content {
-margin: 0 12pt;	
-}
-
-/* ----------------------------------------------------------------------------
-										Link styles
- ---------------------------------------------------------------------------- */
-
-a:link, a:active {color: #00289C; text-decoration: none;}
-a:visited {color: #00289C; text-decoration: none;}
-a:hover {color: #CE9E08; text-decoration: underline;}
-
-/* ----------------------------------------------------------------------------
-										Table styles
- ---------------------------------------------------------------------------- */
-
-table {
-background-color: transparent;
-margin-top: 5pt;
-font-size: 10pt;
-
-
-}
-
-
-p.table-title {
-font-weight: bold;
-color: #338;
-}
-
-p.table-title + table.table{
-margin-top: -5pt;
-} /* Table after it's title should have small top margin */
-
-table.table th {
-background-color: #ccc;
-font-weight: bold;
-}
-
-/*Head row cells*/
-table.table tr td {
-vertical-align: top;
-
-} /*Body cells*/
-
-table.ruled, table.ruled-wide { 
-width: 97%; 
-margin: 1.4em 0; 
-border-bottom: 3px solid #3D3D3D; 
-border-top: 4px solid #3D3D3D; 
-background-color: #F2F2F2; 
-}
-
-table.ruled th, table.ruled-wide th  { 
-color: white; 
-background-color: #3D3D3D; 
-padding: 4px 10px 7px 12px; 
-vertical-align: middle;
-}
-
-
-table.ruled td, table.ruled-wide td { 
-padding: 6px 10px 7px 12px; 
-border-bottom: 1px solid #3D3D3D;
-vertical-align: baseline;
-}
-
-tr.RuledHeading, tr.RuledWideHeading {
-background-color: transparent;
-}
-
-tr.RuledEvenRow, tr.RuledWideEvenRow {
-background-color: transparent;
-}
-
-tr.RuledOddRow, tr.RuledWideOddRow {
-background-color: transparent;
-}
-
-th.table-heading {
-font-size: 10pt;
-text-align: left;
-font-weight: bold;
-color: #3D3D3D;
-}
-
-/* Unruled Tables */ 
-
-table.not-ruled, table.not-ruled-wide { 
-width: 97%;
-margin: 1em 0; 
-}
-
-table.not-ruled th, table.not-ruled-wide th { 
-color: #338;
-padding: 4px 20px 2px 0;
-vertical-align: text-bottom;
-}
-
-table.not-ruled td, table.not-ruled-wide td { 
-padding: 4px 20px 2px 0;
-vertical-align: top;
-}
-table.not-ruled td div.figure-anchor, 
-table.not-ruled-wide td div.figure-anchor {
-margin-top: 5pt;	
-}
-
-
-
-/* tables in list elements */
-li table.ruled, li table.ruled-wide, li table.not-ruled, li table.not-ruled-wide {
-width: 0;
-}
-
-/* paras within tables */
-table.ruled p, table.ruled-wide p, table.not-ruled p, table.not-ruled-wide p {
-margin: 2pt 0;
-}
-
-/* div.note_xx within tables */
-table.ruled div.note-note, 
-table.ruled-wide div.note-note, 
-table.not-ruled div.note-note, 
-table.not-ruled-wide div.note-note {
-margin: 2pt 0;
-}
-
-/* ul's within tables*/
-table.ruled ul, table.ruled-wide ul, table.not-ruled ul, table.not-ruled-wide ul {
-margin: 6pt 0 0 12pt;
-list-style-type: disc;
-}
-table.ruled ul p, table.ruled-wide ul p, table.not-ruled ul p, table.not-ruled-wide ul p {
-margin-top: 6pt;
-}
-table.ruled ul li, table.ruled-wide ul li, table.not-ruled ul li, table.not-ruled-wide ul li {
-margin: 4pt 0 0 0;
-}
-
-/* ol's within tables */
-table.ruled ol, table.ruled-wide ol, table.not-ruled ol, table.not-ruled-wide ol {
-margin: 6pt 0 0 18pt;
-}
-table.ruled ol p, table.ruled-wide ol p, table.not-ruled ol p, table.not-ruled-wide ol p {
-margin-top: 6pt;
-}
-table.ruled ol li, table.ruled-wide ol li, table.not-ruled ol li, table.not-ruled-wide ol li {
-margin: 4pt 0 0 0;
-}
-
-
- at media print {
-
-    table.ruled-wide th.table-heading {
-    color: #3D3D3D;
-    background-color: transparent;
-    padding-top: 4pt;
-    border-bottom: 4px solid #3D3D3D;
-    }
-
-} /* @media print */
-
-
-p.table-body {} /* Paragraph within table body */
-p.table-heading {} /* Paragraph within table body */
-p.table-footing {} /* Paragraph within table body */
-
-/* data table */
-/* also used in dialog box topics */
-table.ref-data {
-margin: 0;
-border: none;
-font-size: 9pt;
-}
-
-/* data table td */
-table.ref-data td {
-padding: 0 0 12pt 0;
-width: 0;
-}
-
-
-
-
-
-/* ----------------------------------------------------------------------------
-										List styles
- ---------------------------------------------------------------------------- */
-
-ul {
-margin: 6pt 0 0 12pt;
-list-style-type: disc;
-}
-
-ul p {
-margin-top: 6pt;
-}
-
-ul li {
-margin: 10pt 0 0 6pt;
-}
-
-ul.bullet_no {
-list-style-type: none;
-}
-
-ol {
-margin: 6pt 0 0 18pt;
-}
-
-ol p {
-margin-top: 6pt;
-}
-
-ol li {
-margin: 10pt 0 0 0;
-padding-left: 0pt;
-}
-
-div.single_step_instruction ol {
-list-style-image: url(../images/ac.menuaro.gif);
-}
-
-div.see-also ul ul {
-margin-left: 0px;
-}
-
-div.see-also li {
-margin-top: 4pt;
-}
-
-div.see-also {
-margin-top: 18pt;
-padding-top: 2pt;
-border-top: 1px solid #449;
-}
-
-span.see-also {
-color: #338;
-font-weight: bold;
-}
-
-div.topic-list li {
-margin-top: 4pt;
-}
-
-div.dl_section {
-margin-left: 30pt;
-}
-
-/* section titles (break heads within topics) */
-div.dl_section p.title,
-div.dl_section p.section_title_h1,
-div.section p.section_title_h1 {
-background-color: #959595;
-font-weight: bold;
-font-size: 10pt;
-color: #fff;
-padding: 2pt 6pt 3pt 4pt;
-margin-top: 20pt;
-}
-
- at media print {
-
-    div.dl_section p.title,
-    div.dl_section p.section_title_h1,
-    div.section p.section_title_h1 {
-    background-color: transparent;
-    padding-left: 0pt;
-    }
-
-}
-
-dl {}
-
-dl p {
-margin-top: 6pt;
-}
-
-dt {
-margin-top: 12pt;
-margin-bottom: 0px;
-}
-
-dd {
-margin-top: 0pt;
-margin-bottom: 0px;
-}
-
-ul.jumplist {
-margin-left: 10pt;
-margin-bottom: 10pt;
-}
-
-ol[start] {
-margin-top: 2pt
-} /* continued list */
-
-div.list-intro {
-font-size: 10pt;
-margin-bottom: 5pt;
-font-weight: bold;
-color: #990000;
-}
-
-div.enclosed-list {
-margin-top: -5pt;
-padding: 0 0 0 15pt;
-} /* Block to indent enclosed lists */
-
-div.enclosed-list div.list-intro {
-padding-top: 10pt;
-} /* Subsequent list into */
-
-div.enclosed-list ul {
-margin: 0;
-}
-
-div.enclosed-list ol {
-margin: 0;
-}
-
-div.topic-list h4.related {
-font-weight: bold;
-font-size: 10pt;
-color: #338;
-margin: 16pt 0 8pt 0;
-}
-
-div.topic-list {
-font-size: 10pt;
-padding: 0;
-}
-
-
-.topiclist-litem {
-margin-bottom: 6pt;
-}
-
-/* definition list */
-table.dl {
-font-size: 10pt;
-}
-
-/* in a definition list, a term-definition pair */
-tr.dl-pair {
-}
-
-td.term {
-width: 100pt;
-vertical-align: baseline;
-padding: 0 12pt 0 0;
-}
-
-td.definiton {
-vertical-align: baseline;
-padding: 0;
-}
-
-/* Civil 3D quick reference sections */
-
-div.section {
-margin-top: 12pt;
-}
-
-span.term {
-font-size: 10pt;
-font-weight: bold;
-color: #36c;
-}
-
-div.definition {
-margin-bottom: 10pt;
-}
-
-div.definition p {
-margin-top: 4pt;
-}
-
-div.definition ul {
-margin-top: 0pt;
-}
-
-div.definition li {
-margin-top: 4pt;
-}
-/* definition links (glossary links) */
-span.term a {
-color: green;    /* 'green' = #070 */
-text-decoration: none;
-border-bottom: 1px dotted green;
-}
-
-/* definition links */
-span.term a:visited {
-color: green;
-}
-
-/* collapsible */
-
-div.collapsible {
-margin-top: 10pt;
-margin-bottom: 5pt;
-}
-
-img.collapsible {
-cursor: pointer;
-}
-
-div.collapsible-section {
-}
-
-span.collapsible-section-title {
-color: #027;
-font-size: 10pt;
-font-weight: bold;
-padding-left: 5px;
-cursor: pointer;
-}
-/* ----------------------------------------------------------------------------
-										Note styles
- ---------------------------------------------------------------------------- */
-
-div.note-note, 
-div.note-warning, 
-div.note-tip, 
-div.note-related, 
-div.note-important, 
-div.note-bestpractice {
-margin-top: 10pt;
-margin-bottom: 0px;
-}
-
-/* Notes within table */
-table.table div.note-note, 
-table.table div.note-warning, 
-table.table div.note-tip, 
-table.table div.note-related, 
-table.table div.note-important, 
-table.table div.note-bestpractice {
-padding-top: 5px;
-padding-bottom: 5px;
-font-size: 9pt;
-}
-/* Notes within lists */
-
-li div.note-note, 
-li div.note-warning, 
-li div.note-tip, 
-li div.note-related, 
-li div.note-important, 
-li div.note-bestpractice {
-margin-left: 0pt;
-margin-top: 2pt;
-margin-bottom: 8pt;
-}
-
-/*  Note label styles */
-div.note-important span.label {
-color: #c00;
-font-size: 9pt;
-font-weight: bold;
-padding-right: 5px;
-}
-
-div.note-warning span.label {
-color: #c00;
-font-size: 9pt;
-font-weight: bold;
-padding-right: 5px;
-}
-
-div.note-note span.label {
-color: #338;
-font-size: 9pt;
-font-weight: bold;
-padding-right: 5px;
-}
-
-div.note-tip span.label {
-color: #338;
-font-size: 9pt;
-font-weight: bold;
-padding-right: 5px;
-}
-
-div.note-related span.label {
-color: #027;
-font-size: 9pt;
-font-weight: bold;
-padding-right: 5px;
-}
-
-div.note-important span.label {
-color: #c00;
-font-size: 9pt;
-font-weight: bold;
-padding-right: 5px;
-}
-
-div.note-bestpractice span.label {
-color: #c00;
-font-size: 9pt;
-font-weight: bold;
-padding-right: 5px;
-}
-
-/* ---------------------------------------------------------------------------------------------
-                                        Code elements
- --------------------------------------------------------------------------------------------- */
-span.code, 
-div.codeBlock, 
-p.codeLine, 
-p.codeComment, 
-span.codeLiteral {
-font-family: "Courier New", Courier, monospace;
-font-size: 10pt;
-font-style: normal;
-font-weight: normal;
-}
-
-span.code {}
-
-div.codeBlock div.codeBlock {
-margin-left: 30pt;
-} /* Only descendant code blocks should have indents */
-
-p.codeLine, 
-p.codeComment {
-padding: 1px;
-margin: 1px;
-}
-
-p.codeSpace {}
-
-span.codeLiteral {}
-
-div.codeBlock {
-margin-top: 8pt;
-padding: 8pt;
-background: #feb;
-}
-/* Fixes word wrap in code block */
-pre {
-white-space: pre; /* CSS2 */
-white-space: -moz-pre-wrap; /* Mozilla */
-white-space: -hp-pre-wrap; /* HP printers */
-white-space: -o-pre-wrap; /* Opera 7 */
-white-space: -pre-wrap; /* Opera 4-6 */
-white-space: pre-wrap; /* CSS 2.1 */
-white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
-word-wrap: break-word; /* IE */
-}
-
-div.codeBlock pre.codeLine {
-margin-top: 0pt;
-margin-bottom: 0pt;
-}
-
- at media print {
-
-    div.codeBlock {
-    background: #fff;
-    border: 1px solid #000;
-    }
-
-} /* @media print */
-
-
-/* ---------------------------------------------------------------------------------------------
-							Charspan
---------------------------------------------------------------------------------------------- */
-span.charspan-keyboardEntry {}
-
-span.charspan-strong {
-font-weight: bold;
-}
-
-span.charspan-special {}
-
-/*
-Note that CharSpan[@class='Emphasis'], CharSpan[@class='Subscript'] and CharSpan[@class='Superscript'] elements
-are being formatted as <em>, <sub> and <sub> html elements so please change element css definitions instead of class
-*/
-
-/* ---------------------------------------------------------------------------------------------
-							Emphasis
---------------------------------------------------------------------------------------------- */
-em, em.mild {
-font-style: italic;
-}
-
-em.strong {
-font-style: normal;
-font-weight: bold;
-}
-
-em.extreme {
-font-style: italic;
-font-weight: bold;
-}
-
-/* ---------------------------------------------------------------------------------------------
-							UIString
---------------------------------------------------------------------------------------------- */
-span.uis-promptMessage {
-font-style: normal;
-font-weight: bold;
-}
-
-span.uis-dialogCaption {
-font-style: normal;
-font-weight: bold;
-}
-
-span.uis-entryField {
-font-style: normal;
-font-weight: bold;
-}
-
-span.uis-menuText {}
-
-span.uis-stringTable {}
-
-span.uis-unspecified {}
-
-/* -------------------------------------------------------------------------------------------
-							Comments
-------------------------------------------------------------------------------------------- */
-div.comments-editor {
-font-weight: bold;
-color: red;
-}
-
-div.comments-localizer {
-font-weight: bold;
-color: red;
-}
-
-div.comments-special {
-font-weight: bold;
-color: red;
-}
-
-div.comments-author {
-color: #cc0000;
-margin-left: 24pt;
-margin-right: 48pt;
-}
-
-/* ------------------------------------------------------------------------------------------
-							Misc
------------------------------------------------------------------------------------------- */
-.title, 
-.list-intro {
-font-weight: bold;
-color: #990000;
-margin-top: 10pt;
-margin-bottom: -5pt;
-}
-
-p.title {
-font-weight: bold;
-font-size: 10pt;
-color: #338;
-margin: 16pt 0 0 0;
-}
-
-p.section_title_h1 {
-font-weight: bold;
-font-size: 10pt;
-color: #338;
-margin: 16pt 0 0 0;
-
-}
-
-p.list-intro {
-font-weight: bold;
-font-size: 10pt;
-color: #338;
-margin: 16pt 0 0 0;
-
-}
-
-p.prompt {
-margin-left: 12pt;
-color: #00c;
-}
-
-p.entryField {
-font-style: normal;
-font-weight: bold;
-} 	/* The same as 'uis-entryField'? */
-
-span.keyboardEntry { } 	/* The same as 'charspan-keyboardEntry'? */
-
-span.keyCaps {
-font-style: normal;
-font-weight: bold;
-}
-
-span.filePath {
-font-style: italic;
-}
-
-span.appSetting {}
-
-span.bookTitle {}
-
-span.coord {}
-
-span.codeIdentifier {}
-
-span.dialogCaption{
-font-style: italic;
-}
-
-span.menuText{
-font-style: normal;
-font-weight: bold;
-}
-
-span.glyphCopyright {}
-
-span.glyphTM {}
-
-span.glyphArrow {}
-
-span.glyphEllipsis {}
-
-span.glyphSpecial {}
-
-span.glyphRegistered {}
-
-span.glyph_additional {
-font-family: Symbol;
-}
-span.glyph_square {
-font-family: Wingdings;
-}
-
-a.webLink {}
-
-span.fileName {}
-
-span.term {
-font-size: 10pt;
-font-weight: bold;
-color: #36c;
-}
-
-dd div.definition { }
-
-dd div.brief_example {
-font-size: 9pt;
-color: #000;
-background-color : #77aacc;
-padding: 7pt 15pt;
-margin: 0pt;
-}
-
-div.section {}
-
-p.summary {}
-
-/* -----------------------------------------------------------------------------------------------
-								Topic heading elements
- ----------------------------------------------------------------------------------------------- */
-
-/* head region */
-div.head {
-font-family: arial;
-background-color: #000000;
-margin: 0;
-width: 100%;
-background-image: url(../images/product_name.gif);
-background-repeat: no-repeat;
-background-position: 15px 14px;
-}
-
- at media print {
-
-   div.head {
-   background-image: none;
-   }
-
-} /* @media print */
-
-/* head block - sets head region margins */
-div.head-block {
-padding-top: 2pt;
-}
-
-/* nav group - contains browse buttons */
-div.nav-group {
-position: relative;
-height: 30px;
-}
-
- at media print {
-
-   div.nav-group {
-   display: none;
-   }
-
-} /* @media print */
-
-/* ask-me stuff */
-
-form.ask-me {
-width: 275px;
-padding: 0px;
-margin: 0px;
-height: 0px;
-float: left;
-}
-
-input.ask-me-image {
-cursor:  pointer;
-margin: 2pt 0;
-height: 21px;
-}
-
-input.ask-me-text {
-width: 160pt;
-padding: 1pt 0 0 5px;
-height: 23px;
-margin-bottom: 2pt;
-}
-
-/* link to parent topic */
-
-div.head-parent-link span.head-parent-link {
-font-weight: normal;
-font-style: normal;
-font-family: verdana;
-font-size: 8pt;
-}
-
-div.head-parent-link a {
-color: #347;
-text-decoration: underline;
-}
-
-div.head-parent-link a:hover {
-color: #347;
-text-decoration: underline;
-}
-
-div.head-parent-link a:visited {
-color: #347;
-text-decoration: underline;
-}
-
-/* browse button set */
-
-div.browse {
-position: absolute;
-right: 0px;
-padding: 10px 12px 1px 0;
-}
-
-/* browse button images */
-div.browse img {
-margin-left: 2px;
-}
-
-/* browse button info bar */
-div.button-info {
-text-align: right;
-font-size: 8pt;
-height: 15px;
-}
-
-/* browse button info text */
-span#infoline {
-padding: 1px 15px 1px 0;
-/*visibility: hidden;*/
-color: #959595;
-width: 100%;
-text-align: right;
-}
-
-/* bread crumbs */
-
-div.ancestry {
-color: #959595;
-background-color: #212121;
-margin: 2px 0 0 0;
-padding: 1px 0 5px 17px;
-font-size: 8pt;
-}
-
-div.ancestry a {
-color: #959595;
-text-decoration: none;
-}
-
-div.ancestry a:link {
-color: #959595;
-text-decoration: none;
-}
-
-div.ancestry a:visited {
-color: #959595;
-text-decoration: none;
-}
-
-div.ancestry a:hover {
-text-decoration: underline;
-color: white;
-}
-
- at media print {
-
-    div.ancestry {
-    display: none;
-    }
-
-} /* @media print */
-
-/* head-text bar */
-div.head-text {
-background-color: #3d3d3d;
-padding: 8px 18px 8px 16px;
-/*height: 40px;*/
-}
-
-/* head-text */
-div.head-text span {
-color: #fff;
-font-size: 16pt;
-line-height: 18pt;
-}
-
- at media print {
-
-   div.head-text span {
-   font-size: 18pt;
-   color: #666;
-   filter: glow-off;
-   }
-
-} /* @media print */
-
-/* collapse-expand block */
-/* contains the collapse block () and the expand block (), only 
-   one of which is visible depending on collapse-expand state */
-div.collapse-expand {
-width: 200px;
-float: right;
-font-weight: normal;
-white-space: nowrap;
-position: relative;
-top: -6px;
-}
-
- at media print {
-
-    div.collapse-expand {
-    display: none;
-    }
-
-} /* @media print */
-
-/* collapse block */
-/* initial state: hidden */
-div#collapseAllSection {
-display: none;
-}
-
-/* expand block */
-/* initial state: hidden */
-div#expandAllSection {
-display: none;
-}
-
-/* collapse-expand images */
-img.expandcollapse_img {
-display: none;
-}
-
-/* collapse-expand label */
-div.collapse-expand-label {
-text-align: right;
-width: 100%;
-position: absolute;
-top: -4px;
-right: 0px;
-padding: 0px;
-margin: 0px;
-}
-
-div.collapse-expand-label span {
-font-weight: normal;
-color: #959595;
-cursor: pointer;
-font-size: 10px
-}
-
-/* collapse-expand description */
-div.collapse-expand-description {
-font-weight: normal;
-color: #959595;
-text-align: right;
-width: 100%;
-position: absolute;
-top: 15px;
-right: 0px;
-padding: 0px 0 0 10px;
-margin: 0px;
-}
-
-/* -----------------------------------------------------------------------------------------------
-                                               Head Tabs elements
- ----------------------------------------------------------------------------------------------- */
-
-/* head tabs */
-div.head-tabs {
-background-image: url(../images/tab-bkg.gif);
-}
-
-/* head-tab table */
-div.head-tabs table {
-font-size: 10pt;
-color: #fff;
-margin: 0px;
-padding: 0px;
-background: transparent;
-border: none;
-}
-
-/* head-tab row */
-div.head-tabs tr {
-vertical-align: middle;
-height: 28px;
-}
-
- at media print {
-
-    div.head-tabs table {
-    margin-left: 2px;
-    }
-
-    div.head-tabs tr {
-    position: relative;
-    left: -2px;
-    }
-
-}
-
-/* head-tab */
-div.head-tabs td {
-border-right: 0;
-padding: 0;
-}
-
-/* head-tab sides */
-td.tab-edge {
-background-color: #fff;
-display: inline;
-padding: 0;
-border-right: 0;
-}
-
- at media print {
-
-   td.tab-edge {
-   display: none;
-   }
-
-} /* @media print */
-
-/* head-tab, selectable */
-td.tab {
-background-image: url(../images/tab-bkg2.gif);
-padding: 0 1em;
-cursor: pointer;
-vertical-align: middle;
-}
-
- at media print {
-
-    td.tab {
-    border: none;
-    background-image: none;
-    }
-
-} /* @media print */
-
-/* head-tab, selected */
-td.tab-active {
-background-color: #fff;
-cursor: default;
-vertical-align: middle;
-background-image: url(../images/tab-bkg-xn.gif); 
-background-repeat: repeat;
-}
-
- at media print {
-
-    td.tab-active {
-    border: none;
-    background-image: none;
-    }
-
-} /* @media print */
-
-/* head-tab bodies, dimmed */
-td.tab-disabled {
-padding: 0 1em;
-background-image: url(../images/tab-bkg-o.gif);
-cursor: default;
-vertical-align: middle;
-}
-
-/* head-tab text */
-td.tab span {
-color: #0033BB;
-text-decoration: underline;
-width: 100%;
-padding: 0px;
-}
-
- at media print {
-
-    td.tab span {
-    color: #666;
-    }
-
-} /* @media print */
-
-/* head-tab text, selected */
-td.tab-active span {
-color: #000;
-font-weight: bold;
-padding: 0px;
-position: relative;
-top: 0px;
-}
-
-/* head-tab text, dimmed */
-td.tab-disabled span {
-width: 100%;
-color: #666;
-position: relative;
-top: 0px;
-visibility: hidden;
-}
-
-/* head-region bottom margin */
-div.head-margin {
-line-height: 0pt;
-padding-bottom: 6pt;
-}
-
-/* Temporary fix for grey lines in Quick Reference Tabs */
-div.quickReferenceList div.section p.section_title_h1  {
-  background-color: #FFFFFF
-}
-
-/* -----------------------------------------------------------------------------------------------
-								Topic footing (comments section) elements
- ----------------------------------------------------------------------------------------------- */
-
-div.footer-block {
-margin: 25pt 0 20pt 0;
-border-top: 2px #959595 solid;
-border-bottom: 2px #959595 solid;
-text-align: right;
-padding: 8px 15px 14px 0;
-display: block;
-}
-
-
- at media print {
-
-   div.footer-block {
-   display: none;
-   }
-
-}  /* @media print */
-
-/* -----------------------------------------------------------------------------------------------
-								Art related elements
- ----------------------------------------------------------------------------------------------- */
-
-p.figure-title {
-margin: 6pt 0 16pt 0;
-padding: 4pt 8pt 5pt 0;
-font-weight: bold;
-}
-
-div.figure-anchor {
-margin-top: 16pt;
-}
-
-/* -----------------------------------------------------------------------------------------------
-                                                DynamicHelp elements
- ----------------------------------------------------------------------------------------------- */
-
-span.AltContentHidden {
-display: none;
-}
-
-span.RelatedContentHidden {
-display: none;
-}
-
-span.DefaultContentHidden {
-display: none;
-}
-
-/* -----------------------------------------------------------------------------------------------
-   Workflow tables
------------------------------------------------------------------------------------------------ */
-
-table.workflow {
-text-align: center;
-border-collapse: collapse;
-margin: 10pt 10pt 0 0;
-
-}
-
-tr.task {
-vertical-align: middle;
-height: 1px;
-}
-
-/* set min width of columns */
-div.task-title-min-width {
-height: 1px;
-width: 257px;
-}
-
-div.task-summary-min-width {
-width: 300px;
-}
-
-/* task-title column */
-td.task-title {
-height: 56px;
-background-image: url(../images/task-button-middle.png);
-background-repeat: repeat;
-padding: 0 17px 10px 10px;
-}
-
-td.task-title-top {
-height: 18px;
-background-image: url(../images/task-button-top.png);
-background-repeat: no-repeat;
-padding: 0 17px 10px 10px;
-font-size: 10pt;
-}
-
-td.task-title-bottom {
-height: 25px;
-background-image: url(../images/task-button-bottom.png);
-background-repeat: no-repeat;
-padding: 0 17px 10px 10px;
-font-size: 10pt;
-}
-
-td.task-title-last {
-height: 56px;
-background-image: url(../images/task-button-middle.png);
-background-repeat: repeat;
-padding: 0 17px 10px 10px;
-}
-
-div.task-title {
-font-family: helvetica, arial;
-font-size: 10pt;
-line-height: 11pt;
-font-weight: bold;
-color: #383838;
-}
-
-div.task-title a,
-div.task-title-last a {
-/* div.task-title-last selectors, here and in the next four rules, are    */
-/* compensating for an xsl defect - delete them when the defect is fixed  */
-font-weight: bold;
-display: block;
-}
-
-div.task-title a:link,
-div.task-title-last a:link {
-color: #46a;
-text-decoration: none;
-}
-
-div.task-title a:visited,
-div.task-title-last a:visited {
-color: #46a;
-text-decoration: none;
-}
-
-div.task-title a:hover,
-div.task-title-last a:hover {
-text-decoration: underline;
-}
-
-div.task-title a:active,
-div.task-title-last a:active {
-color: #e24;
-text-decoration: none;
-}
-
-/* task-link column */
-td.task-link {
-width: 30px;
-}
-
-td.task-link img {
-position: relative;
-top: -1px;
-}
-
-/* task-summary column */
-td.task-summary {
-font-family: helvetica, arial;
-padding: 4pt 10pt;
-background: #e6eada;
-text-align: left;
-width: 100%;
-}
-
-span.task-summary {
-font-size: 10pt;
-line-height: 11pt;
-}
-
-/* task-arrow */
-tr.task-arrow {
-font-size: 8pt;
-}
-
-td.task-arrow-left img {
-position: relative;
-left: -2px;
-}
-
-.hilite {
-background-color: #ff0;
-}
-
-.hilite1 {
-background-color: #f3f;
-}
-
-
-
-div.section p.section_title_h2, div.section p.section_title_h3 {
-font-size: 10pt;
-font-weight: bold;
-color: #990000;
-margin: 10pt 0 6pt 0;
-}
-
-/* -----------------------------------------------------------------------------------------------
-   Reference Pages
------------------------------------------------------------------------------------------------ */
-.qrEntryHeadTitle, .qrEntryTitle, .qrTitle {
-    padding: 3pt 2pt 3pt 2pt;
-    margin: 5pt 0;
-}
-
-.qrEntryHeadTitle, .qrEntryTitle {
-    font-weight:bold;
-    color:white;
- }
-
-.qrEntryHeadTitle, .qrEntryTitle, .qrEntryValue {
-   padding-left: 7pt;
-}
-
-a.qrItemLink {
-display: none;
-color: #333399;
-text-decoration:none;
-}
-
-.qrEntryHeadTitle {
-    background-color: #3366AA;
-}
-
-.qrEntryTitle {
-    background-color: #6699CC;
-}
-.qrTitle {
-display: none;
-color:#993333;
-background-color: #FFAA66;
-vertical-align: middle;
-text-align : center;
-}
-
-div.qrentryheadtitle {
-background-color: #35a;
-}
-
-div.qrentrytitle {
-background-color: transparent;
-color: #038;
-font-size: 10pt;
-padding: 0;
-margin: 8pt 0 0 0;
-}
-
-div.qrentryvalue {
-padding: 0;
-margin-top: 4pt;
-}
-
-div.qrentryvalue img.qricon {
-margin-top: 4px;
-}
-hr.qr-line1 {
-display: none;
-height:3px;
-color:#FFAA66;
-}
-
-hr.qr-line2 {
-display: none;
-height:3px;
-color:#3366AA;
-}
-
+/* Consolidation of many .css files. Controls the pages in the files folder */
+
+
+body {
+background-color: #fff;
+font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+font-size: 10pt;
+font-style: normal;
+font-weight: normal;
+color: #000;
+letter-spacing: normal;
+word-spacing: normal;
+text-align: left;
+text-indent: 0pt;
+margin: 0;
+height: 100%;
+}
+
+p {
+margin-bottom: 0px;
+}
+
+div.body_content {
+margin: 0 12pt;	
+}
+
+/* ----------------------------------------------------------------------------
+										Link styles
+ ---------------------------------------------------------------------------- */
+
+a:link, a:active {color: #00289C; text-decoration: none;}
+a:visited {color: #00289C; text-decoration: none;}
+a:hover {color: #CE9E08; text-decoration: underline;}
+
+/* ----------------------------------------------------------------------------
+										Table styles
+ ---------------------------------------------------------------------------- */
+
+table {
+background-color: transparent;
+margin-top: 5pt;
+font-size: 10pt;
+
+
+}
+
+
+p.table-title {
+font-weight: bold;
+color: #338;
+}
+
+p.table-title + table.table{
+margin-top: -5pt;
+} /* Table after it's title should have small top margin */
+
+table.table th {
+background-color: #ccc;
+font-weight: bold;
+}
+
+/*Head row cells*/
+table.table tr td {
+vertical-align: top;
+
+} /*Body cells*/
+
+table.ruled, table.ruled-wide { 
+width: 97%; 
+margin: 1.4em 0; 
+border-bottom: 3px solid #3D3D3D; 
+border-top: 4px solid #3D3D3D; 
+background-color: #F2F2F2; 
+}
+
+table.ruled th, table.ruled-wide th  { 
+color: white; 
+background-color: #3D3D3D; 
+padding: 4px 10px 7px 12px; 
+vertical-align: middle;
+}
+
+
+table.ruled td, table.ruled-wide td { 
+padding: 6px 10px 7px 12px; 
+border-bottom: 1px solid #3D3D3D;
+vertical-align: baseline;
+}
+
+tr.RuledHeading, tr.RuledWideHeading {
+background-color: transparent;
+}
+
+tr.RuledEvenRow, tr.RuledWideEvenRow {
+background-color: transparent;
+}
+
+tr.RuledOddRow, tr.RuledWideOddRow {
+background-color: transparent;
+}
+
+th.table-heading {
+font-size: 10pt;
+text-align: left;
+font-weight: bold;
+color: #3D3D3D;
+}
+
+/* Unruled Tables */ 
+
+table.not-ruled, table.not-ruled-wide { 
+width: 97%;
+margin: 1em 0; 
+}
+
+table.not-ruled th, table.not-ruled-wide th { 
+color: #338;
+padding: 4px 20px 2px 0;
+vertical-align: text-bottom;
+}
+
+table.not-ruled td, table.not-ruled-wide td { 
+padding: 4px 20px 2px 0;
+vertical-align: top;
+}
+table.not-ruled td div.figure-anchor, 
+table.not-ruled-wide td div.figure-anchor {
+margin-top: 5pt;	
+}
+
+
+
+/* tables in list elements */
+li table.ruled, li table.ruled-wide, li table.not-ruled, li table.not-ruled-wide {
+width: 0;
+}
+
+/* paras within tables */
+table.ruled p, table.ruled-wide p, table.not-ruled p, table.not-ruled-wide p {
+margin: 2pt 0;
+}
+
+/* div.note_xx within tables */
+table.ruled div.note-note, 
+table.ruled-wide div.note-note, 
+table.not-ruled div.note-note, 
+table.not-ruled-wide div.note-note {
+margin: 2pt 0;
+}
+
+/* ul's within tables*/
+table.ruled ul, table.ruled-wide ul, table.not-ruled ul, table.not-ruled-wide ul {
+margin: 6pt 0 0 12pt;
+list-style-type: disc;
+}
+table.ruled ul p, table.ruled-wide ul p, table.not-ruled ul p, table.not-ruled-wide ul p {
+margin-top: 6pt;
+}
+table.ruled ul li, table.ruled-wide ul li, table.not-ruled ul li, table.not-ruled-wide ul li {
+margin: 4pt 0 0 0;
+}
+
+/* ol's within tables */
+table.ruled ol, table.ruled-wide ol, table.not-ruled ol, table.not-ruled-wide ol {
+margin: 6pt 0 0 18pt;
+}
+table.ruled ol p, table.ruled-wide ol p, table.not-ruled ol p, table.not-ruled-wide ol p {
+margin-top: 6pt;
+}
+table.ruled ol li, table.ruled-wide ol li, table.not-ruled ol li, table.not-ruled-wide ol li {
+margin: 4pt 0 0 0;
+}
+
+
+ at media print {
+
+    table.ruled-wide th.table-heading {
+    color: #3D3D3D;
+    background-color: transparent;
+    padding-top: 4pt;
+    border-bottom: 4px solid #3D3D3D;
+    }
+
+} /* @media print */
+
+
+p.table-body {} /* Paragraph within table body */
+p.table-heading {} /* Paragraph within table body */
+p.table-footing {} /* Paragraph within table body */
+
+/* data table */
+/* also used in dialog box topics */
+table.ref-data {
+margin: 0;
+border: none;
+font-size: 9pt;
+}
+
+/* data table td */
+table.ref-data td {
+padding: 0 0 12pt 0;
+width: 0;
+}
+
+
+
+
+
+/* ----------------------------------------------------------------------------
+										List styles
+ ---------------------------------------------------------------------------- */
+
+ul {
+margin: 6pt 0 0 12pt;
+list-style-type: disc;
+}
+
+ul p {
+margin-top: 6pt;
+}
+
+ul li {
+margin: 10pt 0 0 6pt;
+}
+
+ul.bullet_no {
+list-style-type: none;
+}
+
+ol {
+margin: 6pt 0 0 18pt;
+}
+
+ol p {
+margin-top: 6pt;
+}
+
+ol li {
+margin: 10pt 0 0 0;
+padding-left: 0pt;
+}
+
+div.single_step_instruction ol {
+list-style-image: url(../images/ac.menuaro.gif);
+}
+
+div.see-also ul ul {
+margin-left: 0px;
+}
+
+div.see-also li {
+margin-top: 4pt;
+}
+
+div.see-also {
+margin-top: 18pt;
+padding-top: 2pt;
+border-top: 1px solid #449;
+}
+
+span.see-also {
+color: #338;
+font-weight: bold;
+}
+
+div.topic-list li {
+margin-top: 4pt;
+}
+
+div.dl_section {
+margin-left: 30pt;
+}
+
+/* section titles (break heads within topics) */
+div.dl_section p.title,
+div.dl_section p.section_title_h1,
+div.section p.section_title_h1 {
+background-color: #959595;
+font-weight: bold;
+font-size: 10pt;
+color: #fff;
+padding: 2pt 6pt 3pt 4pt;
+margin-top: 20pt;
+}
+
+ at media print {
+
+    div.dl_section p.title,
+    div.dl_section p.section_title_h1,
+    div.section p.section_title_h1 {
+    background-color: transparent;
+    padding-left: 0pt;
+    }
+
+}
+
+dl {}
+
+dl p {
+margin-top: 6pt;
+}
+
+dt {
+margin-top: 12pt;
+margin-bottom: 0px;
+}
+
+dd {
+margin-top: 0pt;
+margin-bottom: 0px;
+}
+
+ul.jumplist {
+margin-left: 10pt;
+margin-bottom: 10pt;
+}
+
+ol[start] {
+margin-top: 2pt
+} /* continued list */
+
+div.list-intro {
+font-size: 10pt;
+margin-bottom: 5pt;
+font-weight: bold;
+color: #990000;
+}
+
+div.enclosed-list {
+margin-top: -5pt;
+padding: 0 0 0 15pt;
+} /* Block to indent enclosed lists */
+
+div.enclosed-list div.list-intro {
+padding-top: 10pt;
+} /* Subsequent list into */
+
+div.enclosed-list ul {
+margin: 0;
+}
+
+div.enclosed-list ol {
+margin: 0;
+}
+
+div.topic-list h4.related {
+font-weight: bold;
+font-size: 10pt;
+color: #338;
+margin: 16pt 0 8pt 0;
+}
+
+div.topic-list {
+font-size: 10pt;
+padding: 0;
+}
+
+
+.topiclist-litem {
+margin-bottom: 6pt;
+}
+
+/* definition list */
+table.dl {
+font-size: 10pt;
+}
+
+/* in a definition list, a term-definition pair */
+tr.dl-pair {
+}
+
+td.term {
+width: 100pt;
+vertical-align: baseline;
+padding: 0 12pt 0 0;
+}
+
+td.definiton {
+vertical-align: baseline;
+padding: 0;
+}
+
+/* Civil 3D quick reference sections */
+
+div.section {
+margin-top: 12pt;
+}
+
+span.term {
+font-size: 10pt;
+font-weight: bold;
+color: #36c;
+}
+
+div.definition {
+margin-bottom: 10pt;
+}
+
+div.definition p {
+margin-top: 4pt;
+}
+
+div.definition ul {
+margin-top: 0pt;
+}
+
+div.definition li {
+margin-top: 4pt;
+}
+/* definition links (glossary links) */
+span.term a {
+color: green;    /* 'green' = #070 */
+text-decoration: none;
+border-bottom: 1px dotted green;
+}
+
+/* definition links */
+span.term a:visited {
+color: green;
+}
+
+/* collapsible */
+
+div.collapsible {
+margin-top: 10pt;
+margin-bottom: 5pt;
+}
+
+img.collapsible {
+cursor: pointer;
+}
+
+div.collapsible-section {
+}
+
+span.collapsible-section-title {
+color: #027;
+font-size: 10pt;
+font-weight: bold;
+padding-left: 5px;
+cursor: pointer;
+}
+/* ----------------------------------------------------------------------------
+										Note styles
+ ---------------------------------------------------------------------------- */
+
+div.note-note, 
+div.note-warning, 
+div.note-tip, 
+div.note-related, 
+div.note-important, 
+div.note-bestpractice {
+margin-top: 10pt;
+margin-bottom: 0px;
+}
+
+/* Notes within table */
+table.table div.note-note, 
+table.table div.note-warning, 
+table.table div.note-tip, 
+table.table div.note-related, 
+table.table div.note-important, 
+table.table div.note-bestpractice {
+padding-top: 5px;
+padding-bottom: 5px;
+font-size: 9pt;
+}
+/* Notes within lists */
+
+li div.note-note, 
+li div.note-warning, 
+li div.note-tip, 
+li div.note-related, 
+li div.note-important, 
+li div.note-bestpractice {
+margin-left: 0pt;
+margin-top: 2pt;
+margin-bottom: 8pt;
+}
+
+/*  Note label styles */
+div.note-important span.label {
+color: #c00;
+font-size: 9pt;
+font-weight: bold;
+padding-right: 5px;
+}
+
+div.note-warning span.label {
+color: #c00;
+font-size: 9pt;
+font-weight: bold;
+padding-right: 5px;
+}
+
+div.note-note span.label {
+color: #338;
+font-size: 9pt;
+font-weight: bold;
+padding-right: 5px;
+}
+
+div.note-tip span.label {
+color: #338;
+font-size: 9pt;
+font-weight: bold;
+padding-right: 5px;
+}
+
+div.note-related span.label {
+color: #027;
+font-size: 9pt;
+font-weight: bold;
+padding-right: 5px;
+}
+
+div.note-important span.label {
+color: #c00;
+font-size: 9pt;
+font-weight: bold;
+padding-right: 5px;
+}
+
+div.note-bestpractice span.label {
+color: #c00;
+font-size: 9pt;
+font-weight: bold;
+padding-right: 5px;
+}
+
+/* ---------------------------------------------------------------------------------------------
+                                        Code elements
+ --------------------------------------------------------------------------------------------- */
+span.code, 
+div.codeBlock, 
+p.codeLine, 
+p.codeComment, 
+span.codeLiteral {
+font-family: "Courier New", Courier, monospace;
+font-size: 10pt;
+font-style: normal;
+font-weight: normal;
+}
+
+span.code {}
+
+div.codeBlock div.codeBlock {
+margin-left: 30pt;
+} /* Only descendant code blocks should have indents */
+
+p.codeLine, 
+p.codeComment {
+padding: 1px;
+margin: 1px;
+}
+
+p.codeSpace {}
+
+span.codeLiteral {}
+
+div.codeBlock {
+margin-top: 8pt;
+padding: 8pt;
+background: #feb;
+}
+/* Fixes word wrap in code block */
+pre {
+white-space: pre; /* CSS2 */
+white-space: -moz-pre-wrap; /* Mozilla */
+white-space: -hp-pre-wrap; /* HP printers */
+white-space: -o-pre-wrap; /* Opera 7 */
+white-space: -pre-wrap; /* Opera 4-6 */
+white-space: pre-wrap; /* CSS 2.1 */
+white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
+word-wrap: break-word; /* IE */
+}
+
+div.codeBlock pre.codeLine {
+margin-top: 0pt;
+margin-bottom: 0pt;
+}
+
+ at media print {
+
+    div.codeBlock {
+    background: #fff;
+    border: 1px solid #000;
+    }
+
+} /* @media print */
+
+
+/* ---------------------------------------------------------------------------------------------
+							Charspan
+--------------------------------------------------------------------------------------------- */
+span.charspan-keyboardEntry {}
+
+span.charspan-strong {
+font-weight: bold;
+}
+
+span.charspan-special {}
+
+/*
+Note that CharSpan[@class='Emphasis'], CharSpan[@class='Subscript'] and CharSpan[@class='Superscript'] elements
+are being formatted as <em>, <sub> and <sub> html elements so please change element css definitions instead of class
+*/
+
+/* ---------------------------------------------------------------------------------------------
+							Emphasis
+--------------------------------------------------------------------------------------------- */
+em, em.mild {
+font-style: italic;
+}
+
+em.strong {
+font-style: normal;
+font-weight: bold;
+}
+
+em.extreme {
+font-style: italic;
+font-weight: bold;
+}
+
+/* ---------------------------------------------------------------------------------------------
+							UIString
+--------------------------------------------------------------------------------------------- */
+span.uis-promptMessage {
+font-style: normal;
+font-weight: bold;
+}
+
+span.uis-dialogCaption {
+font-style: normal;
+font-weight: bold;
+}
+
+span.uis-entryField {
+font-style: normal;
+font-weight: bold;
+}
+
+span.uis-menuText {}
+
+span.uis-stringTable {}
+
+span.uis-unspecified {}
+
+/* -------------------------------------------------------------------------------------------
+							Comments
+------------------------------------------------------------------------------------------- */
+div.comments-editor {
+font-weight: bold;
+color: red;
+}
+
+div.comments-localizer {
+font-weight: bold;
+color: red;
+}
+
+div.comments-special {
+font-weight: bold;
+color: red;
+}
+
+div.comments-author {
+color: #cc0000;
+margin-left: 24pt;
+margin-right: 48pt;
+}
+
+/* ------------------------------------------------------------------------------------------
+							Misc
+------------------------------------------------------------------------------------------ */
+.title, 
+.list-intro {
+font-weight: bold;
+color: #990000;
+margin-top: 10pt;
+margin-bottom: -5pt;
+}
+
+p.title {
+font-weight: bold;
+font-size: 10pt;
+color: #338;
+margin: 16pt 0 0 0;
+}
+
+p.section_title_h1 {
+font-weight: bold;
+font-size: 10pt;
+color: #338;
+margin: 16pt 0 0 0;
+
+}
+
+p.list-intro {
+font-weight: bold;
+font-size: 10pt;
+color: #338;
+margin: 16pt 0 0 0;
+
+}
+
+p.prompt {
+margin-left: 12pt;
+color: #00c;
+}
+
+p.entryField {
+font-style: normal;
+font-weight: bold;
+} 	/* The same as 'uis-entryField'? */
+
+span.keyboardEntry { } 	/* The same as 'charspan-keyboardEntry'? */
+
+span.keyCaps {
+font-style: normal;
+font-weight: bold;
+}
+
+span.filePath {
+font-style: italic;
+}
+
+span.appSetting {}
+
+span.bookTitle {}
+
+span.coord {}
+
+span.codeIdentifier {}
+
+span.dialogCaption{
+font-style: italic;
+}
+
+span.menuText{
+font-style: normal;
+font-weight: bold;
+}
+
+span.glyphCopyright {}
+
+span.glyphTM {}
+
+span.glyphArrow {}
+
+span.glyphEllipsis {}
+
+span.glyphSpecial {}
+
+span.glyphRegistered {}
+
+span.glyph_additional {
+font-family: Symbol;
+}
+span.glyph_square {
+font-family: Wingdings;
+}
+
+a.webLink {}
+
+span.fileName {}
+
+span.term {
+font-size: 10pt;
+font-weight: bold;
+color: #36c;
+}
+
+dd div.definition { }
+
+dd div.brief_example {
+font-size: 9pt;
+color: #000;
+background-color : #77aacc;
+padding: 7pt 15pt;
+margin: 0pt;
+}
+
+div.section {}
+
+p.summary {}
+
+/* -----------------------------------------------------------------------------------------------
+								Topic heading elements
+ ----------------------------------------------------------------------------------------------- */
+
+/* head region */
+div.head {
+font-family: arial;
+background-color: #000000;
+margin: 0;
+width: 100%;
+background-image: url(../images/product_name.gif);
+background-repeat: no-repeat;
+background-position: 15px 14px;
+}
+
+ at media print {
+
+   div.head {
+   background-image: none;
+   }
+
+} /* @media print */
+
+/* head block - sets head region margins */
+div.head-block {
+padding-top: 2pt;
+}
+
+/* nav group - contains browse buttons */
+div.nav-group {
+position: relative;
+height: 30px;
+}
+
+ at media print {
+
+   div.nav-group {
+   display: none;
+   }
+
+} /* @media print */
+
+/* ask-me stuff */
+
+form.ask-me {
+width: 275px;
+padding: 0px;
+margin: 0px;
+height: 0px;
+float: left;
+}
+
+input.ask-me-image {
+cursor:  pointer;
+margin: 2pt 0;
+height: 21px;
+}
+
+input.ask-me-text {
+width: 160pt;
+padding: 1pt 0 0 5px;
+height: 23px;
+margin-bottom: 2pt;
+}
+
+/* link to parent topic */
+
+div.head-parent-link span.head-parent-link {
+font-weight: normal;
+font-style: normal;
+font-family: verdana;
+font-size: 8pt;
+}
+
+div.head-parent-link a {
+color: #347;
+text-decoration: underline;
+}
+
+div.head-parent-link a:hover {
+color: #347;
+text-decoration: underline;
+}
+
+div.head-parent-link a:visited {
+color: #347;
+text-decoration: underline;
+}
+
+/* browse button set */
+
+div.browse {
+position: absolute;
+right: 0px;
+padding: 10px 12px 1px 0;
+}
+
+/* browse button images */
+div.browse img {
+margin-left: 2px;
+}
+
+/* browse button info bar */
+div.button-info {
+text-align: right;
+font-size: 8pt;
+height: 15px;
+}
+
+/* browse button info text */
+span#infoline {
+padding: 1px 15px 1px 0;
+/*visibility: hidden;*/
+color: #959595;
+width: 100%;
+text-align: right;
+}
+
+/* bread crumbs */
+
+div.ancestry {
+color: #959595;
+background-color: #212121;
+margin: 2px 0 0 0;
+padding: 1px 0 5px 17px;
+font-size: 8pt;
+}
+
+div.ancestry a {
+color: #959595;
+text-decoration: none;
+}
+
+div.ancestry a:link {
+color: #959595;
+text-decoration: none;
+}
+
+div.ancestry a:visited {
+color: #959595;
+text-decoration: none;
+}
+
+div.ancestry a:hover {
+text-decoration: underline;
+color: white;
+}
+
+ at media print {
+
+    div.ancestry {
+    display: none;
+    }
+
+} /* @media print */
+
+/* head-text bar */
+div.head-text {
+background-color: #3d3d3d;
+padding: 8px 18px 8px 16px;
+/*height: 40px;*/
+}
+
+/* head-text */
+div.head-text span {
+color: #fff;
+font-size: 16pt;
+line-height: 18pt;
+}
+
+ at media print {
+
+   div.head-text span {
+   font-size: 18pt;
+   color: #666;
+   filter: glow-off;
+   }
+
+} /* @media print */
+
+/* collapse-expand block */
+/* contains the collapse block () and the expand block (), only 
+   one of which is visible depending on collapse-expand state */
+div.collapse-expand {
+width: 200px;
+float: right;
+font-weight: normal;
+white-space: nowrap;
+position: relative;
+top: -6px;
+}
+
+ at media print {
+
+    div.collapse-expand {
+    display: none;
+    }
+
+} /* @media print */
+
+/* collapse block */
+/* initial state: hidden */
+div#collapseAllSection {
+display: none;
+}
+
+/* expand block */
+/* initial state: hidden */
+div#expandAllSection {
+display: none;
+}
+
+/* collapse-expand images */
+img.expandcollapse_img {
+display: none;
+}
+
+/* collapse-expand label */
+div.collapse-expand-label {
+text-align: right;
+width: 100%;
+position: absolute;
+top: -4px;
+right: 0px;
+padding: 0px;
+margin: 0px;
+}
+
+div.collapse-expand-label span {
+font-weight: normal;
+color: #959595;
+cursor: pointer;
+font-size: 10px
+}
+
+/* collapse-expand description */
+div.collapse-expand-description {
+font-weight: normal;
+color: #959595;
+text-align: right;
+width: 100%;
+position: absolute;
+top: 15px;
+right: 0px;
+padding: 0px 0 0 10px;
+margin: 0px;
+}
+
+/* -----------------------------------------------------------------------------------------------
+                                               Head Tabs elements
+ ----------------------------------------------------------------------------------------------- */
+
+/* head tabs */
+div.head-tabs {
+background-image: url(../images/tab-bkg.gif);
+}
+
+/* head-tab table */
+div.head-tabs table {
+font-size: 10pt;
+color: #fff;
+margin: 0px;
+padding: 0px;
+background: transparent;
+border: none;
+}
+
+/* head-tab row */
+div.head-tabs tr {
+vertical-align: middle;
+height: 28px;
+}
+
+ at media print {
+
+    div.head-tabs table {
+    margin-left: 2px;
+    }
+
+    div.head-tabs tr {
+    position: relative;
+    left: -2px;
+    }
+
+}
+
+/* head-tab */
+div.head-tabs td {
+border-right: 0;
+padding: 0;
+}
+
+/* head-tab sides */
+td.tab-edge {
+background-color: #fff;
+display: inline;
+padding: 0;
+border-right: 0;
+}
+
+ at media print {
+
+   td.tab-edge {
+   display: none;
+   }
+
+} /* @media print */
+
+/* head-tab, selectable */
+td.tab {
+background-image: url(../images/tab-bkg2.gif);
+padding: 0 1em;
+cursor: pointer;
+vertical-align: middle;
+}
+
+ at media print {
+
+    td.tab {
+    border: none;
+    background-image: none;
+    }
+
+} /* @media print */
+
+/* head-tab, selected */
+td.tab-active {
+background-color: #fff;
+cursor: default;
+vertical-align: middle;
+background-image: url(../images/tab-bkg-xn.gif); 
+background-repeat: repeat;
+}
+
+ at media print {
+
+    td.tab-active {
+    border: none;
+    background-image: none;
+    }
+
+} /* @media print */
+
+/* head-tab bodies, dimmed */
+td.tab-disabled {
+padding: 0 1em;
+background-image: url(../images/tab-bkg-o.gif);
+cursor: default;
+vertical-align: middle;
+}
+
+/* head-tab text */
+td.tab span {
+color: #0033BB;
+text-decoration: underline;
+width: 100%;
+padding: 0px;
+}
+
+ at media print {
+
+    td.tab span {
+    color: #666;
+    }
+
+} /* @media print */
+
+/* head-tab text, selected */
+td.tab-active span {
+color: #000;
+font-weight: bold;
+padding: 0px;
+position: relative;
+top: 0px;
+}
+
+/* head-tab text, dimmed */
+td.tab-disabled span {
+width: 100%;
+color: #666;
+position: relative;
+top: 0px;
+visibility: hidden;
+}
+
+/* head-region bottom margin */
+div.head-margin {
+line-height: 0pt;
+padding-bottom: 6pt;
+}
+
+/* Temporary fix for grey lines in Quick Reference Tabs */
+div.quickReferenceList div.section p.section_title_h1  {
+  background-color: #FFFFFF
+}
+
+/* -----------------------------------------------------------------------------------------------
+								Topic footing (comments section) elements
+ ----------------------------------------------------------------------------------------------- */
+
+div.footer-block {
+margin: 25pt 0 20pt 0;
+border-top: 2px #959595 solid;
+border-bottom: 2px #959595 solid;
+text-align: right;
+padding: 8px 15px 14px 0;
+display: block;
+}
+
+
+ at media print {
+
+   div.footer-block {
+   display: none;
+   }
+
+}  /* @media print */
+
+/* -----------------------------------------------------------------------------------------------
+								Art related elements
+ ----------------------------------------------------------------------------------------------- */
+
+p.figure-title {
+margin: 6pt 0 16pt 0;
+padding: 4pt 8pt 5pt 0;
+font-weight: bold;
+}
+
+div.figure-anchor {
+margin-top: 16pt;
+}
+
+/* -----------------------------------------------------------------------------------------------
+                                                DynamicHelp elements
+ ----------------------------------------------------------------------------------------------- */
+
+span.AltContentHidden {
+display: none;
+}
+
+span.RelatedContentHidden {
+display: none;
+}
+
+span.DefaultContentHidden {
+display: none;
+}
+
+/* -----------------------------------------------------------------------------------------------
+   Workflow tables
+----------------------------------------------------------------------------------------------- */
+
+table.workflow {
+text-align: center;
+border-collapse: collapse;
+margin: 10pt 10pt 0 0;
+
+}
+
+tr.task {
+vertical-align: middle;
+height: 1px;
+}
+
+/* set min width of columns */
+div.task-title-min-width {
+height: 1px;
+width: 257px;
+}
+
+div.task-summary-min-width {
+width: 300px;
+}
+
+/* task-title column */
+td.task-title {
+height: 56px;
+background-image: url(../images/task-button-middle.png);
+background-repeat: repeat;
+padding: 0 17px 10px 10px;
+}
+
+td.task-title-top {
+height: 18px;
+background-image: url(../images/task-button-top.png);
+background-repeat: no-repeat;
+padding: 0 17px 10px 10px;
+font-size: 10pt;
+}
+
+td.task-title-bottom {
+height: 25px;
+background-image: url(../images/task-button-bottom.png);
+background-repeat: no-repeat;
+padding: 0 17px 10px 10px;
+font-size: 10pt;
+}
+
+td.task-title-last {
+height: 56px;
+background-image: url(../images/task-button-middle.png);
+background-repeat: repeat;
+padding: 0 17px 10px 10px;
+}
+
+div.task-title {
+font-family: helvetica, arial;
+font-size: 10pt;
+line-height: 11pt;
+font-weight: bold;
+color: #383838;
+}
+
+div.task-title a,
+div.task-title-last a {
+/* div.task-title-last selectors, here and in the next four rules, are    */
+/* compensating for an xsl defect - delete them when the defect is fixed  */
+font-weight: bold;
+display: block;
+}
+
+div.task-title a:link,
+div.task-title-last a:link {
+color: #46a;
+text-decoration: none;
+}
+
+div.task-title a:visited,
+div.task-title-last a:visited {
+color: #46a;
+text-decoration: none;
+}
+
+div.task-title a:hover,
+div.task-title-last a:hover {
+text-decoration: underline;
+}
+
+div.task-title a:active,
+div.task-title-last a:active {
+color: #e24;
+text-decoration: none;
+}
+
+/* task-link column */
+td.task-link {
+width: 30px;
+}
+
+td.task-link img {
+position: relative;
+top: -1px;
+}
+
+/* task-summary column */
+td.task-summary {
+font-family: helvetica, arial;
+padding: 4pt 10pt;
+background: #e6eada;
+text-align: left;
+width: 100%;
+}
+
+span.task-summary {
+font-size: 10pt;
+line-height: 11pt;
+}
+
+/* task-arrow */
+tr.task-arrow {
+font-size: 8pt;
+}
+
+td.task-arrow-left img {
+position: relative;
+left: -2px;
+}
+
+.hilite {
+background-color: #ff0;
+}
+
+.hilite1 {
+background-color: #f3f;
+}
+
+
+
+div.section p.section_title_h2, div.section p.section_title_h3 {
+font-size: 10pt;
+font-weight: bold;
+color: #990000;
+margin: 10pt 0 6pt 0;
+}
+
+/* -----------------------------------------------------------------------------------------------
+   Reference Pages
+----------------------------------------------------------------------------------------------- */
+.qrEntryHeadTitle, .qrEntryTitle, .qrTitle {
+    padding: 3pt 2pt 3pt 2pt;
+    margin: 5pt 0;
+}
+
+.qrEntryHeadTitle, .qrEntryTitle {
+    font-weight:bold;
+    color:white;
+ }
+
+.qrEntryHeadTitle, .qrEntryTitle, .qrEntryValue {
+   padding-left: 7pt;
+}
+
+a.qrItemLink {
+display: none;
+color: #333399;
+text-decoration:none;
+}
+
+.qrEntryHeadTitle {
+    background-color: #3366AA;
+}
+
+.qrEntryTitle {
+    background-color: #6699CC;
+}
+.qrTitle {
+display: none;
+color:#993333;
+background-color: #FFAA66;
+vertical-align: middle;
+text-align : center;
+}
+
+div.qrentryheadtitle {
+background-color: #35a;
+}
+
+div.qrentrytitle {
+background-color: transparent;
+color: #038;
+font-size: 10pt;
+padding: 0;
+margin: 8pt 0 0 0;
+}
+
+div.qrentryvalue {
+padding: 0;
+margin-top: 4pt;
+}
+
+div.qrentryvalue img.qricon {
+margin-top: 4px;
+}
+hr.qr-line1 {
+display: none;
+height:3px;
+color:#FFAA66;
+}
+
+hr.qr-line2 {
+display: none;
+height:3px;
+color:#3366AA;
+}
+


Property changes on: trunk/MgDev/Web/src/localized/help/en/style/adsk.cpm.css
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,441 +1,441 @@
-<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
-<%@ page import="org.osgeo.mapguide.*" %>
-<%@ page import="java.util.*" %>
-<%@ page import="java.lang.*" %>
-<%@ page import="java.io.*" %>
-<%@ page import="java.text.*" %>
-<%@ page import="javax.xml.parsers.DocumentBuilder" %>
-<%@ page import="javax.xml.parsers.DocumentBuilderFactory" %>
-<%@ page import="org.w3c.dom.Document" %>
-<%@ page import="org.w3c.dom.Element" %>
-<%@ page import="org.w3c.dom.Node" %>
-<%@ page import="org.w3c.dom.NodeList" %>
-<%@ page import="javax.servlet.jsp.*" %>
-<%@ page import="javax.servlet.http.*" %>
-<%@ include file="common.jsp" %>
-<%@ page isThreadSafe="false" %>
-<%!
-
-    String mapName;
-    String sessionId;
-    String localeCode;
-    Locale locale;
-
-    class SelectionSet
-    {
-        private HashMap<String, Vector<Feature>> _layers;
-
-        public SelectionSet()
-        {
-            _layers = new HashMap<String, Vector<Feature>>();
-        }
-
-        public void addFeature(Feature feat)
-        {
-            if (!_layers.containsKey(feat.LayerName))
-                _layers.put(feat.LayerName, new Vector<Feature>());
-
-            _layers.get(feat.LayerName).add(feat);
-        }
-
-        public String[] getLayers()
-        {
-            String[] layers = new String[_layers.keySet().size()];
-            _layers.keySet().toArray(layers);
-            
-            return layers;
-        }
-
-        public Feature[] getFeatures(String layerName)
-        {
-            if (_layers.containsKey(layerName))
-            {
-                Vector<Feature> layerFeatures = _layers.get(layerName);
-                Feature[] feats = new Feature[layerFeatures.size()];
-                layerFeatures.toArray(feats);
-                return feats;
-            }
-
-            return null;
-        }
-    }
-
-    class ZoomPoint
-    {
-        public double X;
-        public double Y;
-    }
-
-    class FeatureProperty
-    {
-        public String Name;
-        public String Value;
-    }
-
-    class Feature
-    {
-        public String LayerName;
-        public ZoomPoint Zoom;
-
-        private HashMap<String, FeatureProperty> _properties;
-
-        public Feature(String layerName)
-        {
-            this.LayerName = layerName;
-            _properties = new HashMap<String, FeatureProperty>();
-        }
-
-        public void addProperty(FeatureProperty prop)
-        {
-            _properties.put(prop.Name, prop);
-        }
-
-        public FeatureProperty[] getProperties()
-        {
-            Collection<FeatureProperty> values = _properties.values();
-            FeatureProperty[] props = new FeatureProperty[values.size()];
-            values.toArray(props);
-            return props;
-        }
-    }
-    
-    static String getTextValue(Element el, String tagName)
-    {
-        String textVal = null;
-        NodeList nl = el.getElementsByTagName(tagName);
-        if (nl != null && nl.getLength() > 0)
-        {
-            Element e = (Element)nl.item(0);
-            textVal = e.getFirstChild().getNodeValue();
-        }
-        return textVal;
-    }
-    
-    static HashMap<String, String> GetLayerPropertyMappings(MgResourceService resSvc, MgLayerBase layer) throws Exception
-    {
-        HashMap<String, String> mappings = new HashMap<String, String>();
-        
-        MgByteReader content = resSvc.GetResourceContent(layer.GetLayerDefinition());
-        ByteArrayInputStream contentReader = new ByteArrayInputStream(content.ToString().getBytes("UTF-8"));
-        
-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-        DocumentBuilder db = dbf.newDocumentBuilder();
-        Document doc = db.parse(contentReader);
-        
-        doc.getDocumentElement().normalize();
-        NodeList propNodes = doc.getElementsByTagName("PropertyMapping");
-        
-        for (int i = 0; i < propNodes.getLength(); i++)
-        {
-            Element propEl = (Element)propNodes.item(i);
-            String name = getTextValue(propEl, "Name");
-            String value = getTextValue(propEl, "Value");
-            
-            if (name != null && value != null)
-                mappings.put(name, value);
-        }
-        
-        return mappings;
-    }
-    
-    String GetPropertyValueFromFeatureReader(MgFeatureReader reader, MgAgfReaderWriter agfRw, int propType, String propName) throws Exception
-    {
-        String value = "";
-        switch(propType)
-        {
-            case MgPropertyType.Boolean:
-                value = String.format(locale, "%s", reader.GetBoolean(propName));
-                break;
-            case MgPropertyType.Byte:
-                value = String.format(locale, "%d", reader.GetByte(propName));
-                break; 
-            case MgPropertyType.DateTime:
-                value = GetDateTimeString(reader.GetDateTime(propName)); // yyyy-mm-dd is enforced regardless of locale
-                break;
-            case MgPropertyType.Single:
-                value = String.format(locale, "%f", reader.GetSingle(propName));
-                break;
-            case MgPropertyType.Double:
-                value = String.format(locale, "%f", reader.GetDouble(propName));
-                break;
-            case MgPropertyType.Int16:
-                value = String.format(locale, "%d", reader.GetInt16(propName));
-                break;
-            case MgPropertyType.Int32:
-                value = String.format(locale, "%d", reader.GetInt32(propName));
-                break;
-            case MgPropertyType.Int64:
-                value = String.format(locale, "%d", reader.GetInt64(propName));
-                break;
-            case MgPropertyType.String:
-                value = JsonEscape(reader.GetString(propName)); // string content is arbitrary
-                break;
-            default: //NOT PRESENTABLE IN PROPERTY GRID
-                value = "";
-                break;
-        }
-        return value;   
-    }
-
-    static String GetDateTimeString(MgDateTime value) throws MgException
-    {
-        return value.GetYear() + "-" + value.GetMonth() + "-" + value.GetDay();
-    }
-    
-    void GetParameters(HttpServletRequest request)
-    {
-        mapName = GetParameter(request, "MAPNAME");
-        sessionId = GetParameter(request, "SESSION");
-        localeCode = GetParameter(request, "LOCALE");
-    }
-    
-    String JsonEscape(String str)
-    {
-        return EscapeForHtml(str).replace("\\", "\\\\");
-    }
-    
-    String JsonifyError(Exception ex)
-    {
-        if (ex == null)
-            return "";
-        /*
-        {
-            "Error" : {
-                "Message" : <exception-message>,
-                "StackTrace" : <exception-stack-trace>
-            }
-        }
-        */
-        
-        StringBuffer sb = new StringBuffer();
-        //Use exception message or type name if no message found
-        String msg = ex.getMessage();
-        if (msg == null || msg.length() == 0)
-        {
-            msg = MgLocalizer.GetString("SERVERERROR", localeCode);
-        }
-        //Begin response
-        sb.append("{\"Error\":{");
-        //Exception message
-        sb.append("\"Message\":\"" + JsonEscape(msg) + "\",");
-        StringBuffer strace = new StringBuffer();
-        StackTraceElement[] st = ex.getStackTrace();
-        for (int i = 0; i < st.length; i++)
-        {
-            strace.append(st[i].getClassName() + "." + st[i].getMethodName() + "(" + st[i].getLineNumber() + ")\\n");
-        }
-        sb.append("\"StackTrace\":\"" + JsonEscape(strace.toString()) + "\"");
-        //End response
-        sb.append("}}");
-        return sb.toString();
-    }
-    
-    static String GetJson(SelectionSet set)
-    {
-        /*
-        A sample of the JSON output this method will produce:
-        
-        
-        {
-            "Layer1" : [ 
-                { 
-                    'values' { "name" : "name1" , "value" : "value1" }, 
-                    'zoom' : { x: num1, y: num2 } 
-                } , 
-                ..,
-                ..,
-                ..,
-            ],
-            "Layer2" : [ 
-                { 
-                    'values' { "name" : "name2" , "value" : "value2" }, 
-                    'zoom' : { x: num1, y: num2 } 
-                } , 
-                ..,
-                ..,
-                ..,
-            ]
-        }
-        */
-        
-        if (set == null)
-            return "";
-        
-        StringBuffer sb = new StringBuffer();
-        //Begin selection set
-        sb.append("{");
-        String[] layers = set.getLayers();
-        for (int i = 0; i < layers.length; i++)
-        {
-            //Begin layer
-            sb.append("\"" + layers[i] + "\" : [");
-            Feature[] features = set.getFeatures(layers[i]);
-            for (int j = 0; j < features.length; j++)
-            {
-                Feature feat = features[j];
-                //begin feature
-                //begin feature properties
-                sb.append("{\"values\" : [");
-                FeatureProperty[] properties = feat.getProperties();
-                for(int k = 0; k < properties.length; k++)
-                {
-                    FeatureProperty fp = properties[k];
-                    sb.append("{\"name\" : \"" + fp.Name + "\", \"value\" : \"" + fp.Value + "\" }");
-                    if (k != properties.length - 1)
-                        sb.append(",");
-                }
-                //end feature properties
-                //begin zoom
-                sb.append("], \"zoom\" : ");
-                if (feat.Zoom == null)
-                    sb.append("null");
-                else
-                    sb.append("{\"x\" : " + feat.Zoom.X + ", \"y\" : " + feat.Zoom.Y + "}");
-                //end zoom
-                //end feature
-                sb.append("}");
-                if (j != features.length - 1)
-                    sb.append(",");
-            }
-            //End Layer
-            sb.append("]");
-            if (i != layers.length - 1)
-                sb.append(",");
-        }
-        //End selection set
-        sb.append("}");
-        return sb.toString();
-    }
-%>
-<%
-    mapName = "";
-    sessionId = "";
-    localeCode = "";
-
-    GetParameters(request);
-    
-    if (null == localeCode || localeCode.length() == 0)
-        localeCode = GetDefaultLocale();
-        
-    locale = new Locale(localeCode);
-
-    try
-    {
-        MgUserInformation cred = new MgUserInformation(sessionId);
-        cred.SetClientIp(GetClientIp(request));
-        cred.SetClientAgent(GetClientAgent());
-
-        MgSiteConnection site = new MgSiteConnection();
-        site.Open(cred);
-
-        MgResourceService resSvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
-        
-        MgMap map = new MgMap(site);
-        map.Open(mapName);
-
-        MgSelection selection = new MgSelection(map);
-        selection.Open(resSvc, mapName);
-
-        MgReadOnlyLayerCollection layers = selection.GetLayers();
-        if (layers != null && layers.GetCount() > 0)
-        {
-            int layerCount = layers.GetCount();
-            MgAgfReaderWriter agfRW = new MgAgfReaderWriter();
-            SelectionSet selectionSet = new SelectionSet();
-
-            for (int i = 0; i < layerCount; i++)
-            {
-                MgLayerBase layer = layers.GetItem(i);
-                String layerName = layer.GetName();
-
-                MgResourceIdentifier fsId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-                String className = layer.GetFeatureClassName();
-                String geomName = layer.GetFeatureGeometryName();
-
-                MgFeatureQueryOptions query = new MgFeatureQueryOptions();
-                HashMap<String, String> mappings = GetLayerPropertyMappings(resSvc, layer);
-                Set<String> propNames = mappings.keySet();
-
-                for (String name : propNames)
-                {
-                    query.AddFeatureProperty(name);
-                }
-
-                query.AddFeatureProperty(geomName);
-                String filter = selection.GenerateFilter(layer, className);
-                query.SetFilter(filter);
-
-                MgFeatureReader reader = layer.SelectFeatures(query);
-
-                MgClassDefinition clsDef = reader.GetClassDefinition();
-                MgPropertyDefinitionCollection props = clsDef.GetProperties();
-
-                while (reader.ReadNext())
-                {
-                    Feature feat = new Feature(layerName);
-                    ZoomPoint zoom = null;
-
-                    for (int k = 0; k < props.GetCount(); k++)
-                    {
-                        MgPropertyDefinition propDef = props.GetItem(k);
-                        String propName = propDef.GetName();
-                        int propType = reader.GetPropertyType(propName);
-
-                        if (mappings.get(propName) != null || propType == MgPropertyType.Geometry)
-                        {
-                            String value = "";
-                            if (!reader.IsNull(propName))
-                            {
-                                if (propName.equals(geomName))
-                                {
-                                    MgByteReader agf = reader.GetGeometry(propName);
-                                    MgGeometry geom = agfRW.Read(agf);
-                                    MgCoordinate pt = geom.GetCentroid().GetCoordinate();
-
-                                    zoom = new ZoomPoint();
-                                    zoom.X = pt.GetX();
-                                    zoom.Y = pt.GetY();
-
-                                    feat.Zoom = zoom;
-                                }
-                                else
-                                {
-                                    value = GetPropertyValueFromFeatureReader(reader, agfRW, propType, propName);
-                                }
-
-                                if (mappings.get(propName) != null)
-                                {
-                                    FeatureProperty fp = new FeatureProperty();
-                                    fp.Name = mappings.get(propName);
-                                    fp.Value = value;
-
-                                    feat.addProperty(fp);
-                                }
-                            }
-                        }
-                    }
-                    selectionSet.addFeature(feat);
-                }
-                reader.Close();
-            }
-
-            //Now output the selection set
-            response.addHeader("Content-Type", "application/json");
-            response.addHeader("X-JSON", "true");
-
-            response.getWriter().write(GetJson(selectionSet));
-        }
-    }
-    catch (MgException ex)
-    {
-        response.addHeader("Content-Type", "application/json");
-        response.addHeader("X-JSON", "true");
-        response.getWriter().write(JsonifyError(ex));
-    }
-    catch (Exception ex)
-    {
-        response.addHeader("Content-Type", "application/json");
-        response.addHeader("X-JSON", "true");
-        response.getWriter().write(JsonifyError(ex));
-    }
+<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@ page import="org.osgeo.mapguide.*" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.lang.*" %>
+<%@ page import="java.io.*" %>
+<%@ page import="java.text.*" %>
+<%@ page import="javax.xml.parsers.DocumentBuilder" %>
+<%@ page import="javax.xml.parsers.DocumentBuilderFactory" %>
+<%@ page import="org.w3c.dom.Document" %>
+<%@ page import="org.w3c.dom.Element" %>
+<%@ page import="org.w3c.dom.Node" %>
+<%@ page import="org.w3c.dom.NodeList" %>
+<%@ page import="javax.servlet.jsp.*" %>
+<%@ page import="javax.servlet.http.*" %>
+<%@ include file="common.jsp" %>
+<%@ page isThreadSafe="false" %>
+<%!
+
+    String mapName;
+    String sessionId;
+    String localeCode;
+    Locale locale;
+
+    class SelectionSet
+    {
+        private HashMap<String, Vector<Feature>> _layers;
+
+        public SelectionSet()
+        {
+            _layers = new HashMap<String, Vector<Feature>>();
+        }
+
+        public void addFeature(Feature feat)
+        {
+            if (!_layers.containsKey(feat.LayerName))
+                _layers.put(feat.LayerName, new Vector<Feature>());
+
+            _layers.get(feat.LayerName).add(feat);
+        }
+
+        public String[] getLayers()
+        {
+            String[] layers = new String[_layers.keySet().size()];
+            _layers.keySet().toArray(layers);
+            
+            return layers;
+        }
+
+        public Feature[] getFeatures(String layerName)
+        {
+            if (_layers.containsKey(layerName))
+            {
+                Vector<Feature> layerFeatures = _layers.get(layerName);
+                Feature[] feats = new Feature[layerFeatures.size()];
+                layerFeatures.toArray(feats);
+                return feats;
+            }
+
+            return null;
+        }
+    }
+
+    class ZoomPoint
+    {
+        public double X;
+        public double Y;
+    }
+
+    class FeatureProperty
+    {
+        public String Name;
+        public String Value;
+    }
+
+    class Feature
+    {
+        public String LayerName;
+        public ZoomPoint Zoom;
+
+        private HashMap<String, FeatureProperty> _properties;
+
+        public Feature(String layerName)
+        {
+            this.LayerName = layerName;
+            _properties = new HashMap<String, FeatureProperty>();
+        }
+
+        public void addProperty(FeatureProperty prop)
+        {
+            _properties.put(prop.Name, prop);
+        }
+
+        public FeatureProperty[] getProperties()
+        {
+            Collection<FeatureProperty> values = _properties.values();
+            FeatureProperty[] props = new FeatureProperty[values.size()];
+            values.toArray(props);
+            return props;
+        }
+    }
+    
+    static String getTextValue(Element el, String tagName)
+    {
+        String textVal = null;
+        NodeList nl = el.getElementsByTagName(tagName);
+        if (nl != null && nl.getLength() > 0)
+        {
+            Element e = (Element)nl.item(0);
+            textVal = e.getFirstChild().getNodeValue();
+        }
+        return textVal;
+    }
+    
+    static HashMap<String, String> GetLayerPropertyMappings(MgResourceService resSvc, MgLayerBase layer) throws Exception
+    {
+        HashMap<String, String> mappings = new HashMap<String, String>();
+        
+        MgByteReader content = resSvc.GetResourceContent(layer.GetLayerDefinition());
+        ByteArrayInputStream contentReader = new ByteArrayInputStream(content.ToString().getBytes("UTF-8"));
+        
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        Document doc = db.parse(contentReader);
+        
+        doc.getDocumentElement().normalize();
+        NodeList propNodes = doc.getElementsByTagName("PropertyMapping");
+        
+        for (int i = 0; i < propNodes.getLength(); i++)
+        {
+            Element propEl = (Element)propNodes.item(i);
+            String name = getTextValue(propEl, "Name");
+            String value = getTextValue(propEl, "Value");
+            
+            if (name != null && value != null)
+                mappings.put(name, value);
+        }
+        
+        return mappings;
+    }
+    
+    String GetPropertyValueFromFeatureReader(MgFeatureReader reader, MgAgfReaderWriter agfRw, int propType, String propName) throws Exception
+    {
+        String value = "";
+        switch(propType)
+        {
+            case MgPropertyType.Boolean:
+                value = String.format(locale, "%s", reader.GetBoolean(propName));
+                break;
+            case MgPropertyType.Byte:
+                value = String.format(locale, "%d", reader.GetByte(propName));
+                break; 
+            case MgPropertyType.DateTime:
+                value = GetDateTimeString(reader.GetDateTime(propName)); // yyyy-mm-dd is enforced regardless of locale
+                break;
+            case MgPropertyType.Single:
+                value = String.format(locale, "%f", reader.GetSingle(propName));
+                break;
+            case MgPropertyType.Double:
+                value = String.format(locale, "%f", reader.GetDouble(propName));
+                break;
+            case MgPropertyType.Int16:
+                value = String.format(locale, "%d", reader.GetInt16(propName));
+                break;
+            case MgPropertyType.Int32:
+                value = String.format(locale, "%d", reader.GetInt32(propName));
+                break;
+            case MgPropertyType.Int64:
+                value = String.format(locale, "%d", reader.GetInt64(propName));
+                break;
+            case MgPropertyType.String:
+                value = JsonEscape(reader.GetString(propName)); // string content is arbitrary
+                break;
+            default: //NOT PRESENTABLE IN PROPERTY GRID
+                value = "";
+                break;
+        }
+        return value;   
+    }
+
+    static String GetDateTimeString(MgDateTime value) throws MgException
+    {
+        return value.GetYear() + "-" + value.GetMonth() + "-" + value.GetDay();
+    }
+    
+    void GetParameters(HttpServletRequest request)
+    {
+        mapName = GetParameter(request, "MAPNAME");
+        sessionId = GetParameter(request, "SESSION");
+        localeCode = GetParameter(request, "LOCALE");
+    }
+    
+    String JsonEscape(String str)
+    {
+        return EscapeForHtml(str).replace("\\", "\\\\");
+    }
+    
+    String JsonifyError(Exception ex)
+    {
+        if (ex == null)
+            return "";
+        /*
+        {
+            "Error" : {
+                "Message" : <exception-message>,
+                "StackTrace" : <exception-stack-trace>
+            }
+        }
+        */
+        
+        StringBuffer sb = new StringBuffer();
+        //Use exception message or type name if no message found
+        String msg = ex.getMessage();
+        if (msg == null || msg.length() == 0)
+        {
+            msg = MgLocalizer.GetString("SERVERERROR", localeCode);
+        }
+        //Begin response
+        sb.append("{\"Error\":{");
+        //Exception message
+        sb.append("\"Message\":\"" + JsonEscape(msg) + "\",");
+        StringBuffer strace = new StringBuffer();
+        StackTraceElement[] st = ex.getStackTrace();
+        for (int i = 0; i < st.length; i++)
+        {
+            strace.append(st[i].getClassName() + "." + st[i].getMethodName() + "(" + st[i].getLineNumber() + ")\\n");
+        }
+        sb.append("\"StackTrace\":\"" + JsonEscape(strace.toString()) + "\"");
+        //End response
+        sb.append("}}");
+        return sb.toString();
+    }
+    
+    static String GetJson(SelectionSet set)
+    {
+        /*
+        A sample of the JSON output this method will produce:
+        
+        
+        {
+            "Layer1" : [ 
+                { 
+                    'values' { "name" : "name1" , "value" : "value1" }, 
+                    'zoom' : { x: num1, y: num2 } 
+                } , 
+                ..,
+                ..,
+                ..,
+            ],
+            "Layer2" : [ 
+                { 
+                    'values' { "name" : "name2" , "value" : "value2" }, 
+                    'zoom' : { x: num1, y: num2 } 
+                } , 
+                ..,
+                ..,
+                ..,
+            ]
+        }
+        */
+        
+        if (set == null)
+            return "";
+        
+        StringBuffer sb = new StringBuffer();
+        //Begin selection set
+        sb.append("{");
+        String[] layers = set.getLayers();
+        for (int i = 0; i < layers.length; i++)
+        {
+            //Begin layer
+            sb.append("\"" + layers[i] + "\" : [");
+            Feature[] features = set.getFeatures(layers[i]);
+            for (int j = 0; j < features.length; j++)
+            {
+                Feature feat = features[j];
+                //begin feature
+                //begin feature properties
+                sb.append("{\"values\" : [");
+                FeatureProperty[] properties = feat.getProperties();
+                for(int k = 0; k < properties.length; k++)
+                {
+                    FeatureProperty fp = properties[k];
+                    sb.append("{\"name\" : \"" + fp.Name + "\", \"value\" : \"" + fp.Value + "\" }");
+                    if (k != properties.length - 1)
+                        sb.append(",");
+                }
+                //end feature properties
+                //begin zoom
+                sb.append("], \"zoom\" : ");
+                if (feat.Zoom == null)
+                    sb.append("null");
+                else
+                    sb.append("{\"x\" : " + feat.Zoom.X + ", \"y\" : " + feat.Zoom.Y + "}");
+                //end zoom
+                //end feature
+                sb.append("}");
+                if (j != features.length - 1)
+                    sb.append(",");
+            }
+            //End Layer
+            sb.append("]");
+            if (i != layers.length - 1)
+                sb.append(",");
+        }
+        //End selection set
+        sb.append("}");
+        return sb.toString();
+    }
+%>
+<%
+    mapName = "";
+    sessionId = "";
+    localeCode = "";
+
+    GetParameters(request);
+    
+    if (null == localeCode || localeCode.length() == 0)
+        localeCode = GetDefaultLocale();
+        
+    locale = new Locale(localeCode);
+
+    try
+    {
+        MgUserInformation cred = new MgUserInformation(sessionId);
+        cred.SetClientIp(GetClientIp(request));
+        cred.SetClientAgent(GetClientAgent());
+
+        MgSiteConnection site = new MgSiteConnection();
+        site.Open(cred);
+
+        MgResourceService resSvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
+        
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
+
+        MgSelection selection = new MgSelection(map);
+        selection.Open(resSvc, mapName);
+
+        MgReadOnlyLayerCollection layers = selection.GetLayers();
+        if (layers != null && layers.GetCount() > 0)
+        {
+            int layerCount = layers.GetCount();
+            MgAgfReaderWriter agfRW = new MgAgfReaderWriter();
+            SelectionSet selectionSet = new SelectionSet();
+
+            for (int i = 0; i < layerCount; i++)
+            {
+                MgLayerBase layer = layers.GetItem(i);
+                String layerName = layer.GetName();
+
+                MgResourceIdentifier fsId = new MgResourceIdentifier(layer.GetFeatureSourceId());
+                String className = layer.GetFeatureClassName();
+                String geomName = layer.GetFeatureGeometryName();
+
+                MgFeatureQueryOptions query = new MgFeatureQueryOptions();
+                HashMap<String, String> mappings = GetLayerPropertyMappings(resSvc, layer);
+                Set<String> propNames = mappings.keySet();
+
+                for (String name : propNames)
+                {
+                    query.AddFeatureProperty(name);
+                }
+
+                query.AddFeatureProperty(geomName);
+                String filter = selection.GenerateFilter(layer, className);
+                query.SetFilter(filter);
+
+                MgFeatureReader reader = layer.SelectFeatures(query);
+
+                MgClassDefinition clsDef = reader.GetClassDefinition();
+                MgPropertyDefinitionCollection props = clsDef.GetProperties();
+
+                while (reader.ReadNext())
+                {
+                    Feature feat = new Feature(layerName);
+                    ZoomPoint zoom = null;
+
+                    for (int k = 0; k < props.GetCount(); k++)
+                    {
+                        MgPropertyDefinition propDef = props.GetItem(k);
+                        String propName = propDef.GetName();
+                        int propType = reader.GetPropertyType(propName);
+
+                        if (mappings.get(propName) != null || propType == MgPropertyType.Geometry)
+                        {
+                            String value = "";
+                            if (!reader.IsNull(propName))
+                            {
+                                if (propName.equals(geomName))
+                                {
+                                    MgByteReader agf = reader.GetGeometry(propName);
+                                    MgGeometry geom = agfRW.Read(agf);
+                                    MgCoordinate pt = geom.GetCentroid().GetCoordinate();
+
+                                    zoom = new ZoomPoint();
+                                    zoom.X = pt.GetX();
+                                    zoom.Y = pt.GetY();
+
+                                    feat.Zoom = zoom;
+                                }
+                                else
+                                {
+                                    value = GetPropertyValueFromFeatureReader(reader, agfRW, propType, propName);
+                                }
+
+                                if (mappings.get(propName) != null)
+                                {
+                                    FeatureProperty fp = new FeatureProperty();
+                                    fp.Name = mappings.get(propName);
+                                    fp.Value = value;
+
+                                    feat.addProperty(fp);
+                                }
+                            }
+                        }
+                    }
+                    selectionSet.addFeature(feat);
+                }
+                reader.Close();
+            }
+
+            //Now output the selection set
+            response.addHeader("Content-Type", "application/json");
+            response.addHeader("X-JSON", "true");
+
+            response.getWriter().write(GetJson(selectionSet));
+        }
+    }
+    catch (MgException ex)
+    {
+        response.addHeader("Content-Type", "application/json");
+        response.addHeader("X-JSON", "true");
+        response.getWriter().write(JsonifyError(ex));
+    }
+    catch (Exception ex)
+    {
+        response.addHeader("Content-Type", "application/json");
+        response.addHeader("X-JSON", "true");
+        response.getWriter().write(JsonifyError(ex));
+    }
 %>
\ No newline at end of file


Property changes on: trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerjava/quickplotgeneratepicture.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/quickplotgeneratepicture.jsp	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerjava/quickplotgeneratepicture.jsp	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,229 +1,229 @@
-<%--
-  -Copyright (C) 2004-2010 by Autodesk, Inc.
-  -This library is free software; you can redistribute it and/or
-  -modify it under the terms of version 2.1 of the GNU Lesser
-  -General Public License as published by the Free Software Foundation.
-
-  -This library is distributed in the hope that it will be useful,
-  -but WITHOUT ANY WARRANTY; without even the implied warranty of
-  -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  -Lesser General Public License for more details.
-
-  -You should have received a copy of the GNU Lesser General Public
-  -License along with this library; if not, write to the Free Software
-  -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
---%>
-
-<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
-<%@ page import="org.osgeo.mapguide.*" %>
-<%@ page import="java.util.*" %>
-<%@ page import="java.io.*" %>
-<%@ page import="java.text.*" %>
-<%@ page import="javax.servlet.jsp.*" %>
-<%@ page import="javax.servlet.http.*" %>
-<%@ page import="java.util.*" %>
-<%@ page import="java.awt.*" %>
-<%@ page import="java.awt.image.*" %>
-<%@ page import="java.awt.geom.*" %>
-<%@ page import="javax.imageio.*" %>
-<%@ page import="javax.net.*" %>
-
-<%@ include file="common.jsp" %>
-<%@ page isThreadSafe="false" %>
-
-<%!
-String mapName;
-String sessionId;
-double rotation = 0.0;
-int printDpi    = 300;
-int scaleDenominator = 0;
-MgPolygon captureBox = null;
-MgPolygon normalizedCapture = null;
-Size<Integer> printSize = null;
-Size<Double> paperSize = null;
-String mapAgentPath = "";
-String naPath = "";
-%>
-
-<%
-    
-    GetRequestParameters(request);
-    response.setContentType("image/png");
-    ImageIO.write(GenerateMap(printSize), "png", response.getOutputStream());
-
-%>
-
-<%!
-void GetRequestParameters(HttpServletRequest request) throws MgException
-{
-    sessionId = ValidateSessionId(GetParameter(request, "session_id"));
-    mapName   = ValidateMapName(GetParameter(request, "map_name"));
-    rotation  = GetDoubleParameter(request, "rotation");
-    printDpi  = GetIntParameter(request, "print_dpi");
-    scaleDenominator = GetIntParameter(request, "scale_denominator");
-    
-    String[] a = GetParameter(request, "paper_size").split(",");
-    paperSize  = new Size<Double>(Double.parseDouble(a[0]), Double.parseDouble(a[1]));
-    printSize  = new Size<Integer>((int) (paperSize.width / 25.4 * printDpi), (int) (paperSize.height / 25.4 * printDpi));
-    
-    a = GetParameter(request, "box").split(",");
-    captureBox = CreatePolygon(a);
-    
-    a = GetParameter(request, "normalized_box").split(",");
-    normalizedCapture = CreatePolygon(a);
-    
-    mapAgentPath = GetMapAgentPath(request);
-    naPath = getServletContext().getRealPath("viewerfiles/quickplotnortharrow.png");
-}
-
-MgPolygon CreatePolygon(String[] coordinates) throws MgException
-{
-    MgGeometryFactory geometryFactory = new MgGeometryFactory();
-    MgCoordinateCollection coordinateCollection = new MgCoordinateCollection();
-    
-    for (int i = 0; i < coordinates.length; ++i)
-    {
-        coordinateCollection.Add(geometryFactory.CreateCoordinateXY(Double.parseDouble(coordinates[i]), Double.parseDouble(coordinates[++i])));
-    }
-    
-    coordinateCollection.Add(geometryFactory.CreateCoordinateXY(Double.parseDouble(coordinates[0]), Double.parseDouble(coordinates[1])));
-    MgLinearRing linearRing = geometryFactory.CreateLinearRing(coordinateCollection);
-    
-    return geometryFactory.CreatePolygon(linearRing, null);
-}
-
-BufferedImage GenerateMap(Size<Integer> size) throws MgException, IOException
-{
-    MgUserInformation userInfo = new MgUserInformation(sessionId);
-    MgSiteConnection siteConnection = new MgSiteConnection();
-    siteConnection.Open(userInfo);
-    MgResourceService resourceService = (MgResourceService) siteConnection.CreateService(MgServiceType.ResourceService);
-    MgRenderingService renderingService = (MgRenderingService) siteConnection.CreateService(MgServiceType.RenderingService);
-    
-    MgMap map = new MgMap();
-    map.Open(resourceService, mapName);
-    
-    MgSelection selection = new MgSelection(map);
-    
-    // Caculate the generated picture size
-    MgEnvelope envelope = captureBox.Envelope();
-    MgEnvelope normalizedE = normalizedCapture.Envelope();
-    Size<Double> size1 = new Size<Double>(envelope.GetWidth(), envelope.GetHeight());
-    Size<Double> size2 = new Size<Double>(normalizedE.GetWidth(), normalizedE.GetHeight());
-    
-    Size<Double> toSize = new Size<Double>(size1.width / size2.width * size.width, size1.height / size2.height * size.height);
-    MgCoordinate center = captureBox.GetCentroid().GetCoordinate();
-    
-    // Get the map agent url
-    // Get the correct http protocol
-    StringBuilder mapAgent = new StringBuilder(mapAgentPath);
-    mapAgent.append("?VERSION=1.0.0&OPERATION=GETMAPIMAGE")
-            .append("&SESSION=").append(sessionId)
-            .append("&MAPNAME=").append(mapName)
-            .append("&FORMAT=PNG")
-            .append("&SETVIEWCENTERX=").append(center.GetX())
-            .append("&SETVIEWCENTERY=").append(center.GetY())
-            .append("&SETVIEWSCALE=").append(scaleDenominator)
-            .append("&SETDISPLAYDPI=").append(printDpi)
-            .append("&SETDISPLAYWIDTH=").append(String.valueOf(toSize.width))
-            .append("&SETDISPLAYHEIGHT=").append(String.valueOf(toSize.height))
-            .append("&CLIP=0");
-            
-    BufferedImage image  = ImageIO.read(new URL(mapAgent.toString()));
-    BufferedImage result = Math.abs(rotation) > Double.MIN_VALUE ? new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB) : image;
-    Graphics2D graphics  = result.createGraphics();
-    
-    if (Math.abs(rotation) > Double.MIN_VALUE)
-    {
-        graphics.translate(size.width / 2, size.height / 2);
-        graphics.rotate(rotation * Math.PI / 180);
-        graphics.drawImage(image, new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BICUBIC), -image.getWidth() / 2, -image.getHeight() / 2);
-    }
-
-    graphics.dispose();
-    
-    DrawNorthArrow(result);
-    
-    return result;
-}
-
-void DrawNorthArrow(BufferedImage image) throws IOException
-{
-    // The north arrow image is created under this dpi
-    int naDpi = 300;
-    // The north arrow will be put at the bottom-right corner with a margin 12 MM
-    int naMargin = 12;
-    double scaleFactor = (double) printDpi / naDpi;
-
-    BufferedImage na  = ImageIO.read(new File(naPath));
-    Rectangle2D rec = new Rectangle2D.Double();
-    rec.setRect(0.0, 0.0, na.getWidth(), na.getHeight());
-    
-    Path2D.Double path = new Path2D.Double();
-    path.moveTo(0, 0);
-    path.lineTo(na.getWidth(), 0);
-    path.lineTo(na.getWidth(), na.getHeight());
-    path.lineTo(0, na.getHeight());
-
-    AffineTransform transform = new AffineTransform();
-    transform.rotate(rotation * Math.PI / 180, (double) na.getWidth() / 2, (double) na.getHeight() / 2);
-    transform.scale(scaleFactor, scaleFactor);
-    path.transform(transform);
-    
-    rec = path.getBounds2D();
-
-    BufferedImage rotatedNA = na;
-    // Transform the northarrow image if it's necessary to rotate it or scale it
-    if (Math.abs(rotation) > Double.MIN_VALUE || Math.abs(scaleFactor - 1.0) > Double.MIN_VALUE)
-    {
-        GraphicsConfiguration gc = na.createGraphics().getDeviceConfiguration();
-        rotatedNA = gc.createCompatibleImage((int) Math.ceil(rec.getWidth()), (int) Math.ceil(rec.getHeight()), Transparency.TRANSLUCENT);
-        Graphics2D nag = rotatedNA.createGraphics();
-        nag.setComposite(AlphaComposite.Src);
-        nag.translate(rec.getWidth() / 2, rec.getHeight() / 2);
-        nag.rotate(rotation * Math.PI / 180);
-        nag.scale(scaleFactor, scaleFactor);
-        nag.drawImage(na, new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BICUBIC), (int) Math.ceil(-na.getWidth() / 2), (int) Math.ceil(-na.getHeight() / 2));
-        nag.dispose();
-    }
-    
-    int x = (int) Math.ceil(image.getWidth() - rotatedNA.getWidth() - naMargin / 25.4 * printDpi);;
-    int y = (int) Math.ceil(image.getHeight() - rotatedNA.getHeight() - naMargin / 25.4 * printDpi);
-    
-    Graphics2D graphics = image.createGraphics();
-    graphics.drawImage(rotatedNA, new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BICUBIC), x, y);
-    graphics.dispose();
-}
-
-String GetMapAgentPath(HttpServletRequest request)
-{
-    // Get the map agent url
-    // Get the correct http protocol
-    StringBuilder mapAgent = new StringBuilder(request.getScheme());
-    mapAgent.append("://");
-    // Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
-    // be always on the same server with map agent. 
-    mapAgent.append("127.0.0.1").append(":");
-    // Get the correct port number;
-    mapAgent.append(request.getServerPort());
-    // Get the correct virtual directory
-    mapAgent.append(request.getContextPath());
-    mapAgent.append("/mapagent/mapagent.fcgi");
-    
-    return mapAgent.toString();
-}
-%>
-
-<%!
-    class Size<T>
-    {
-        public T width;
-        public T height;
-        
-        public Size(T width, T height)
-        {
-            this.width  = width;
-            this.height = height;
-        }
-    }
+<%--
+  -Copyright (C) 2004-2010 by Autodesk, Inc.
+  -This library is free software; you can redistribute it and/or
+  -modify it under the terms of version 2.1 of the GNU Lesser
+  -General Public License as published by the Free Software Foundation.
+
+  -This library is distributed in the hope that it will be useful,
+  -but WITHOUT ANY WARRANTY; without even the implied warranty of
+  -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  -Lesser General Public License for more details.
+
+  -You should have received a copy of the GNU Lesser General Public
+  -License along with this library; if not, write to the Free Software
+  -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+--%>
+
+<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@ page import="org.osgeo.mapguide.*" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.io.*" %>
+<%@ page import="java.text.*" %>
+<%@ page import="javax.servlet.jsp.*" %>
+<%@ page import="javax.servlet.http.*" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.awt.*" %>
+<%@ page import="java.awt.image.*" %>
+<%@ page import="java.awt.geom.*" %>
+<%@ page import="javax.imageio.*" %>
+<%@ page import="javax.net.*" %>
+
+<%@ include file="common.jsp" %>
+<%@ page isThreadSafe="false" %>
+
+<%!
+String mapName;
+String sessionId;
+double rotation = 0.0;
+int printDpi    = 300;
+int scaleDenominator = 0;
+MgPolygon captureBox = null;
+MgPolygon normalizedCapture = null;
+Size<Integer> printSize = null;
+Size<Double> paperSize = null;
+String mapAgentPath = "";
+String naPath = "";
+%>
+
+<%
+    
+    GetRequestParameters(request);
+    response.setContentType("image/png");
+    ImageIO.write(GenerateMap(printSize), "png", response.getOutputStream());
+
+%>
+
+<%!
+void GetRequestParameters(HttpServletRequest request) throws MgException
+{
+    sessionId = ValidateSessionId(GetParameter(request, "session_id"));
+    mapName   = ValidateMapName(GetParameter(request, "map_name"));
+    rotation  = GetDoubleParameter(request, "rotation");
+    printDpi  = GetIntParameter(request, "print_dpi");
+    scaleDenominator = GetIntParameter(request, "scale_denominator");
+    
+    String[] a = GetParameter(request, "paper_size").split(",");
+    paperSize  = new Size<Double>(Double.parseDouble(a[0]), Double.parseDouble(a[1]));
+    printSize  = new Size<Integer>((int) (paperSize.width / 25.4 * printDpi), (int) (paperSize.height / 25.4 * printDpi));
+    
+    a = GetParameter(request, "box").split(",");
+    captureBox = CreatePolygon(a);
+    
+    a = GetParameter(request, "normalized_box").split(",");
+    normalizedCapture = CreatePolygon(a);
+    
+    mapAgentPath = GetMapAgentPath(request);
+    naPath = getServletContext().getRealPath("viewerfiles/quickplotnortharrow.png");
+}
+
+MgPolygon CreatePolygon(String[] coordinates) throws MgException
+{
+    MgGeometryFactory geometryFactory = new MgGeometryFactory();
+    MgCoordinateCollection coordinateCollection = new MgCoordinateCollection();
+    
+    for (int i = 0; i < coordinates.length; ++i)
+    {
+        coordinateCollection.Add(geometryFactory.CreateCoordinateXY(Double.parseDouble(coordinates[i]), Double.parseDouble(coordinates[++i])));
+    }
+    
+    coordinateCollection.Add(geometryFactory.CreateCoordinateXY(Double.parseDouble(coordinates[0]), Double.parseDouble(coordinates[1])));
+    MgLinearRing linearRing = geometryFactory.CreateLinearRing(coordinateCollection);
+    
+    return geometryFactory.CreatePolygon(linearRing, null);
+}
+
+BufferedImage GenerateMap(Size<Integer> size) throws MgException, IOException
+{
+    MgUserInformation userInfo = new MgUserInformation(sessionId);
+    MgSiteConnection siteConnection = new MgSiteConnection();
+    siteConnection.Open(userInfo);
+    MgResourceService resourceService = (MgResourceService) siteConnection.CreateService(MgServiceType.ResourceService);
+    MgRenderingService renderingService = (MgRenderingService) siteConnection.CreateService(MgServiceType.RenderingService);
+    
+    MgMap map = new MgMap();
+    map.Open(resourceService, mapName);
+    
+    MgSelection selection = new MgSelection(map);
+    
+    // Caculate the generated picture size
+    MgEnvelope envelope = captureBox.Envelope();
+    MgEnvelope normalizedE = normalizedCapture.Envelope();
+    Size<Double> size1 = new Size<Double>(envelope.GetWidth(), envelope.GetHeight());
+    Size<Double> size2 = new Size<Double>(normalizedE.GetWidth(), normalizedE.GetHeight());
+    
+    Size<Double> toSize = new Size<Double>(size1.width / size2.width * size.width, size1.height / size2.height * size.height);
+    MgCoordinate center = captureBox.GetCentroid().GetCoordinate();
+    
+    // Get the map agent url
+    // Get the correct http protocol
+    StringBuilder mapAgent = new StringBuilder(mapAgentPath);
+    mapAgent.append("?VERSION=1.0.0&OPERATION=GETMAPIMAGE")
+            .append("&SESSION=").append(sessionId)
+            .append("&MAPNAME=").append(mapName)
+            .append("&FORMAT=PNG")
+            .append("&SETVIEWCENTERX=").append(center.GetX())
+            .append("&SETVIEWCENTERY=").append(center.GetY())
+            .append("&SETVIEWSCALE=").append(scaleDenominator)
+            .append("&SETDISPLAYDPI=").append(printDpi)
+            .append("&SETDISPLAYWIDTH=").append(String.valueOf(toSize.width))
+            .append("&SETDISPLAYHEIGHT=").append(String.valueOf(toSize.height))
+            .append("&CLIP=0");
+            
+    BufferedImage image  = ImageIO.read(new URL(mapAgent.toString()));
+    BufferedImage result = Math.abs(rotation) > Double.MIN_VALUE ? new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB) : image;
+    Graphics2D graphics  = result.createGraphics();
+    
+    if (Math.abs(rotation) > Double.MIN_VALUE)
+    {
+        graphics.translate(size.width / 2, size.height / 2);
+        graphics.rotate(rotation * Math.PI / 180);
+        graphics.drawImage(image, new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BICUBIC), -image.getWidth() / 2, -image.getHeight() / 2);
+    }
+
+    graphics.dispose();
+    
+    DrawNorthArrow(result);
+    
+    return result;
+}
+
+void DrawNorthArrow(BufferedImage image) throws IOException
+{
+    // The north arrow image is created under this dpi
+    int naDpi = 300;
+    // The north arrow will be put at the bottom-right corner with a margin 12 MM
+    int naMargin = 12;
+    double scaleFactor = (double) printDpi / naDpi;
+
+    BufferedImage na  = ImageIO.read(new File(naPath));
+    Rectangle2D rec = new Rectangle2D.Double();
+    rec.setRect(0.0, 0.0, na.getWidth(), na.getHeight());
+    
+    Path2D.Double path = new Path2D.Double();
+    path.moveTo(0, 0);
+    path.lineTo(na.getWidth(), 0);
+    path.lineTo(na.getWidth(), na.getHeight());
+    path.lineTo(0, na.getHeight());
+
+    AffineTransform transform = new AffineTransform();
+    transform.rotate(rotation * Math.PI / 180, (double) na.getWidth() / 2, (double) na.getHeight() / 2);
+    transform.scale(scaleFactor, scaleFactor);
+    path.transform(transform);
+    
+    rec = path.getBounds2D();
+
+    BufferedImage rotatedNA = na;
+    // Transform the northarrow image if it's necessary to rotate it or scale it
+    if (Math.abs(rotation) > Double.MIN_VALUE || Math.abs(scaleFactor - 1.0) > Double.MIN_VALUE)
+    {
+        GraphicsConfiguration gc = na.createGraphics().getDeviceConfiguration();
+        rotatedNA = gc.createCompatibleImage((int) Math.ceil(rec.getWidth()), (int) Math.ceil(rec.getHeight()), Transparency.TRANSLUCENT);
+        Graphics2D nag = rotatedNA.createGraphics();
+        nag.setComposite(AlphaComposite.Src);
+        nag.translate(rec.getWidth() / 2, rec.getHeight() / 2);
+        nag.rotate(rotation * Math.PI / 180);
+        nag.scale(scaleFactor, scaleFactor);
+        nag.drawImage(na, new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BICUBIC), (int) Math.ceil(-na.getWidth() / 2), (int) Math.ceil(-na.getHeight() / 2));
+        nag.dispose();
+    }
+    
+    int x = (int) Math.ceil(image.getWidth() - rotatedNA.getWidth() - naMargin / 25.4 * printDpi);;
+    int y = (int) Math.ceil(image.getHeight() - rotatedNA.getHeight() - naMargin / 25.4 * printDpi);
+    
+    Graphics2D graphics = image.createGraphics();
+    graphics.drawImage(rotatedNA, new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BICUBIC), x, y);
+    graphics.dispose();
+}
+
+String GetMapAgentPath(HttpServletRequest request)
+{
+    // Get the map agent url
+    // Get the correct http protocol
+    StringBuilder mapAgent = new StringBuilder(request.getScheme());
+    mapAgent.append("://");
+    // Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
+    // be always on the same server with map agent. 
+    mapAgent.append("127.0.0.1").append(":");
+    // Get the correct port number;
+    mapAgent.append(request.getServerPort());
+    // Get the correct virtual directory
+    mapAgent.append(request.getContextPath());
+    mapAgent.append("/mapagent/mapagent.fcgi");
+    
+    return mapAgent.toString();
+}
+%>
+
+<%!
+    class Size<T>
+    {
+        public T width;
+        public T height;
+        
+        public Size(T width, T height)
+        {
+            this.width  = width;
+            this.height = height;
+        }
+    }
 %>
\ No newline at end of file


Property changes on: trunk/MgDev/Web/src/mapviewerjava/quickplotgeneratepicture.jsp
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerjava/quickplotpanel.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/quickplotpanel.jsp	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerjava/quickplotpanel.jsp	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,67 +1,67 @@
-<%--
-  -Copyright (C) 2004-2010 by Autodesk, Inc.
-  -This library is free software; you can redistribute it and/or
-  -modify it under the terms of version 2.1 of the GNU Lesser
-  -General Public License as published by the Free Software Foundation.
-
-  -This library is distributed in the hope that it will be useful,
-  -but WITHOUT ANY WARRANTY; without even the implied warranty of
-  -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  -Lesser General Public License for more details.
-
-  -You should have received a copy of the GNU Lesser General Public
-  -License along with this library; if not, write to the Free Software
-  -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
---%>
-
-<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
-<%@ page import="org.osgeo.mapguide.*" %>
-<%@ page import="java.util.*" %>
-<%@ page import="java.io.*" %>
-<%@ page import="java.text.*" %>
-<%@ page import="javax.servlet.jsp.*" %>
-<%@ page import="javax.servlet.http.*" %>
-<%@ include file="common.jsp" %>
-<%@ page isThreadSafe="false" %>
-
-<%!
-String mapName;
-String sessionId;
-String locale;
-int targetType;
-int us;
-%>
-
-<%
-    response.setContentType("text/html; charset=UTF-8");
-    request.setCharacterEncoding("UTF-8");
-    mapName = sessionId = locale = "";
-    targetType = us = 0;
-
-    MgLocalizer.SetLocalizedFilesPath(getServletContext().getRealPath("/") + "localized/");
-    GetRequestParameters(request);
-
-    String vpath = GetSurroundVirtualPath(request);
-	String jsPath = "../viewerfiles/";
-    String templ = MgLocalizer.Localize(LoadTemplate("/viewerfiles/quickplotpanel.templ"), locale, GetClientOS(request));
-    String[] vals = { 
-                      jsPath,
-                      jsPath,
-                      String.valueOf(targetType),
-                      "quickplotgeneratepicture.jsp",
-                      "quickplotpreviewinner.jsp"
-                      };
-
-    response.getWriter().write(Substitute(templ, vals));
-%>
-
-<%!
-void GetRequestParameters(HttpServletRequest request)
-{
-    sessionId = ValidateSessionId(GetParameter(request, "SESSION"));
-    locale = ValidateLocaleString(GetParameter(request, "LOCALE"));
-    mapName = ValidateMapName(GetParameter(request, "MAPNAME"));
-    targetType = GetIntParameter(request, "TARGETTYPE");
-    us = GetIntParameter(request, "US");
-}
-%>
+<%--
+  -Copyright (C) 2004-2010 by Autodesk, Inc.
+  -This library is free software; you can redistribute it and/or
+  -modify it under the terms of version 2.1 of the GNU Lesser
+  -General Public License as published by the Free Software Foundation.
+
+  -This library is distributed in the hope that it will be useful,
+  -but WITHOUT ANY WARRANTY; without even the implied warranty of
+  -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  -Lesser General Public License for more details.
+
+  -You should have received a copy of the GNU Lesser General Public
+  -License along with this library; if not, write to the Free Software
+  -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+--%>
+
+<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@ page import="org.osgeo.mapguide.*" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.io.*" %>
+<%@ page import="java.text.*" %>
+<%@ page import="javax.servlet.jsp.*" %>
+<%@ page import="javax.servlet.http.*" %>
+<%@ include file="common.jsp" %>
+<%@ page isThreadSafe="false" %>
+
+<%!
+String mapName;
+String sessionId;
+String locale;
+int targetType;
+int us;
+%>
+
+<%
+    response.setContentType("text/html; charset=UTF-8");
+    request.setCharacterEncoding("UTF-8");
+    mapName = sessionId = locale = "";
+    targetType = us = 0;
+
+    MgLocalizer.SetLocalizedFilesPath(getServletContext().getRealPath("/") + "localized/");
+    GetRequestParameters(request);
+
+    String vpath = GetSurroundVirtualPath(request);
+	String jsPath = "../viewerfiles/";
+    String templ = MgLocalizer.Localize(LoadTemplate("/viewerfiles/quickplotpanel.templ"), locale, GetClientOS(request));
+    String[] vals = { 
+                      jsPath,
+                      jsPath,
+                      String.valueOf(targetType),
+                      "quickplotgeneratepicture.jsp",
+                      "quickplotpreviewinner.jsp"
+                      };
+
+    response.getWriter().write(Substitute(templ, vals));
+%>
+
+<%!
+void GetRequestParameters(HttpServletRequest request)
+{
+    sessionId = ValidateSessionId(GetParameter(request, "SESSION"));
+    locale = ValidateLocaleString(GetParameter(request, "LOCALE"));
+    mapName = ValidateMapName(GetParameter(request, "MAPNAME"));
+    targetType = GetIntParameter(request, "TARGETTYPE");
+    us = GetIntParameter(request, "US");
+}
+%>


Property changes on: trunk/MgDev/Web/src/mapviewerjava/quickplotpanel.jsp
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerjava/quickplotpreviewinner.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/quickplotpreviewinner.jsp	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerjava/quickplotpreviewinner.jsp	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,98 +1,98 @@
-<%--
-  -Copyright (C) 2004-2010 by Autodesk, Inc.
-  -This library is free software; you can redistribute it and/or
-  -modify it under the terms of version 2.1 of the GNU Lesser
-  -General Public License as published by the Free Software Foundation.
-
-  -This library is distributed in the hope that it will be useful,
-  -but WITHOUT ANY WARRANTY; without even the implied warranty of
-  -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  -Lesser General Public License for more details.
-
-  -You should have received a copy of the GNU Lesser General Public
-  -License along with this library; if not, write to the Free Software
-  -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
---%>
-
-<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
-<%@ page import="org.osgeo.mapguide.*" %>
-<%@ page import="java.util.*" %>
-<%@ page import="java.io.*" %>
-<%@ page import="java.text.*" %>
-<%@ page import="javax.servlet.jsp.*" %>
-<%@ page import="javax.servlet.http.*" %>
-<%@ page import="java.util.*" %>
-<%@ page import="java.util.regex.*" %>
-
-<%@ include file="common.jsp" %>
-<%@ page isThreadSafe="false" %>
-
-<%!
-String mapName;
-String sessionId;
-String locale;
-int targetType;
-int us;
-
-Hashtable<String, String> annotations = new Hashtable<String, String>();
-%>
-
-<%
-    response.setContentType("text/html; charset=UTF-8");
-    request.setCharacterEncoding("UTF-8");
-    mapName = sessionId = locale = "";
-    targetType = us = 0;
-
-    MgLocalizer.SetLocalizedFilesPath(getServletContext().getRealPath("/") + "localized/");
-    GetRequestParameters(request);
-
-	String jsPath = "../viewerfiles/";
-    String templ = MgLocalizer.Localize(LoadTemplate("/viewerfiles/quickplotpreviewinner.templ"), locale, GetClientOS(request));
-    
-    for (Enumeration<String> keys = annotations.keys();
-         keys.hasMoreElements();)
-    {
-        String key = keys.nextElement();
-        templ = templ.replaceAll(Pattern.quote(key), annotations.get(key));
-    }
-    // Set the date annotation according to its format mask
-    Pattern pattern = Pattern.compile("\\{date:.*\\[java=(.+?)\\].*?\\}");
-    Matcher matcher = pattern.matcher(templ);
-    // Set a default format string
-    String formatString = "%1$tm/%1$te/%1$tY";
-    if (matcher.matches())
-    {
-        formatString = matcher.group(1);
-    }
-    
-    templ = templ.replaceAll(pattern.toString(), String.format(formatString, Calendar.getInstance()));
-    String[] vals = {jsPath};
-
-    response.getWriter().write(Substitute(templ, vals));
-%>
-
-<%!
-void GetRequestParameters(HttpServletRequest request)
-{
-    sessionId = ValidateSessionId(GetParameter(request, "SESSION"));
-    locale = ValidateLocaleString(GetParameter(request, "LOCALE"));
-    mapName = ValidateMapName(GetParameter(request, "MAPNAME"));
-    targetType = GetIntParameter(request, "TARGETTYPE");
-    us = GetIntParameter(request, "US");
-    
-    // The parameters whose name matches this pattern will be treated as annotation
-    String pattern = "^\\{field:.+\\}$";
-    for (Enumeration<String> names = request.getParameterNames();
-         names.hasMoreElements();)
-     {
-        String name = names.nextElement();
-
-        if (name.matches(pattern))
-        {
-            annotations.put(name, EscapeForHtml(request.getParameter(name)));
-        }
-     }
-    
-    annotations.put("{scale}", "1 : " + GetParameter(request, "scale_denominator"));
-}
-%>
+<%--
+  -Copyright (C) 2004-2010 by Autodesk, Inc.
+  -This library is free software; you can redistribute it and/or
+  -modify it under the terms of version 2.1 of the GNU Lesser
+  -General Public License as published by the Free Software Foundation.
+
+  -This library is distributed in the hope that it will be useful,
+  -but WITHOUT ANY WARRANTY; without even the implied warranty of
+  -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  -Lesser General Public License for more details.
+
+  -You should have received a copy of the GNU Lesser General Public
+  -License along with this library; if not, write to the Free Software
+  -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+--%>
+
+<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@ page import="org.osgeo.mapguide.*" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.io.*" %>
+<%@ page import="java.text.*" %>
+<%@ page import="javax.servlet.jsp.*" %>
+<%@ page import="javax.servlet.http.*" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.util.regex.*" %>
+
+<%@ include file="common.jsp" %>
+<%@ page isThreadSafe="false" %>
+
+<%!
+String mapName;
+String sessionId;
+String locale;
+int targetType;
+int us;
+
+Hashtable<String, String> annotations = new Hashtable<String, String>();
+%>
+
+<%
+    response.setContentType("text/html; charset=UTF-8");
+    request.setCharacterEncoding("UTF-8");
+    mapName = sessionId = locale = "";
+    targetType = us = 0;
+
+    MgLocalizer.SetLocalizedFilesPath(getServletContext().getRealPath("/") + "localized/");
+    GetRequestParameters(request);
+
+	String jsPath = "../viewerfiles/";
+    String templ = MgLocalizer.Localize(LoadTemplate("/viewerfiles/quickplotpreviewinner.templ"), locale, GetClientOS(request));
+    
+    for (Enumeration<String> keys = annotations.keys();
+         keys.hasMoreElements();)
+    {
+        String key = keys.nextElement();
+        templ = templ.replaceAll(Pattern.quote(key), annotations.get(key));
+    }
+    // Set the date annotation according to its format mask
+    Pattern pattern = Pattern.compile("\\{date:.*\\[java=(.+?)\\].*?\\}");
+    Matcher matcher = pattern.matcher(templ);
+    // Set a default format string
+    String formatString = "%1$tm/%1$te/%1$tY";
+    if (matcher.matches())
+    {
+        formatString = matcher.group(1);
+    }
+    
+    templ = templ.replaceAll(pattern.toString(), String.format(formatString, Calendar.getInstance()));
+    String[] vals = {jsPath};
+
+    response.getWriter().write(Substitute(templ, vals));
+%>
+
+<%!
+void GetRequestParameters(HttpServletRequest request)
+{
+    sessionId = ValidateSessionId(GetParameter(request, "SESSION"));
+    locale = ValidateLocaleString(GetParameter(request, "LOCALE"));
+    mapName = ValidateMapName(GetParameter(request, "MAPNAME"));
+    targetType = GetIntParameter(request, "TARGETTYPE");
+    us = GetIntParameter(request, "US");
+    
+    // The parameters whose name matches this pattern will be treated as annotation
+    String pattern = "^\\{field:.+\\}$";
+    for (Enumeration<String> names = request.getParameterNames();
+         names.hasMoreElements();)
+     {
+        String name = names.nextElement();
+
+        if (name.matches(pattern))
+        {
+            annotations.put(name, EscapeForHtml(request.getParameter(name)));
+        }
+     }
+    
+    annotations.put("{scale}", "1 : " + GetParameter(request, "scale_denominator"));
+}
+%>


Property changes on: trunk/MgDev/Web/src/mapviewerjava/quickplotpreviewinner.jsp
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,387 +1,387 @@
-<%@ Page Language="C#" %>
-<%@ Import Namespace="System" %>
-<%@ Import Namespace="System.IO" %>
-<%@ Import Namespace="System.Collections.Generic" %>
-<%@ Import Namespace="System.Web" %>
-<%@ Import Namespace="System.Xml" %>
-<%@ Import Namespace="System.Globalization" %>
-<%@ Import Namespace="OSGeo.MapGuide" %>
-<!-- #include File="common.aspx" -->
-
-<script runat="server">
-    
-    class SelectionSet
-    {
-        private Dictionary<string, List<Feature>> _layers;
-
-        public SelectionSet()
-        {
-            _layers = new Dictionary<String, List<Feature>>();
-        }
-
-        public void AddFeature(Feature feat)
-        {
-            if (!_layers.ContainsKey(feat.LayerName))
-                _layers[feat.LayerName] = new List<Feature>();
-
-            _layers[feat.LayerName].Add(feat);
-        }
-
-        public String[] GetLayers()
-        {
-            return new List<String>(_layers.Keys).ToArray();
-        }
-
-        public Feature[] GetFeatures(String layerName)
-        {
-            if (_layers.ContainsKey(layerName))
-                return _layers[layerName].ToArray();
-
-            return null;
-        }
-    }
-
-    class ZoomPoint
-    {
-        public double X;
-        public double Y;
-    }
-
-    class FeatureProperty
-    {
-        public String Name;
-        public String Value;
-    }
-
-    class Feature
-    {
-        public String LayerName;
-        public ZoomPoint Zoom;
-
-        private Dictionary<string, FeatureProperty> _properties;
-
-        public Feature(string layerName)
-        {
-            this.LayerName = layerName;
-            _properties = new Dictionary<string, FeatureProperty>();
-        }
-
-        public void AddProperty(FeatureProperty prop)
-        {
-            _properties[prop.Name] = prop;
-        }
-
-        public FeatureProperty[] GetProperties()
-        {
-            return new List<FeatureProperty>(_properties.Values).ToArray();
-        }
-    }
-    
-    String mapName;
-    String sessionId;
-    String locale;
-    CultureInfo culture;
-
-    static NameValueCollection GetLayerPropertyMappings(MgResourceService resSvc, MgLayerBase layer)
-    {
-        NameValueCollection mappings = new NameValueCollection();
-        MgByteReader content = resSvc.GetResourceContent(layer.GetLayerDefinition());
-        XmlDocument doc = new XmlDocument();
-        doc.LoadXml(content.ToString());
-        XmlNodeList propNodes = doc.SelectNodes("//LayerDefinition/VectorLayerDefinition/PropertyMapping");
-        foreach (XmlNode propNode in propNodes)
-        {
-            String name = propNode["Name"].InnerText;
-            String value = propNode["Value"].InnerText;
-
-            mappings[name] = value;
-        }
-        return mappings;
-    }
-    
-    String GetPropertyValueFromFeatureReader(MgFeatureReader reader, MgAgfReaderWriter agfRw, int propType, String propName)
-    {
-        String value = "";
-        switch(propType)
-        {
-            case MgPropertyType.Boolean:
-                value = String.Format(culture, "{0}", reader.GetBoolean(propName));
-                break;
-            case MgPropertyType.Byte:
-                value = String.Format(culture, "{0:d}", reader.GetByte(propName));
-                break; 
-            case MgPropertyType.DateTime:
-                value = GetDateTimeString(reader.GetDateTime(propName)); // yyyy-mm-dd is enforced regardless of locale
-                break;
-            case MgPropertyType.Single:
-                value = String.Format(culture, "{0:f}", reader.GetSingle(propName));
-                break;
-            case MgPropertyType.Double:
-                value = String.Format(culture, "{0:f}", reader.GetDouble(propName));
-                break;
-            case MgPropertyType.Int16:
-                value = String.Format(culture, "{0:d}", reader.GetInt16(propName));
-                break;
-            case MgPropertyType.Int32:
-                value = String.Format(culture, "{0:d}", reader.GetInt32(propName));
-                break;
-            case MgPropertyType.Int64:
-                value = String.Format(culture, "{0:d}", reader.GetInt64(propName));
-                break;
-            case MgPropertyType.String:
-                value = JsonEscape(reader.GetString(propName)); //String content is arbitrary
-                break;
-            default: //NOT PRESENTABLE IN PROPERTY GRID
-                value = "";
-                break;
-        }
-        return value;   
-    }
-
-    static String GetDateTimeString(MgDateTime value)
-    {
-        return String.Format("{0}-{1}-{2}", value.Year, value.Month, value.Day);
-    }
-    
-    void GetParameters(NameValueCollection param)
-    {
-        mapName = param["MAPNAME"];
-        sessionId = param["SESSION"];
-        locale = param["LOCALE"];
-    }
-
-    void GetRequestParameters()
-    {
-        if (Request.RequestType == "POST")
-            GetParameters(Request.Form);
-        else
-            GetParameters(Request.QueryString);
-    }
-    
-    String JsonEscape(String str)
-    {
-        return EscapeForHtml(str).Replace("\\", "\\\\");
-    }
-    
-    String JsonifyError(Exception ex)
-    {
-        return "{\"Error\":{\"Message\":\"" + JsonEscape(ex.Message) + "\",\"StackTrace\":\"" + JsonEscape(ex.StackTrace) + "\"}}";
-    }
-
-    static String GetJson(SelectionSet set)
-    {
-        /*
-        A sample of the JSON output this method will produce:
-        
-        
-        {
-            "Layer1" : [ 
-                { 
-                    'values' { "name" : "name1" , "value" : "value1" }, 
-                    'zoom' : { x: num1, y: num2 } 
-                } , 
-                ..,
-                ..,
-                ..,
-            ],
-            "Layer2" : [ 
-                { 
-                    'values' { "name" : "name2" , "value" : "value2" }, 
-                    'zoom' : { x: num1, y: num2 } 
-                } , 
-                ..,
-                ..,
-                ..,
-            ]
-        }
-        */
-        
-        if (set == null)
-            return "";
-        
-        StringBuilder sb = new StringBuilder();
-        //Begin selection set
-        sb.Append("{");
-        String[] layers = set.GetLayers();
-        for (int i = 0; i < layers.Length; i++)
-        {
-            //Begin layer
-            sb.Append("\"" + layers[i] + "\" : [");
-            Feature[] features = set.GetFeatures(layers[i]);
-            for (int j = 0; j < features.Length; j++)
-            {
-                Feature feat = features[j];
-                //begin feature
-                //begin feature properties
-                sb.Append("{\"values\" : [");
-                FeatureProperty[] properties = feat.GetProperties();
-                for(int k = 0; k < properties.Length; k++)
-                {
-                    FeatureProperty fp = properties[k];
-                    sb.Append("{\"name\" : \"" + fp.Name + "\", \"value\" : \"" + fp.Value + "\" }");
-                    if (k != properties.Length - 1)
-                        sb.Append(",");
-                }
-                //end feature properties
-                //begin zoom
-                sb.Append("], \"zoom\" : ");
-                if (feat.Zoom == null)
-                    sb.Append("null");
-                else
-                    sb.Append("{\"x\" : " + feat.Zoom.X + ", \"y\" : " + feat.Zoom.Y + "}");
-                //end zoom
-                //end feature
-                sb.Append("}");
-                if (j != features.Length - 1)
-                    sb.Append(",");
-            }
-            //End Layer
-            sb.Append("]");
-            if (i != layers.Length - 1)
-                sb.Append(",");
-        }
-        //End selection set
-        sb.Append("}");
-        return sb.ToString();
-    }
-    
-</script>
-<% 
-
-    mapName = "";
-    sessionId = "";
-    locale = "";
-
-    GetRequestParameters();
-    
-    if (String.IsNullOrEmpty(locale))
-        locale = GetDefaultLocale();
-        
-    culture = CultureInfo.GetCultureInfo(locale);
-    
-    //HACK: The default locale (en) resolves to a neutral culture, .net forbids the use of 
-    //neutral cultures for formatting purposes, so default to InvariantCulture if the resolved
-    //culture is not neutral.
-    if (culture.IsNeutralCulture)
-        culture = CultureInfo.InvariantCulture; //We need a non-neutral culture
-
-    try
-    {
-        MgUserInformation cred = new MgUserInformation(sessionId);
-        cred.SetClientIp(GetClientIp(Request));
-        cred.SetClientAgent(GetClientAgent());
-
-        MgSiteConnection site = new MgSiteConnection();
-        site.Open(cred);
-
-        MgResourceService resSvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
-        
-        MgMap map = new MgMap(site);
-        map.Open(mapName);
-
-        MgSelection selection = new MgSelection(map);
-        selection.Open(resSvc, mapName);
-
-        MgReadOnlyLayerCollection layers = selection.GetLayers();
-        if (layers != null && layers.Count > 0)
-        {
-            int layerCount = layers.Count;
-            MgAgfReaderWriter agfRW = new MgAgfReaderWriter();
-            SelectionSet selectionSet = new SelectionSet();
-
-            for (int i = 0; i < layerCount; i++)
-            {
-                MgLayerBase layer = layers[i];
-                String layerName = layer.Name;
-
-                MgResourceIdentifier fsId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-                String className = layer.GetFeatureClassName();
-                String geomName = layer.GetFeatureGeometryName();
-
-                MgFeatureQueryOptions query = new MgFeatureQueryOptions();
-                NameValueCollection mappings = GetLayerPropertyMappings(resSvc, layer);
-
-                foreach (String key in mappings.Keys)
-                {
-                    query.AddFeatureProperty(key);
-                }
-
-                query.AddFeatureProperty(geomName);
-                String filter = selection.GenerateFilter(layer, className);
-                query.SetFilter(filter);
-
-                MgFeatureReader reader = layer.SelectFeatures(query);
-
-                MgClassDefinition clsDef = reader.GetClassDefinition();
-                MgPropertyDefinitionCollection props = clsDef.GetProperties();
-
-                while (reader.ReadNext())
-                {
-                    Feature feat = new Feature(layerName);
-                    ZoomPoint zoom = null;
-
-                    for (int k = 0; k < props.Count; k++)
-                    {
-                        MgPropertyDefinition propDef = props[k];
-                        String propName = propDef.Name;
-                        int propType = reader.GetPropertyType(propName);
-
-                        if (mappings[propName] != null || propType == MgPropertyType.Geometry)
-                        {
-                            String value = "";
-                            if (!reader.IsNull(propName))
-                            {
-                                if (propName == geomName)
-                                {
-                                    MgByteReader agf = reader.GetGeometry(propName);
-                                    MgGeometry geom = agfRW.Read(agf);
-                                    MgCoordinate pt = geom.Centroid.Coordinate;
-
-                                    zoom = new ZoomPoint();
-                                    zoom.X = pt.X;
-                                    zoom.Y = pt.Y;
-
-                                    feat.Zoom = zoom;
-                                }
-                                else
-                                {
-                                    value = GetPropertyValueFromFeatureReader(reader, agfRW, propType, propName);
-                                }
-
-                                if (mappings[propName] != null)
-                                {
-                                    FeatureProperty fp = new FeatureProperty();
-                                    fp.Name = mappings[propName];
-                                    fp.Value = value;
-
-                                    feat.AddProperty(fp);
-                                }
-                            }
-                        }
-                    }
-                    selectionSet.AddFeature(feat);
-                }
-                reader.Close();
-            }
-
-            //Now output the selection set
-            Response.AddHeader("Content-Type", "application/json");
-            Response.AddHeader("X-JSON", "true");
-
-            Response.Write(GetJson(selectionSet));
-        }
-    }
-    catch (MgException ex)
-    {
-        Response.AddHeader("Content-Type", "application/json");
-        Response.AddHeader("X-JSON", "true");
-        Response.Write(JsonifyError(ex));
-    }
-    catch (Exception ex)
-    { 
-        Response.AddHeader("Content-Type", "application/json");
-        Response.AddHeader("X-JSON", "true");
-        Response.Write(JsonifyError(ex));
-    }
-    
+<%@ Page Language="C#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Collections.Generic" %>
+<%@ Import Namespace="System.Web" %>
+<%@ Import Namespace="System.Xml" %>
+<%@ Import Namespace="System.Globalization" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+<!-- #include File="common.aspx" -->
+
+<script runat="server">
+    
+    class SelectionSet
+    {
+        private Dictionary<string, List<Feature>> _layers;
+
+        public SelectionSet()
+        {
+            _layers = new Dictionary<String, List<Feature>>();
+        }
+
+        public void AddFeature(Feature feat)
+        {
+            if (!_layers.ContainsKey(feat.LayerName))
+                _layers[feat.LayerName] = new List<Feature>();
+
+            _layers[feat.LayerName].Add(feat);
+        }
+
+        public String[] GetLayers()
+        {
+            return new List<String>(_layers.Keys).ToArray();
+        }
+
+        public Feature[] GetFeatures(String layerName)
+        {
+            if (_layers.ContainsKey(layerName))
+                return _layers[layerName].ToArray();
+
+            return null;
+        }
+    }
+
+    class ZoomPoint
+    {
+        public double X;
+        public double Y;
+    }
+
+    class FeatureProperty
+    {
+        public String Name;
+        public String Value;
+    }
+
+    class Feature
+    {
+        public String LayerName;
+        public ZoomPoint Zoom;
+
+        private Dictionary<string, FeatureProperty> _properties;
+
+        public Feature(string layerName)
+        {
+            this.LayerName = layerName;
+            _properties = new Dictionary<string, FeatureProperty>();
+        }
+
+        public void AddProperty(FeatureProperty prop)
+        {
+            _properties[prop.Name] = prop;
+        }
+
+        public FeatureProperty[] GetProperties()
+        {
+            return new List<FeatureProperty>(_properties.Values).ToArray();
+        }
+    }
+    
+    String mapName;
+    String sessionId;
+    String locale;
+    CultureInfo culture;
+
+    static NameValueCollection GetLayerPropertyMappings(MgResourceService resSvc, MgLayerBase layer)
+    {
+        NameValueCollection mappings = new NameValueCollection();
+        MgByteReader content = resSvc.GetResourceContent(layer.GetLayerDefinition());
+        XmlDocument doc = new XmlDocument();
+        doc.LoadXml(content.ToString());
+        XmlNodeList propNodes = doc.SelectNodes("//LayerDefinition/VectorLayerDefinition/PropertyMapping");
+        foreach (XmlNode propNode in propNodes)
+        {
+            String name = propNode["Name"].InnerText;
+            String value = propNode["Value"].InnerText;
+
+            mappings[name] = value;
+        }
+        return mappings;
+    }
+    
+    String GetPropertyValueFromFeatureReader(MgFeatureReader reader, MgAgfReaderWriter agfRw, int propType, String propName)
+    {
+        String value = "";
+        switch(propType)
+        {
+            case MgPropertyType.Boolean:
+                value = String.Format(culture, "{0}", reader.GetBoolean(propName));
+                break;
+            case MgPropertyType.Byte:
+                value = String.Format(culture, "{0:d}", reader.GetByte(propName));
+                break; 
+            case MgPropertyType.DateTime:
+                value = GetDateTimeString(reader.GetDateTime(propName)); // yyyy-mm-dd is enforced regardless of locale
+                break;
+            case MgPropertyType.Single:
+                value = String.Format(culture, "{0:f}", reader.GetSingle(propName));
+                break;
+            case MgPropertyType.Double:
+                value = String.Format(culture, "{0:f}", reader.GetDouble(propName));
+                break;
+            case MgPropertyType.Int16:
+                value = String.Format(culture, "{0:d}", reader.GetInt16(propName));
+                break;
+            case MgPropertyType.Int32:
+                value = String.Format(culture, "{0:d}", reader.GetInt32(propName));
+                break;
+            case MgPropertyType.Int64:
+                value = String.Format(culture, "{0:d}", reader.GetInt64(propName));
+                break;
+            case MgPropertyType.String:
+                value = JsonEscape(reader.GetString(propName)); //String content is arbitrary
+                break;
+            default: //NOT PRESENTABLE IN PROPERTY GRID
+                value = "";
+                break;
+        }
+        return value;   
+    }
+
+    static String GetDateTimeString(MgDateTime value)
+    {
+        return String.Format("{0}-{1}-{2}", value.Year, value.Month, value.Day);
+    }
+    
+    void GetParameters(NameValueCollection param)
+    {
+        mapName = param["MAPNAME"];
+        sessionId = param["SESSION"];
+        locale = param["LOCALE"];
+    }
+
+    void GetRequestParameters()
+    {
+        if (Request.RequestType == "POST")
+            GetParameters(Request.Form);
+        else
+            GetParameters(Request.QueryString);
+    }
+    
+    String JsonEscape(String str)
+    {
+        return EscapeForHtml(str).Replace("\\", "\\\\");
+    }
+    
+    String JsonifyError(Exception ex)
+    {
+        return "{\"Error\":{\"Message\":\"" + JsonEscape(ex.Message) + "\",\"StackTrace\":\"" + JsonEscape(ex.StackTrace) + "\"}}";
+    }
+
+    static String GetJson(SelectionSet set)
+    {
+        /*
+        A sample of the JSON output this method will produce:
+        
+        
+        {
+            "Layer1" : [ 
+                { 
+                    'values' { "name" : "name1" , "value" : "value1" }, 
+                    'zoom' : { x: num1, y: num2 } 
+                } , 
+                ..,
+                ..,
+                ..,
+            ],
+            "Layer2" : [ 
+                { 
+                    'values' { "name" : "name2" , "value" : "value2" }, 
+                    'zoom' : { x: num1, y: num2 } 
+                } , 
+                ..,
+                ..,
+                ..,
+            ]
+        }
+        */
+        
+        if (set == null)
+            return "";
+        
+        StringBuilder sb = new StringBuilder();
+        //Begin selection set
+        sb.Append("{");
+        String[] layers = set.GetLayers();
+        for (int i = 0; i < layers.Length; i++)
+        {
+            //Begin layer
+            sb.Append("\"" + layers[i] + "\" : [");
+            Feature[] features = set.GetFeatures(layers[i]);
+            for (int j = 0; j < features.Length; j++)
+            {
+                Feature feat = features[j];
+                //begin feature
+                //begin feature properties
+                sb.Append("{\"values\" : [");
+                FeatureProperty[] properties = feat.GetProperties();
+                for(int k = 0; k < properties.Length; k++)
+                {
+                    FeatureProperty fp = properties[k];
+                    sb.Append("{\"name\" : \"" + fp.Name + "\", \"value\" : \"" + fp.Value + "\" }");
+                    if (k != properties.Length - 1)
+                        sb.Append(",");
+                }
+                //end feature properties
+                //begin zoom
+                sb.Append("], \"zoom\" : ");
+                if (feat.Zoom == null)
+                    sb.Append("null");
+                else
+                    sb.Append("{\"x\" : " + feat.Zoom.X + ", \"y\" : " + feat.Zoom.Y + "}");
+                //end zoom
+                //end feature
+                sb.Append("}");
+                if (j != features.Length - 1)
+                    sb.Append(",");
+            }
+            //End Layer
+            sb.Append("]");
+            if (i != layers.Length - 1)
+                sb.Append(",");
+        }
+        //End selection set
+        sb.Append("}");
+        return sb.ToString();
+    }
+    
+</script>
+<% 
+
+    mapName = "";
+    sessionId = "";
+    locale = "";
+
+    GetRequestParameters();
+    
+    if (String.IsNullOrEmpty(locale))
+        locale = GetDefaultLocale();
+        
+    culture = CultureInfo.GetCultureInfo(locale);
+    
+    //HACK: The default locale (en) resolves to a neutral culture, .net forbids the use of 
+    //neutral cultures for formatting purposes, so default to InvariantCulture if the resolved
+    //culture is not neutral.
+    if (culture.IsNeutralCulture)
+        culture = CultureInfo.InvariantCulture; //We need a non-neutral culture
+
+    try
+    {
+        MgUserInformation cred = new MgUserInformation(sessionId);
+        cred.SetClientIp(GetClientIp(Request));
+        cred.SetClientAgent(GetClientAgent());
+
+        MgSiteConnection site = new MgSiteConnection();
+        site.Open(cred);
+
+        MgResourceService resSvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
+        
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
+
+        MgSelection selection = new MgSelection(map);
+        selection.Open(resSvc, mapName);
+
+        MgReadOnlyLayerCollection layers = selection.GetLayers();
+        if (layers != null && layers.Count > 0)
+        {
+            int layerCount = layers.Count;
+            MgAgfReaderWriter agfRW = new MgAgfReaderWriter();
+            SelectionSet selectionSet = new SelectionSet();
+
+            for (int i = 0; i < layerCount; i++)
+            {
+                MgLayerBase layer = layers[i];
+                String layerName = layer.Name;
+
+                MgResourceIdentifier fsId = new MgResourceIdentifier(layer.GetFeatureSourceId());
+                String className = layer.GetFeatureClassName();
+                String geomName = layer.GetFeatureGeometryName();
+
+                MgFeatureQueryOptions query = new MgFeatureQueryOptions();
+                NameValueCollection mappings = GetLayerPropertyMappings(resSvc, layer);
+
+                foreach (String key in mappings.Keys)
+                {
+                    query.AddFeatureProperty(key);
+                }
+
+                query.AddFeatureProperty(geomName);
+                String filter = selection.GenerateFilter(layer, className);
+                query.SetFilter(filter);
+
+                MgFeatureReader reader = layer.SelectFeatures(query);
+
+                MgClassDefinition clsDef = reader.GetClassDefinition();
+                MgPropertyDefinitionCollection props = clsDef.GetProperties();
+
+                while (reader.ReadNext())
+                {
+                    Feature feat = new Feature(layerName);
+                    ZoomPoint zoom = null;
+
+                    for (int k = 0; k < props.Count; k++)
+                    {
+                        MgPropertyDefinition propDef = props[k];
+                        String propName = propDef.Name;
+                        int propType = reader.GetPropertyType(propName);
+
+                        if (mappings[propName] != null || propType == MgPropertyType.Geometry)
+                        {
+                            String value = "";
+                            if (!reader.IsNull(propName))
+                            {
+                                if (propName == geomName)
+                                {
+                                    MgByteReader agf = reader.GetGeometry(propName);
+                                    MgGeometry geom = agfRW.Read(agf);
+                                    MgCoordinate pt = geom.Centroid.Coordinate;
+
+                                    zoom = new ZoomPoint();
+                                    zoom.X = pt.X;
+                                    zoom.Y = pt.Y;
+
+                                    feat.Zoom = zoom;
+                                }
+                                else
+                                {
+                                    value = GetPropertyValueFromFeatureReader(reader, agfRW, propType, propName);
+                                }
+
+                                if (mappings[propName] != null)
+                                {
+                                    FeatureProperty fp = new FeatureProperty();
+                                    fp.Name = mappings[propName];
+                                    fp.Value = value;
+
+                                    feat.AddProperty(fp);
+                                }
+                            }
+                        }
+                    }
+                    selectionSet.AddFeature(feat);
+                }
+                reader.Close();
+            }
+
+            //Now output the selection set
+            Response.AddHeader("Content-Type", "application/json");
+            Response.AddHeader("X-JSON", "true");
+
+            Response.Write(GetJson(selectionSet));
+        }
+    }
+    catch (MgException ex)
+    {
+        Response.AddHeader("Content-Type", "application/json");
+        Response.AddHeader("X-JSON", "true");
+        Response.Write(JsonifyError(ex));
+    }
+    catch (Exception ex)
+    { 
+        Response.AddHeader("Content-Type", "application/json");
+        Response.AddHeader("X-JSON", "true");
+        Response.Write(JsonifyError(ex));
+    }
+    
 %>
\ No newline at end of file


Property changes on: trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewernet/quickplotgeneratepicture.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/quickplotgeneratepicture.aspx	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewernet/quickplotgeneratepicture.aspx	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,217 +1,217 @@
-<%--
-Copyright (C) 2004-2010 by Autodesk, Inc.
-This library is free software; you can redistribute it and/or
-modify it under the terms of version 2.1 of the GNU Lesser
-General Public License as published by the Free Software Foundation.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
---%>
-
-<%@ Import Namespace="System" %>
-<%@ Import Namespace="System.Web" %>
-<%@ Import Namespace="System.IO" %>
-<%@ Import Namespace="System.Collections.Specialized" %>
-<%@ Import Namespace="System.Text" %>
-<%@ Import Namespace="System.Drawing" %>
-<%@ Import Namespace="OSGeo.MapGuide" %>
-<%@ Import Namespace="System.Net" %>
-<%@ Import Namespace="System.Drawing.Drawing2D" %>
-
-<!-- #Include File="common.aspx -->
-
-<script runat="server">
-string sessionID = "";
-string mapName   = "";
-double rotation  = 0.0;
-int printDpi     = 300;
-int scaleDenominator = 0;
-MgPolygon captureBox = null;
-MgPolygon normalizedCapture;
-Size printSize = new Size(0, 0);
-SizeF paperSize = new SizeF(0.0f, 0.0f);
-
-</script>
-
-<%
-    Response.Charset = "utf-8";
-    GetRequestParameters();
-    GenerateMap(printSize);
-%>
-
-<script runat="server">
-
-void GetRequestParameters()
-{
-    if(Request.HttpMethod == "POST")
-        GetParameters(Request.Form);
-    else
-        GetParameters(Request.QueryString);
-}
-
-void GetParameters(NameValueCollection parameters)
-{
-    sessionID = ValidateSessionId(GetParameter(parameters, "session_id"));
-    mapName = ValidateMapName(GetParameter(parameters, "map_name"));
-    rotation = GetDoubleParameter(parameters, "rotation");
-    printDpi = GetIntParameter(parameters, "print_dpi");
-    
-    scaleDenominator = GetIntParameter(parameters, "scale_denominator");
-    
-    string[] a = parameters["paper_size"].Split(',');
-    paperSize  = new SizeF(float.Parse(a[0]), float.Parse(a[1]));
-    printSize  = new Size((int) (paperSize.Width / 25.4 * printDpi), (int) (paperSize.Height / 25.4 * printDpi));
-    
-    a = parameters["box"].Split(',');
-    captureBox = CreatePolygon(a);
-    
-    a = parameters["normalized_box"].Split(',');
-    normalizedCapture = CreatePolygon(a);
-}
-
-MgPolygon CreatePolygon(string[] coordinates)
-{
-    MgGeometryFactory geometryFactory = new MgGeometryFactory();
-    MgCoordinateCollection coordinateCollection = new MgCoordinateCollection();
-    
-    for (int i = 0; i < coordinates.Length; ++i)
-    {
-        coordinateCollection.Add(geometryFactory.CreateCoordinateXY(double.Parse(coordinates[i]), double.Parse(coordinates[++i])));
-    }
-    
-    coordinateCollection.Add(geometryFactory.CreateCoordinateXY(double.Parse(coordinates[0]), double.Parse(coordinates[1])));
-    MgLinearRing linearRing = geometryFactory.CreateLinearRing(coordinateCollection);
-    
-    return geometryFactory.CreatePolygon(linearRing, null);
-}
-
-void GenerateMap(Size size)
-{
-    MgUserInformation userInfo = new MgUserInformation(sessionID);
-    MgSiteConnection siteConnection = new MgSiteConnection();
-    siteConnection.Open(userInfo);
-    MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
-    MgRenderingService renderingService = siteConnection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
-    
-    MgMap map = new MgMap();
-    map.Open(resourceService, mapName);
-    
-    MgSelection selection = new MgSelection(map);
-    
-    // Calculate the generated picture size
-    MgEnvelope envelope = captureBox.Envelope();
-    MgEnvelope normalizedE = normalizedCapture.Envelope();
-    SizeF size1 = new SizeF((float) envelope.GetWidth(), (float) envelope.GetHeight());
-    SizeF size2 = new SizeF((float) normalizedE.GetWidth(), (float) normalizedE.GetHeight());
-
-    SizeF toSize = new SizeF(size1.Width / size2.Width * size.Width, size1.Height / size2.Height * size.Height);
-    MgCoordinate center = captureBox.GetCentroid().GetCoordinate();
-    
-    // Get the map agent url
-    // Get the correct http protocol
-    StringBuilder mapAgent = new StringBuilder(Request.IsSecureConnection ? "https://" : "http://");
-    // Get the correct port number
-    // Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
-    // be always on the same server with map agent. 
-    mapAgent.Append("127.0.0.1").Append(":").Append(Request.ServerVariables["SERVER_PORT"]);
-
-    // Get the correct virtual directory
-    string url = Request.ServerVariables["URL"];
-    mapAgent.Append(url.Substring(0, url.IndexOf("/", 1)));
-
-    mapAgent.Append("/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE")
-            .AppendFormat("&SESSION={0}", sessionID)
-            .AppendFormat("&MAPNAME={0}", mapName)
-            .Append("&FORMAT=PNG")
-            .AppendFormat("&SETVIEWCENTERX={0}", center.GetX())
-            .AppendFormat("&SETVIEWCENTERY={0}", center.GetY())
-            .AppendFormat("&SETVIEWSCALE={0}", scaleDenominator)
-            .AppendFormat("&SETDISPLAYDPI={0}", printDpi)
-            .AppendFormat("&SETDISPLAYWIDTH={0}", toSize.Width)
-            .AppendFormat("&SETDISPLAYHEIGHT={0}", toSize.Height)
-            .Append("&CLIP=0");
-
-    WebRequest request = WebRequest.Create(mapAgent.ToString());
-
-    using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
-    {
-        if (response.StatusCode == HttpStatusCode.OK)
-        {
-            using (Bitmap image = new Bitmap(response.GetResponseStream()))
-            {
-                using (Bitmap result = Math.Abs(rotation) > double.Epsilon ? new Bitmap(size.Width, size.Height) : image)
-                {
-                    using (Graphics graphics = Graphics.FromImage(result))
-                    {
-                        if (Math.Abs(rotation) > double.Epsilon)
-                        {
-                            graphics.TranslateTransform(size.Width / 2, size.Height / 2);
-                            graphics.RotateTransform((float)rotation);
-                            graphics.DrawImage(image, -image.Width / 2, -image.Height / 2);
-                        }
-                    }
-                    
-                    DrawNorthArrow(result);
-                    
-                    using (MemoryStream stream = new MemoryStream())
-                    {
-                        result.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
-                        Response.ContentType = "image/png";
-                        Response.BinaryWrite(stream.ToArray());
-                    }
-                }
-            }
-        }
-    }
-}
-
-void DrawNorthArrow(Bitmap image)
-{
-    // The north arrow image is created under this dpi
-    int naDpi = 300;
-    // The north arrow will be put at the bottom-right corner with a margin 12 MM
-    int naMargin = 12;
-    string naPath = Server.MapPath("../viewerfiles/quickplotnortharrow.png");
-    using (Graphics graphics = Graphics.FromImage(image))
-    {
-        using (System.Drawing.Image na = Bitmap.FromFile(naPath))
-        {
-            float scaleFactor = (float) printDpi / naDpi;
-            RectangleF rec = new RectangleF(new PointF(0.0f, 0.0f), new SizeF(na.Width * scaleFactor, na.Height * scaleFactor));
-            
-            if (Math.Abs(rotation) > double.Epsilon)
-            {
-                GraphicsUnit pixelUnit = GraphicsUnit.Pixel;
-                Region region = new Region(na.GetBounds(ref pixelUnit));
-                Matrix matrix = new Matrix();
-                matrix.RotateAt((float) rotation, new PointF((float)na.Width / 2, (float)na.Height / 2));
-                matrix.Scale(scaleFactor, scaleFactor);
-                region.Transform(matrix);
-                rec = region.GetBounds(graphics);
-            }
-            
-            using (System.Drawing.Image rotatedNA = new Bitmap((int) Math.Ceiling(rec.Width), (int) Math.Ceiling(rec.Height)))
-            {
-                using (Graphics nag = Graphics.FromImage(rotatedNA))
-                {
-                    nag.TranslateTransform((float)rotatedNA.Width / 2, (float)rotatedNA.Height / 2);
-                    nag.RotateTransform((float) rotation);
-                    nag.ScaleTransform(scaleFactor, scaleFactor);
-                    nag.DrawImage(na, -na.Width / 2, -na.Height / 2);
-                }
-                
-                double x = image.Width - rotatedNA.Width - naMargin / 25.4 * printDpi;
-                double y = image.Height - rotatedNA.Height - naMargin / 25.4 * printDpi;
-                graphics.DrawImage(rotatedNA, new PointF((float)x, (float)y));
-            }
-        }
-    }
-}
-
-</script>
+<%--
+Copyright (C) 2004-2010 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+--%>
+
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Web" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.Text" %>
+<%@ Import Namespace="System.Drawing" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+<%@ Import Namespace="System.Net" %>
+<%@ Import Namespace="System.Drawing.Drawing2D" %>
+
+<!-- #Include File="common.aspx -->
+
+<script runat="server">
+string sessionID = "";
+string mapName   = "";
+double rotation  = 0.0;
+int printDpi     = 300;
+int scaleDenominator = 0;
+MgPolygon captureBox = null;
+MgPolygon normalizedCapture;
+Size printSize = new Size(0, 0);
+SizeF paperSize = new SizeF(0.0f, 0.0f);
+
+</script>
+
+<%
+    Response.Charset = "utf-8";
+    GetRequestParameters();
+    GenerateMap(printSize);
+%>
+
+<script runat="server">
+
+void GetRequestParameters()
+{
+    if(Request.HttpMethod == "POST")
+        GetParameters(Request.Form);
+    else
+        GetParameters(Request.QueryString);
+}
+
+void GetParameters(NameValueCollection parameters)
+{
+    sessionID = ValidateSessionId(GetParameter(parameters, "session_id"));
+    mapName = ValidateMapName(GetParameter(parameters, "map_name"));
+    rotation = GetDoubleParameter(parameters, "rotation");
+    printDpi = GetIntParameter(parameters, "print_dpi");
+    
+    scaleDenominator = GetIntParameter(parameters, "scale_denominator");
+    
+    string[] a = parameters["paper_size"].Split(',');
+    paperSize  = new SizeF(float.Parse(a[0]), float.Parse(a[1]));
+    printSize  = new Size((int) (paperSize.Width / 25.4 * printDpi), (int) (paperSize.Height / 25.4 * printDpi));
+    
+    a = parameters["box"].Split(',');
+    captureBox = CreatePolygon(a);
+    
+    a = parameters["normalized_box"].Split(',');
+    normalizedCapture = CreatePolygon(a);
+}
+
+MgPolygon CreatePolygon(string[] coordinates)
+{
+    MgGeometryFactory geometryFactory = new MgGeometryFactory();
+    MgCoordinateCollection coordinateCollection = new MgCoordinateCollection();
+    
+    for (int i = 0; i < coordinates.Length; ++i)
+    {
+        coordinateCollection.Add(geometryFactory.CreateCoordinateXY(double.Parse(coordinates[i]), double.Parse(coordinates[++i])));
+    }
+    
+    coordinateCollection.Add(geometryFactory.CreateCoordinateXY(double.Parse(coordinates[0]), double.Parse(coordinates[1])));
+    MgLinearRing linearRing = geometryFactory.CreateLinearRing(coordinateCollection);
+    
+    return geometryFactory.CreatePolygon(linearRing, null);
+}
+
+void GenerateMap(Size size)
+{
+    MgUserInformation userInfo = new MgUserInformation(sessionID);
+    MgSiteConnection siteConnection = new MgSiteConnection();
+    siteConnection.Open(userInfo);
+    MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
+    MgRenderingService renderingService = siteConnection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
+    
+    MgMap map = new MgMap();
+    map.Open(resourceService, mapName);
+    
+    MgSelection selection = new MgSelection(map);
+    
+    // Calculate the generated picture size
+    MgEnvelope envelope = captureBox.Envelope();
+    MgEnvelope normalizedE = normalizedCapture.Envelope();
+    SizeF size1 = new SizeF((float) envelope.GetWidth(), (float) envelope.GetHeight());
+    SizeF size2 = new SizeF((float) normalizedE.GetWidth(), (float) normalizedE.GetHeight());
+
+    SizeF toSize = new SizeF(size1.Width / size2.Width * size.Width, size1.Height / size2.Height * size.Height);
+    MgCoordinate center = captureBox.GetCentroid().GetCoordinate();
+    
+    // Get the map agent url
+    // Get the correct http protocol
+    StringBuilder mapAgent = new StringBuilder(Request.IsSecureConnection ? "https://" : "http://");
+    // Get the correct port number
+    // Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
+    // be always on the same server with map agent. 
+    mapAgent.Append("127.0.0.1").Append(":").Append(Request.ServerVariables["SERVER_PORT"]);
+
+    // Get the correct virtual directory
+    string url = Request.ServerVariables["URL"];
+    mapAgent.Append(url.Substring(0, url.IndexOf("/", 1)));
+
+    mapAgent.Append("/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE")
+            .AppendFormat("&SESSION={0}", sessionID)
+            .AppendFormat("&MAPNAME={0}", mapName)
+            .Append("&FORMAT=PNG")
+            .AppendFormat("&SETVIEWCENTERX={0}", center.GetX())
+            .AppendFormat("&SETVIEWCENTERY={0}", center.GetY())
+            .AppendFormat("&SETVIEWSCALE={0}", scaleDenominator)
+            .AppendFormat("&SETDISPLAYDPI={0}", printDpi)
+            .AppendFormat("&SETDISPLAYWIDTH={0}", toSize.Width)
+            .AppendFormat("&SETDISPLAYHEIGHT={0}", toSize.Height)
+            .Append("&CLIP=0");
+
+    WebRequest request = WebRequest.Create(mapAgent.ToString());
+
+    using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
+    {
+        if (response.StatusCode == HttpStatusCode.OK)
+        {
+            using (Bitmap image = new Bitmap(response.GetResponseStream()))
+            {
+                using (Bitmap result = Math.Abs(rotation) > double.Epsilon ? new Bitmap(size.Width, size.Height) : image)
+                {
+                    using (Graphics graphics = Graphics.FromImage(result))
+                    {
+                        if (Math.Abs(rotation) > double.Epsilon)
+                        {
+                            graphics.TranslateTransform(size.Width / 2, size.Height / 2);
+                            graphics.RotateTransform((float)rotation);
+                            graphics.DrawImage(image, -image.Width / 2, -image.Height / 2);
+                        }
+                    }
+                    
+                    DrawNorthArrow(result);
+                    
+                    using (MemoryStream stream = new MemoryStream())
+                    {
+                        result.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
+                        Response.ContentType = "image/png";
+                        Response.BinaryWrite(stream.ToArray());
+                    }
+                }
+            }
+        }
+    }
+}
+
+void DrawNorthArrow(Bitmap image)
+{
+    // The north arrow image is created under this dpi
+    int naDpi = 300;
+    // The north arrow will be put at the bottom-right corner with a margin 12 MM
+    int naMargin = 12;
+    string naPath = Server.MapPath("../viewerfiles/quickplotnortharrow.png");
+    using (Graphics graphics = Graphics.FromImage(image))
+    {
+        using (System.Drawing.Image na = Bitmap.FromFile(naPath))
+        {
+            float scaleFactor = (float) printDpi / naDpi;
+            RectangleF rec = new RectangleF(new PointF(0.0f, 0.0f), new SizeF(na.Width * scaleFactor, na.Height * scaleFactor));
+            
+            if (Math.Abs(rotation) > double.Epsilon)
+            {
+                GraphicsUnit pixelUnit = GraphicsUnit.Pixel;
+                Region region = new Region(na.GetBounds(ref pixelUnit));
+                Matrix matrix = new Matrix();
+                matrix.RotateAt((float) rotation, new PointF((float)na.Width / 2, (float)na.Height / 2));
+                matrix.Scale(scaleFactor, scaleFactor);
+                region.Transform(matrix);
+                rec = region.GetBounds(graphics);
+            }
+            
+            using (System.Drawing.Image rotatedNA = new Bitmap((int) Math.Ceiling(rec.Width), (int) Math.Ceiling(rec.Height)))
+            {
+                using (Graphics nag = Graphics.FromImage(rotatedNA))
+                {
+                    nag.TranslateTransform((float)rotatedNA.Width / 2, (float)rotatedNA.Height / 2);
+                    nag.RotateTransform((float) rotation);
+                    nag.ScaleTransform(scaleFactor, scaleFactor);
+                    nag.DrawImage(na, -na.Width / 2, -na.Height / 2);
+                }
+                
+                double x = image.Width - rotatedNA.Width - naMargin / 25.4 * printDpi;
+                double y = image.Height - rotatedNA.Height - naMargin / 25.4 * printDpi;
+                graphics.DrawImage(rotatedNA, new PointF((float)x, (float)y));
+            }
+        }
+    }
+}
+
+</script>


Property changes on: trunk/MgDev/Web/src/mapviewernet/quickplotgeneratepicture.aspx
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewernet/quickplotpanel.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/quickplotpanel.aspx	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewernet/quickplotpanel.aspx	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,72 +1,72 @@
-<%--
-Copyright (C) 2004-2010 by Autodesk, Inc.
-This library is free software; you can redistribute it and/or
-modify it under the terms of version 2.1 of the GNU Lesser
-General Public License as published by the Free Software Foundation.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
---%>
-
-<%@ Import Namespace="System" %>
-<%@ Import Namespace="System.IO" %>
-<%@ Import Namespace="System.Collections.Specialized" %>
-<%@ Import Namespace="System.Text" %>
-
-<!-- #Include File="common.aspx -->
-
-<script runat="server">
-String locale = "";
-String mapName = "";
-String sessionId = "";
-int targetType = 0;
-int us = 0;
-</script>
-
-<%
-    Response.Charset = "utf-8";
-
-    GetRequestParameters();
-
-    MgLocalizer.SetLocalizedFilesPath(Request.ServerVariables["APPL_PHYSICAL_PATH"] + "..\\localized\\");
-    String templ = MgLocalizer.Localize(LoadTemplate(Request, "../viewerfiles/quickplotpanel.templ"), locale, GetClientOS(Request));
-
-    String vpath = GetSurroundVirtualPath(Request);
-    String jsPath = "../viewerfiles/";
-    String[] vals = {
-                    jsPath,
-                    jsPath,
-                    targetType.ToString(NumberFormatInfo.InvariantInfo),
-                    "quickplotgeneratepicture.aspx",
-                    "quickplotpreviewinner.aspx"
-                    };
-
-    Response.Write(Substitute(templ, vals));
-%>
-
-<script runat="server">
-
-void GetRequestParameters()
-{
-    if(Request.HttpMethod == "POST")
-        GetParameters(Request.Form);
-    else
-        GetParameters(Request.QueryString);
-}
-
-void GetParameters(NameValueCollection parameters)
-{
-    sessionId = ValidateSessionId(GetParameter(parameters, "SESSION"));
-    locale = ValidateLocaleString(GetParameter(parameters, "LOCALE"));
-    targetType = GetIntParameter(parameters, "TARGETTYPE");
-    us = GetIntParameter(parameters, "US");
-    mapName = ValidateMapName(GetParameter(parameters, "MAPNAME"));
-}
-
-</script>
+<%--
+Copyright (C) 2004-2010 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+--%>
+
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.Text" %>
+
+<!-- #Include File="common.aspx -->
+
+<script runat="server">
+String locale = "";
+String mapName = "";
+String sessionId = "";
+int targetType = 0;
+int us = 0;
+</script>
+
+<%
+    Response.Charset = "utf-8";
+
+    GetRequestParameters();
+
+    MgLocalizer.SetLocalizedFilesPath(Request.ServerVariables["APPL_PHYSICAL_PATH"] + "..\\localized\\");
+    String templ = MgLocalizer.Localize(LoadTemplate(Request, "../viewerfiles/quickplotpanel.templ"), locale, GetClientOS(Request));
+
+    String vpath = GetSurroundVirtualPath(Request);
+    String jsPath = "../viewerfiles/";
+    String[] vals = {
+                    jsPath,
+                    jsPath,
+                    targetType.ToString(NumberFormatInfo.InvariantInfo),
+                    "quickplotgeneratepicture.aspx",
+                    "quickplotpreviewinner.aspx"
+                    };
+
+    Response.Write(Substitute(templ, vals));
+%>
+
+<script runat="server">
+
+void GetRequestParameters()
+{
+    if(Request.HttpMethod == "POST")
+        GetParameters(Request.Form);
+    else
+        GetParameters(Request.QueryString);
+}
+
+void GetParameters(NameValueCollection parameters)
+{
+    sessionId = ValidateSessionId(GetParameter(parameters, "SESSION"));
+    locale = ValidateLocaleString(GetParameter(parameters, "LOCALE"));
+    targetType = GetIntParameter(parameters, "TARGETTYPE");
+    us = GetIntParameter(parameters, "US");
+    mapName = ValidateMapName(GetParameter(parameters, "MAPNAME"));
+}
+
+</script>


Property changes on: trunk/MgDev/Web/src/mapviewernet/quickplotpanel.aspx
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewernet/quickplotpreviewinner.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/quickplotpreviewinner.aspx	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewernet/quickplotpreviewinner.aspx	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,97 +1,97 @@
-<%--
-Copyright (C) 2004-2010 by Autodesk, Inc.
-This library is free software; you can redistribute it and/or
-modify it under the terms of version 2.1 of the GNU Lesser
-General Public License as published by the Free Software Foundation.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
---%>
-
-<%@ Page Language="C#" ValidateRequest="false" %>
-
-<%@ Import Namespace="System" %>
-<%@ Import Namespace="System.Web" %>
-<%@ Import Namespace="System.IO" %>
-<%@ Import Namespace="System.Collections.Specialized" %>
-<%@ Import Namespace="System.Text" %>
-<%@ Import Namespace="System.Text.RegularExpressions"%>
-
-<!-- #Include File="common.aspx -->
-
-<script runat="server">
-String locale = "";
-String mapName = "";
-String sessionId = "";
-int targetType = 0;
-int us = 0;
-int scaleDenominator = 0;
-
-NameValueCollection annotations = new NameValueCollection();
-</script>
-
-<%
-    Response.Charset = "utf-8";
-
-    GetRequestParameters();
-
-    MgLocalizer.SetLocalizedFilesPath(Request.ServerVariables["APPL_PHYSICAL_PATH"] + "..\\localized\\");
-    String templ = MgLocalizer.Localize(LoadTemplate(Request, "../viewerfiles/quickplotpreviewinner.templ"), locale, GetClientOS(Request));
-    // Set some annotation labels in the page by replacing the placeholders in the html code
-    StringBuilder sb = new StringBuilder(templ);
-    foreach (String key in annotations)
-    {
-        sb.Replace(key, annotations[key]);
-    }
-    templ = sb.ToString();
-    // Set the date annotation according to its format mask
-    String pattern = @"\{date:.*\[net=(?<mask>.+?)\].+?\}";
-    String mask    = Regex.Match(templ, pattern).Result("${mask}");
-    templ = Regex.Replace(templ, pattern, DateTime.Now.ToString(mask));
-    // The scale annotation
-    
-    String jsPath = "../viewerfiles/";
-    String[] vals = {jsPath};
-
-    Response.Write(Substitute(templ, vals));
-%>
-
-<script runat="server">
-
-void GetRequestParameters()
-{
-    if(Request.HttpMethod == "POST")
-        GetParameters(Request.Form);
-    else
-        GetParameters(Request.QueryString);
-}
-
-void GetParameters(NameValueCollection parameters)
-{
-    sessionId = ValidateSessionId(GetParameter(parameters, "SESSION"));
-    locale = ValidateLocaleString(GetParameter(parameters, "LOCALE"));
-    targetType = GetIntParameter(parameters, "TARGETTYPE");
-    us = GetIntParameter(parameters, "US");
-    scaleDenominator = GetIntParameter(parameters, "SCALE_DENOMINATOR");
-    mapName = ValidateMapName(GetParameter(parameters, "MAPNAME"));
-    
-    // The parameters whose name matches this pattern will be treated as annotation
-    String pattern = @"^\{field:.+\}$";
-    foreach (String key in parameters.AllKeys)
-    {
-        if (Regex.Match(key, pattern).Success)
-        {
-            annotations.Add(key, HttpUtility.HtmlEncode(parameters[key]));
-        }
-    }
-    
-    annotations.Add("{scale}", String.Format("1 : {0}", scaleDenominator));
-}
-
-</script>
+<%--
+Copyright (C) 2004-2010 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+--%>
+
+<%@ Page Language="C#" ValidateRequest="false" %>
+
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Web" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.Text" %>
+<%@ Import Namespace="System.Text.RegularExpressions"%>
+
+<!-- #Include File="common.aspx -->
+
+<script runat="server">
+String locale = "";
+String mapName = "";
+String sessionId = "";
+int targetType = 0;
+int us = 0;
+int scaleDenominator = 0;
+
+NameValueCollection annotations = new NameValueCollection();
+</script>
+
+<%
+    Response.Charset = "utf-8";
+
+    GetRequestParameters();
+
+    MgLocalizer.SetLocalizedFilesPath(Request.ServerVariables["APPL_PHYSICAL_PATH"] + "..\\localized\\");
+    String templ = MgLocalizer.Localize(LoadTemplate(Request, "../viewerfiles/quickplotpreviewinner.templ"), locale, GetClientOS(Request));
+    // Set some annotation labels in the page by replacing the placeholders in the html code
+    StringBuilder sb = new StringBuilder(templ);
+    foreach (String key in annotations)
+    {
+        sb.Replace(key, annotations[key]);
+    }
+    templ = sb.ToString();
+    // Set the date annotation according to its format mask
+    String pattern = @"\{date:.*\[net=(?<mask>.+?)\].+?\}";
+    String mask    = Regex.Match(templ, pattern).Result("${mask}");
+    templ = Regex.Replace(templ, pattern, DateTime.Now.ToString(mask));
+    // The scale annotation
+    
+    String jsPath = "../viewerfiles/";
+    String[] vals = {jsPath};
+
+    Response.Write(Substitute(templ, vals));
+%>
+
+<script runat="server">
+
+void GetRequestParameters()
+{
+    if(Request.HttpMethod == "POST")
+        GetParameters(Request.Form);
+    else
+        GetParameters(Request.QueryString);
+}
+
+void GetParameters(NameValueCollection parameters)
+{
+    sessionId = ValidateSessionId(GetParameter(parameters, "SESSION"));
+    locale = ValidateLocaleString(GetParameter(parameters, "LOCALE"));
+    targetType = GetIntParameter(parameters, "TARGETTYPE");
+    us = GetIntParameter(parameters, "US");
+    scaleDenominator = GetIntParameter(parameters, "SCALE_DENOMINATOR");
+    mapName = ValidateMapName(GetParameter(parameters, "MAPNAME"));
+    
+    // The parameters whose name matches this pattern will be treated as annotation
+    String pattern = @"^\{field:.+\}$";
+    foreach (String key in parameters.AllKeys)
+    {
+        if (Regex.Match(key, pattern).Success)
+        {
+            annotations.Add(key, HttpUtility.HtmlEncode(parameters[key]));
+        }
+    }
+    
+    annotations.Add("{scale}", String.Format("1 : {0}", scaleDenominator));
+}
+
+</script>


Property changes on: trunk/MgDev/Web/src/mapviewernet/quickplotpreviewinner.aspx
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,485 +1,485 @@
-<?php
-
-/*
-
-TODO:
-
-- Use the property mapping. This will have to be old-fashioned parsing the <PropertyMapping> elements 
-of the layer definition. I really wanted to use MgSelection::GetSelectedFeatures(layer, class, true) but realised
-that unless the geometry is mapped, you're not going to see it in the Feature Reader (ie. No zoom point). Right now 
-it is returning all properties.
-
-- I know of a few features in the Sheboygan Dataset that trip up the JSON response. Need to find out of addslashes() fixes this.
-
-- General cleanup of the code
-
-
-*/
-
-//require_once('FirePHPCore/fb.php');
-
-//
-// Used to model the JSON response.
-//
-class SelectionSet
-{
-    private $layers;
-    
-    public function __construct()
-    {
-        $this->layers = array();
-    }
-    
-    public function AddFeature($feat)
-    {
-        $layerName = $feat->layerName;
-        if(!array_key_exists($layerName, $this->layers))
-            $this->layers[$layerName] = array();
-            
-        array_push($this->layers[$layerName], $feat);
-    }
-    
-    public function GetLayers()
-    {
-        return array_keys($this->layers);
-    }
-    
-    public function GetFeatures($layerName)
-    {
-        if(array_key_exists($layerName, $this->layers))
-            return $this->layers[$layerName];
-        
-        return null;
-    }
-}
-
-class ZoomPoint
-{
-    public $x;
-    public $y;
-}
-
-//
-// Represents a selected feature property
-//
-class FeatureProperty
-{
-    public $name;
-    public $value;
-}
-
-//
-// Represents a selected feature
-//
-class Feature
-{
-    public $layerName;
-    public $zoom;
-    
-    private $properties;
-    
-    public function __construct($layerName)
-    {
-        $this->layerName = $layerName;
-        $this->properties = array();
-    }
-    
-    public function AddProperty($prop)
-    {
-        $this->properties[$prop->name] = $prop;
-    }
-    
-    public function GetProperties()
-    {
-        return $this->properties;
-    }
-}
-
-	include 'common.php';
-    include 'constants.php';
-
-    $mapName = "";
-    $sessionId = "";
-    $locale = "";
-
-    GetRequestParameters();
-    
-    if (null == $locale || strlen($locale) == 0)
-        $locale = GetDefaultLocale();
-        
-    setlocale(LC_ALL, $locale);
-   
-	try
-	{
-		InitializeWebTier();
-		
-		$cred = new MgUserInformation($sessionId);
-        $cred->SetClientIp(GetClientIp());
-        $cred->SetClientAgent(GetClientAgent());
-
-        //connect to the site and get an instance of the resource and feature service
-        //
-        $site = new MgSiteConnection();
-        $site->Open($cred);
-        $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
-
-        //load the map runtime state
-        //
-        $map = new MgMap($site);
-        $map->Open($mapName);
-		
-		// Create the selection set
-        $selection = new MgSelection($map);
-        $selection->Open($resourceSrvc, $mapName);
-		
-		$layers = $selection->GetLayers();
-        if($layers != null)
-        {
-            $nLayers = $layers->GetCount();
-            $agfRW = new MgAgfReaderWriter();
-            
-            $selectionSet = new SelectionSet();
-            
-            for ($i = 0; $i < $nLayers; $i++) {
-                $lyr = $layers->GetItem($i);
-                $layerName = $lyr->GetName();
-                
-                //FB::log("Layer Name: " . $lyr->GetName());
-                
-                $featResId = new MgResourceIdentifier($lyr->GetFeatureSourceId());
-                $class = $lyr->GetFeatureClassName();
-                
-                $queryOptions = new MgFeatureQueryOptions();
-                
-                $mappings = GetLayerPropertyMappings($resourceSrvc, $lyr);
-                //FB::log("Property Mappings for Layer: $layerName");
-                foreach($mappings as $name => $value) {
-                    $queryOptions->AddFeatureProperty($name);
-                    //FB::log("$name => $value");
-                }
-                $geomName = $lyr->GetFeatureGeometryName();
-                $queryOptions->AddFeatureProperty($geomName);
-                
-                $filter = $selection->GenerateFilter($lyr, $class);
-                $queryOptions->SetFilter($filter);
-                $fr = $lyr->SelectFeatures($queryOptions);
-                
-                $clsDef = $fr->GetClassDefinition();
-                $props = $clsDef->GetProperties();
-                
-                //FB::log("Geometry: $geomName");
-                
-                while($fr->ReadNext())
-                {
-                    $feat = new Feature($layerName);
-                    $zoom = null;
-                    
-                    for ($k = 0; $k < $props->GetCount(); $k++)
-                    {
-                        $prop = $props->GetItem($k);
-                        $propName = $prop->GetName();
-                        $propType = $fr->GetPropertyType($propName);
-                        
-                        //We only care about mapped properties or geometry properties
-                        if (array_key_exists($propName, $mappings) || $propType == MgPropertyType::Geometry)
-                        {
-                            $value = "";
-                            if (!$fr->IsNull($propName))
-                            {
-                                if(strcmp($propName,$geomName) == 0)
-                                {
-                                    //We want the centroid so we have a zoom-to point
-                                    $agf = $fr->GetGeometry($propName);
-                                    $geom = $agfRW->Read($agf);
-                                    $pt = $geom->GetCentroid()->GetCoordinate();
-                                    
-                                    $zoom = new ZoomPoint();
-                                    $zoom->x = $pt->GetX();
-                                    $zoom->y = $pt->GetY();
-                                    
-                                    $feat->zoom = $zoom;
-                                    //FB::log("zoom: (".$zoom->x.",".$zoom->y.")");
-                                }
-                                else
-                                {
-                                    $value = GetPropertyValueFromFeatureReader($fr, $agfRW, $propType, $propName);
-                                }
-                            }
-                        
-                            if (array_key_exists($propName, $mappings))
-                            {
-                                $fp = new FeatureProperty();
-                                $fp->name = $mappings[$propName];
-                                $fp->value = $value;
-                                
-                                $feat->AddProperty($fp);
-                            }
-                        }
-                    }
-                    
-                    $c = count($feat->GetProperties());
-                    //FB::log("Selected feature processed ($c)");
-                    
-                    $selectionSet->AddFeature($feat);
-                }
-                $fr->Close();
-            }
-            
-            //Now output the selection set
-            
-            header("Content-Type: application/json");
-            header("X-JSON: true");
-            echo GetJson($selectionSet);
-        }
-    }
-    catch(Exception $e)
-    {
-        header("Content-Type: application/json");
-        header("X-JSON: true");
-        echo JsonifyError($e->getMessage(), $e->getTraceAsString());
-    }
-	catch(MgException $e)
-    {
-        header("Content-Type: application/json");
-        header("X-JSON: true");
-        echo JsonifyError($e->GetDetails(), $e->GetStackTrace());
-    }
-
-function GetJson($selectionSet)
-{
-    if($selectionSet == null)
-        return "";
-        
-    //FB::log("Processing JSON response");
-    /*
-	A sample of the JSON output this method will produce:
-	
-	
-	{
-		"Layer1" : [ 
-			{ 
-				'values' { "name" : "name1" , "value" : "value1" }, 
-				'zoom' : { x: num1, y: num2 } 
-			} , 
-			..,
-			..,
-			..,
-		],
-		"Layer2" : [ 
-			{ 
-				'values' { "name" : "name2" , "value" : "value2" }, 
-				'zoom' : { x: num1, y: num2 } 
-			} , 
-			..,
-			..,
-			..,
-		]
-	}
-	*/
-    
-    $layers = $selectionSet->GetLayers();
-    $totalLayers = array(); //The data portion of the JSON response
-    
-    //FB::log("Layers in selection set: ".count($layers));
-    
-    for ($i = 0; $i < count($layers); $i++)
-    {   
-        $layerName = $layers[$i];
-		
-        $features = $selectionSet->GetFeatures($layerName);
-        
-        //FB::log("Features: ".$features);
-        
-        if($features != null)
-        {
-            //FB::log("Processing layer: $layerName");
-        
-            $totalFeaturesOnLayer = array();
-            
-            if (count($features) > 0)
-            {
-                for ($j = 0; $j < count($features); $j++)
-                {
-                    $feat = $features[$j];
-                    $featureProperties = array();
-                    
-                    $fps = $feat->GetProperties();
-                    foreach($fps as $fp)
-                    {
-                        $name = $fp->name;
-                        $value = $fp->value;
-                        //Add JSONified feature property
-                        array_push($featureProperties, "{\"name\" : \"$name\", \"value\" : \"$value\" }");
-                    }
-                    //Add JSONified feature
-                    if($feat->zoom != null)
-                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : { \"x\": ".$feat->zoom->x.", \"y\": ".$feat->zoom->y." } }");
-                    else
-                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : null }");
-                        
-                    //FB::log("Feature processed on layer: $layerName");
-                }
-            }
-            
-            array_push($totalLayers, "\"$layerName\" : [" . join(", ", $totalFeaturesOnLayer) . "]");
-            //FB::log("Selected features on layer added to final JSON response");
-        }
-    }
-    
-    //FB::log("Selection layer count: ".count($totalLayers));
-    
-    $result = "{" . join(",",$totalLayers) . "}";
-    //return json_encode($result);
-    return $result;
-}
-
-function GetPropertyValueFromFeatureReader($fr, $agfRW, $propType, $propName)
-{
-    $val = "";
-    $tStr = "";
-    switch($propType)
-    {
-        case MgPropertyType::Null:
-            $tStr = "Null";
-            $val = "";
-            break;
-        case MgPropertyType::Boolean:
-            $tStr = "Boolean";
-            $val = sprintf("%s", $fr->GetBoolean($propName));
-            break;
-        case MgPropertyType::Byte:
-            $tStr = "Byte";
-            $val = sprintf("%d", $fr->GetByte($propName));
-            break;
-        case MgPropertyType::DateTime:
-            $tStr = "DateTime";
-            $val = printDateTime($fr->GetDateTime($propName)); // yyyy-mm-dd is enforced regardless of locale
-            break;
-        case MgPropertyType::Single:
-            $tStr = "Single";
-            $val = sprintf("%f", $fr->GetSingle($propName));
-            break;
-        case MgPropertyType::Double:
-            $tStr = "Double";
-            $val = sprintf("%f", $fr->GetDouble($propName));
-            break;
-        case MgPropertyType::Int16:
-            $tStr = "Int16";
-            $val = sprintf("%d", $fr->GetInt16($propName));
-            break;
-        case MgPropertyType::Int32:
-            $tStr = "Int32";
-            $val = sprintf("%d", $fr->GetInt32($propName));
-            break;
-        case MgPropertyType::Int64:
-            $tStr = "Int64";
-            $val = sprintf("%d", $fr->GetInt64($propName));
-            break;
-        case MgPropertyType::String:
-            $tStr = "String";
-            $val = JsonEscape($fr->GetString($propName)); //String content is arbitrary
-            break;
-        case MgPropertyType::Blob: //NOT PRESENTABLE IN PROPERTY GRID
-            $tStr = "BLOB";
-            break;
-        case MgPropertyType::Clob: //NOT PRESENTABLE IN PROPERTY GRID
-            $tStr = "CLOB";
-            break;
-        case MgPropertyType::Feature: //NOT PRESENTABLE IN PROPERTY GRID
-            $tStr = "Feature";
-            break;
-        case MgPropertyType::Geometry: //NOT PRESENTABLE IN PROPERTY GRID
-            $tStr = "Geometry";
-            break;
-        case MgPropertyType::Raster: //NOT PRESENTABLE IN PROPERTY GRID
-            $tStr = "Raster";
-            break;
-    }
-    //FB::log("$propName ($tStr) = $val");
-    return $val;
-}
-
-/* retrieve the property mappings for a layer */
-function GetLayerPropertyMappings($resourceService, $layer) {
-    $mappings = array();
-    $byteReader = $resourceService->GetResourceContent($layer->GetLayerDefinition());
-    $xmldoc = DOMDocument::loadXML(ByteReaderToString($byteReader));
-    $mappingNodeList = $xmldoc->getElementsByTagName('PropertyMapping');
-    for ($i=0; $i<$mappingNodeList->length; $i++) {
-        $mapping = $mappingNodeList->item($i);
-        $nameElt = $mapping->getElementsByTagName('Name');
-        $name = $nameElt->item(0)->nodeValue;
-        $valueElt = $mapping->getElementsByTagName('Value');
-        $value = $valueElt->item(0)->nodeValue;
-        $mappings[$name] = $value;
-    }
-    return $mappings;
-}
-
-function ByteReaderToString($byteReader)
-{
-    return $byteReader->ToString();
-}
-
-function printDateTime($mgDateTime)
-{
-   $dayToday = $mgDateTime->GetDay();
-   $month = $mgDateTime->GetMonth();
-   $year = $mgDateTime->GetYear();
-   return $dayToday.".".$month.".".$year;
-}
-
-function GetParameters($params)
-{
-    global $mapName, $sessionId, $locale;
-
-    $mapName = $params['MAPNAME'];
-    $sessionId = $params['SESSION'];
-    $locale = $params['LOCALE'];
-}
-
-function JsonEscape($str)
-{
-    return str_replace("\\", "\\\\", EscapeForHtml($str));
-}
-
-function JsonifyError($msg, $st)
-{
-    /*
-    {
-        "Error" : {
-            "Message" : <exception-message>,
-            "StackTrace" : <exception-stack-trace>
-        }
-    }
-    */
-    $emsg = JsonEscape($msg);
-    $est = JsonEscape($st);
-    $json = "{\"Error\":{\"Message\":\"$emsg\",\"StackTrace\":\"$est\"}}";
-    return $json;
-}
-
-function UnescapeMagicQuotes($str)
-{
-    if(ini_get("magic_quotes_sybase") == "1")
-        return str_replace("''", "'", $str);
-    else if(get_magic_quotes_gpc() == "1")
-    {
-        //Unescape double quotes
-        $str = str_replace('\\"', '"', $str);
-
-        //remove additional backslash
-        return str_replace("\\", "", $str);
-    }
-    return $str;
-}
-
-function GetRequestParameters()
-{
-    if($_SERVER['REQUEST_METHOD'] == "POST")
-        GetParameters($_POST);
-    else
-        GetParameters($_GET);
-}
-
+<?php
+
+/*
+
+TODO:
+
+- Use the property mapping. This will have to be old-fashioned parsing the <PropertyMapping> elements 
+of the layer definition. I really wanted to use MgSelection::GetSelectedFeatures(layer, class, true) but realised
+that unless the geometry is mapped, you're not going to see it in the Feature Reader (ie. No zoom point). Right now 
+it is returning all properties.
+
+- I know of a few features in the Sheboygan Dataset that trip up the JSON response. Need to find out of addslashes() fixes this.
+
+- General cleanup of the code
+
+
+*/
+
+//require_once('FirePHPCore/fb.php');
+
+//
+// Used to model the JSON response.
+//
+class SelectionSet
+{
+    private $layers;
+    
+    public function __construct()
+    {
+        $this->layers = array();
+    }
+    
+    public function AddFeature($feat)
+    {
+        $layerName = $feat->layerName;
+        if(!array_key_exists($layerName, $this->layers))
+            $this->layers[$layerName] = array();
+            
+        array_push($this->layers[$layerName], $feat);
+    }
+    
+    public function GetLayers()
+    {
+        return array_keys($this->layers);
+    }
+    
+    public function GetFeatures($layerName)
+    {
+        if(array_key_exists($layerName, $this->layers))
+            return $this->layers[$layerName];
+        
+        return null;
+    }
+}
+
+class ZoomPoint
+{
+    public $x;
+    public $y;
+}
+
+//
+// Represents a selected feature property
+//
+class FeatureProperty
+{
+    public $name;
+    public $value;
+}
+
+//
+// Represents a selected feature
+//
+class Feature
+{
+    public $layerName;
+    public $zoom;
+    
+    private $properties;
+    
+    public function __construct($layerName)
+    {
+        $this->layerName = $layerName;
+        $this->properties = array();
+    }
+    
+    public function AddProperty($prop)
+    {
+        $this->properties[$prop->name] = $prop;
+    }
+    
+    public function GetProperties()
+    {
+        return $this->properties;
+    }
+}
+
+	include 'common.php';
+    include 'constants.php';
+
+    $mapName = "";
+    $sessionId = "";
+    $locale = "";
+
+    GetRequestParameters();
+    
+    if (null == $locale || strlen($locale) == 0)
+        $locale = GetDefaultLocale();
+        
+    setlocale(LC_ALL, $locale);
+   
+	try
+	{
+		InitializeWebTier();
+		
+		$cred = new MgUserInformation($sessionId);
+        $cred->SetClientIp(GetClientIp());
+        $cred->SetClientAgent(GetClientAgent());
+
+        //connect to the site and get an instance of the resource and feature service
+        //
+        $site = new MgSiteConnection();
+        $site->Open($cred);
+        $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
+
+        //load the map runtime state
+        //
+        $map = new MgMap($site);
+        $map->Open($mapName);
+		
+		// Create the selection set
+        $selection = new MgSelection($map);
+        $selection->Open($resourceSrvc, $mapName);
+		
+		$layers = $selection->GetLayers();
+        if($layers != null)
+        {
+            $nLayers = $layers->GetCount();
+            $agfRW = new MgAgfReaderWriter();
+            
+            $selectionSet = new SelectionSet();
+            
+            for ($i = 0; $i < $nLayers; $i++) {
+                $lyr = $layers->GetItem($i);
+                $layerName = $lyr->GetName();
+                
+                //FB::log("Layer Name: " . $lyr->GetName());
+                
+                $featResId = new MgResourceIdentifier($lyr->GetFeatureSourceId());
+                $class = $lyr->GetFeatureClassName();
+                
+                $queryOptions = new MgFeatureQueryOptions();
+                
+                $mappings = GetLayerPropertyMappings($resourceSrvc, $lyr);
+                //FB::log("Property Mappings for Layer: $layerName");
+                foreach($mappings as $name => $value) {
+                    $queryOptions->AddFeatureProperty($name);
+                    //FB::log("$name => $value");
+                }
+                $geomName = $lyr->GetFeatureGeometryName();
+                $queryOptions->AddFeatureProperty($geomName);
+                
+                $filter = $selection->GenerateFilter($lyr, $class);
+                $queryOptions->SetFilter($filter);
+                $fr = $lyr->SelectFeatures($queryOptions);
+                
+                $clsDef = $fr->GetClassDefinition();
+                $props = $clsDef->GetProperties();
+                
+                //FB::log("Geometry: $geomName");
+                
+                while($fr->ReadNext())
+                {
+                    $feat = new Feature($layerName);
+                    $zoom = null;
+                    
+                    for ($k = 0; $k < $props->GetCount(); $k++)
+                    {
+                        $prop = $props->GetItem($k);
+                        $propName = $prop->GetName();
+                        $propType = $fr->GetPropertyType($propName);
+                        
+                        //We only care about mapped properties or geometry properties
+                        if (array_key_exists($propName, $mappings) || $propType == MgPropertyType::Geometry)
+                        {
+                            $value = "";
+                            if (!$fr->IsNull($propName))
+                            {
+                                if(strcmp($propName,$geomName) == 0)
+                                {
+                                    //We want the centroid so we have a zoom-to point
+                                    $agf = $fr->GetGeometry($propName);
+                                    $geom = $agfRW->Read($agf);
+                                    $pt = $geom->GetCentroid()->GetCoordinate();
+                                    
+                                    $zoom = new ZoomPoint();
+                                    $zoom->x = $pt->GetX();
+                                    $zoom->y = $pt->GetY();
+                                    
+                                    $feat->zoom = $zoom;
+                                    //FB::log("zoom: (".$zoom->x.",".$zoom->y.")");
+                                }
+                                else
+                                {
+                                    $value = GetPropertyValueFromFeatureReader($fr, $agfRW, $propType, $propName);
+                                }
+                            }
+                        
+                            if (array_key_exists($propName, $mappings))
+                            {
+                                $fp = new FeatureProperty();
+                                $fp->name = $mappings[$propName];
+                                $fp->value = $value;
+                                
+                                $feat->AddProperty($fp);
+                            }
+                        }
+                    }
+                    
+                    $c = count($feat->GetProperties());
+                    //FB::log("Selected feature processed ($c)");
+                    
+                    $selectionSet->AddFeature($feat);
+                }
+                $fr->Close();
+            }
+            
+            //Now output the selection set
+            
+            header("Content-Type: application/json");
+            header("X-JSON: true");
+            echo GetJson($selectionSet);
+        }
+    }
+    catch(Exception $e)
+    {
+        header("Content-Type: application/json");
+        header("X-JSON: true");
+        echo JsonifyError($e->getMessage(), $e->getTraceAsString());
+    }
+	catch(MgException $e)
+    {
+        header("Content-Type: application/json");
+        header("X-JSON: true");
+        echo JsonifyError($e->GetDetails(), $e->GetStackTrace());
+    }
+
+function GetJson($selectionSet)
+{
+    if($selectionSet == null)
+        return "";
+        
+    //FB::log("Processing JSON response");
+    /*
+	A sample of the JSON output this method will produce:
+	
+	
+	{
+		"Layer1" : [ 
+			{ 
+				'values' { "name" : "name1" , "value" : "value1" }, 
+				'zoom' : { x: num1, y: num2 } 
+			} , 
+			..,
+			..,
+			..,
+		],
+		"Layer2" : [ 
+			{ 
+				'values' { "name" : "name2" , "value" : "value2" }, 
+				'zoom' : { x: num1, y: num2 } 
+			} , 
+			..,
+			..,
+			..,
+		]
+	}
+	*/
+    
+    $layers = $selectionSet->GetLayers();
+    $totalLayers = array(); //The data portion of the JSON response
+    
+    //FB::log("Layers in selection set: ".count($layers));
+    
+    for ($i = 0; $i < count($layers); $i++)
+    {   
+        $layerName = $layers[$i];
+		
+        $features = $selectionSet->GetFeatures($layerName);
+        
+        //FB::log("Features: ".$features);
+        
+        if($features != null)
+        {
+            //FB::log("Processing layer: $layerName");
+        
+            $totalFeaturesOnLayer = array();
+            
+            if (count($features) > 0)
+            {
+                for ($j = 0; $j < count($features); $j++)
+                {
+                    $feat = $features[$j];
+                    $featureProperties = array();
+                    
+                    $fps = $feat->GetProperties();
+                    foreach($fps as $fp)
+                    {
+                        $name = $fp->name;
+                        $value = $fp->value;
+                        //Add JSONified feature property
+                        array_push($featureProperties, "{\"name\" : \"$name\", \"value\" : \"$value\" }");
+                    }
+                    //Add JSONified feature
+                    if($feat->zoom != null)
+                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : { \"x\": ".$feat->zoom->x.", \"y\": ".$feat->zoom->y." } }");
+                    else
+                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : null }");
+                        
+                    //FB::log("Feature processed on layer: $layerName");
+                }
+            }
+            
+            array_push($totalLayers, "\"$layerName\" : [" . join(", ", $totalFeaturesOnLayer) . "]");
+            //FB::log("Selected features on layer added to final JSON response");
+        }
+    }
+    
+    //FB::log("Selection layer count: ".count($totalLayers));
+    
+    $result = "{" . join(",",$totalLayers) . "}";
+    //return json_encode($result);
+    return $result;
+}
+
+function GetPropertyValueFromFeatureReader($fr, $agfRW, $propType, $propName)
+{
+    $val = "";
+    $tStr = "";
+    switch($propType)
+    {
+        case MgPropertyType::Null:
+            $tStr = "Null";
+            $val = "";
+            break;
+        case MgPropertyType::Boolean:
+            $tStr = "Boolean";
+            $val = sprintf("%s", $fr->GetBoolean($propName));
+            break;
+        case MgPropertyType::Byte:
+            $tStr = "Byte";
+            $val = sprintf("%d", $fr->GetByte($propName));
+            break;
+        case MgPropertyType::DateTime:
+            $tStr = "DateTime";
+            $val = printDateTime($fr->GetDateTime($propName)); // yyyy-mm-dd is enforced regardless of locale
+            break;
+        case MgPropertyType::Single:
+            $tStr = "Single";
+            $val = sprintf("%f", $fr->GetSingle($propName));
+            break;
+        case MgPropertyType::Double:
+            $tStr = "Double";
+            $val = sprintf("%f", $fr->GetDouble($propName));
+            break;
+        case MgPropertyType::Int16:
+            $tStr = "Int16";
+            $val = sprintf("%d", $fr->GetInt16($propName));
+            break;
+        case MgPropertyType::Int32:
+            $tStr = "Int32";
+            $val = sprintf("%d", $fr->GetInt32($propName));
+            break;
+        case MgPropertyType::Int64:
+            $tStr = "Int64";
+            $val = sprintf("%d", $fr->GetInt64($propName));
+            break;
+        case MgPropertyType::String:
+            $tStr = "String";
+            $val = JsonEscape($fr->GetString($propName)); //String content is arbitrary
+            break;
+        case MgPropertyType::Blob: //NOT PRESENTABLE IN PROPERTY GRID
+            $tStr = "BLOB";
+            break;
+        case MgPropertyType::Clob: //NOT PRESENTABLE IN PROPERTY GRID
+            $tStr = "CLOB";
+            break;
+        case MgPropertyType::Feature: //NOT PRESENTABLE IN PROPERTY GRID
+            $tStr = "Feature";
+            break;
+        case MgPropertyType::Geometry: //NOT PRESENTABLE IN PROPERTY GRID
+            $tStr = "Geometry";
+            break;
+        case MgPropertyType::Raster: //NOT PRESENTABLE IN PROPERTY GRID
+            $tStr = "Raster";
+            break;
+    }
+    //FB::log("$propName ($tStr) = $val");
+    return $val;
+}
+
+/* retrieve the property mappings for a layer */
+function GetLayerPropertyMappings($resourceService, $layer) {
+    $mappings = array();
+    $byteReader = $resourceService->GetResourceContent($layer->GetLayerDefinition());
+    $xmldoc = DOMDocument::loadXML(ByteReaderToString($byteReader));
+    $mappingNodeList = $xmldoc->getElementsByTagName('PropertyMapping');
+    for ($i=0; $i<$mappingNodeList->length; $i++) {
+        $mapping = $mappingNodeList->item($i);
+        $nameElt = $mapping->getElementsByTagName('Name');
+        $name = $nameElt->item(0)->nodeValue;
+        $valueElt = $mapping->getElementsByTagName('Value');
+        $value = $valueElt->item(0)->nodeValue;
+        $mappings[$name] = $value;
+    }
+    return $mappings;
+}
+
+function ByteReaderToString($byteReader)
+{
+    return $byteReader->ToString();
+}
+
+function printDateTime($mgDateTime)
+{
+   $dayToday = $mgDateTime->GetDay();
+   $month = $mgDateTime->GetMonth();
+   $year = $mgDateTime->GetYear();
+   return $dayToday.".".$month.".".$year;
+}
+
+function GetParameters($params)
+{
+    global $mapName, $sessionId, $locale;
+
+    $mapName = $params['MAPNAME'];
+    $sessionId = $params['SESSION'];
+    $locale = $params['LOCALE'];
+}
+
+function JsonEscape($str)
+{
+    return str_replace("\\", "\\\\", EscapeForHtml($str));
+}
+
+function JsonifyError($msg, $st)
+{
+    /*
+    {
+        "Error" : {
+            "Message" : <exception-message>,
+            "StackTrace" : <exception-stack-trace>
+        }
+    }
+    */
+    $emsg = JsonEscape($msg);
+    $est = JsonEscape($st);
+    $json = "{\"Error\":{\"Message\":\"$emsg\",\"StackTrace\":\"$est\"}}";
+    return $json;
+}
+
+function UnescapeMagicQuotes($str)
+{
+    if(ini_get("magic_quotes_sybase") == "1")
+        return str_replace("''", "'", $str);
+    else if(get_magic_quotes_gpc() == "1")
+    {
+        //Unescape double quotes
+        $str = str_replace('\\"', '"', $str);
+
+        //remove additional backslash
+        return str_replace("\\", "", $str);
+    }
+    return $str;
+}
+
+function GetRequestParameters()
+{
+    if($_SERVER['REQUEST_METHOD'] == "POST")
+        GetParameters($_POST);
+    else
+        GetParameters($_GET);
+}
+
 ?>
\ No newline at end of file


Property changes on: trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,182 +1,182 @@
-<?php
-
-    include 'common.php';
-    include 'constants.php';
-    
-    $sessionID = "";
-    $mapName   = "";
-    $rotation  = 0.0;
-    $printDpi  = 300;
-    $scaleDenominator = 0;
-    $captureBox;
-    $normalizedCapture;
-    $printSize;
-    $paperSize;
-    
-    GetParameters();
-    GenerateMap($printSize);
-?>
-
-<?php    
-    function GetParameters()
-    {
-        global $sessionID, $mapName, $printDpi, $rotation, $paperSize, $captureBox, $printSize, $scaleDenominator, $normalizedCapture;
-        $args = $_GET;
-        if ($_SERVER["REQUEST_METHOD"] == "POST")
-        {
-            $args = $_POST;
-        }
-        
-        // Not necessary to validate the parameters    	
-        $sessionID   = $args["session_id"];
-        $mapName     = $args["map_name"];
-        $rotation    = floatval($args["rotation"]);
-        $printDpi    = intval($args["print_dpi"]);
-
-        $scaleDenominator = intval($args["scale_denominator"]);
-
-        $array       = explode(",", $args["paper_size"]);
-        $paperSize   = new Size(floatval($array[0]), floatval($array[1]));
-        $printSize   = new Size($paperSize->width / 25.4 * $printDpi, $paperSize->height / 25.4 * $printDpi);
-        
-        $array       = explode(",", $args["box"]);
-        $captureBox  = CreatePolygon($array);
-        
-        $array       = explode(",", $args["normalized_box"]);
-        $normalizedCapture = CreatePolygon($array);
-    }
-    
-    function CreatePolygon($coordinates)
-    {
-        $geometryFactory      = new MgGeometryFactory();
-        $coordinateCollection = new MgCoordinateCollection();
-        $linearRingCollection = new MgLinearRingCollection();
-        
-        for ($index = 0; $index < count($coordinates); ++$index)
-        {
-            $coordinate = $geometryFactory->CreateCoordinateXY(floatval($coordinates[$index]), floatval($coordinates[++$index]));
-            $coordinateCollection->Add($coordinate);
-        }
-        
-        $coordinateCollection->Add($geometryFactory->CreateCoordinateXY(floatval($coordinates[0]), floatval($coordinates[1])));
-        
-        $linearRingCollection = $geometryFactory->CreateLinearRing($coordinateCollection);
-        $captureBox           = $geometryFactory->CreatePolygon($linearRingCollection, null);
-        
-        return $captureBox;
-    }
-
-    function GenerateMap($size)
-    {
-        global $sessionID, $mapName, $captureBox, $printSize, $normalizedCapture, $rotation, $scaleDenominator, $printDpi;
-        
-        $userInfo         = new MgUserInformation($sessionID);
-        $siteConnection   = new MgSiteConnection();
-        $siteConnection->Open($userInfo);
-        $resourceService  = $siteConnection->CreateService(MgServiceType::ResourceService);
-        $renderingService = $siteConnection->CreateService(MgServiceType::RenderingService);
-        
-        $map = new MgMap();
-        $map->Open($resourceService, $mapName);
-        
-        $selection        = new MgSelection($map);
-        
-        // Calculate the generated picture size
-        $envelope         = $captureBox->Envelope();
-        $normalizedE      = $normalizedCapture->Envelope();
-        $size1            = new Size($envelope->getWidth(), $envelope->getHeight());
-        $size2            = new Size($normalizedE->getWidth(), $normalizedE->getHeight());
-        $toSize           = new Size($size1->width / $size2->width * $size->width, $size1->height / $size2->height * $size->height);
-        $center           = $captureBox->GetCentroid()->GetCoordinate();
-        
-        // Get the map agent url
-        // Get the correct http protocal
-        $mapAgent = "http";
-        if ($_SERVER["HTTPS"] == "on")
-        {
-            $mapAgent .= "s";
-        }
-        // Get the correct port number
-        // Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
-        // be always on the same server with map agent. 
-        $mapAgent .= "://127.0.0.1:" . $_SERVER["SERVER_PORT"];
-        // Get the correct virtual directory
-        $mapAgent .= substr($_SERVER["REQUEST_URI"], 0, strpos($_SERVER["REQUEST_URI"], "/", 1));
-        $mapAgent .="/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE" .
-                    "&SESSION=$sessionID" .  
-                    "&MAPNAME=$mapName" .
-                    "&FORMAT=PNG" .
-                    "&SETVIEWCENTERX=" . $center->GetX() .
-                    "&SETVIEWCENTERY=" . $center->GetY() .
-                    "&SETVIEWSCALE=$scaleDenominator" . 
-                    "&SETDISPLAYDPI=$printDpi" . 
-                    "&SETDISPLAYWIDTH=$toSize->width" . 
-                    "&SETDISPLAYHEIGHT=$toSize->height" . 
-                    "&CLIP=0";
-
-        $image = imagecreatefrompng($mapAgent);
-        // Rotate the picture back to be normalized
-        $normalizedImg = imagerotate($image, -$rotation, 0);
-        // Free the original image
-        imagedestroy($image);
-        // Crop the normalized image
-        $croppedImg = imagecreatetruecolor($size->width, $size->height);
-        imagecopy($croppedImg, $normalizedImg, 0, 0, (imagesx($normalizedImg) - $size->width) / 2, (imagesy($normalizedImg) - $size->height) / 2, $size->width, $size->height);
-        // Free the normalized image
-        imagedestroy($normalizedImg);
-        // Draw the north arrow on the map
-        DrawNorthArrow($croppedImg);
-
-        header ("Content-type: image/png"); 
-        imagepng($croppedImg);
-        imagedestroy($croppedImg);
-    }
-    
-    function DrawNorthArrow($map)
-    {
-        global $paperSize, $rotation;
-        
-        // Load the north arrow image which has a 300 dpi resolution
-        $na         = imagecreatefrompng("../viewerfiles/quickplotnortharrow.png");
-        // Rotate the north arrow according to the capture rotation
-        $transparent= imagecolortransparent($na);
-        $rotatedNa  = imagerotate($na, -$rotation, $transparent);
-        // Free the north arrow image
-        imagedestroy($na);
-        // Get the size of north arrow image
-        $naWidth    = imagesx($rotatedNa);
-        $naHeight   = imagesy($rotatedNa);
-        // Get the map size
-        $mapWidth   = imagesx($map);
-        $mapHeight  = imagesy($map);
-        // Get the logical resolution of map
-        $resolution = $mapWidth * 25.4 / $paperSize->width;
-        // On printed paper, north arrow is located at the right bottom corner with 6 MM margin
-        $naRes      = 300;
-        $naMargin   = 12;
-        // Calculate the margin as pixels according to the resolutions
-        $margin     = $resolution * $naMargin / 25.4;
-        // Get the width of the north arrow on the map picture
-        $drawWidth  = $naWidth * $resolution / $naRes;
-        $drawHeight = $naHeight * $resolution / $naRes;
-        // Draw the north arrow on the map picture
-        imagecopyresized($map, $rotatedNa, $mapWidth - $drawWidth - $margin, $mapHeight - $drawHeight - $margin, 0, 0, $drawWidth, $drawHeight, $naWidth, $naHeight);
-        // Free the north arrow image
-        imagedestroy($rotatedNa); 
-    }
-
-?>
-
-<?php    
-    class Size
-    {
-        public $width;
-        public $height;
-        
-        public function __construct($width, $height)
-        {
-            $this->width  = $width;
-            $this->height = $height;
-        }
-    }
+<?php
+
+    include 'common.php';
+    include 'constants.php';
+    
+    $sessionID = "";
+    $mapName   = "";
+    $rotation  = 0.0;
+    $printDpi  = 300;
+    $scaleDenominator = 0;
+    $captureBox;
+    $normalizedCapture;
+    $printSize;
+    $paperSize;
+    
+    GetParameters();
+    GenerateMap($printSize);
+?>
+
+<?php    
+    function GetParameters()
+    {
+        global $sessionID, $mapName, $printDpi, $rotation, $paperSize, $captureBox, $printSize, $scaleDenominator, $normalizedCapture;
+        $args = $_GET;
+        if ($_SERVER["REQUEST_METHOD"] == "POST")
+        {
+            $args = $_POST;
+        }
+        
+        // Not necessary to validate the parameters    	
+        $sessionID   = $args["session_id"];
+        $mapName     = $args["map_name"];
+        $rotation    = floatval($args["rotation"]);
+        $printDpi    = intval($args["print_dpi"]);
+
+        $scaleDenominator = intval($args["scale_denominator"]);
+
+        $array       = explode(",", $args["paper_size"]);
+        $paperSize   = new Size(floatval($array[0]), floatval($array[1]));
+        $printSize   = new Size($paperSize->width / 25.4 * $printDpi, $paperSize->height / 25.4 * $printDpi);
+        
+        $array       = explode(",", $args["box"]);
+        $captureBox  = CreatePolygon($array);
+        
+        $array       = explode(",", $args["normalized_box"]);
+        $normalizedCapture = CreatePolygon($array);
+    }
+    
+    function CreatePolygon($coordinates)
+    {
+        $geometryFactory      = new MgGeometryFactory();
+        $coordinateCollection = new MgCoordinateCollection();
+        $linearRingCollection = new MgLinearRingCollection();
+        
+        for ($index = 0; $index < count($coordinates); ++$index)
+        {
+            $coordinate = $geometryFactory->CreateCoordinateXY(floatval($coordinates[$index]), floatval($coordinates[++$index]));
+            $coordinateCollection->Add($coordinate);
+        }
+        
+        $coordinateCollection->Add($geometryFactory->CreateCoordinateXY(floatval($coordinates[0]), floatval($coordinates[1])));
+        
+        $linearRingCollection = $geometryFactory->CreateLinearRing($coordinateCollection);
+        $captureBox           = $geometryFactory->CreatePolygon($linearRingCollection, null);
+        
+        return $captureBox;
+    }
+
+    function GenerateMap($size)
+    {
+        global $sessionID, $mapName, $captureBox, $printSize, $normalizedCapture, $rotation, $scaleDenominator, $printDpi;
+        
+        $userInfo         = new MgUserInformation($sessionID);
+        $siteConnection   = new MgSiteConnection();
+        $siteConnection->Open($userInfo);
+        $resourceService  = $siteConnection->CreateService(MgServiceType::ResourceService);
+        $renderingService = $siteConnection->CreateService(MgServiceType::RenderingService);
+        
+        $map = new MgMap();
+        $map->Open($resourceService, $mapName);
+        
+        $selection        = new MgSelection($map);
+        
+        // Calculate the generated picture size
+        $envelope         = $captureBox->Envelope();
+        $normalizedE      = $normalizedCapture->Envelope();
+        $size1            = new Size($envelope->getWidth(), $envelope->getHeight());
+        $size2            = new Size($normalizedE->getWidth(), $normalizedE->getHeight());
+        $toSize           = new Size($size1->width / $size2->width * $size->width, $size1->height / $size2->height * $size->height);
+        $center           = $captureBox->GetCentroid()->GetCoordinate();
+        
+        // Get the map agent url
+        // Get the correct http protocal
+        $mapAgent = "http";
+        if ($_SERVER["HTTPS"] == "on")
+        {
+            $mapAgent .= "s";
+        }
+        // Get the correct port number
+        // Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
+        // be always on the same server with map agent. 
+        $mapAgent .= "://127.0.0.1:" . $_SERVER["SERVER_PORT"];
+        // Get the correct virtual directory
+        $mapAgent .= substr($_SERVER["REQUEST_URI"], 0, strpos($_SERVER["REQUEST_URI"], "/", 1));
+        $mapAgent .="/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE" .
+                    "&SESSION=$sessionID" .  
+                    "&MAPNAME=$mapName" .
+                    "&FORMAT=PNG" .
+                    "&SETVIEWCENTERX=" . $center->GetX() .
+                    "&SETVIEWCENTERY=" . $center->GetY() .
+                    "&SETVIEWSCALE=$scaleDenominator" . 
+                    "&SETDISPLAYDPI=$printDpi" . 
+                    "&SETDISPLAYWIDTH=$toSize->width" . 
+                    "&SETDISPLAYHEIGHT=$toSize->height" . 
+                    "&CLIP=0";
+
+        $image = imagecreatefrompng($mapAgent);
+        // Rotate the picture back to be normalized
+        $normalizedImg = imagerotate($image, -$rotation, 0);
+        // Free the original image
+        imagedestroy($image);
+        // Crop the normalized image
+        $croppedImg = imagecreatetruecolor($size->width, $size->height);
+        imagecopy($croppedImg, $normalizedImg, 0, 0, (imagesx($normalizedImg) - $size->width) / 2, (imagesy($normalizedImg) - $size->height) / 2, $size->width, $size->height);
+        // Free the normalized image
+        imagedestroy($normalizedImg);
+        // Draw the north arrow on the map
+        DrawNorthArrow($croppedImg);
+
+        header ("Content-type: image/png"); 
+        imagepng($croppedImg);
+        imagedestroy($croppedImg);
+    }
+    
+    function DrawNorthArrow($map)
+    {
+        global $paperSize, $rotation;
+        
+        // Load the north arrow image which has a 300 dpi resolution
+        $na         = imagecreatefrompng("../viewerfiles/quickplotnortharrow.png");
+        // Rotate the north arrow according to the capture rotation
+        $transparent= imagecolortransparent($na);
+        $rotatedNa  = imagerotate($na, -$rotation, $transparent);
+        // Free the north arrow image
+        imagedestroy($na);
+        // Get the size of north arrow image
+        $naWidth    = imagesx($rotatedNa);
+        $naHeight   = imagesy($rotatedNa);
+        // Get the map size
+        $mapWidth   = imagesx($map);
+        $mapHeight  = imagesy($map);
+        // Get the logical resolution of map
+        $resolution = $mapWidth * 25.4 / $paperSize->width;
+        // On printed paper, north arrow is located at the right bottom corner with 6 MM margin
+        $naRes      = 300;
+        $naMargin   = 12;
+        // Calculate the margin as pixels according to the resolutions
+        $margin     = $resolution * $naMargin / 25.4;
+        // Get the width of the north arrow on the map picture
+        $drawWidth  = $naWidth * $resolution / $naRes;
+        $drawHeight = $naHeight * $resolution / $naRes;
+        // Draw the north arrow on the map picture
+        imagecopyresized($map, $rotatedNa, $mapWidth - $drawWidth - $margin, $mapHeight - $drawHeight - $margin, 0, 0, $drawWidth, $drawHeight, $naWidth, $naHeight);
+        // Free the north arrow image
+        imagedestroy($rotatedNa); 
+    }
+
+?>
+
+<?php    
+    class Size
+    {
+        public $width;
+        public $height;
+        
+        public function __construct($width, $height)
+        {
+            $this->width  = $width;
+            $this->height = $height;
+        }
+    }
 ?>
\ No newline at end of file


Property changes on: trunk/MgDev/Web/src/mapviewerphp/quickplotgeneratepicture.php
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerphp/quickplotpanel.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/quickplotpanel.php	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerphp/quickplotpanel.php	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,57 +1,57 @@
-<?php
-
-//
-//  Copyright (C) 2004-2009 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-    include 'common.php';
-    include 'constants.php';
-
-    $locale = "";
-    $targetType = 0;
-    $mapName = "";
-    $sessionId = "";
-    $us = "";
-
-    GetRequestParameters();
-
-    $templ  = file_get_contents("../viewerfiles/quickplotpanel.templ");
-    SetLocalizedFilesPath(GetLocalizationPath());
-    $templ  = Localize($templ, $locale, GetClientOS());
-    $vpath  = GetSurroundVirtualPath();
-    $jsPath = "../viewerfiles/";
-    print sprintf($templ, $jsPath, $jsPath, $targetType, "quickplotgeneratepicture.php", "quickplotpreviewinner.php");
-
-function GetParameters($params)
-{
-    global $target, $cmdIndex, $clientWidth, $mapName, $sessionId, $targetType, $us, $locale;
-
-    $locale = $params['LOCALE'];
-    $mapName = $params['MAPNAME'];
-    $sessionId = $params['SESSION'];
-    $targetType = $params['TARGETTYPE'];
-    $us = $params['US'];
-}
-
-function GetRequestParameters()
-{
-    if($_SERVER['REQUEST_METHOD'] == "POST")
-        GetParameters($_POST);
-    else
-        GetParameters($_GET);
-}
-
-?>
+<?php
+
+//
+//  Copyright (C) 2004-2009 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+    include 'common.php';
+    include 'constants.php';
+
+    $locale = "";
+    $targetType = 0;
+    $mapName = "";
+    $sessionId = "";
+    $us = "";
+
+    GetRequestParameters();
+
+    $templ  = file_get_contents("../viewerfiles/quickplotpanel.templ");
+    SetLocalizedFilesPath(GetLocalizationPath());
+    $templ  = Localize($templ, $locale, GetClientOS());
+    $vpath  = GetSurroundVirtualPath();
+    $jsPath = "../viewerfiles/";
+    print sprintf($templ, $jsPath, $jsPath, $targetType, "quickplotgeneratepicture.php", "quickplotpreviewinner.php");
+
+function GetParameters($params)
+{
+    global $target, $cmdIndex, $clientWidth, $mapName, $sessionId, $targetType, $us, $locale;
+
+    $locale = $params['LOCALE'];
+    $mapName = $params['MAPNAME'];
+    $sessionId = $params['SESSION'];
+    $targetType = $params['TARGETTYPE'];
+    $us = $params['US'];
+}
+
+function GetRequestParameters()
+{
+    if($_SERVER['REQUEST_METHOD'] == "POST")
+        GetParameters($_POST);
+    else
+        GetParameters($_GET);
+}
+
+?>


Property changes on: trunk/MgDev/Web/src/mapviewerphp/quickplotpanel.php
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,84 +1,84 @@
-<?php
-//
-//  Copyright (C) 2004-2009 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    include 'common.php';
-    include 'constants.php';
-    
-    $locale = GetDefaultLocale();
-    $scaleDenominator;
-    $annotations;
-    
-    $args = GetRequestMethod();
-    GetParameters($args);
-
-    $templ = file_get_contents("../viewerfiles/QuickPlotPreviewInner.templ");
-    SetLocalizedFilesPath(GetLocalizationPath());
-    
-    // Localize the page
-    $templ = Localize($templ, $locale, GetClientOS());
-    
-    // Set some annotation labels in the page by replacing the placeholders in the html code
-    $templ = str_replace(array_keys($annotations), array_values($annotations), $templ);
-    // Set the date annotation according to its format mask
-    $pattern = "/\{date:.*\[php=(.+?)\].+?\}/";
-    $matches = array();
-    if (preg_match($pattern, $templ, $matches))
-    {
-        $mask  = $matches[1];
-        $date  = date($mask);
-        $templ = preg_replace($pattern, $date, $templ);
-    }
-    
-    $jsPath    = "../viewerfiles/";
-    print sprintf($templ, $jsPath);
-?>
-
-<?php
-function GetParameters($params)
-{
-    global $scaleDenominator, $annotations;
-    
-    $scaleDenominator = intval($params["scale_denominator"]);
-    $annotations = array();
-    
-    // The parameters whose name matches this pattern will be treated as annotation
-    $pattern = "/^\{field:.+\}$/i";
-    foreach ($params as $key => $value)
-    {
-        if (preg_match($pattern, $key) == 1)
-        {
-            $annotations[$key] = htmlspecialchars(urlDecode($value), ENT_QUOTES);
-        }
-    }
-    
-    // The scale annotation
-    $annotations["{scale}"] = "1 : " . $scaleDenominator;
-}
-
-function GetRequestMethod()
-{
-    if($_SERVER['REQUEST_METHOD'] == "POST")
-    {
-        return $_POST;
-    }
-    else
-    {
-        return $_GET;
-    }
-}
-
-?>
+<?php
+//
+//  Copyright (C) 2004-2009 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    include 'common.php';
+    include 'constants.php';
+    
+    $locale = GetDefaultLocale();
+    $scaleDenominator;
+    $annotations;
+    
+    $args = GetRequestMethod();
+    GetParameters($args);
+
+    $templ = file_get_contents("../viewerfiles/QuickPlotPreviewInner.templ");
+    SetLocalizedFilesPath(GetLocalizationPath());
+    
+    // Localize the page
+    $templ = Localize($templ, $locale, GetClientOS());
+    
+    // Set some annotation labels in the page by replacing the placeholders in the html code
+    $templ = str_replace(array_keys($annotations), array_values($annotations), $templ);
+    // Set the date annotation according to its format mask
+    $pattern = "/\{date:.*\[php=(.+?)\].+?\}/";
+    $matches = array();
+    if (preg_match($pattern, $templ, $matches))
+    {
+        $mask  = $matches[1];
+        $date  = date($mask);
+        $templ = preg_replace($pattern, $date, $templ);
+    }
+    
+    $jsPath    = "../viewerfiles/";
+    print sprintf($templ, $jsPath);
+?>
+
+<?php
+function GetParameters($params)
+{
+    global $scaleDenominator, $annotations;
+    
+    $scaleDenominator = intval($params["scale_denominator"]);
+    $annotations = array();
+    
+    // The parameters whose name matches this pattern will be treated as annotation
+    $pattern = "/^\{field:.+\}$/i";
+    foreach ($params as $key => $value)
+    {
+        if (preg_match($pattern, $key) == 1)
+        {
+            $annotations[$key] = htmlspecialchars(urlDecode($value), ENT_QUOTES);
+        }
+    }
+    
+    // The scale annotation
+    $annotations["{scale}"] = "1 : " . $scaleDenominator;
+}
+
+function GetRequestMethod()
+{
+    if($_SERVER['REQUEST_METHOD'] == "POST")
+    {
+        return $_POST;
+    }
+    else
+    {
+        return $_GET;
+    }
+}
+
+?>


Property changes on: trunk/MgDev/Web/src/mapviewerphp/quickplotpreviewinner.php
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/floatingmessage.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/floatingmessage.js	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/floatingmessage.js	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,113 +1,113 @@
-var FloatingMessage = function(parentNode)
-{
-    this.initialize(parentNode);
-}
-
-FloatingMessage.prototype = 
-{
-    parentNode : null,
-    domObj : null,
-    leadingIcon : null,
-    textCell : null,
-    message : "",
-    
-    infoIconName : "../stdicons/icon_info.gif",
-    warningIconName : "../stdicons/icon_warning.gif",
-    errorIconName : "../stdicons/icon_error.gif",
-    
-    containerCssText : "position:absolute; z-index:10000; padding:10px; border:solid 2px #ECECEC; background:#FFFFBB",
-    iconCssText : "margin-right:10px; width:16px; height:16px",
-    textCellCssText : "width:100%; vertical-align:top; font: 8pt Tahoma",
-
-    opacity: 0.95,
-    
-    initialize : function(parentNode)
-    {
-        this.parentNode = $(parentNode);
-        // Create the div container
-        var container   = document.createElement("div");
-        container.style.visibility = "hidden";
-        this.container  = $(container);
-        parentNode.appendChild(container);
-
-        container.style.cssText = this.containerCssText;
-        var offset = {left:10, top:10};
-        container.style.left = offset.left + "px";
-        container.style.top  = offset.top  + "px";
-        
-        // Create the inner table
-        var table = document.createElement("table");
-        container.appendChild(table);
-        table.style.width = "100%";
-        table.cellSpacing = "0";
-        table.cellPadding = "0";
-        table.border      = "0";
-        // Create the table row
-        var row   = table.insertRow(0);
-        // The icon cell
-        var cell  = row.insertCell(0);
-        // Add the info icon by default
-        var icon  = document.createElement("img");
-        icon.src  = this.infoIconName;
-        cell.appendChild(icon);
-        icon.style.cssText = this.iconCssText;
-        this.leadingIcon   = icon;
-        // Create the text cell
-        cell      = row.insertCell(1);
-        cell.style.cssText = this.textCellCssText;
-        this.textCell = $(cell);
-        this.textCell.innerHTML = this.message;
-        
-        this.refreshLayout();
-        // Hide message bar by default
-        this.container.setOpacity(0);
-        this.container.style.visibility = "visible";
-    },
-    
-    info : function(message)
-    {
-        this.message = message;
-        this.leadingIcon.src = this.infoIconName;
-        this.show();
-    },
-    
-    warn : function(message)
-    {
-        this.message = message;
-        this.leadingIcon.src = this.warningIconName;
-        this.show();
-    },
-    
-    error : function(message)
-    {
-        this.message = message;
-        this.leadingIcon.src = this.errorIconName;
-        this.show();
-    },
-    
-    clear : function()
-    {
-        this.message = "";
-        this.textCell.innerHTML = "";
-        this.hide();
-    },
-    
-    show : function()
-    {
-        this.textCell.innerHTML = this.message;
-        this.container.fade(this.opacity);
-    },
-    
-    hide : function()
-    {
-        this.container.fade(0);
-    },
-    
-    refreshLayout: function()
-    {
-        // 90 = 2 * padding (10) + 2 * offset(10) + 2 * border (2) + 46 (the navigator control)
-        this.container.style.width  = this.parentNode.offsetWidth - 90 + "px";
-    },
-    
-    CLASS_NAME: "FloatingMessage"
+var FloatingMessage = function(parentNode)
+{
+    this.initialize(parentNode);
+}
+
+FloatingMessage.prototype = 
+{
+    parentNode : null,
+    domObj : null,
+    leadingIcon : null,
+    textCell : null,
+    message : "",
+    
+    infoIconName : "../stdicons/icon_info.gif",
+    warningIconName : "../stdicons/icon_warning.gif",
+    errorIconName : "../stdicons/icon_error.gif",
+    
+    containerCssText : "position:absolute; z-index:10000; padding:10px; border:solid 2px #ECECEC; background:#FFFFBB",
+    iconCssText : "margin-right:10px; width:16px; height:16px",
+    textCellCssText : "width:100%; vertical-align:top; font: 8pt Tahoma",
+
+    opacity: 0.95,
+    
+    initialize : function(parentNode)
+    {
+        this.parentNode = $(parentNode);
+        // Create the div container
+        var container   = document.createElement("div");
+        container.style.visibility = "hidden";
+        this.container  = $(container);
+        parentNode.appendChild(container);
+
+        container.style.cssText = this.containerCssText;
+        var offset = {left:10, top:10};
+        container.style.left = offset.left + "px";
+        container.style.top  = offset.top  + "px";
+        
+        // Create the inner table
+        var table = document.createElement("table");
+        container.appendChild(table);
+        table.style.width = "100%";
+        table.cellSpacing = "0";
+        table.cellPadding = "0";
+        table.border      = "0";
+        // Create the table row
+        var row   = table.insertRow(0);
+        // The icon cell
+        var cell  = row.insertCell(0);
+        // Add the info icon by default
+        var icon  = document.createElement("img");
+        icon.src  = this.infoIconName;
+        cell.appendChild(icon);
+        icon.style.cssText = this.iconCssText;
+        this.leadingIcon   = icon;
+        // Create the text cell
+        cell      = row.insertCell(1);
+        cell.style.cssText = this.textCellCssText;
+        this.textCell = $(cell);
+        this.textCell.innerHTML = this.message;
+        
+        this.refreshLayout();
+        // Hide message bar by default
+        this.container.setOpacity(0);
+        this.container.style.visibility = "visible";
+    },
+    
+    info : function(message)
+    {
+        this.message = message;
+        this.leadingIcon.src = this.infoIconName;
+        this.show();
+    },
+    
+    warn : function(message)
+    {
+        this.message = message;
+        this.leadingIcon.src = this.warningIconName;
+        this.show();
+    },
+    
+    error : function(message)
+    {
+        this.message = message;
+        this.leadingIcon.src = this.errorIconName;
+        this.show();
+    },
+    
+    clear : function()
+    {
+        this.message = "";
+        this.textCell.innerHTML = "";
+        this.hide();
+    },
+    
+    show : function()
+    {
+        this.textCell.innerHTML = this.message;
+        this.container.fade(this.opacity);
+    },
+    
+    hide : function()
+    {
+        this.container.fade(0);
+    },
+    
+    refreshLayout: function()
+    {
+        // 90 = 2 * padding (10) + 2 * offset(10) + 2 * border (2) + 46 (the navigator control)
+        this.container.style.width  = this.parentNode.offsetWidth - 90 + "px";
+    },
+    
+    CLASS_NAME: "FloatingMessage"
 };
\ No newline at end of file


Property changes on: trunk/MgDev/Web/src/viewerfiles/floatingmessage.js
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/jxlib.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/jxlib.js	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/jxlib.js	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,30 +1,30 @@
-/******************************************************************************
- * MooTools 1.2.2
- * Copyright (c) 2006-2007 [Valerio Proietti](http://mad4milk.net/).
- * MooTools is distributed under an MIT-style license.
- ******************************************************************************
- * reset.css - Copyright (c) 2006, Yahoo! Inc. All rights reserved.
- * Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt
- ******************************************************************************
- * Jx UI Library, 2.0
- * Copyright (c) 2006-2008, DM Solutions Group Inc. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
+/******************************************************************************
+ * MooTools 1.2.2
+ * Copyright (c) 2006-2007 [Valerio Proietti](http://mad4milk.net/).
+ * MooTools is distributed under an MIT-style license.
+ ******************************************************************************
+ * reset.css - Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+ * Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt
+ ******************************************************************************
+ * Jx UI Library, 2.0
+ * Copyright (c) 2006-2008, DM Solutions Group Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *****************************************************************************/
 var MooTools={version:"1.2.2",build:"f0491d62fbb7e906789aa3733d6a67d43e5af7c9"};var Native=function(K){K=K||{};var A=K.name;var I=K.legacy;var B=K.protect;var C=K.implement;var H=K.generics;var F=K.initialize;var G=K.afterImplement||function(){};var D=F||I;H=H!==false;D.constructor=Native;D.$family={name:"native"};if(I&&F){D.prototype=I.prototype}D.prototype.constructor=D;if(A){var E=A.toLowerCase();D.prototype.$family={name:E};Native.typize(D,E)}var J=function(N,L,O,M){if(!B||M||!N.prototype[L]){N.prototype[L]=O}if(H){Native.genericize(N,L,B)}G.call(N,L,O);return N};D.alias=function(N,L,O){if(typeof N=="string"){if((N=this.prototype[N])){return J(this,L,N,O)}}for(var M in N){this.alias(M,N[M],L)}return this};D.implement=function(M,L,O){if(typeof M=="string"){return J(this,M,L,O)}for(var N in M){J(this,N,M[N],L)}return this};if(C){D.implement(C)}return D};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototyp
 e.slice.call(arguments);return B.prototype[C].apply(D.shift(),D)}}};Native.implement=function(D,C){for(var B=0,A=D.length;B<A;B++){D[B].implement(C)}};Native.typize=function(A,B){if(!A.type){A.type=function(C){return($type(C)===B)}}};(function(){var A={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var G in A){new Native({name:G,initialize:A[G],protect:true})}var D={"boolean":Boolean,"native":Native,object:Object};for(var C in D){Native.typize(D[C],C)}var F={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var E in F){for(var B=F[E].length;B--;){Native.genericize(window[E],F[E][B],true)}}})();var Hash=new Native({name:"Hash",initialize:function(A){if($type(A)=="hash"){A=$unlink(A.getC
 lean())}for(var B in A){this[B]=A[B]}return this}});Hash.implement({forEach:function(B,C){for(var A in this){if(this.hasOwnProperty(A)){B.call(C,this[A],A,this)}}},getClean:function(){var B={};for(var A in this){if(this.hasOwnProperty(A)){B[A]=this[A]}}return B},getLength:function(){var B=0;for(var A in this){if(this.hasOwnProperty(A)){B++}}return B}});Hash.alias("forEach","each");Array.implement({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}}});Array.alias("forEach","each");function $A(B){if(B.item){var A=B.length,C=new Array(A);while(A--){C[A]=B[A]}return C}return Array.prototype.slice.call(B)}function $arguments(A){return function(){return arguments[A]}}function $chk(A){return !!(A||A===0)}function $clear(A){clearTimeout(A);clearInterval(A);return null}function $defined(A){return(A!=undefined)}function $each(C,B,D){var A=$type(C);((A=="arguments"||A=="collection"||A=="array")?Array:Hash).each(C,B,D)}function $empty(){}function $extend(
 C,A){for(var B in (A||{})){C[B]=A[B]}return C}function $H(A){return new Hash(A)}function $lambda(A){return(typeof A=="function")?A:function(){return A}}function $merge(){var A=Array.slice(arguments);A.unshift({});return $mixin.apply(null,A)}function $mixin(E){for(var D=1,A=arguments.length;D<A;D++){var B=arguments[D];if($type(B)!="object"){continue}for(var C in B){var G=B[C],F=E[C];E[C]=(F&&$type(G)=="object"&&$type(F)=="object")?$mixin(F,G):$unlink(G)}}return E}function $pick(){for(var B=0,A=arguments.length;B<A;B++){if(arguments[B]!=undefined){return arguments[B]}}return null}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $splat(B){var A=$type(B);return(A)?((A!="array"&&A!="arguments")?[B]:B):[]}var $time=Date.now||function(){return +new Date};function $try(){for(var B=0,A=arguments.length;B<A;B++){try{return arguments[B]()}catch(C){}}return null}function $type(A){if(A==undefined){return false}if(A.$family){return(A.$family.name=="number"&&!isFin
 ite(A))?false:A.$family.name}if(A.nodeName){switch(A.nodeType){case 1:return"element";case 3:return(/\S/).test(A.nodeValue)?"textnode":"whitespace"}}else{if(typeof A.length=="number"){if(A.callee){return"arguments"}else{if(A.item){return"collection"}}}}return typeof A}function $unlink(C){var B;switch($type(C)){case"object":B={};for(var E in C){B[E]=$unlink(C[E])}break;case"hash":B=new Hash(C);break;case"array":B=[];for(var D=0,A=C.length;D<A;D++){B[D]=$unlink(C[D])}break;default:return C}return B}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925))},trident:function(){return(!window.ActiveXObject)?false:((window.XML
 HttpRequest)?5:4)},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419)},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18)}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var B in this.Engines){var A=this.Engines[B]();if(A){this.Engine={name:B,version:A};this.Engine[B]=this.Engine[B+A]=true;break}}return{name:B,version:A}};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var A=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(A[0]||0+"."+A[1],10)||0,build:parseInt(A[2
 ],10)||0}})();function $exec(B){if(!B){return B}if(window.execScript){window.execScript(B)}else{var A=document.createElement("script");A.setAttribute("type","text/javascript");A[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=B;document.head.appendChild(A);document.head.removeChild(A)}return B}Native.UID=1;var $uid=(Browser.Engine.trident)?function(A){return(A.uid||(A.uid=[Native.UID++]))[0]}:function(A){return A.uid||(A.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(A){$uid(A);if(!A.Element){A.Element=$empty;if(Browser.Engine.webkit){A.document.createElement("iframe")}A.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}A.document.window=A;return $extend(A,Window.Prototype)},afterImplement:function(B,A){window[B]=Window.Prototype[B]=A}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",lega
 cy:(Browser.Engine.trident)?null:window.Document,initialize:function(A){$uid(A);A.head=A.getElementsByTagName("head")[0];A.html=A.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){A.execCommand("BackgroundImageCache",false,true)})}if(Browser.Engine.trident){A.window.attachEvent("onunload",function(){A.window.detachEvent("onunload",arguments.callee);A.head=A.html=A.window=null})}return $extend(A,Document.Prototype)},afterImplement:function(B,A){document[B]=Document.Prototype[B]=A}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},clean:function(){return this.filter($defined)},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B+
 +){if(this[B]===C){return B}}return -1},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A]}return D},link:function(C){var A={};for(var E=0,B=this.length;E<B;E++){for(var D in C){if(C[D](this[E])){A[D]=this[E];delete C[D];break}}}return A},contains:function(A,B){return this.indexOf(A,B)!=-1},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(A){if(!this.contains(A)){this.push(A)}return this},combine:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},erase:function(B){for(var A=this.length;A--;A){if(this[A]===
 B){this.splice(A,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var D=[];for(var B=0,A=this.length;B<A;B++){var C=$type(this[B]);if(!C){continue}D=D.concat((C=="array"||C=="collection"||C=="arguments")?Array.flatten(this[B]):this[B])}return D},hexToRgb:function(B){if(this.length!=3){return null}var A=this.map(function(C){if(C.length==1){C+=C}return C.toInt(16)});return(B)?A:"rgb("+A+")"},rgbToHex:function(D){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!D){return"transparent"}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C)}return(D)?B:"#"+B.join("")}});Function.implement({extend:function(A){for(var B in A){this[B]=A[B]}return this},create:function(B){var A=this;B=B||{};return function(D){var C=B.arguments;C=(C!=undefined)?$splat(C):Array.slice(arguments,(B.event)?1:0);if(B.event){C=[D||window.event].extend(C)}var E=function(){return A.apply(B.bind||null,C)};if(B.delay){return setTimeo
 ut(E,B.delay)}if(B.periodical){return setInterval(E,B.periodical)}if(B.attempt){return $try(E)}return E()}},run:function(A,B){return this.apply(B,$splat(A))},pass:function(A,B){return this.create({bind:B,arguments:A})},bind:function(B,A){return this.create({bind:B,arguments:A})},bindWithEvent:function(B,A){return this.create({bind:B,arguments:A,event:true})},attempt:function(A,B){return this.create({bind:B,arguments:A,attempt:true})()},delay:function(B,C,A){return this.create({bind:C,arguments:A,delay:B})()},periodical:function(C,B,A){return this.create({bind:B,arguments:A,periodical:C})()}});Number.implement({limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A},times:function(B,C){for(var A=0;A<this;A++){B.call(C,A,this)}},toFloat:function(){return parseFloat(this)},toInt:function(A){return parseInt(this,A||10)}});Number.alias("times","each");(function(B){var A={};B.each(function(C){if(!Number[C]){A[C]=f
 unction(){return Math[C].apply(null,[this].concat($A(arguments)))}}});Number.implement(A)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(A,B){return((typeof A=="string")?new RegExp(A,B):A).test(this)},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(A){return parseInt(this,A||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(B){var A=this.match(/
 ^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):null},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null},stripScripts:function(B){var A="";var C=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){A+=arguments[1]+"\n";return""});if(B===true){$exec(A)}else{if($type(B)=="function"){B(A,C)}}return C},substitute:function(A,B){return this.replace(B||(/\\?\{([^{}]+)\}/g),function(D,C){if(D.charAt(0)=="\\"){return D.slice(1)}return(A[C]!=undefined)?A[C]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(B){for(var A in this){if(this.hasOwnProperty(A)&&this[A]===B){return A}}return null},hasValue:function(A){return(Hash.keyOf(this,A)!==null)},extend:function(A){Hash.each(A,function(C,B){Hash.set(this,B,C)},this);return this},combine:function(A){Hash.each(A,function(C,B){Hash.include(this,B,C)},this);return this},erase:function(A){if(this.hasOwnProperty(A)){delete this[A]}return this},get:function(A){re
 turn(this.hasOwnProperty(A))?this[A]:null},set:function(A,B){if(!this[A]||this.hasOwnProperty(A)){this[A]=B}return this},empty:function(){Hash.each(this,function(B,A){delete this[A]},this);return this},include:function(A,B){if(this[A]==undefined){this[A]=B}return this},map:function(B,C){var A=new Hash;Hash.each(this,function(E,D){A.set(D,B.call(C,E,D,this))},this);return A},filter:function(B,C){var A=new Hash;Hash.each(this,function(E,D){if(B.call(C,E,D,this)){A.set(D,E)}},this);return A},every:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&!B.call(C,this[A],A)){return false}}return true},some:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&B.call(C,this[A],A)){return true}}return false},getKeys:function(){var A=[];Hash.each(this,function(C,B){A.push(B)});return A},getValues:function(){var A=[];Hash.each(this,function(B){A.push(B)});return A},toQueryString:function(A){var B=[];Hash.each(this,function(F,E){if(A){E=A+"["+E+"]"}var D;switch($type(F)){ca
 se"object":D=Hash.toQueryString(F,E);break;case"array":var C={};F.each(function(H,G){C[G]=H});D=Hash.toQueryString(C,E);break;default:D=E+"="+encodeURIComponent(F)}if(F!=undefined){B.push(D)}});return B.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(A,F){F=F||window;var K=F.document;A=A||F.event;if(A.$extended){return A}this.$extended=true;var J=A.type;var G=A.target||A.srcElement;while(G&&G.nodeType==3){G=G.parentNode}if(J.test(/key/)){var B=A.which||A.keyCode;var M=Event.Keys.keyOf(B);if(J=="keydown"){var D=B-111;if(D>0&&D<13){M="f"+D}}M=M||String.fromCharCode(B).toLowerCase()}else{if(J.match(/(click|mouse|menu)/i)){K=(!K.compatMode||K.compatMode=="CSS1Compat")?K.html:K.body;var I={x:A.pageX||A.clientX+K.scrollLeft,y:A.pageY||A.clientY+K.scrollTop};var C={x:(A.pageX)?A.pageX-F.pageXOffset:A.clientX,y:(A.pageY)?A.pageY-F.pageYOffset:A.clientY};if(J.match(/DOMMouseScroll|mousewheel/)){var H=(A.wheelDelta)
 ?A.wheelDelta/120:-(A.detail||0)/3}var E=(A.which==3)||(A.button==2);var L=null;if(J.match(/over|out/)){switch(J){case"mouseover":L=A.relatedTarget||A.fromElement;break;case"mouseout":L=A.relatedTarget||A.toElement}if(!(function(){while(L&&L.nodeType==3){L=L.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){L=false}}}}return $extend(this,{event:A,type:J,page:I,client:C,rightClick:E,wheel:H,relatedTarget:L,target:G,code:B,key:M,shift:A.shiftKey,control:A.ctrlKey,alt:A.altKey,meta:A.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});function Class(B
 ){if(B instanceof Function){B={initialize:B}}var A=function(){Object.reset(this);if(A._prototyping){return this}this._current=$empty;var C=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return C}.extend(this);A.implement(B);A.constructor=Class;A.prototype.constructor=A;return A}Function.prototype.protect=function(){this._protected=true;return this};Object.reset=function(A,C){if(C==null){for(var E in A){Object.reset(A,E)}return A}delete A[C];switch($type(A[C])){case"object":var D=function(){};D.prototype=A[C];var B=new D;A[C]=Object.reset(B);break;case"array":A[C]=$unlink(A[C]);break}return A};new Native({name:"Class",initialize:Class}).extend({instantiate:function(B){B._prototyping=true;var A=new B;delete B._prototyping;return A},wrap:function(A,B,C){if(C._origin){C=C._origin}return function(){if(C._protected&&this._current==null){throw new Error('The method "'+B+'" cannot be called.')}var E=this.caller,F=this._current;th
 is.caller=F;this._current=arguments.callee;var D=C.apply(this,arguments);this._current=F;this.caller=E;return D}.extend({_owner:A,_origin:C,_name:B})}});Class.implement({implement:function(A,D){if($type(A)=="object"){for(var E in A){this.implement(E,A[E])}return this}var F=Class.Mutators[A];if(F){D=F.call(this,D);if(D==null){return this}}var C=this.prototype;switch($type(D)){case"function":if(D._hidden){return this}C[A]=Class.wrap(this,A,D);break;case"object":var B=C[A];if($type(B)=="object"){$mixin(B,D)}else{C[A]=$unlink(D)}break;case"array":C[A]=$unlink(D);break;default:C[A]=D}return this}});Class.Mutators={Extends:function(A){this.parent=A;this.prototype=Class.instantiate(A);this.implement("parent",function(){var B=this.caller._name,C=this.caller._owner.parent.prototype[B];if(!C){throw new Error('The method "'+B+'" has no parent.')}return C.apply(this,arguments)}.protect())},Implements:function(A){$splat(A).each(function(B){if(B instanceof Function){B=Class.instantiate(B)
 }this.implement(B)},this)}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){this.$chain.empty();return this}});var Events=new Class({$events:{},addEvent:function(C,B,A){C=Events.removeOn(C);if(B!=$empty){this.$events[C]=this.$events[C]||[];this.$events[C].include(B);if(A){B.internal=true}}return this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},fireEvent:function(C,B,A){C=Events.removeOn(C);if(!this.$events||!this.$events[C]){return this}this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})()},this);return this},removeEvent:function(B,A){B=Events.removeOn(B);if(!this.$events[B]){return this}if(!A.internal){this.$events[B].erase(A)}return this},removeEvents:function(C){if($type(C)=="object"){for(var D in C){this.removeEvent(D,C[D])}return this}if(C){C
 =Events.removeOn(C)}for(var D in this.$events){if(C&&C!=D){continue}var B=this.$events[D];for(var A=B.length;A--;A){this.removeEvent(D,B[A])}}return this}});Events.removeOn=function(A){return A.replace(/^on([A-Z])/,function(B,C){return C.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var A in this.options){if($type(this.options[A])!="function"||!(/^on[A-Z]/).test(A)){continue}this.addEvent(A,this.options[A]);delete this.options[A]}return this}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(A,B){var C=Element.Constructors.get(A);if(C){return C(B)}if(typeof A=="string"){return document.newElement(A,B)}return $(A).set(B)},afterImplement:function(A,B){Element.Prototype[A]=B;if(Array[A]){return }Elements.implement(A,function(){var C=[],G=true;for(var E=0,D=this.length;E<D;E++){var F=this[E][A].apply(this[E],arguments);C.push(F);if(G){G=($
 type(F)=="element")}}return(G)?new Elements(C):C})}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var E=Array.link(arguments,{properties:Object.type,iframe:$defined});var C=E.properties||{};var B=$(E.iframe)||false;var D=C.onload||$empty;delete C.onload;C.id=C.name=$pick(C.id,C.name,B.id,B.name,"IFrame_"+$time());B=new Element(B||"iframe",C);var A=function(){var F=$try(function(){return B.contentWindow.location.host});if(F&&F==window.location.host){var G=new Window(B.contentWindow);new Document(B.contentWindow.document);$extend(G.Element.prototype,Element.Prototype)}D.call(B.contentWindow,B.contentWindow.document)};(window.frames[C.id])?A():B.addListener("load",A);return B}});var Elements=new Native({initialize:function(F,B){B=$extend({ddup:true,cash:true},B);F=F||[];if(B.ddup||B.cash){var G={},E=[];for(var C=0,A=F.length;C<A;C++){var D=$.element(F[C],!B.cash);if(B.ddup){
 if(G[D.uid]){continue}G[D.uid]=true}E.push(D)}F=E}return(B.cash)?$extend(F,this):F}});Elements.implement({filter:function(A,B){if(!A){return this}return new Elements(Array.filter(this,(typeof A=="string")?function(C){return C.match(A)}:A,B))}});Document.implement({newElement:function(A,B){if(Browser.Engine.trident&&B){["name","type","checked"].each(function(C){if(!B[C]){return }A+=" "+C+'="'+B[C]+'"';if(C!="checked"){delete B[C]}});A="<"+A+">"}return $.element(this.createElement(A)).set(B)},newTextNode:function(A){return this.createTextNode(A)},getDocument:function(){return this},getWindow:function(){return this.window}});Window.implement({$:function(B,C){if(B&&B.$family&&B.uid){return B}var A=$type(B);return($[A])?$[A](B,C,this.document):null},$$:function(A){if(arguments.length==1&&typeof A=="string"){return this.document.getElements(A)}var F=[];var C=Array.flatten(arguments);for(var D=0,B=C.length;D<B;D++){var E=C[D];switch($type(E)){case"element":F.push(E);break;case"stri
 ng":F.extend(this.document.getElements(E,true))}}return new Elements(F)},getDocument:function(){return this.document},getWindow:function(){return this}});$.string=function(C,B,A){C=A.getElementById(C);return(C)?$.element(C,B):null};$.element=function(A,D){$uid(A);if(!D&&!A.$family&&!(/^object|embed$/i).test(A.tagName)){var B=Element.Prototype;for(var C in B){A[C]=B[C]}}return A};$.object=function(B,C,A){if(B.toElement){return $.element(B.toElement(A),C)}return null};$.textnode=$.whitespace=$.window=$.document=$arguments(0);Native.implement([Element,Document],{getElement:function(A,B){return $(this.getElements(A,true)[0]||null,B)},getElements:function(A,D){A=A.split(",");var C=[];var B=(A.length>1);A.each(function(E){var F=this.getElementsByTagName(E.trim());(B)?C.extend(F):C=F},this);return new Elements(C,{ddup:B,cash:!D})}});(function(){var H={},F={};var I={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};va
 r C=function(L){return(F[L]||(F[L]={}))};var G=function(N,L){if(!N){return }var M=N.uid;if(Browser.Engine.trident){if(N.clearAttributes){var P=L&&N.cloneNode(false);N.clearAttributes();if(P){N.mergeAttributes(P)}}else{if(N.removeEvents){N.removeEvents()}}if((/object/i).test(N.tagName)){for(var O in N){if(typeof N[O]=="function"){N[O]=$empty}}Element.dispose(N)}}if(!M){return }H[M]=F[M]=null};var D=function(){Hash.each(H,G);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(G)}if(window.CollectGarbage){CollectGarbage()}H=F=null};var J=function(N,L,S,M,P,R){var O=N[S||L];var Q=[];while(O){if(O.nodeType==1&&(!M||Element.match(O,M))){if(!P){return $(O,R)}Q.push(O)}O=O[L]}return(P)?new Elements(Q,{ddup:false,cash:!R}):null};var E={html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var B=["compact","nowrap","ismap","declare","noshade","checked","
 disabled","readonly","multiple","selected","noresize","defer"];var K=["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];B=B.associate(B);Hash.extend(E,B);Hash.extend(E,K.associate(K.map(String.toLowerCase)));var A={before:function(M,L){if(L.parentNode){L.parentNode.insertBefore(M,L)}},after:function(M,L){if(!L.parentNode){return }var N=L.nextSibling;(N)?L.parentNode.insertBefore(M,N):L.parentNode.appendChild(M)},bottom:function(M,L){L.appendChild(M)},top:function(M,L){var N=L.firstChild;(N)?L.insertBefore(M,N):L.appendChild(M)}};A.inside=A.bottom;Hash.each(A,function(L,M){M=M.capitalize();Element.implement("inject"+M,function(N){L(this,$(N,true));return this});Element.implement("grab"+M,function(N){L($(N,true),this);return this})});Element.implement({set:function(O,M){switch($type(O)){case"object":for(var N in O){this.set(N,O[N])}break;case"string":var L=Element.Properties.get(O);(L&&L.set)?L.set.app
 ly(this,Array.slice(arguments,1)):this.setProperty(O,M)}return this},get:function(M){var L=Element.Properties.get(M);return(L&&L.get)?L.get.apply(this,Array.slice(arguments,1)):this.getProperty(M)},erase:function(M){var L=Element.Properties.get(M);(L&&L.erase)?L.erase.apply(this):this.removeProperty(M);return this},setProperty:function(M,N){var L=E[M];if(N==undefined){return this.removeProperty(M)}if(L&&B[M]){N=!!N}(L)?this[L]=N:this.setAttribute(M,""+N);return this},setProperties:function(L){for(var M in L){this.setProperty(M,L[M])}return this},getProperty:function(M){var L=E[M];var N=(L)?this[L]:this.getAttribute(M,2);return(B[M])?!!N:(L)?N:N||null},getProperties:function(){var L=$A(arguments);return L.map(this.getProperty,this).associate(L)},removeProperty:function(M){var L=E[M];(L)?this[L]=(L&&B[M])?false:"":this.removeAttribute(M);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this},hasClass:function(L){return this.classNa
 me.contains(L," ")},addClass:function(L){if(!this.hasClass(L)){this.className=(this.className+" "+L).clean()}return this},removeClass:function(L){this.className=this.className.replace(new RegExp("(^|\\s)"+L+"(?:\\s|$)"),"$1");return this},toggleClass:function(L){return this.hasClass(L)?this.removeClass(L):this.addClass(L)},adopt:function(){Array.flatten(arguments).each(function(L){L=$(L,true);if(L){this.appendChild(L)}},this);return this},appendText:function(M,L){return this.grab(this.getDocument().newTextNode(M),L)},grab:function(M,L){A[L||"bottom"]($(M,true),this);return this},inject:function(M,L){A[L||"bottom"](this,$(M,true));return this},replaces:function(L){L=$(L,true);L.parentNode.replaceChild(this,L);return this},wraps:function(M,L){M=$(M,true);return this.replaces(M).grab(M,L)},getPrevious:function(L,M){return J(this,"previousSibling",null,L,false,M)},getAllPrevious:function(L,M){return J(this,"previousSibling",null,L,true,M)},getNext:function(L,M){return J(this,"ne
 xtSibling",null,L,false,M)},getAllNext:function(L,M){return J(this,"nextSibling",null,L,true,M)},getFirst:function(L,M){return J(this,"nextSibling","firstChild",L,false,M)},getLast:function(L,M){return J(this,"previousSibling","lastChild",L,false,M)},getParent:function(L,M){return J(this,"parentNode",null,L,false,M)},getParents:function(L,M){return J(this,"parentNode",null,L,true,M)},getSiblings:function(L,M){return this.getParent().getChildren(L,M).erase(this)},getChildren:function(L,M){return J(this,"nextSibling","firstChild",L,true,M)},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(O,N){var M=this.ownerDocument.getElementById(O);if(!M){return null}for(var L=M.parentNode;L!=this;L=L.parentNode){if(!L){return null}}return $.element(M,N)},getSelected:function(){return new Elements($A(this.options).filter(function(L){return L.selected}))},getComputedStyle:function(M){if(this.currentStyle){return
  this.currentStyle[M.camelCase()]}var L=this.getDocument().defaultView.getComputedStyle(this,null);return(L)?L.getPropertyValue([M.hyphenate()]):null},toQueryString:function(){var L=[];this.getElements("input, select, textarea",true).each(function(M){if(!M.name||M.disabled){return }var N=(M.tagName.toLowerCase()=="select")?Element.getSelected(M).map(function(O){return O.value}):((M.type=="radio"||M.type=="checkbox")&&!M.checked)?null:M.value;$splat(N).each(function(O){if(typeof O!="undefined"){L.push(M.name+"="+encodeURIComponent(O))}})});return L.join("&")},clone:function(O,L){O=O!==false;var R=this.cloneNode(O);var N=function(V,U){if(!L){V.removeAttribute("id")}if(Browser.Engine.trident){V.clearAttributes();V.mergeAttributes(U);V.removeAttribute("uid");if(V.options){var W=V.options,S=U.options;for(var T=W.length;T--;){W[T].selected=S[T].selected}}}var X=I[U.tagName.toLowerCase()];if(X&&U[X]){V[X]=U[X]}};if(O){var P=R.getElementsByTagName("*"),Q=this.getElementsByTagName("*
 ");for(var M=P.length;M--;){N(P[M],Q[M])}}N(R,this);return $(R)},destroy:function(){Element.empty(this);Element.dispose(this);G(this,true);return null},empty:function(){$A(this.childNodes).each(function(L){Element.destroy(L)});return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},hasChild:function(L){L=$(L,true);if(!L){return false}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(L.tagName)).contains(L)}return(this.contains)?(this!=L&&this.contains(L)):!!(this.compareDocumentPosition(L)&16)},match:function(L){return(!L||(L==this)||(Element.get(this,"tag")==L))}});Native.implement([Element,Window,Document],{addListener:function(O,N){if(O=="unload"){var L=N,M=this;N=function(){M.removeListener("unload",N);L()}}else{H[this.uid]=this}if(this.addEventListener){this.addEventListener(O,N,false)}else{this.attachEvent("on"+O,N)}return this},removeListener:function(M,L){if(this.removeEventListener){this
 .removeEventListener(M,L,false)}else{this.detachEvent("on"+M,L)}return this},retrieve:function(M,L){var O=C(this.uid),N=O[M];if(L!=undefined&&N==undefined){N=O[M]=L}return $pick(N)},store:function(M,L){var N=C(this.uid);N[M]=L;return this},eliminate:function(L){var M=C(this.uid);delete M[L];return this}});window.addListener("unload",D)})();Element.Properties=new Hash;Element.Properties.style={set:function(A){this.style.cssText=A},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.html=(function(){var C=document.createElement("div");var A={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};A.thead=A.tfoot=A.tbody;var B={set:function(){var E=Array.flatten(arguments).join("");var F=Browser.Engine.trident&&A[this.get("tag")];if(F){var G=C;G.inn
 erHTML=F[1]+E+F[2];for(var D=F[0];D--;){G=G.firstChild}this.empty().adopt(G.childNodes)}else{this.innerHTML=E}}};B.erase=B.set;return B})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText}var A=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var B=A.innerText;A.destroy();return B}}}Element.Properties.events={set:function(A){this.addEvents(A)}};Native.implement([Element,Window,Document],{addEvent:function(E,G){var H=this.retrieve("events",{});H[E]=H[E]||{keys:[],values:[]};if(H[E].keys.contains(G)){return this}H[E].keys.push(G);var F=E,A=Element.Events.get(E),C=G,I=this;if(A){if(A.onAdd){A.onAdd.call(this,G)}if(A.condition){C=function(J){if(A.condition.call(this,J)){return G.call(this,J)}return true}}F=A.base||F}var D=function(){return G.call(I)};var B=Element.NativeEvents[F];if(B){if(B==2){D=function(J){J=new Event(J,I.getWindow());if(C.call(I,J)=
 ==false){J.stop()}}}this.addListener(F,D)}H[E].values.push(D);return this},removeEvent:function(C,B){var A=this.retrieve("events");if(!A||!A[C]){return this}var F=A[C].keys.indexOf(B);if(F==-1){return this}A[C].keys.splice(F,1);var E=A[C].values.splice(F,1)[0];var D=Element.Events.get(C);if(D){if(D.onRemove){D.onRemove.call(this,B)}C=D.base||C}return(Element.NativeEvents[C])?this.removeListener(C,E):this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},removeEvents:function(A){if($type(A)=="object"){for(var C in A){this.removeEvent(C,A[C])}return this}var B=this.retrieve("events");if(!B){return this}if(!A){for(var C in B){this.removeEvents(C)}this.eliminate("events")}else{if(B[A]){while(B[A].keys[0]){this.removeEvent(A,B[A].keys[0])}B[A]=null}}return this},fireEvent:function(D,B,A){var C=this.retrieve("events");if(!C||!C[D]){return this}C[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})()},this);return this},cloneEvents:function(D
 ,A){D=$(D);var C=D.retrieve("events");if(!C){return this}if(!A){for(var B in C){this.cloneEvents(D,B)}}else{if(C[A]){C[A].keys.each(function(E){this.addEvent(A,E)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var A=function(B){var C=B.relatedTarget;if(C==undefined){return true}if(C===false){return false}return($type(this)!="document"&&C!=this&&C.prefix!="xul"&&!this.hasChild(C))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:A},mouseleave:{base:"mouseout",condition:A},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(A){this.setStyles(A)}};Element.Pro
 perties.opacity={set:function(A,B){if(!B){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=A;this.store("opacity",A)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(A){return this.set("opacity",A,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(B,A){switch(B){case"opacity":return this.set("opacity",parseFloat(A));case"float":B=(Browser.Engine.trident)?"styleFloat":"cssFloat"}B=B.camelCase();if($type(A)!="string"){var C=(Element.Styles.get(B)||"@").split(" ");A=$splat(A).map(function(E,D){if(!C[D]){return""}return($type(E)=="number")?C[D].replace("@",Math.round(E)):E}).join(" ")}else{if(A==String(Number(A))){A=Math.round(A)}}this.style[B
 ]=A;return this},getStyle:function(G){switch(G){case"opacity":return this.get("opacity");case"float":G=(Browser.Engine.trident)?"styleFloat":"cssFloat"}G=G.camelCase();var A=this.style[G];if(!$chk(A)){A=[];for(var F in Element.ShortStyles){if(G!=F){continue}for(var E in Element.ShortStyles[F]){A.push(this.getStyle(E))}return A.join(" ")}A=this.getComputedStyle(G)}if(A){A=String(A);var C=A.match(/rgba?\([\d\s,]+\)/);if(C){A=A.replace(C[0],C[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(A,10)))){if(G.test(/^(height|width)$/)){var B=(G=="width")?["left","right"]:["top","bottom"],D=0;B.each(function(H){D+=this.getStyle("border-"+H+"-width").toInt()+this.getStyle("padding-"+H).toInt()},this);return this["offset"+G.capitalize()]-D+"px"}if((Browser.Engine.presto)&&String(A).test("px")){return A}if(G.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return A},setStyles:function(B){for(var A in B){this.setStyle(A,B[A])}return this},getStyles:f
 unction(){var A={};Array.each(arguments,function(B){A[B]=this.getStyle(B)},this);return A}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(G){var F=Element.ShortStyles;var B=Element.Styles;["margin","padding"].each(function(H){var I=H+G;F[H][I]=B[I]="@px"});var E="borde
 r"+G;F.border[E]=B[E]="@px @ rgb(@, @, @)";var D=E+"Width",A=E+"Style",C=E+"Color";F[E]={};F.borderWidth[D]=F[E][D]=B[D]="@px";F.borderStyle[A]=F[E][A]=B[A]="@";F.borderColor[C]=F[E][C]=B[C]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(H,I){if(B(this)){this.getWindow().scrollTo(H,I)}else{this.scrollLeft=H;this.scrollTop=I}return this},getSize:function(){if(B(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(B(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(B(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var I=this,H={x:0,y:0};while(I&&!B(I)){H.x+=I.scrollLeft;H.y+=I.scrollTop;I=I.parentNode}return H},getOffsetParent:function(){var H=this;if(B(H)){return null}if(!Browser.Engine.trident){return H.offsetParent}while((H=H.parentNode)&&!B(H)){if(D(H,"position")!
 ="static"){return H}}return null},getOffsets:function(){if(Browser.Engine.trident){var L=this.getBoundingClientRect(),J=this.getDocument().documentElement;var M=D(this,"position")=="fixed";return{x:L.left+((M)?0:J.scrollLeft)-J.clientLeft,y:L.top+((M)?0:J.scrollTop)-J.clientTop}}var I=this,H={x:0,y:0};if(B(this)){return H}while(I&&!B(I)){H.x+=I.offsetLeft;H.y+=I.offsetTop;if(Browser.Engine.gecko){if(!F(I)){H.x+=C(I);H.y+=G(I)}var K=I.parentNode;if(K&&D(K,"overflow")!="visible"){H.x+=C(K);H.y+=G(K)}}else{if(I!=this&&Browser.Engine.webkit){H.x+=C(I);H.y+=G(I)}}I=I.offsetParent}if(Browser.Engine.gecko&&!F(this)){H.x-=C(this);H.y-=G(this)}return H},getPosition:function(K){if(B(this)){return{x:0,y:0}}var L=this.getOffsets(),I=this.getScrolls();var H={x:L.x-I.x,y:L.y-I.y};var J=(K&&(K=$(K)))?K.getPosition():{x:0,y:0};return{x:H.x-J.x,y:H.y-J.y}},getCoordinates:function(J){if(B(this)){return this.getWindow().getCoordinates()}var H=this.getPosition(J),I=this.getSize();var K={left:H.
 x,top:H.y,width:I.x,height:I.y};K.right=K.left+K.width;K.bottom=K.top+K.height;return K},computePosition:function(H){return{left:H.x-E(this,"margin-left"),top:H.y-E(this,"margin-top")}},position:function(H){return this.setStyles(this.computePosition(H))}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var I=this.getWindow();return{x:I.innerWidth,y:I.innerHeight}}var H=A(this);return{x:H.clientWidth,y:H.clientHeight}},getScroll:function(){var I=this.getWindow(),H=A(this);return{x:I.pageXOffset||H.scrollLeft,y:I.pageYOffset||H.scrollTop}},getScrollSize:function(){var I=A(this),H=this.getSize();return{x:Math.max(I.scrollWidth,H.x),y:Math.max(I.scrollHeight,H.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var H=this.getSize();return{top:0,left:0,bottom:H.y,right:H.x,height:H.y,width:H.x}}});var D=Element.getComputedStyle;function E(H,I){return D(H,I).toInt()||0}function F(H){return D(H,"-moz-box-si
 zing")=="border-box"}function G(H){return E(H,"border-top-width")}function C(H){return E(H,"border-left-width")}function B(H){return(/^(?:body|html)$/i).test(H.tagName)}function A(H){var I=H.getDocument();return(!I.compatMode||I.compatMode=="CSS1Compat")?I.html:I.body}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Native.implement([Document,Element],{getElements:function(H,G){H=H.split(",");var C,E={};for(var D=0,B=H.length;D<B;D++){var A=H[D],F=Selectors.Utils.search(this,A,E);if(D!=0&&F.item){F=$A(F)}C=(D==0)?F:(C.item)?$A(C).concat(F):C.concat(F)}return new Elements(C,{dd
 up:(H.length>1),cash:!G})}});Element.implement({match:function(B){if(!B||(B==this)){return true}var D=Selectors.Utils.parseTagAndID(B);var A=D[0],E=D[1];if(!Selectors.Filters.byID(this,E)||!Selectors.Filters.byTag(this,A)){return false}var C=Selectors.Utils.parseSelector(B);return(C)?Selectors.Utils.filter(this,C,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(B,C){if(!C){return true}var A=$uid(B);if(!C[A]){return C[A]=true}return false},parseNthArgument:function(F){if(Selectors.Cache.nth[F]){return Selectors.Cache.nth[F]}var C=F.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!C){return false}var E=parseInt(C[1],10);var B=(E||E===0)?E:1;var D=C[2]||false;var A=parseInt(C[3],10)||0;if(B!=0){A--;while(A<1){A+=B}while(A>
 =B){A-=B}}else{B=A;D="index"}switch(D){case"n":C={a:B,b:A,special:"n"};break;case"odd":C={a:2,b:0,special:"n"};break;case"even":C={a:2,b:1,special:"n"};break;case"first":C={a:0,special:"index"};break;case"last":C={special:"last-child"};break;case"only":C={special:"only-child"};break;default:C={a:(B-1),special:"index"}}return Selectors.Cache.nth[F]=C},parseSelector:function(E){if(Selectors.Cache.parsed[E]){return Selectors.Cache.parsed[E]}var D,H={classes:[],pseudos:[],attributes:[]};while((D=Selectors.RegExps.combined.exec(E))){var I=D[1],G=D[2],F=D[3],B=D[5],C=D[6],J=D[7];if(I){H.classes.push(I)}else{if(C){var A=Selectors.Pseudo.get(C);if(A){H.pseudos.push({parser:A,argument:J})}else{H.attributes.push({name:C,operator:"=",value:J})}}else{if(G){H.attributes.push({name:G,operator:F,value:B})}}}}if(!H.classes.length){delete H.classes}if(!H.attributes.length){delete H.attributes}if(!H.pseudos.length){delete H.pseudos}if(!H.classes&&!H.attributes&&!H.pseudos){H=null}return Selec
 tors.Cache.parsed[E]=H},parseTagAndID:function(B){var A=B.match(Selectors.RegExps.tag);var C=B.match(Selectors.RegExps.id);return[(A)?A[1]:"*",(C)?C[1]:false]},filter:function(F,C,E){var D;if(C.classes){for(D=C.classes.length;D--;D){var G=C.classes[D];if(!Selectors.Filters.byClass(F,G)){return false}}}if(C.attributes){for(D=C.attributes.length;D--;D){var B=C.attributes[D];if(!Selectors.Filters.byAttribute(F,B.name,B.operator,B.value)){return false}}}if(C.pseudos){for(D=C.pseudos.length;D--;D){var A=C.pseudos[D];if(!Selectors.Filters.byPseudo(F,A.parser,A.argument,E)){return false}}}return true},getByTagAndID:function(B,A,D){if(D){var C=(B.getElementById)?B.getElementById(D,true):Element.getElementById(B,D,true);return(C&&Selectors.Filters.byTag(C,A))?[C]:[]}else{return B.getElementsByTagName(A)}},search:function(I,H,N){var B=[];var C=H.trim().replace(Selectors.RegExps.splitter,function(Y,X,W){B.push(X);return":)"+W}).split(":)");var J,E,U;for(var T=0,P=C.length;T<P;T++){var 
 S=C[T];if(T==0&&Selectors.RegExps.quick.test(S)){J=I.getElementsByTagName(S);continue}var A=B[T-1];var K=Selectors.Utils.parseTagAndID(S);var V=K[0],L=K[1];if(T==0){J=Selectors.Utils.getByTagAndID(I,V,L)}else{var D={},G=[];for(var R=0,Q=J.length;R<Q;R++){G=Selectors.Getters[A](G,J[R],V,L,D)}J=G}var F=Selectors.Utils.parseSelector(S);if(F){E=[];for(var O=0,M=J.length;O<M;O++){U=J[O];if(Selectors.Utils.filter(U,F,N)){E.push(U)}}J=E}}return J}};Selectors.Getters={" ":function(H,G,I,A,E){var D=Selectors.Utils.getByTagAndID(G,I,A);for(var C=0,B=D.length;C<B;C++){var F=D[C];if(Selectors.Utils.chk(F,E)){H.push(F)}}return H},">":function(H,G,I,A,F){var C=Selectors.Utils.getByTagAndID(G,I,A);for(var E=0,D=C.length;E<D;E++){var B=C[E];if(B.parentNode==G&&Selectors.Utils.chk(B,F)){H.push(B)}}return H},"+":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(Selectors.Utils.chk(B,D)&&Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B)}break}}return C},"~":f
 unction(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(!Selectors.Utils.chk(B,D)){break}if(Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B)}}}return C}};Selectors.Filters={byTag:function(B,A){return(A=="*"||(B.tagName&&B.tagName.toLowerCase()==A))},byID:function(A,B){return(!B||(A.id&&A.id==B))},byClass:function(B,A){return(B.className&&B.className.contains(A," "))},byPseudo:function(A,D,C,B){return D.call(A,C,B)},byAttribute:function(C,D,B,E){var A=Element.prototype.getProperty.call(C,D);if(!A){return(B=="!=")}if(!B||E==undefined){return true}switch(B){case"=":return(A==E);case"*=":return(A.contains(E));case"^=":return(A.substr(0,E.length)==E);case"$=":return(A.substr(A.length-E.length)==E);case"!=":return(A!=E);case"~=":return A.contains(E," ");case"|=":return A.contains(E,"-")}return false}};Selectors.Pseudo=new Hash({checked:function(){return this.checked},empty:function(){return !(this.innerText||this.textContent||"").length},not:function(A
 ){return !Element.match(this,A)},contains:function(A){return(this.innerText||this.textContent||"").contains(A)},"first-child":function(){return Selectors.Pseudo.index.call(this,0)},"last-child":function(){var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false}}return true},"only-child":function(){var B=this;while((B=B.previousSibling)){if(B.nodeType==1){return false}}var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false}}return true},"nth-child":function(G,E){G=(G==undefined)?"n":G;var C=Selectors.Utils.parseNthArgument(G);if(C.special!="n"){return Selectors.Pseudo[C.special].call(this,C.a,E)}var F=0;E.positions=E.positions||{};var D=$uid(this);if(!E.positions[D]){var B=this;while((B=B.previousSibling)){if(B.nodeType!=1){continue}F++;var A=E.positions[$uid(B)];if(A!=undefined){F=A+F;break}}E.positions[D]=F}return(E.positions[D]%C.a==C.b)},index:function(A){var B=this,C=0;while((B=B.previousSibling)){if(B.nodeType==1&&++C>A){return false}}return(C==A)
 },even:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n+1",A)},odd:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n",A)},selected:function(){return this.selected}});Element.Events.domready={onAdd:function(A){if(Browser.loaded){A.call(this)}}};(function(){var B=function(){if(Browser.loaded){return }Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};if(Browser.Engine.trident){var A=document.createElement("div");(function(){($try(function(){A.doScroll("left");return $(A).inject(document.body).set("html","temp").dispose()}))?B():arguments.callee.delay(50)})()}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?B():arguments.callee.delay(50)})()}else{window.addEvent("load",B);document.addEvent("DOMContentLoaded",B)}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:fu
 nction(A){return JSON.$specialChars[A]||"\\u00"+Math.floor(A.charCodeAt()/16).toString(16)+(A.charCodeAt()%16).toString(16)},encode:function(B){switch($type(B)){case"string":return'"'+B.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(B.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var A=[];Hash.each(B,function(E,D){var C=JSON.encode(E);if(C){A.push(JSON.encode(D)+":"+C)}});return"{"+A+"}";case"number":case"boolean":return String(B);case false:return"null"}return null},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize
 :function(B,A){this.key=B;this.setOptions(A)},write:function(B){B=encodeURIComponent(B);if(this.options.domain){B+="; domain="+this.options.domain}if(this.options.path){B+="; path="+this.options.path}if(this.options.duration){var A=new Date();A.setTime(A.getTime()+this.options.duration*24*60*60*1000);B+="; expires="+A.toGMTString()}if(this.options.secure){B+="; secure"}this.options.document.cookie=this.key+"="+B;return this},read:function(){var A=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(A)?decodeURIComponent(A[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(B,C,A){return new Cookie(B,A).write(C)};Cookie.read=function(A){return new Cookie(A).read()};Cookie.dispose=function(B,A){return new Cookie(B,A).dispose()};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowS
 criptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(L,M){this.instance="Swiff_"+$time();this.setOptions(M);M=this.options;var B=this.id=M.id||this.instance;var A=$(M.container);Swiff.CallBacks[this.instance]={};var E=M.params,G=M.vars,F=M.callBacks;var H=$extend({height:M.height,width:M.width},M.properties);var K=this;for(var D in F){Swiff.CallBacks[this.instance][D]=(function(N){return function(){return N.apply(K.object,arguments)}})(F[D]);G[D]="Swiff.CallBacks."+this.instance+"."+D}E.flashVars=Hash.toQueryString(G);if(Browser.Engine.trident){H.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";E.movie=L}else{H.type="application/x-shockwave-flash";H.data=L}var J='<object id="'+B+'"';for(var I in H){J+=" "+I+'="'+H[I]+'"'}J+=">";for(var C in E){if(E[C]){J+='<param name="'+C+'" value="'+E[C]+'" />'}}J+="</object>";this.object=((A)?A.empty():new Element("div")).set("html",J).firstChil
 d},replaces:function(A){A=$(A,true);A.parentNode.replaceChild(this.toElement(),A);return this},inject:function(A){$(A,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(A){this.subject=this.subject||this;this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var B=this.options.wait;if(B===false){this.options.link="cancel"}},getTransition:function(){return function(A){return -(Math.cos(Math.PI*A)-1)/2}},step:function(){var A=$time();if(A<this.time+this.options.duration){var B=this.transition((A-this.time)/this.options.duration
 );this.set(this.compute(this.from,this.to,B))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(A){return A},compute:function(C,B,A){return Fx.compute(C,B,A)},check:function(){if(!this.timer){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},start:function(B,A){if(!this.check(B,A)){return this}this.from=B;this.to=A;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer()){this.onComplete()}return this},cancel:function(){if(this.stopTimer()){this.onCancel()}return this},onStart:function(){this.fireEvent("start",this.subject)},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject)}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain()},pause:function(){this.stopTimer();re
 turn this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer){return false}this.time=$time()-this.time;this.timer=$clear(this.timer);return true},startTimer:function(){if(this.timer){return false}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true}});Fx.compute=function(C,B,A){return(B-C)*A+C};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(D,E,B){B=$splat(B);var C=B[1];if(!$chk(C)){B[1]=B[0];B[0]=D.getStyle(E)}var A=B.map(this.parse);return{from:A[0],to:A[1]}},parse:function(A){A=$lambda(A)();A=(typeof A=="string")?A.split(" "):$splat(A);return A.map(function(C){C=String(C);var B=false;Fx.CSS.Parsers.each(function(F,E){if(B){return }var D=F.parse(C);if($chk(D)){B={value:D,parser:F}}});B=B||{value:C,parser:Fx.CSS.Parsers.String};return B})},compute:function(D,C,B){var A=[];(Math.min(D.length,C.length)).times(function(E){A.push({value:
 D[E].parser.compute(D[E].value,C[E].value,B),parser:D[E].parser})});A.$family={name:"fx:css:value"};return A},serve:function(C,B){if($type(C)!="fx:css:value"){C=this.parse(C)}var A=[];C.each(function(D){A=A.concat(D.parser.serve(D.value,B))});return A},render:function(A,D,C,B){A.setStyle(D,this.serve(C,B))},search:function(A){if(Fx.CSS.Cache[A]){return Fx.CSS.Cache[A]}var B={};Array.each(document.styleSheets,function(E,D){var C=E.href;if(C&&C.contains("://")&&!C.contains(document.domain)){return }var F=E.rules||E.cssRules;Array.each(F,function(I,G){if(!I.style){return }var H=(I.selectorText)?I.selectorText.replace(/^\w+/,function(J){return J.toLowerCase()}):null;if(!H||!H.test("^"+A+"$")){return }Element.Styles.each(function(K,J){if(!I.style[J]||Element.ShortStyles[J]){return }K=String(I.style[J]);B[J]=(K.test(/^rgb/))?K.rgbToHex():K})})});return Fx.CSS.Cache[A]=B}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(A){if(A.match(/^#[0-9a-f]{3,6}$/i)){return A.h
 exToRgb(true)}return((A=A.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[A[1],A[2],A[3]]:false},compute:function(C,B,A){return C.map(function(E,D){return Math.round(Fx.compute(C[D],B[D],A))})},serve:function(A){return A.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(B,A){return(A)?B+A:B}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(B,A){if(arguments.length==1){A=B;B=this.property||this.options.property}this.render(this.element,B,A,this.options.unit);return this},start:function(C,E,D){if(!this.check(C,E,D)){return this}var B=Array.flatten(arguments);this.property=this.options.property||B.shift();var A=this.prepare(this.element,this.property,B);return this.parent(A.from,A.to)}});Element.Properties.tween={set:function(A){var B=this.retrieve("tween");if(B){B.cancel()}return this.eliminate("tween").store("tween:option
 s",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("tween")){if(A||!this.retrieve("tween:options")){this.set("tween",A)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(A,C,B){this.get("tween").start(arguments);return this},fade:function(C){var E=this.get("tween"),D="opacity",A;C=$pick(C,"toggle");switch(C){case"in":E.start(D,1);break;case"out":E.start(D,0);break;case"show":E.set(D,1);break;case"hide":E.set(D,0);break;case"toggle":var B=this.retrieve("fade:flag",this.get("opacity")==1);E.start(D,(B)?0:1);this.store("fade:flag",!B);A=true;break;default:E.start(D,arguments)}if(!A){this.eliminate("fade:flag")}return this},highlight:function(C,A){if(!A){A=this.retrieve("highlight:original",this.getStyle("background-color"));A=(A=="transparent")?"#fff":A}var B=this.get("tween");B.start("background-color",C||"#ffff88",A).chain(function(){this.setStyle("background-color",this.re
 trieve("highlight:original"));B.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(A){if(typeof A=="string"){A=this.search(A)}for(var B in A){this.render(this.element,B,A[B],this.options.unit)}return this},compute:function(E,D,C){var A={};for(var B in E){A[B]=this.parent(E[B],D[B],C)}return A},start:function(B){if(!this.check(B)){return this}if(typeof B=="string"){B=this.search(B)}var E={},D={};for(var C in B){var A=this.prepare(this.element,C,B[C]);E[C]=A.from;D[C]=A.to}return this.parent(E,D)}});Element.Properties.morph={set:function(A){var B=this.retrieve("morph");if(B){B.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("morph")){if(A||!this.retrieve("morph:options")){this.set("morph",A)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}}
 ;Element.implement({morph:function(A){this.get("morph").start(A);return this}});Fx.implement({getTransition:function(){var A=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof A=="string"){var B=A.split(":");A=Fx.Transitions;A=A[B[0]]||A[B[0].capitalize()];if(B[1]){A=A["ease"+B[1].capitalize()+(B[2]?B[2].capitalize():"")]}}return A}});Fx.Transition=function(B,A){A=$splat(A);return $extend(B,{easeIn:function(C){return B(C,A)},easeOut:function(C){return 1-B(1-C,A)},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2}})};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B])}};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6)},Expo:function(A){return Math.pow(2,8*(A-1))},Circ:function(A){return 1-Math.sin(Math.acos(A))},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2)},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A)},Bounce:fun
 ction(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=A*A-Math.pow((11-6*B-11*D)/4,2);break}}return C},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(A){this.xhr=new Browser.Request();this.setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return }this.running=false;this.status=0;$try(functi
 on(){this.status=this.xhr.status}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}this.xhr.onreadystatechange=$empty},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(A){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(A)}return A.stripScripts(this.options.evalScripts)},success:function(B,A){this.onSuccess(this.processScripts(B),A)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(A,B){this.headers.set(A,B);return this},getHeader:function(A){return $try(function(){return this.xhr.getResponseHeader(A)}.bind(this
 ))},check:function(){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},send:function(J){if(!this.check(J)){return this}this.running=true;var H=$type(J);if(H=="string"||H=="element"){J={data:J}}var D=this.options;J=$extend({data:D.data,url:D.url,method:D.method},J);var F=J.data,B=J.url,A=J.method;switch($type(F)){case"element":F=$(F).toQueryString();break;case"object":case"hash":F=Hash.toQueryString(F)}if(this.options.format){var I="format="+this.options.format;F=(F)?I+"&"+F:I}if(this.options.emulation&&["put","delete"].contains(A)){var G="_method="+A;F=(F)?G+"&"+F:G;A="post"}if(this.options.urlEncoded&&A=="post"){var C=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+C)}if(this.options.noCache){var E="noCache="+new Date().getTime();F=(F)?E+"&"+F:E}if(F&&A=="get"){B=B+(
 B.contains("?")?"&":"?")+F;F=null}this.xhr.open(A.toUpperCase(),B,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(L,K){try{this.xhr.setRequestHeader(K,L)}catch(M){this.fireEvent("exception",[K,L])}},this);this.fireEvent("request");this.xhr.send(F);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var A={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(B){A[B]=function(){var C=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(C,{method:B.toLowerCase()}))}});Request.implement(A)})();Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(C){var B=C.match(/<body[^>]*>([\s\S]*?)<\/body>/i);C=(B
 )?B[1]:C;var A=new Element("div");return $try(function(){var D="<root>"+C+"</root>",G;if(Browser.Engine.trident){G=new ActiveXObject("Microsoft.XMLDOM");G.async=false;G.loadXML(D)}else{G=new DOMParser().parseFromString(D,"text/xml")}D=G.getElementsByTagName("root")[0];if(!D){return }for(var F=0,E=D.childNodes.length;F<E;F++){var H=Element.clone(D.childNodes[F],true,true);if(H){A.grab(H)}}return A})||A.set("html",C)},success:function(D){var C=this.options,B=this.response;B.html=D.stripScripts(function(E){B.javascript=E});var A=this.processHTML(B.html);B.tree=A.childNodes;B.elements=A.getElements("*");if(C.filter){B.tree=B.elements.filter(C.filter)}if(C.update){$(C.update).empty().set("html",B.html)}else{if(C.append){$(C.append).adopt(A.getChildren())}}if(C.evalScripts){$exec(B.javascript)}this.onSuccess(B.tree,B.elements,B.html,B.javascript)}});Element.Properties.send={set:function(A){var B=this.retrieve("send");if(B){B.cancel()}return this.eliminate("send").store("send:optio
 ns",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},A))},get:function(A){if(A||!this.retrieve("send")){if(A||!this.retrieve("send:options")){this.set("send",A)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.Properties.load={set:function(A){var B=this.retrieve("load");if(B){B.cancel()}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},A))},get:function(A){if(A||!this.retrieve("load")){if(A||!this.retrieve("load:options")){this.set("load",A)}this.store("load",new Request.HTML(this.retrieve("load:options")))}return this.retrieve("load")}};Element.implement({send:function(A){var B=this.get("send");B.send({data:this,url:A||B.options.url});return this},load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this}});Request.JSON=new Class({Extends:Request,options:{secure:true},initi
 alize:function(A){this.parent(A);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(A){this.response.json=JSON.decode(A,this.options.secure);this.onSuccess(this.response.json,A)}});MooTools.More={version:"1.2.2.1"};(function(){var A={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};var B;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(C){if(!A.languages[C]){return this}A.language=C;this.load();this.fireEvent("langChange",C);return this},load:function(){var C=this.cascade(this.getCurrentLanguage());B={};$each(C,function(E,D){B[D]=this.lambda(E)},this)},getCurrentLanguage:function(){return A.language},addLanguage:function(C){A.languages[C]=A.languages[C]||{};return this},cascade:function(E){var C=(A.languages[E]||{}).cascades||[];C.combine(A.cascades);C.erase(E).push(E);var D=C.map(function(F){return A.languages[F]},this);return $merge.apply(this,D)},lambda:function(C){(C||{}).get=function(E,D){return $lambda
 (C[E]).apply(this,$splat(D))};return C},get:function(E,D,C){if(B&&B[E]){return(D?B[E].get(D,C):B[E])}},set:function(D,E,C){this.addLanguage(D);langData=A.languages[D];if(!langData[E]){langData[E]={}}$extend(langData[E],C);if(D==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",D)}return this},list:function(){return Hash.getKeys(A.languages)}})})();var Log=new Class({log:function(){Log.logger.call(this,arguments)}});Log.logged=[];Log.logger=function(){if(window.console&&console.log){console.log.apply(console,arguments)}else{Log.logged.push(arguments)}};Class.refactor=function(B,A){$each(A,function(E,D){var C=B.prototype[D];if(C&&(C=C._origin)&&typeof E=="function"){B.implement(D,function(){var F=this.previous;this.previous=C;var G=E.apply(this,arguments);this.previous=F;return G})}else{B.implement(D,E)}});return B};Class.Mutators.Binds=function(A){return A};Class.Mutators.initialize=function(A){return function(){$splat(this.Binds).each(function(B){var C=this[
 B];if(C){this[B]=C.bind(this)}},this);return A.apply(this,arguments)}};Class.Occlude=new Class({occlude:function(C,B){B=$(B||this.element);var A=B.retrieve(C||this.property);if(A&&!$defined(this.occluded)){this.occluded=A}else{this.occluded=false;B.store(C||this.property,this)}return this.occluded}});(function(){var B={wait:function(C){return this.chain(function(){this.callChain.delay($pick(C,500),this)}.bind(this))}};Chain.implement(B);if(window.Fx){Fx.implement(B);["Css","Tween","Elements"].each(function(C){if(Fx[C]){Fx[C].implement(B)}})}try{Element.implement({chains:function(C){$splat($pick(C,["tween","morph","reveal"])).each(function(D){D=this.get(D);if(!D){return }D.setOptions({link:"chain"})},this);return this},pauseFx:function(D,C){this.chains(C).get($pick(C,"tween")).wait(D);return this}})}catch(A){}})();Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/
 this.length:0},sum:function(){var A=0,B=this.length;if(B){do{A+=this[--B]}while(B)}return A},unique:function(){return[].combine(this)}});(function(){new Native({name:"Date",initialize:Date,protect:true});["now","parse","UTC"].each(function(D){Native.genericize(Date,D,true)});Date.Methods={};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","UTCDate","UTCDay","UTCFullYear","AMPM","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(D){Date.Methods[D.toLowerCase()]=D});$each({ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"},function(E,D){Date.Methods[D]=E});var C=function(E,D){return"0".repeat(D-E.toString().length)+E};Date.implement({set:function(G,E){switch($type(G)){case"object":for(var F in G){this.set(F,G[F])}break;case"string":G=G.toLowerCase();var D=Date.Methods;if(D[G]){this["set"+D[G]](E)}}return this},
 get:function(E){E=E.toLowerCase();var D=Date.Methods;if(D[E]){return this["get"+D[E]]()}return null},clone:function(){return new Date(this.get("time"))},increment:function(D,E){return this.multiply(D,E)},decrement:function(D,E){return this.multiply(D,E,false)},multiply:function(E,J,D){E=E||"day";J=$pick(J,1);D=$pick(D,true);var K=D?1:-1;var H=this.format("%m").toInt()-1;var F=this.format("%Y").toInt();var G=this.get("time");var I=0;switch(E){case"year":J.times(function(L){if(Date.isLeapYear(F+L)&&H>1&&K>0){L++}if(Date.isLeapYear(F+L)&&H<=1&&K<0){L--}I+=Date.units.year(F+L)});break;case"month":J.times(function(N){if(K<0){N++}var M=H+(N*K);var L=L;if(M<0){L--;M=12+M}if(M>11||M<0){L+=(M/12).toInt()*K;M=M%12}I+=Date.units.month(M,L)});break;case"day":return this.set("date",this.get("date")+(K*J));default:I=Date.units[E]()*J;break}this.set("time",G+(I*K));return this},isLeapYear:function(){return Date.isLeapYear(this.get("year"))},clearTime:function(){["hr","min","sec","ms"].each
 (function(D){this.set(D,0)},this);return this},diff:function(G,E){E=E||"day";if($type(G)=="string"){G=Date.parse(G)}switch(E){case"year":return G.format("%Y").toInt()-this.format("%Y").toInt();break;case"month":var D=(G.format("%Y").toInt()-this.format("%Y").toInt())*12;return D+G.format("%m").toInt()-this.format("%m").toInt();break;default:var F=G.get("time")-this.get("time");if(F<0&&Date.units[E]()>(-1*(F))){return 0}else{if(F>=0&&F<Date.units[E]()){return 0}}return((G.get("time")-this.get("time"))/Date.units[E]()).round()}return null},getWeek:function(){var D=(new Date(this.get("year"),0,1)).get("date");return Math.round((this.get("dayofyear")+(D>3?D-4:D+3))/7)},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3")},getGMTOffset:function(){var D=this.get("timezoneOffset");return((D>0)?"-":" + ")+C(Math.floor(Math.abs(D)/60),2)+C(D%60,2)},parse:function(D){this.set("t
 ime",Date.parse(D));return this},isValid:function(D){return !!(D||this).valueOf()},format:function(D){if(!this.isValid()){return"invalid date"}D=D||"%x %X";D=({db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"})[D.toLowerCase()]||D;var E=this;return D.replace(/\%([aAbBcdHIjmMpSUWwxXyYTZ\%])/g,function(F,G){switch(G){case"a":return Date.getMsg("days")[E.get("day")].substr(0,3);case"A":return Date.getMsg("days")[E.get("day")];case"b":return Date.getMsg("months")[E.get("month")].substr(0,3);case"B":return Date.getMsg("months")[E.get("month")];case"c":return E.toString();case"d":return C(E.get("date"),2);case"H":return C(E.get("hr"),2);case"I":return((E.get("hr")%12)||12);case"j":return C(E.get("dayofyear"),3);case"m":return C((E.get("mo")+1),2);case"M":return C(E.get("min"),2);case"p":return Date.getMsg(E.get("hr")<12?"AM":"PM");case"S":return C(E.get("seconds"),2);case"U
 ":return C(E.get("week"),2);case"W":throw new Error("%W is not supported yet");case"w":return E.get("day");case"x":return E.format(Date.getMsg("shortDate"));case"X":return E.format(Date.getMsg("shortTime"));case"y":return E.get("year").toString().substr(2);case"Y":return E.get("year");case"T":return E.get("GMTOffset");case"Z":return E.get("Timezone");case"%":return"%"}return G})},setAMPM:function(D){D=D.toUpperCase();if(this.format("%H").toInt()>11&&D=="AM"){return this.decrement("hour",12)}else{if(this.format("%H").toInt()<12&&D=="PM"){return this.increment("hour",12)}}return this}});Date.alias("diff","compare");Date.alias("format","strftime");var B=Date.parse;var A=function(E,D){if(Date.isLeapYear(D.toInt())&&E===1){return 29}return[31,28,31,30,31,30,31,31,30,31,30,31][E]};$extend(Date,{getMsg:function(E,D){return MooTools.lang.get("Date",E,D)},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000
 ),month:function(F,D){var E=new Date();return A($pick(F,E.format("%m").toInt()),$pick(D,E.format("%Y").toInt()))*86400000},year:function(D){D=D||new Date().format("%Y").toInt();return Date.isLeapYear(D.toInt())?31622400000:31536000000}},isLeapYear:function(D){return new Date(D,1,29).getDate()==29},fixY2K:function(E){if(!isNaN(E)){var D=new Date(E);if(D.get("year")<2000&&E.toString().indexOf(D.get("year"))<0){D.increment("year",100)}return D}else{return E}},parse:function(F){var E=$type(F);if(E=="number"){return new Date(F)}if(E!="string"){return F}if(!F.length){return null}var D;Date.parsePatterns.each(function(I,G){if(D){return }var H=I.re.exec(F);if(H){D=I.handler(H)}});return D||new Date(B(F))},parseDay:function(D,G){var F=-1;switch($type(D)){case"number":F=Date.getMsg("days")[D-1]||false;if(!F){throw new Error("Invalid day index value must be between 1 and 7")}break;case"string":var E=Date.getMsg("days").filter(function(H){return this.test(H)},new RegExp("^"+D,"i"));if(!
 E.length){throw new Error("Invalid day string")}if(E.length>1){throw new Error("Ambiguous day")}F=E[0]}return(G)?Date.getMsg("days").indexOf(F):F},parseMonth:function(G,F){var E=-1;switch($type(G)){case"object":E=Date.getMsg("months")[G.get("mo")];break;case"number":E=Date.getMsg("months")[G-1]||false;if(!E){throw new Error("Invalid month index value must be between 1 and 12:"+index)}break;case"string":var D=Date.getMsg("months").filter(function(H){return this.test(H)},new RegExp("^"+G,"i"));if(!D.length){throw new Error("Invalid month string")}if(D.length>1){throw new Error("Ambiguous month")}E=D[0]}return(F)?Date.getMsg("months").indexOf(E):E},parseUTC:function(E){var D=new Date(E);var F=Date.UTC(D.get("year"),D.get("mo"),D.get("date"),D.get("hr"),D.get("min"),D.get("sec"));return new Date(F)},orderIndex:function(D){return Date.getMsg("dateOrder").indexOf(D)+1},parsePatterns:[{re:/^(\d{4})[\.\-\/](\d{1,2})[\.\-\/](\d{1,2})$/,handler:function(D){return new Date(D[1],D[2]-1,
 D[3])}},{re:/^(\d{4})[\.\-\/](\d{1,2})[\.\-\/](\d{1,2})\s(\d{1,2}):(\d{1,2})(?:\:(\d{1,2}))?(\w{2})?$/,handler:function(D){var E=new Date(D[1],D[2]-1,D[3]);E.set("hr",D[4]);E.set("min",D[5]);E.set("sec",D[6]||0);if(D[7]){E.set("ampm",D[7])}return E}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})$/,handler:function(D){var E=new Date(D[Date.orderIndex("year")],D[Date.orderIndex("month")]-1,D[Date.orderIndex("date")]);return Date.fixY2K(E)}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})\s(\d{1,2})[:\.](\d{1,2})(?:[\:\.](\d{1,2}))?(\w{2})?$/,handler:function(D){var E=new Date(D[Date.orderIndex("year")],D[Date.orderIndex("month")]-1,D[Date.orderIndex("date")]);E.set("hr",D[4]);E.set("min",D[5]);E.set("sec",D[6]||0);if(D[7]){E.set("ampm",D[7])}return Date.fixY2K(E)}}]})})();["LastDayOfMonth","Ordinal"].each(function(A){Date.Methods[A.toLowerCase()]=A});Date.implement({timeDiffInWords:function(A){return Date.distanceOfTimeInWords(this,A||new Date)},getOrdinal:function(A){re
 turn Date.getMsg("ordinal",A||this.get("date"))},getDayOfYear:function(){return((Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+1,0,0,0)-Date.UTC(this.getFullYear(),0,1,0,0,0))/Date.units.day())},getLastDayOfMonth:function(){var A=this.clone();A.setMonth(A.getMonth()+1,0);return A.getDate()}});Date.alias("timeDiffInWords","timeAgoInWords");$extend(Date,{distanceOfTimeInWords:function(B,A){return this.getTimePhrase(((A.getTime()-B.getTime())/1000).toInt(),B,A)},getTimePhrase:function(D,C,A){var B=function(){var E;if(D>=0){E="Ago"}else{D=D*-1;E="Until"}if(D<60){return Date.getMsg("lessThanMinute"+E,D)}else{if(D<120){return Date.getMsg("minute"+E,D)}else{if(D<(45*60)){D=(D/60).round();return Date.getMsg("minutes"+E,D)}else{if(D<(90*60)){return Date.getMsg("hour"+E,D)}else{if(D<(24*60*60)){D=(D/3600).round();return Date.getMsg("hours"+E,D)}else{if(D<(48*60*60)){return Date.getMsg("day"+E,D)}else{D=(D/86400).round();return Date.getMsg("days"+E,D)}}}}}}};return B().sub
 stitute({delta:D})}});Date.parsePatterns.extend([{re:/^(\d{4})(?:-?(\d{2})(?:-?(\d{2})(?:[T ](\d{2})(?::?(\d{2})(?::?(\d{2})(?:\.(\d+))?)?)?(?:Z|(?:([-+])(\d{2})(?::?(\d{2}))?)?)?)?)?)?$/,handler:function(A){var C=0;var B=new Date(A[1],0,1);if(A[3]){B.set("date",A[3])}if(A[2]){B.set("mo",A[2]-1)}if(A[4]){B.set("hr",A[4])}if(A[5]){B.set("min",A[5])}if(A[6]){B.set("sec",A[6])}if(A[7]){B.set("ms",("0."+A[7]).toInt()*1000)}if(A[9]){C=(A[9].toInt()*60)+A[10].toInt();C*=((A[8]=="-")?1:-1)}B.setTime((B*1)+(C*60*1000).toInt());return B}},{re:/^tod/i,handler:function(){return new Date()}},{re:/^tom/i,handler:function(){return new Date().increment()}},{re:/^yes/i,handler:function(){return new Date().decrement()}},{re:/^(\d{1,2})(st|nd|rd|th)?$/i,handler:function(A){var B=new Date();B.set("date",A[1].toInt());return B}},{re:/^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i,handler:function(A){var B=new Date();B.set("mo",Date.parseMonth(A[2],true),A[1].toInt());return B}},{re:/^(\d{1,2})(?:st|nd|rd|
 th)? (\w+),? (\d{4})$/i,handler:function(A){var B=new Date();B.set("mo",Date.parseMonth(A[2],true),A[1].toInt());B.setYear(A[3]);return B}},{re:/^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i,handler:function(A){var B=new Date();B.set("mo",Date.parseMonth(A[1],true),A[2].toInt());B.setYear(A[3]);return B}},{re:/^next (\w+)$/i,handler:function(D){var E=new Date();var B=E.getDay();var C=Date.parseDay(D[1],true);var A=C-B;if(C<=B){A+=7}E.set("date",E.getDate()+A);return E}},{re:/^\d+\s[a-zA-z]..\s\d.\:\d.$/,handler:function(B){var C=new Date();B=B[0].split(" ");C.set("date",B[0]);var A;Date.getMsg("months").each(function(E,D){if(new RegExp("^"+B[1]).test(E)){A=D}});C.set("mo",A);C.set("hr",B[2].split(":")[0]);C.set("min",B[2].split(":")[1]);C.set("ms",0);return C}},{re:/^last (\w+)$/i,handler:function(A){return Date.parse("next "+A[0]).decrement("day",7)}}]);Hash.implement({getFromPath:function(A){var B=this.getClean();A.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(C){if(!
 B){return null}var D=arguments[2]||arguments[1]||arguments[0];B=(D in B)?B[D]:null;return C});return B},cleanValues:function(A){A=A||$defined;this.each(function(C,B){if(!A(C)){this.erase(B)}},this);return this},run:function(){var A=arguments;this.each(function(C,B){if($type(C)=="function"){C.run(A)}})}});(function(){var B=["À","à","Á","á","Â","â","Ã","ã","Ä","ä","Å","å","Ă","ă","Ą","ą","Ć","ć","Č","č","Ç","ç","Ď","ď","Đ","đ","È","è","É","é","Ê","ê","Ë","ë","Ě","ě","Ę","ę","Ğ","ğ","Ì","ì","Í","í","Î","î","Ï","ï","Ĺ","ĺ","Ľ","ľ","Ł","ł","Ñ","ñ","Ň","ň","Ń","ń","Ò","ò","Ó","ó","Ô","ô","Õ","õ","Ö","ö","Ø","ø","ő","Ř","ř","Ŕ","ŕ","Š","š","Ş","ş","Ś","ś","Ť","ť","Ť","ť","Ţ","ţ","Ù","ù","Ú","ú","Û","û","Ü","ü","Ů","ů","Ÿ","ÿ","ý","Ý","Ž","ž","Ź","ź","Ż","ż","Þ","þ","Ð","ð","ß","Œ","œ","Æ","æ","µ"];var A=["A","a","A","a","A","a","A","a","Ae","ae","A","a","A","a","A"
 ,"a","C","c","C","c","C","c","D","d","D","d","E","e","E","e","E","e","E","e","E","e","E","e","G","g","I","i","I","i","I","i","I","i","L","l","L","l","L","l","N","n","N","n","N","n","O","o","O","o","O","o","O","o","Oe","oe","O","o","o","R","r","R","r","S","s","S","s","S","s","T","t","T","t","T","t","U","u","U","u","U","u","Ue","ue","U","u","Y","y","Y","y","Z","z","Z","z","Z","z","TH","th","DH","dh","ss","OE","oe","AE","ae","u"];var C={"[\xa0\u2002\u2003\u2009]":" ","\xb7":"*","[\u2018\u2019]":"'","[\u201c\u201d]":'"',"\u2026":"...","\u2013":"-","\u2014":"--","\uFFFD":"&raquo;"};String.implement({standardize:function(){var D=this;B.each(function(F,E){D=D.replace(new RegExp(F,"g"),A[E])});return D},repeat:function(D){return new Array(D+1).join(this)},pad:function(E,G,D){if(this.length>=E){return this}G=G||" ";var F=G.repeat(E-this.length).substr(0,E-this.length);if(!D||D=="right"){return this+F}if(D=="left"){return F+this}return F.substr(0,(F.length/2).floor())+this+F.substr(0,
 (F.length/2).ceil())},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},tidy:function(){var D=this.toString();$each(C,function(F,E){D=D.replace(new RegExp(E,"g"),F)});return D}})})();String.implement({parseQueryString:function(){var B=this.split(/[&;]/),A={};if(B.length){B.each(function(G){var C=G.indexOf("="),D=C<0?[""]:G.substr(0,C).match(/[^\]\[]+/g),E=decodeURIComponent(G.substr(C+1)),F=A;D.each(function(I,H){var J=F[I];if(H<D.length-1){F=F[I]=J||{}}else{if($type(J)=="array"){J.push(E)}else{F[I]=$defined(J)?[J,E]:E}}})})}return A},cleanQueryString:function(A){return this.split("&").filter(function(E){var B=E.indexOf("="),C=B<0?"":E.substr(0,B),D=E.substr(B+1);return A?A.run([C,D]):$chk(D)}).join("&")}});var URI=new Class({Implements:Options,regex:/^(?:(\w+):)?(?:\/\/(?:(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)?(\.\.?$|(?:[^?#\/]*\/)*)([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,parts:["scheme","user","password","host","port","directory","file","query","fragment"]
 ,schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(B,A){this.setOptions(A);var C=this.options.base||URI.base;B=B||C;if(B&&B.parsed){this.parsed=$unlink(B.parsed)}else{this.set("value",B.href||B.toString(),C?new URI(C):false)}},parse:function(C,B){var A=C.match(this.regex);if(!A){return false}A.shift();return this.merge(A.associate(this.parts),B)},merge:function(B,A){if(!B.scheme&&!A.scheme){return false}if(A){this.parts.every(function(C){if(B[C]){return false}B[C]=A[C]||"";return true})}B.port=B.port||this.schemes[B.scheme.toLowerCase()];B.directory=B.directory?this.parseDirectory(B.directory,A?A.directory:""):"/";return B},parseDirectory:function(B,C){B=(B.substr(0,1)=="/"?"":(C||"/"))+B;if(!B.test(URI.regs.directoryDot)){return B}var A=[];B.replace(URI.regs.endSlash,"").split("/").each(function(D){if(D==".."&&A.length>0){A.pop()}else{if(D!="."){A.push(D)}}});return A.join("/")+"/"},combine:function(A){return A.value||A.scheme+"://"+(A.user?A.u
 ser+(A.password?":"+A.password:"")+"@":"")+(A.host||"")+(A.port&&A.port!=this.schemes[A.scheme]?":"+A.port:"")+(A.directory||"/")+(A.file||"")+(A.query?"?"+A.query:"")+(A.fragment?"#"+A.fragment:"")},set:function(B,D,C){if(B=="value"){var A=D.match(URI.regs.scheme);if(A){A=A[1]}if(A&&!$defined(this.schemes[A.toLowerCase()])){this.parsed={scheme:A,value:D}}else{this.parsed=this.parse(D,(C||this).parsed)||(A?{scheme:A,value:D}:{value:D})}}else{this.parsed[B]=D}return this},get:function(A,B){switch(A){case"value":return this.combine(this.parsed,B?B.parsed:false);case"data":return this.getData()}return this.parsed[A]||undefined},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(C,B){var A=this.get(B||"query");if(!$chk(A)){return C?null:{}}var D=A.parseQueryString();return C?D[C]:D},setData:function(A,C,B){if($type(arguments[0])=="string"){A=this.getData();A[arguments[0]]=arguments[1]}else{if(C){A=$merge(this.getData(),A)}}return
  this.set(B||"query",Hash.toQueryString(A))},clearData:function(A){return this.set(A||"query","")}});["toString","valueOf"].each(function(A){URI.prototype[A]=function(){return this.get("value")}});URI.regs={endSlash:/\/$/,scheme:/^(\w+):/,directoryDot:/\.\/|\.$/};URI.base=new URI($$("base[href]").getLast(),{base:document.location});String.implement({toURI:function(A){return new URI(this,A)}});URI=Class.refactor(URI,{combine:function(F,E){if(!E||F.scheme!=E.scheme||F.host!=E.host||F.port!=E.port){return this.previous.apply(this,arguments)}var A=F.file+(F.query?"?"+F.query:"")+(F.fragment?"#"+F.fragment:"");if(!E.directory){return(F.directory||(F.file?"":"./"))+A}var D=E.directory.split("/"),C=F.directory.split("/"),G="",H;var B=0;for(H=0;H<D.length&&H<C.length&&D[H]==C[H];H++){}for(B=0;B<D.length-H-1;B++){G+="../"}for(B=H;B<C.length-1;B++){G+=C[B]+"/"}return(G||(F.file?"":"./"))+A},toAbsolute:function(A){A=new URI(A);if(A){A.set("directory","").set("file","")}return this.toRe
 lative(A)},toRelative:function(A){return this.get("value",new URI(A))}});Element.implement({tidy:function(){this.set("value",this.get("value").tidy())},getTextInRange:function(B,A){return this.get("value").substring(B,A)},getSelectedText:function(){if(document.selection&&document.selection.createRange){return document.selection.createRange().text}return this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd())},getSelectedRange:function(){if($defined(this.selectionStart)){return{start:this.selectionStart,end:this.selectionEnd}}var E={start:0,end:0};var A=this.getDocument().selection.createRange();if(!A||A.parentElement()!=this){return E}var C=A.duplicate();if(this.type=="text"){E.start=0-C.moveStart("character",-100000);E.end=E.start+A.text.length}else{var B=this.get("value");var D=B.length-B.match(/[\n\r]*$/)[0].length;C.moveToElementText(this);C.setEndPoint("StartToEnd",A);E.end=D-C.text.length;C.setEndPoint("StartToStart",A);E.start=D-C.text.length}return E},ge
 tSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(A){if(A=="end"){A=this.get("value").length}this.selectRange(A,A);return this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(E,A){if(this.createTextRange){var C=this.get("value");var D=C.substr(E,A-E).replace(/\r/g,"").length;E=C.substr(0,E).replace(/\r/g,"").length;var B=this.createTextRange();B.collapse(true);B.moveEnd("character",E+D);B.moveStart("character",E);B.select()}else{this.focus();this.setSelectionRange(E,A)}return this},insertAtCursor:function(B,A){var D=this.getSelectedRange();var C=this.get("value");this.set("value",C.substring(0,D.start)+B+C.substring(D.end,C.length));if($pick(A,true)){this.selectRange(D.start,D.start+B.length)}else{this.setCaretPosition(D.start+B.length)}return this},insertAroundCursor:function(B,A){B=$extend({before:"",defaultMiddle:"",after:""},B);v
 ar C=this.getSelectedText()||B.defaultMiddle;var G=this.getSelectedRange();var F=this.get("value");if(G.start==G.end){this.set("value",F.substring(0,G.start)+B.before+C+B.after+F.substring(G.end,F.length));this.selectRange(G.start+B.before.length,G.end+B.before.length+C.length)}else{var D=F.substring(G.start,G.end);this.set("value",F.substring(0,G.start)+B.before+D+B.after+F.substring(G.end,F.length));var E=G.start+B.before.length;if($pick(A,true)){this.selectRange(E,E+D.length)}else{this.setCaretPosition(E+F.length)}}return this}});Element.implement({measure:function(E){var G=function(H){return !!(!H||H.offsetHeight||H.offsetWidth)};if(G(this)){return E.apply(this)}var D=this.getParent(),B=[],F=[];while(!G(D)&&D!=document.body){B.push(D.expose());D=D.getParent()}var C=this.expose();var A=E.apply(this);C();B.each(function(H){H()});return A},expose:function(){if(this.getStyle("display")!="none"){return $empty}var A=this.getStyles("display","position","visibility");return this
 .setStyles({display:"block",position:"absolute",visibility:"hidden"}).setStyles.pass(A,this)},getDimensions:function(A){A=$merge({computeSize:false},A);var D={};var C=function(F,E){return(E.computeSize)?F.getComputedSize(E):F.getSize()};if(this.getStyle("display")=="none"){D=this.measure(function(){return C(this,A)})}else{try{D=C(this,A)}catch(B){}}return $chk(D.x)?$extend(D,{width:D.x,height:D.y}):$extend(D,{x:D.width,y:D.height})},getComputedSize:function(A){A=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},A);var C={width:0,height:0};switch(A.mode){case"vertical":delete C.width;delete A.plains.width;break;case"horizontal":delete C.height;delete A.plains.height;break}var B=[];$each(A.plains,function(G,F){G.each(function(H){A.styles.each(function(I){B.push((I=="border")?I+"-"+H+"-width":I+"-"+H)})})});var E={};B.each(function(F){E[F]=this.getComputedStyle(F)},this);var D=[];$each(A.plains,function(G,F){var H=F.capital
 ize();C["total"+H]=0;C["computed"+H]=0;G.each(function(I){C["computed"+I.capitalize()]=0;B.each(function(K,J){if(K.test(I)){E[K]=E[K].toInt()||0;C["total"+H]=C["total"+H]+E[K];C["computed"+I.capitalize()]=C["computed"+I.capitalize()]+E[K]}if(K.test(I)&&F!=K&&(K.test("border")||K.test("padding"))&&!D.contains(K)){D.push(K);C["computed"+H]=C["computed"+H]-E[K]}})})});["Width","Height"].each(function(G){var F=G.toLowerCase();if(!$chk(C[F])){return }C[F]=C[F]+this["offset"+G]+C["computed"+G];C["total"+G]=C[F]+C["total"+G];delete C["computed"+G]},this);return $extend(E,C)}});(function(){var A=false;window.addEvent("domready",function(){var B=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);A=(B.offsetTop===0);B.dispose()});Element.implement({pin:function(C){if(this.getStyle("display")=="none"){return null}var D;if(C!==false){D=this.getPosition();if(!this.retrieve("pinned")){var F={top:D.y-window.getScroll().y,left:D.x-window.getScroll().x};if(A
 ){this.setStyle("position","fixed").setStyles(F)}else{this.store("pinnedByJS",true);this.setStyles({position:"absolute",top:D.y,left:D.x});this.store("scrollFixer",(function(){if(this.retrieve("pinned")){this.setStyles({top:F.top.toInt()+window.getScroll().y,left:F.left.toInt()+window.getScroll().x})}}).bind(this));window.addEvent("scroll",this.retrieve("scrollFixer"))}this.store("pinned",true)}}else{var E;if(!Browser.Engine.trident){if(this.getParent().getComputedStyle("position")!="static"){E=this.getParent()}else{E=this.getParent().getOffsetParent()}}D=this.getPosition(E);this.store("pinned",false);var B;if(A&&!this.retrieve("pinnedByJS")){B={top:D.y+window.getScroll().y,left:D.x+window.getScroll().x}}else{this.store("pinnedByJS",false);window.removeEvent("scroll",this.retrieve("scrollFixer"));B={top:D.y,left:D.x}}this.setStyles($merge(B,{position:"absolute"}))}return this.addClass("isPinned")},unpin:function(){return this.pin(false).removeClass("isPinned")},togglepin:fun
 ction(){this.pin(!this.retrieve("pinned"))}})})();(function(){var A=Element.prototype.position;Element.implement({position:function(R){if(R&&($defined(R.x)||$defined(R.y))){return A?A.apply(this,arguments):this}$each(R||{},function(T,S){if(!$defined(T)){delete R[S]}});R=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,allowNegative:false},R);var B={x:0,y:0};var H=false;var C=this.measure(function(){return $(this.getOffsetParent())});if(C&&C!=this.getDocument().body){B=C.measure(function(){return this.getPosition()});H=true;R.offset.x=R.offset.x-B.x;R.offset.y=R.offset.y-B.y}var Q=function(S){if($type(S)!="string"){return S}S=S.toLowerCase();var T={};if(S.test("left")){T.x="left"}else{if(S.test("right")){T.x="right"}else{T.x="center"}}if(S.test("upper")||S.test("top")){T.y="top"}else{if(S.test("bottom")){T.y="bottom"}else{T.y="center"}}return T};R.edge=Q(R.edge);R.position=
 Q(R.position);if(!R.edge){if(R.position.x=="center"&&R.position.y=="center"){R.edge={x:"center",y:"center"}}else{R.edge={x:"left",y:"top"}}}this.setStyle("position","absolute");var P=$(R.relativeTo)||document.body;var I=P==document.body?window.getScroll():P.getPosition();var O=I.y;var G=I.x;if(Browser.Engine.trident){var L=P.getScrolls();O+=L.y;G+=L.x}var J=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});if(R.ignoreMargins){R.offset.x=R.offset.x-J["margin-left"];R.offset.y=R.offset.y-J["margin-top"]}var N={};var D=R.offset.y;var E=R.offset.x;var K=window.getSize();switch(R.position.x){case"left":N.x=G+E;break;case"right":N.x=G+E+P.offsetWidth;break;default:N.x=G+((P==document.body?K.x:P.offsetWidth)/2)+E;break}switch(R.position.y){case"top":N.y=O+D;break;case"bottom":N.y=O+D+P.offsetHeight;break;default:N.y=O+((P==document.body?K.y:P.offsetHeight)/2)+D;break}if(R.edge){var M={};switch(R.edge.x){case"left":M.x=0;break;case"right":M.x=-J.x-J.compute
 dRight-J.computedLeft;break;default:M.x=-(J.x/2);break}switch(R.edge.y){case"top":M.y=0;break;case"bottom":M.y=-J.y-J.computedTop-J.computedBottom;break;default:M.y=-(J.y/2);break}N.x=N.x+M.x;N.y=N.y+M.y}N={left:((N.x>=0||H||R.allowNegative)?N.x:0).toInt(),top:((N.y>=0||H||R.allowNegative)?N.y:0).toInt()};if(P.getStyle("position")=="fixed"||R.relFixedPosition){var F=window.getScroll();N.top=N.top.toInt()+F.y;N.left=N.left.toInt()+F.x}if(R.returnPos){return N}else{this.setStyles(N)}return this}})})();Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var B;try{if("none"!=this.getStyle("display")){B=this.getStyle("display")}}catch(A){}return this.store("originalDisplay",B||"block").setStyle("display","none")},show:function(A){return this.setStyle("display",A||this.retrieve("originalDisplay")||"block")},swapClass:function(A,B){return this.removeClass(A).addClass(B)
 }});var InputValidator=new Class({Implements:[Options],options:{errorMsg:"Validation failed.",test:function(A){return true}},initialize:function(B,A){this.setOptions(A);this.className=B},test:function(B,A){if($(B)){return this.options.test($(B),A||this.getProps(B))}else{return false}},getError:function(C,A){var B=this.options.errorMsg;if($type(B)=="function"){B=B($(C),A||this.getProps(C))}return B},getProps:function(A){if(!$(A)){return{}}return A.get("validatorProps")}});Element.Properties.validatorProps={set:function(A){return this.eliminate("validatorProps").store("validatorProps",A)},get:function(A){if(A){this.set(A)}if(this.retrieve("validatorProps")){return this.retrieve("validatorProps")}if(this.getProperty("validatorProps")){try{this.store("validatorProps",JSON.decode(this.getProperty("validatorProps")))}catch(C){return{}}}else{var B=this.get("class").split(" ").filter(function(D){return D.test(":")});if(!B.length){this.store("validatorProps",{})}else{A={};B.each(func
 tion(D){var E=D.split(":");if(E[1]){try{A[E[0]]=JSON.decode(E[1])}catch(F){}}});this.store("validatorProps",A)}}return this.retrieve("validatorProps")}};var FormValidator=new Class({Implements:[Options,Events],Binds:["onSubmit"],options:{fieldSelectors:"input, select, textarea",ignoreHidden:true,useTitles:false,evaluateOnSubmit:true,evaluateFieldsOnBlur:true,evaluateFieldsOnChange:true,serial:true,stopOnFailure:true,warningPrefix:function(){return FormValidator.getMsg("warningPrefix")||"Warning: "},errorPrefix:function(){return FormValidator.getMsg("errorPrefix")||"Error: "}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.element.store("validator",this);this.warningPrefix=$lambda(this.options.warningPrefix)();this.errorPrefix=$lambda(this.options.errorPrefix)();if(this.options.evaluateOnSubmit){this.element.addEvent("submit",this.onSubmit)}if(this.options.evaluateFieldsOnBlur){this.watchFields(this.getFields())}},toElement:function(){return this.element},
 getFields:function(){return(this.fields=this.element.getElements(this.options.fieldSelectors))},watchFields:function(A){A.each(function(B){B.addEvent("blur",this.validateField.pass([B,false],this));if(this.options.evaluateFieldsOnChange){B.addEvent("change",this.validateField.pass([B,true],this))}},this)},onSubmit:function(A){if(!this.validate(A)&&A){A.preventDefault()}else{this.reset()}},reset:function(){this.getFields().each(this.resetField,this);return this},validate:function(B){var A=this.getFields().map(function(C){return this.validateField(C,true)},this).every(function(C){return C});this.fireEvent("formValidate",[A,this.element,B]);if(this.options.stopOnFailure&&!A&&B){B.preventDefault()}return A},validateField:function(I,A){if(this.paused){return true}I=$(I);var D=!I.hasClass("validation-failed");var F,H;if(this.options.serial&&!A){F=this.element.getElement(".validation-failed");H=this.element.getElement(".warning")}if(I&&(!F||A||I.hasClass("validation-failed")||(F&&!
 this.options.serial))){var C=I.className.split(" ").some(function(J){return this.getValidator(J)},this);var G=[];I.className.split(" ").each(function(J){if(J&&!this.test(J,I)){G.include(J)}},this);D=G.length===0;if(C&&!I.hasClass("warnOnly")){if(D){I.addClass("validation-passed").removeClass("validation-failed");this.fireEvent("elementPass",I)}else{I.addClass("validation-failed").removeClass("validation-passed");this.fireEvent("elementFail",[I,G])}}if(!H){var E=I.className.split(" ").some(function(J){if(J.test("^warn-")||I.hasClass("warnOnly")){return this.getValidator(J.replace(/^warn-/,""))}else{return null}},this);I.removeClass("warning");var B=I.className.split(" ").map(function(J){if(J.test("^warn-")||I.hasClass("warnOnly")){return this.test(J.replace(/^warn-/,""),I,true)}else{return null}},this)}}return D},test:function(B,D,E){var A=this.getValidator(B);D=$(D);if(D.hasClass("ignoreValidation")){return true}E=$pick(E,false);if(D.hasClass("warnOnly")){E=true}var C=A?A.te
 st(D):true;if(A&&this.isVisible(D)){this.fireEvent("elementValidate",[C,D,B,E])}if(E){return true}return C},isVisible:function(A){if(!this.options.ignoreHidden){return true}while(A!=document.body){if($(A).getStyle("display")=="none"){return false}A=A.getParent()}return true},resetField:function(A){A=$(A);if(A){A.className.split(" ").each(function(B){if(B.test("^warn-")){B=B.replace(/^warn-/,"")}A.removeClass("validation-failed");A.removeClass("warning");A.removeClass("validation-passed")},this)}return this},stop:function(){this.paused=true;return this},start:function(){this.paused=false;return this},ignoreField:function(A,B){A=$(A);if(A){this.enforceField(A);if(B){A.addClass("warnOnly")}else{A.addClass("ignoreValidation")}}return this},enforceField:function(A){A=$(A);if(A){A.removeClass("warnOnly").removeClass("ignoreValidation")}return this}});FormValidator.getMsg=function(A){return MooTools.lang.get("FormValidator",A)};FormValidator.adders={validators:{},add:function(B,A){
 this.validators[B]=new InputValidator(B,A);if(!this.initialize){this.implement({validators:this.validators})}},addAllThese:function(A){$A(A).each(function(B){this.add(B[0],B[1])},this)},getValidator:function(A){return this.validators[A.split(":")[0]]}};$extend(FormValidator,FormValidator.adders);FormValidator.implement(FormValidator.adders);FormValidator.add("IsEmpty",{errorMsg:false,test:function(A){if(A.type=="select-one"||A.type=="select"){return !(A.selectedIndex>=0&&A.options[A.selectedIndex].value!="")}else{return((A.get("value")==null)||(A.get("value").length==0))}}});FormValidator.addAllThese([["required",{errorMsg:function(){return FormValidator.getMsg("required")},test:function(A){return !FormValidator.getValidator("IsEmpty").test(A)}}],["minLength",{errorMsg:function(A,B){if($type(B.minLength)){return FormValidator.getMsg("minLength").substitute({minLength:B.minLength,length:A.get("value").length})}else{return""}},test:function(A,B){if($type(B.minLength)){return(A
 .get("value").length>=$pick(B.minLength,0))}else{return true}}}],["maxLength",{errorMsg:function(A,B){if($type(B.maxLength)){return FormValidator.getMsg("maxLength").substitute({maxLength:B.maxLength,length:A.get("value").length})}else{return""}},test:function(A,B){return(A.get("value").length<=$pick(B.maxLength,10000))}}],["validate-integer",{errorMsg:FormValidator.getMsg.pass("integer"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^-?[1-9]\d*$/).test(A.get("value"))}}],["validate-numeric",{errorMsg:FormValidator.getMsg.pass("numeric"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(A.get("value"))}}],["validate-digits",{errorMsg:FormValidator.getMsg.pass("digits"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^[\d() .:\-\+#]+$/.test(A.get("value")))}}],["validate-alpha",{errorMsg:FormValidator.getMsg.pass("alpha"),test:function(A){return FormValida
 tor.getValidator("IsEmpty").test(A)||(/^[a-zA-Z]+$/).test(A.get("value"))}}],["validate-alphanum",{errorMsg:FormValidator.getMsg.pass("alphanum"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||!(/\W/).test(A.get("value"))}}],["validate-date",{errorMsg:function(A,B){if(Date.parse){var C=B.dateFormat||"%x";return FormValidator.getMsg("dateSuchAs").substitute({date:new Date().format(C)})}else{return FormValidator.getMsg("dateInFormatMDY")}},test:function(A,B){if(FormValidator.getValidator("IsEmpty").test(A)){return true}var F;if(Date.parse){var E=B.dateFormat||"%x";F=Date.parse(A.get("value"));var D=F.format(E);if(D!="invalid date"){A.set("value",D)}return !isNaN(F)}else{var C=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!C.test(A.get("value"))){return false}F=new Date(A.get("value").replace(C,"$1/$2/$3"));return(parseInt(RegExp.$1,10)==(1+F.getMonth()))&&(parseInt(RegExp.$2,10)==F.getDate())&&(parseInt(RegExp.$3,10)==F.getFullYear())}}}],["validate-email",{errorMsg
 :FormValidator.getMsg.pass("email"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i).test(A.get("value"))}}],["validate-url",{errorMsg:FormValidator.getMsg.pass("url"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(A.get("value"))}}],["validate-currency-dollar",{errorMsg:FormValidator.getMsg.pass("currencyDollar"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/).test(A.get("value"))}}],["validate-one-required",{errorMsg:FormValidator.getMsg.pass("oneRequired"),test:function(A,B){var C=$(B["validate-one-required"])||A.parentNode;return C.getElements("input").some(function(D){if(["checkbox","radio"].contains(D.get("type"))){return D.get("checked")}ret
 urn D.get("value")})}}]]);Element.Properties.validator={set:function(A){var B=this.retrieve("validator");if(B){B.setOptions(A)}return this.store("validator:options")},get:function(A){if(A||!this.retrieve("validator")){if(A||!this.retrieve("validator:options")){this.set("validator",A)}this.store("validator",new FormValidator(this,this.retrieve("validator:options")))}return this.retrieve("validator")}};Element.implement({validate:function(A){this.set("validator",A);return this.get("validator",A).validate()}});FormValidator.Inline=new Class({Extends:FormValidator,options:{scrollToErrorsOnSubmit:true,scrollFxOptions:{offset:{y:-20}}},initialize:function(B,A){this.parent(B,A);this.addEvent("onElementValidate",function(G,F,E,H){var D=this.getValidator(E);if(!G&&D.getError(F)){if(H){F.addClass("warning")}var C=this.makeAdvice(E,F,D.getError(F),H);this.insertAdvice(C,F);this.showAdvice(E,F)}else{this.hideAdvice(E,F)}})},makeAdvice:function(D,F,C,G){var E=(G)?this.warningPrefix:this.
 errorPrefix;E+=(this.options.useTitles)?F.title||C:C;var A=(G)?"warning-advice":"validation-advice";var B=this.getAdvice(D,F);if(B){B=B.clone(true).set("html",E).replaces(B)}else{B=new Element("div",{html:E,styles:{display:"none"},id:"advice-"+D+"-"+this.getFieldId(F)}).addClass(A)}F.store("advice-"+D,B);return B},getFieldId:function(A){return A.id?A.id:A.id="input_"+A.name},showAdvice:function(B,C){var A=this.getAdvice(B,C);if(A&&!C.retrieve(this.getPropName(B))&&(A.getStyle("display")=="none"||A.getStyle("visiblity")=="hidden"||A.getStyle("opacity")==0)){C.store(this.getPropName(B),true);if(A.reveal){A.reveal()}else{A.setStyle("display","block")}}},hideAdvice:function(B,C){var A=this.getAdvice(B,C);if(A&&C.retrieve(this.getPropName(B))){C.store(this.getPropName(B),false);if(A.dissolve){A.dissolve()}else{A.setStyle("display","none")}}},getPropName:function(A){return"advice"+A},resetField:function(A){A=$(A);if(!A){return this}this.parent(A);A.className.split(" ").each(functi
 on(B){this.hideAdvice(B,A)},this);return this},getAllAdviceMessages:function(D,C){var B=[];if(D.hasClass("ignoreValidation")&&!C){return B}var A=D.className.split(" ").some(function(G){var E=G.test("^warn-")||D.hasClass("warnOnly");if(E){G=G.replace(/^warn-/,"")}var F=this.getValidator(G);if(!F){return }B.push({message:F.getError(D),warnOnly:E,passed:F.test(),validator:F})},this);return B},getAdvice:function(A,B){return B.retrieve("advice-"+A)},insertAdvice:function(A,C){var B=C.get("validatorProps");if(!B.msgPos||!$(B.msgPos)){if(C.type.toLowerCase()=="radio"){C.getParent().adopt(A)}else{A.inject($(C),"after")}}else{$(B.msgPos).grab(A)}},validate:function(H,G){var A=this.parent(H,G);if(this.options.scrollToErrorsOnSubmit&&!A){var C=$(this).getElement(".validation-failed");var E=$(this).getParent();var B=function(I){return I.getScrollSize().y!=I.getSize().y};var D;while(E!=document.body&&!B(E)){E=E.getParent()}var F=E.retrieve("fvScroller");if(!F&&window.Fx&&Fx.Scroll){F=new
  Fx.Scroll(E,{transition:"quad:out",offset:{y:-20}});E.store("fvScroller",F)}if(C){if(F){F.toElement(C)}else{E.scrollTo(E.getScroll().x,C.getPosition(E).y-20)}}}}});FormValidator.addAllThese([["validate-enforce-oncheck",{test:function(A,B){if(A.checked){var C=A.getParent("form").retrieve("validator");if(!C){return true}(B.toEnforce||$(B.enforceChildrenOf).getElements("input, select, textarea")).map(function(D){C.enforceField(D)})}return true}}],["validate-ignore-oncheck",{test:function(A,B){if(A.checked){var C=A.getParent("form").retrieve("validator");if(!C){return true}(B.toIgnore||$(B.ignoreChildrenOf).getElements("input, select, textarea")).each(function(D){C.ignoreField(D);C.resetField(D)})}return true}}],["validate-nospace",{errorMsg:function(){return FormValidator.getMsg("noSpace")},test:function(A,B){return !A.get("value").test(/\s/)}}],["validate-toggle-oncheck",{test:function(B,C){var D=B.getParent("form").retrieve("validator");if(!D){return true}var A=C.toToggle||$
 (C.toToggleChildrenOf).getElements("input, select, textarea");if(!B.checked){A.each(function(E){D.ignoreField(E);D.resetField(E)})}else{A.each(function(E){D.enforceField(E)})}return true}}],["validate-reqchk-bynode",{errorMsg:function(){return FormValidator.getMsg("reqChkByNode")},test:function(A,B){return($(B.nodeId).getElements(B.selector||"input[type=checkbox], input[type=radio]")).some(function(C){return C.checked})}}],["validate-required-check",{errorMsg:function(A,B){return B.useTitle?A.get("title"):FormValidator.getMsg("requiredChk")},test:function(A,B){return !!A.checked}}],["validate-reqchk-byname",{errorMsg:function(A,B){return FormValidator.getMsg("reqChkByName").substitute({label:B.label||A.get("type")})},test:function(B,D){var C=D.groupName||B.get("name");var A=$$(document.getElementsByName(C)).some(function(G,F){return G.checked});var E=B.getParent("form").retrieve("validator");if(A&&E){E.resetField(B)}return A}}],["validate-match",{errorMsg:function(A,B){retur
 n FormValidator.getMsg("match").substitute({matchName:B.matchName||$(B.matchInput).get("name")})},test:function(B,C){var D=B.get("value");var A=$(C.matchInput)&&$(C.matchInput).get("value");return D&&A?D==A:true}}],["validate-after-date",{errorMsg:function(A,B){return FormValidator.getMsg("afterDate").substitute({label:B.afterLabel||(B.afterElement?FormValidator.getMsg("startDate"):FormValidator.getMsg("currentDate"))})},test:function(B,C){var D=$(C.afterElement)?Date.parse($(C.afterElement).get("value")):new Date();var A=Date.parse(B.get("value"));return A&&D?A>=D:true}}],["validate-before-date",{errorMsg:function(A,B){return FormValidator.getMsg("beforeDate").substitute({label:B.beforeLabel||(B.beforeElement?FormValidator.getMsg("endDate"):FormValidator.getMsg("currentDate"))})},test:function(B,C){var D=Date.parse(B.get("value"));var A=$(C.beforeElement)?Date.parse($(C.beforeElement).get("value")):new Date();return A&&D?A>=D:true}}],["validate-custom-required",{errorMsg:fu
 nction(){return FormValidator.getMsg("required")},test:function(A,B){return A.get("value")!=B.emptyValue}}],["validate-same-month",{errorMsg:function(A,B){var C=$(B.sameMonthAs)&&$(B.sameMonthAs).get("value");var D=A.get("value");if(D!=""){return FormValidator.getMsg(C?"sameMonth":"startMonth")}},test:function(A,B){var D=Date.parse(A.get("value"));var C=Date.parse($(B.sameMonthAs)&&$(B.sameMonthAs).get("value"));return D&&C?D.format("%B")==C.format("%B"):true}}]]);var OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:["reposition","assert","focus"],options:{positionOptions:{position:"upperLeft",edge:"upperLeft",offset:{x:4,y:2}},poll:false,pollInterval:250},property:"OverText",initialize:function(B,A){this.element=$(B);if(this.occlude()){return this.occluded}this.setOptions(A);this.attach(this.element);OverText.instances.push(this);if(this.options.poll){this.poll()}return this},toElement:function(){return this.element},attach:function(){var A=this.options.t
 extOverride||this.element.get("alt")||this.element.get("title");if(!A){return }this.text=new Element("div",{"class":"overTxtDiv",styles:{lineHeight:"normal",position:"absolute"},html:A,events:{click:this.hide.pass(true,this)}}).inject(this.element,"after");this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert}).store("OverTextDiv",this.text);window.addEvent("resize",this.reposition.bind(this));this.assert();this.reposition()},startPolling:function(){this.pollingPaused=false;return this.poll()},poll:function(A){if(this.poller&&!A){return this}var B=function(){if(!this.pollingPaused){this.assert()}}.bind(this);if(A){$clear(this.poller)}else{this.poller=B.periodical(this.options.pollInterval,this)}return this},stopPolling:function(){this.pollingPaused=true;return this.poll(true)},focus:function(){if(!this.text.isDisplayed()||this.element.get("disabled")){return }this.hide()},hide:function(){if(this.text.isDisplayed()&&!this.element.get("disabled")){this.t
 ext.hide();this.fireEvent("textHide",[this.text,this.element]);this.pollingPaused=true;try{this.element.fireEvent("focus").focus()}catch(A){}}return this},show:function(){if(!this.text.isDisplayed()){this.text.show();this.reposition();this.fireEvent("textShow",[this.text,this.element]);this.pollingPaused=false}return this},assert:function(){this[this.test()?"show":"hide"]()},test:function(){var A=this.element.get("value");return !A},reposition:function(){try{this.assert();if(!this.element.getParent()||!this.element.offsetHeight){return this.hide()}if(this.test()){this.text.position($merge(this.options.positionOptions,{relativeTo:this.element}))}}catch(A){}return this}});OverText.instances=[];OverText.update=function(){return OverText.instances.map(function(A){if(A.element&&A.text){return A.reposition()}return null})};if(window.Fx&&Fx.Reveal){Fx.Reveal.implement({hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed, .overTxtDiv":false})}Fx.Elements=new Cl
 ass({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.subject=$$(B);this.parent(A)},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};for(var B in A){F[B]=this.parent(A[B],E[B],I)}}return C},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D],this.options.unit)}}return this},start:function(C){if(!this.check(C)){return this}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);A[B]=E.from;G[B]=E.to}}return this.parent(H,I)}});var Accordion=Fx.Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false,trigger:"click",initialDisplayFx:true},initialize:function(){var C=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(C.elements,C.options);this.togglers=$$(C.to
 gglers);this.container=$(C.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var B=0,A=this.togglers.length;B<A;B++){this.addSection(this.togglers[B],this.elements[B])}this.elements.each(function(E,D){if(this.options.show===D){this.fireEvent("active",[this.togglers[D],E])}else{for(var F in this.effects){E.setStyle(F,0)}}},this);if($chk(this.options.display)){this.display(this.options.display,this.options.initialDisplayFx)}},addSection:function(D,B){D=$(D);B=$(B);var E=this.togglers.contains(D);this.togglers.include(D);this.e
 lements.include(B);var A=this.togglers.indexOf(D);D.addEvent(this.options.trigger,this.display.bind(this,A));if(this.options.height){B.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){B.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}B.fullOpacity=1;if(this.options.fixedWidth){B.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){B.fullHeight=this.options.fixedHeight}B.setStyle("overflow","hidden");if(!E){for(var C in this.effects){B.setStyle(C,0)}}return this},display:function(A,B){B=$pick(B,true);A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this}this.previous=A;var C={};this.elements.each(function(F,E){C[E]={};var D=(E!=A)||(this.options.alwaysHide&&(F.offsetHeight>0));this.fireEvent(D?"background":"active",[this.togglers[E],F]);for(var G in this.effects){C[E][G
 ]=D?0:F[this.effects[G]]}},this);return B?this.start(C):this.set(C)}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(A){return this.parent(this.element.position($merge(this.options,A,{returnPos:true})))}});Element.Properties.move={set:function(A){var B=this.retrieve("move");if(B){B.cancel()}return this.eliminate("move").store("move:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("move")){if(A||!this.retrieve("move:options")){this.set("move",A)}this.store("move",new Fx.Move(this,this.retrieve("move:options")))}return this.retrieve("move")}};Element.implement({move:function(A){this.get("move").start(A);return this}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:fun
 ction(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true;this.showing=false;this.hidden=true;var D=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var F=(this.element.style.height===""||this.element.style.height=="auto");this.element.setStyle("display","block");if(this.options.transitionOpacity){D.opacity=1}var B={};$each(D,function(H,G){B[G]=[H,0]},this);var E=this.element.getStyle("overflow");this.element.setStyle("overflow","hidden");var A=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false;$each(D,function(H,G){D[G]=H},this);this.element.setStyles($merge({display:"none",overflow:E},D));if(F){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""}if(["width","both"].contains(this.options.mode)){this.element.style.width=""}}if(A){A.setStyle("visibility","visible")}}this.fireE
 vent("hide",this.element);this.callChain()}.bind(this));if(A){A.setStyle("visibility","hidden")}this.start(B)}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element)}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this))}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel();this.dissolve()}}}}catch(C){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element)}return this},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true;this.hiding=false;this.hidden=false;var F,D;this.element.measure(function(){F=(this.element.style.height===""||this.element.style.height=="auto");D=this.element.getComputedSize({styles:this.options.styles,mode:this.options.m
 ode})}.bind(this));$each(D,function(H,G){D[G]=H});if($chk(this.options.heightOverride)){D.height=this.options.heightOverride.toInt()}if($chk(this.options.widthOverride)){D.width=this.options.widthOverride.toInt()}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);D.opacity=1}var B={height:0,display:this.options.display};$each(D,function(H,G){B[G]=0});var E=this.element.getStyle("overflow");this.element.setStyles($merge(B,{overflow:"hidden"}));var A=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;if(A){A.setStyle("visibility","hidden")}this.start(D);this.$chain.unshift(function(){this.element.setStyle("overflow",E);if(!this.options.heightOverride&&F){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""}if(["width","both"].contains(this.options.mode)){this.element.style.width=""}}if(!this.hidden){this.showing=false}if(A){A.setStyle("visibility","visible")}this.callChain();this.fireEvent("show",this.e
 lement)}.bind(this))}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element)}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this))}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal()}}}}catch(C){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("show",this.element)}return this},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal()}else{this.dissolve()}return this}});Element.Properties.reveal={set:function(A){var B=this.retrieve("reveal");if(B){B.cancel()}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("reveal")){if(A||!this.retrieve("reveal:options")){this.set("reveal",A)}this
 .store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options")))}return this.retrieve("reveal")}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(A){this.get("reveal",A).reveal();return this},dissolve:function(A){this.get("reveal",A).dissolve();return this},nix:function(){var A=Array.link(arguments,{destroy:Boolean.type,options:Object.type});this.get("reveal",A.options).dissolve().chain(function(){this[A.destroy?"destroy":"dispose"]()}.bind(this));return this},wink:function(){var B=Array.link(arguments,{duration:Number.type,options:Object.type});var A=this.get("reveal",B.options);A.reveal().chain(function(){(function(){A.dissolve()}).delay(B.duration||2000)})}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);var D=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body)}var C=thi
 s.element;if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D)},true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D)},true)}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1])},compute:function(C,B,A){return[0,1].map(function(D){return Fx.compute(C[D],B[D],A)})},start:function(C,H){if(!this.check(C,H)){return this}var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A}else{D[G]=B[G]}D[G]+=this.options.offset[G]}return this.parent([B.x,B.y],[D.x,D.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(B){var A=$(B).getPosition(this.element);return this.start(A.x,A.y)}});Fx.Slide=new Class({
 Extends:Fx,options:{mode:"vertical"},initialize:function(B,A){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper)}},true);this.element=this.subject=$(B);this.parent(A);var C=this.element.retrieve("wrapper");this.wrapper=C||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},set:function(A){this.element.setStyle(this.margin,A[0]);this.wrapper.setStyle(this.layout,A[1]);return this},compute:function(C,B,A){return[0,1].map(function(D){return Fx.compute(C[D],B[D],A)})},start:function(B
 ,E){if(!this.check(B,E)){return this}this[E||this.options.mode]();var D=this.element.getStyle(this.margin).toInt();var C=this.wrapper.getStyle(this.layout).toInt();var A=[[D,C],[0,this.offset]];var G=[[D,C],[-this.offset,0]];var F;switch(B){case"in":F=A;break;case"out":F=G;break;case"toggle":F=(C==0)?A:G}return this.parent(F[0],F[1])},slideIn:function(A){return this.start("in",A)},slideOut:function(A){return this.start("out",A)},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(A){return this.start("toggle",A)}});Element.Properties.slide={set:function(B){var A=this.retrieve("slide");if(A){A.cancel()}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},B))},get:function(A){if(A||!this.retrieve("slide")){if(A||!this.retrieve("slide:options")){this.set("slide",A)}this.store("slide",new Fx.Slide(this
 ,this.retrieve("slide:options")))}return this.retrieve("slide")}};Element.implement({slide:function(D,E){D=D||"toggle";var B=this.get("slide"),A;switch(D){case"hide":B.hide(E);break;case"show":B.show(E);break;case"toggle":var C=this.retrieve("slide:flag",B.open);B[C?"slideOut":"slideIn"](E);this.store("slide:flag",!C);A=true;break;default:B.start(D,E)}if(!A){this.eliminate("slide:flag")}return this}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(B,C){C=C||document;this.doc=C.getDocument();var D=C.getWindow();this.parent(this.doc,B);this.links=this.options.links?$$(this.options.links):$$(this.doc.links);var A=D.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(F){if(F.href.indexOf(A)!=0){return }var E=F.href.substr(A.length);if(E){this.useLink(F,E)}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){D.location.hash=this.anchor},true)}},useLink:function(C,A){var B;C.addEvent("click",function(D){if(B!==false
 &&!B){B=$(A)||this.doc.getElement("a[name="+A+"]")}if(B){D.preventDefault();this.anchor=A;this.toElement(B);C.blur()}}.bind(this))}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(B,A){this.parent(B,A);this.elements.each(function(C){if(C.getStyle("position")=="static"){C.setStyle("position","relative")}});this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(B,A){return A})},sort:function(E){if($type(E)!="array"){return false}var I=0;var A=0;var H={};var D=this.options.mode=="vertical";var F=this.elements.map(function(M,J){var L=M.getComputedSize({styles:["border","padding","margin"]});var N;if(D){N={top:I,margin:L["margin-top"],height:L.totalHeight};I+=N.height-L["margin-top"]}else{N={left:A,margin:L["margin-left"],width:L.totalWidth};A+=N.width}var K=D?"top":"left";H[J]={};var O=M.getStyle(K).toInt();H[J][K]=O||0;return N},this);this.set(H);E=E.map(function(J){return J.toInt()});if(E.length!=t
 his.elements.length){this.currentOrder.each(function(J){if(!E.contains(J)){E.push(J)}});if(E.length>this.elements.length){E.splice(this.elements.length-1,E.length-this.elements.length)}}I=0;A=0;var B=0;var C={};E.each(function(L,J){var K={};if(D){K.top=I-F[L].top-B;I+=F[L].height}else{K.left=A-F[L].left;A+=F[L].width}B=B+F[L].margin;C[L]=K},this);var G={};$A(E).sort().each(function(J){G[J]=C[J]});this.start(G);this.currentOrder=E;return this},rearrangeDOM:function(A){A=A||this.currentOrder;var B=this.elements[0].getParent();var C=[];this.elements.setStyle("opacity",0);A.each(function(D){C.push(this.elements[D].inject(B).setStyles({top:0,left:0}))},this);this.elements.setStyle("opacity",1);this.elements=$$(C);this.setDefaultOrder();return this},getDefaultOrder:function(){return this.elements.map(function(B,A){return A})},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){retur
 n this.sort(this.currentOrder.reverse())},sortByElements:function(A){return this.sort(A.map(function(B){return this.elements.indexOf(B)},this))},swap:function(C,B){if($type(C)=="element"){C=this.elements.indexOf(C)}if($type(B)=="element"){B=this.elements.indexOf(B)}var A=$A(this.currentOrder);A[this.currentOrder.indexOf(C)]=B;A[this.currentOrder.indexOf(B)]=C;this.sort(A)}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=((A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"sel
 ectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(C){if(this.options.preventDefault){C.preventDefault()}this.mouse.start=C.page;this.fireEvent("beforeStart",this.element);var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt()}else{this.value.now[D]=this.element[this.options.modifiers[D]]}if(this.options.invert){this.value.now[D]*=-1}this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])()}}}}if($t
 ype(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop)},check:function(A){if(this.options.preventDefault){A.preventDefault()}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,A]).fireEvent("snap",this.element)}},drag:function(A){if(this.options.preventDefault){A.preventDefault()}this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]
 =this.limit[B][1]}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0]}}}if(this.options.grid[B]){this.value.now[B]-=((this.value.now[B]-this.limit[B][0])%this.options.grid[B])}if(this.options.style){this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)}else{this.element[this.options.modifiers[B]]=this.value.now[B]}}this.fireEvent("drag",[this.element,A])},cancel:function(A){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(A){this.fireEvent("complete",[this.element,A])}}});Element.implement({makeResizable:function(A){var B=new Drag(this,$
 merge({modifiers:{x:"width",y:"height"}},A));this.store("resizer",B);return B.addEvent("drag",function(){this.fireEvent("resize",B)}.bind(this))}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(C,B){this.parent(C,B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body)}var A=this.element.getStyle("position");if(A=="static"){A="absolute"}if([this.element.getStyle("left"),this.element.getStyle("top")].contains("auto")){this.element.position(this.element.getPosition(this.element.offsetParent))}this.element.setStyle("position",A);this.addEvent("start",this.checkDroppables,true);this.overed=null},start:function(F){if(this.container){var B=this.container.getCoordinates(this.element.getOffsetParent()),C={},E={};["top","right","bottom","left"]
 .each(function(G){C[G]=this.container.getStyle("border-"+G).toInt();E[G]=this.element.getStyle("margin-"+G).toInt()},this);var D=this.element.offsetWidth+E.left+E.right;var A=this.element.offsetHeight+E.top+E.bottom;if(this.options.includeMargins){$each(E,function(H,G){E[G]=0})}if(this.container==this.element.getOffsetParent()){this.options.limit={x:[0-E.left,B.right-C.left-C.right-D+E.right],y:[0-E.top,B.bottom-C.top-C.bottom-A+E.bottom]}}else{this.options.limit={x:[B.left+C.left-E.left,B.right-C.right-D+E.right],y:[B.top+C.top-E.top,B.bottom-C.bottom-A+E.bottom]}}}if(this.options.precalculate){this.positions=this.droppables.map(function(G){return G.getCoordinates()})}this.parent(F)},checkAgainst:function(C,B){C=(this.positions)?this.positions[B]:C.getCoordinates();var A=this.mouse.now;return(A.x>C.left&&A.x<C.right&&A.y<C.bottom&&A.y>C.top)},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=A){if(this.overed){this.fir
 eEvent("leave",[this.element,this.overed])}if(A){this.fireEvent("enter",[this.element,A])}this.overed=A}},drag:function(A){this.parent(A);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables()}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,A]);this.overed=null;return this.parent(A)}});Element.implement({makeDraggable:function(A){var B=new Drag.Move(this,A);this.store("dragger",B);return B}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(A){if(this.options.snap){A=this.toPosition(this.step)}this.knob.setStyle(this.property,A)},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(F,A,E){this.setOptions(E);this.element=$(F);this.knob=$(A);this.previousChange=this.previousEnd=this.step=-1;var G,B={},D={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="
 top";G="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";G="offsetWidth"}this.half=this.knob[G]/2;this.full=this.element[G]-this.knob[G]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);D[this.axis]=this.property;B[this.axis]=[-this.options.offset,this.full-this.options.offset];this.bound={clickedElement:this.clickedElement.bind(this),scrolledElement:this.scrolledElement.bindWithEvent(this),draggedKnob:this.draggedKnob.bind(this)};var C={snap:0,limit:B,modifiers:D,onDrag:this.bound.draggedKnob,onStart:this.bound.draggedKnob,onBeforeStart:(function(){this.isDragging=true}).bind(this)
 ,onComplete:function(){this.isDragging=false;this.draggedKnob();this.end()}.bind(this)};if(this.options.snap){C.grid=Math.ceil(this.stepWidth);C.limit[this.axis][1]=this.full}this.drag=new Drag(this.knob,C);this.attach()},attach:function(){this.element.addEvent("mousedown",this.bound.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.bound.scrolledElement)}this.drag.attach();return this},detach:function(){this.element.removeEvent("mousedown",this.bound.clickedElement);this.element.removeEvent("mousewheel",this.bound.scrolledElement);this.drag.detach();return this},set:function(A){if(!((this.range>0)^(A<this.min))){A=this.min}if(!((this.range>0)^(A>this.max))){A=this.max}this.step=Math.round(A);this.checkStep();this.fireEvent("tick",this.toPosition(this.step));this.end();return this},clickedElement:function(C){if(this.isDragging||C.target==this.knob){return }var B=this.range<0?-1:1;var A=C.page[this.axis]-this.element.getPosition()[this.axis]-this.
 half;A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();this.fireEvent("tick",A);this.end()},scrolledElement:function(A){var B=(this.options.mode=="horizontal")?(A.wheel<0):(A.wheel>0);this.set(B?this.step-this.stepSize:this.step+this.stepSize);A.stop()},draggedKnob:function(){var B=this.range<0?-1:1;var A=this.drag.value.now[this.axis];A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"")}},toStep:function(A){var B=(A+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(B-=B%this.stepSize):B},toPosition:function(A){return(this.full*Math.abs(this.min-A))/
 (this.steps*this.stepSize)-this.options.offset}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(A,B){this.setOptions(B);this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(A)||A));if(!this.options.clone){this.options.revert=false}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert))}},attach:function(){this.addLists(this.lists);return this},detach:function(){this.lists=this.removeLists(this.lists);return this},addItems:function(){Array.flatten(arguments).each(function(A){this.elements.push(A);var B=A.retrieve("sortables:start",this.start.bindWithEvent(this,A));(this.options.handle?A.getElement(this.options.handle)||A:A).addEvent("mousedown",B)},this);return this},addLists:function(){Array.flatten(arguments).each(function(A){this.lists.push(A);this.addItems(A.getChildren())},this);return this},remove
 Items:function(){return $$(Array.flatten(arguments).map(function(A){this.elements.erase(A);var B=A.retrieve("sortables:start");(this.options.handle?A.getElement(this.options.handle)||A:A).removeEvent("mousedown",B);return A},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(A){this.lists.erase(A);this.removeItems(A.getChildren());return A},this))},getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body)}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list)}return A.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width")}).inject(this.list).position(A.getPosition(A.getOffsetParent()))},getDroppables:function(){var A=this.list.getChildren();if(!this.options.constrain){A=this.lists.concat(A).erase(this.list)}return A.erase(this.clone).erase(this.element)},insert:function(C,B){var A="inside";if(this.lists.contains(B)){this.list=B
 ;this.drag.droppables=this.getDroppables()}else{A=this.element.getAllPrevious().contains(B)?"before":"after"}this.element.inject(B,A);this.fireEvent("sort",[this.element,this.clone])},start:function(B,A){if(!this.idle){return }this.idle=false;this.element=A;this.opacity=A.get("opacity");this.list=A.getParent();this.clone=this.getClone(B,A);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){B.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(B)},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var A=this.element.getStyles("width","height");var B=this.clone.c
 omputePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:B.top,left:B.left,width:A.width,height:A.height,opacity:0.25}).chain(this.reset.bind(this))}else{this.reset()}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element)},serialize:function(){var C=Array.link(arguments,{modifier:Function.type,index:$defined});var B=this.lists.map(function(D){return D.getChildren().map(C.modifier||function(E){return E.get("id")},this)},this);var A=C.index;if(this.lists.length==1){A=0}return $chk(A)&&A>=0&&A<this.lists.length?B[A]:B}});Request.JSONP=new Class({Implements:[Chain,Events,Options,Log],options:{url:"",data:{},retries:0,timeout:0,link:"ignore",callbackKey:"callback",injectScript:document.head},initialize:function(A){this.setOptions(A);this.running=false;this.requests=0;this.triesRemaining=[]},check:function(){if(!this.running){return true}switch(this.options.link){case"cancel":thi
 s.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},send:function(C){if(!$chk(arguments[1])&&!this.check(C)){return this}var E=$type(C),A=this.options,B=$chk(arguments[1])?arguments[1]:this.requests++;if(E=="string"||E=="element"){C={data:C}}C=$extend({data:A.data,url:A.url},C);if(!$chk(this.triesRemaining[B])){this.triesRemaining[B]=this.options.retries}var D=this.triesRemaining[B];(function(){var F=this.getScript(C);this.log("JSONP retrieving script with url: "+F.get("src"));this.fireEvent("request",F);this.running=true;(function(){if(D){this.triesRemaining[B]=D-1;if(F){F.destroy();this.request(C,B);this.fireEvent("retry",this.triesRemaining[B])}}else{if(F&&this.options.timeout){F.destroy();this.cancel();this.fireEvent("failure")}}}).delay(this.options.timeout,this)}).delay(Browser.Engine.trident?50:0,this);return this},cancel:function(){if(!this.running){return this}this.running=false;this.fireEvent("cancel");return t
 his},getScript:function(C){var B=Request.JSONP.counter,D;Request.JSONP.counter++;switch($type(C.data)){case"element":D=$(C.data).toQueryString();break;case"object":case"hash":D=Hash.toQueryString(C.data)}var E=C.url+(C.url.test("\\?")?"&":"?")+(C.callbackKey||this.options.callbackKey)+"=Request.JSONP.request_map.request_"+B+(D?"&"+D:"");if(E.length>2083){this.log("JSONP "+E+" will fail in Internet Explorer, which enforces a 2083 bytes length limit on URIs")}var A=new Element("script",{type:"text/javascript",src:E});Request.JSONP.request_map["request_"+B]=function(F){this.success(F,A)}.bind(this);return A.inject(this.options.injectScript)},success:function(B,A){if(A){A.destroy()}this.running=false;this.log("JSONP successfully retrieved: ",B);this.fireEvent("complete",[B]).fireEvent("success",[B]).callChain()}});Request.JSONP.counter=0;Request.JSONP.request_map={};Request.Queue=new Class({Implements:[Options,Events],Binds:["attach","request","complete","cancel","success","fail
 ure","exception"],options:{stopOnFailure:true,autoAdvance:true,concurrent:1,requests:{}},initialize:function(A){this.setOptions(A);this.requests=new Hash;this.addRequests(this.options.requests);this.queue=[];this.reqBinders={}},addRequest:function(A,B){this.requests.set(A,B);this.attach(A,B);return this},addRequests:function(A){$each(A,this.addRequest,this);return this},getName:function(A){return this.requests.keyOf(A)},attach:function(A,B){if(B._groupSend){return this}["request","complete","cancel","success","failure","exception"].each(function(C){if(!this.reqBinders[A]){this.reqBinders[A]={}}this.reqBinders[A][C]=function(){this["on"+C.capitalize()].apply(this,[A,B].extend(arguments))}.bind(this);B.addEvent(C,this.reqBinders[A][C])},this);B._groupSend=B.send;B.send=function(C){this.send(A,C);return B}.bind(this);return this},removeRequest:function(B){var A=$type(B)=="object"?this.getName(B):B;if(!A&&$type(A)!="string"){return this}B=this.requests.get(A);if(!B){return this}
 ["request","complete","cancel","success","failure","exception"].each(function(C){B.removeEvent(C,this.reqBinders[A][C])},this);B.send=B._groupSend;delete B._groupSend;return this},getRunning:function(){return this.requests.filter(function(A){return A.running})},isRunning:function(){return !!this.getRunning().getKeys().length},send:function(B,A){var C=function(){this.requests.get(B)._groupSend(A);this.queue.erase(C)}.bind(this);C.name=B;if(this.getRunning().getKeys().length>=this.options.concurrent||(this.error&&this.options.stopOnFailure)){this.queue.push(C)}else{C()}return this},hasNext:function(A){return(!A)?!!this.queue.length:!!this.queue.filter(function(B){return B.name==A}).length},resume:function(){this.error=false;(this.options.concurrent-this.getRunning().getKeys().length).times(this.runNext,this);return this},runNext:function(A){if(!this.queue.length){return this}if(!A){this.queue[0]()}else{var B;this.queue.each(function(C){if(!B&&C.name==A){B=true;C()}})}return th
 is},runAll:function(){this.queue.each(function(A){A()});return this},clear:function(A){if(!A){this.queue.empty()}else{this.queue=this.queue.map(function(B){if(B.name!=A){return B}else{return false}}).filter(function(B){return B})}return this},cancel:function(A){this.requests.get(A).cancel();return this},onRequest:function(){this.fireEvent("request",arguments)},onComplete:function(){this.fireEvent("complete",arguments)},onCancel:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("cancel",arguments)},onSuccess:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("success",arguments)},onFailure:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("failure",arguments)},onException:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("exception",arguments)}});Request.implement({options:{initialDel
 ay:5000,delay:5000,limit:60000},startTimer:function(B){var A=(function(){if(!this.running){this.send({data:B})}});this.timer=A.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(C){$clear(this.timer);if(C){this.lastDelay=this.options.delay}else{this.lastDelay=(this.lastDelay+this.options.delay).min(this.options.limit)}this.timer=A.delay(this.lastDelay,this)};this.addEvent("complete",this.completeCheck);return this},stopTimer:function(){$clear(this.timer);this.removeEvent("complete",this.completeCheck);return this}});var Asset={javascript:function(F,D){D=$extend({onload:$empty,document:document,check:$lambda(true)},D);var B=new Element("script",{src:F,type:"text/javascript"});var E=D.onload.bind(B),A=D.check,G=D.document;delete D.onload;delete D.check;delete D.document;B.addEvents({load:E,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){E()}}}).set(D);if(Browser.Engine.webkit419){var C=(fun
 ction(){if(!$try(A)){return }$clear(C);E()}).periodical(50)}return B.inject(G.head)},css:function(B,A){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:B},A)).inject(document.head)},image:function(C,B){B=$merge({onload:$empty,onabort:$empty,onerror:$empty},B);var D=new Image();var A=$(D)||new Element("img");["load","abort","error"].each(function(E){var F="on"+E;var G=B[F];delete B[F];D[F]=function(){if(!D){return }if(!A.parentNode){A.width=D.width;A.height=D.height}D=D.onload=D.onabort=D.onerror=null;G.delay(1,A,A);A.fireEvent(E,A,1)}});D.src=A.src=C;if(D&&D.complete){D.onload.delay(1)}return A.set(B)},images:function(D,C){C=$merge({onComplete:$empty,onProgress:$empty},C);D=$splat(D);var A=[];var B=0;return new Elements(D.map(function(E){return Asset.image(E,{onload:function(){C.onProgress.call(this,B,D.indexOf(E));B++;if(B==D.length){C.onComplete()}}})}))}};var Color=new Native({initialize:function(B,C){if(arguments.length>=3){C="rgb";B
 =Array.slice(arguments,0,3)}else{if(typeof B=="string"){if(B.match(/rgb/)){B=B.rgbToHex().hexToRgb(true)}else{if(B.match(/hsb/)){B=B.hsbToRgb()}else{B=B.hexToRgb(true)}}}}C=C||"rgb";switch(C){case"hsb":var A=B;B=B.hsbToRgb();B.hsb=A;break;case"hex":B=B.hexToRgb(true);break}B.rgb=B.slice(0,3);B.hsb=B.hsb||B.rgbToHsb();B.hex=B.rgbToHex();return $extend(B,this)}});Color.implement({mix:function(){var A=Array.slice(arguments);var C=($type(A.getLast())=="number")?A.pop():50;var B=this.slice();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C))}});return new Color(B,"rgb")},invert:function(){return new Color(this.map(function(A){return 255-A}))},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb")},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb")}});var $RGB=function(C,B,A){return new Color([C,B,A],"rgb")};
 var $HSB=function(C,B,A){return new Color([C,B,A],"hsb")};var $HEX=function(A){return new Color(A,"hex")};Array.implement({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A}else{if(C==I){G=2+D-L}else{G=4+A-D}}G/=6;if(G<0){G++}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)]},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C]}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D]}}return false}});String.implement({rgbToHsb:function(){var A=this.match(/\d{1,3}/g);return(A)?A.rgbT
 oHsb():null},hsbToRgb:function(){var A=this.match(/\d{1,3}/g);return(A)?A.hsbToRgb():null}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={}},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false}else{this.events[B].push(A)}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]))},this);return this},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false},this);if(!D){return }this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A)},this)}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(B,A){this.parent(B,A);this.load()},save:function(){var A=JSON.encode(this.hash);if(!A||A.length>4096){return false}if(A=="{}"){this.dispose()}else{this.write(A)}return true},load:function(){this.hash=new
  Hash(JSON.decode(this.read(),true));return this}});Hash.each(Hash.prototype,function(B,A){if(typeof B=="function"){Hash.Cookie.implement(A,function(){var C=B.apply(this.hash,arguments);if(this.options.autoSave){this.save()}return C})}});var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:true||(Browser.Engine.trident4||(Browser.Engine.gecko&&!Browser.Engine.gecko19&&Browser.Platform.mac))},property:"IframeShim",initialize:function(B,A){this.element=$(B);if(this.occlude()){return this.occluded}this.setOptions(A);this.makeShim();return this},makeShim:function(){if(this.options.browsers){var C=this.element.getStyle("zIndex").toInt();if(!C){var B=this.element.getStyle("position");if(B=="static"||!B){this.element.setStyle("position","relative")}this.element.setStyle("zIndex",C||1)}C=($chk(this.options.zIndex)&&C>this.options.zIndex)?this.options.zIndex:C-1;if(C<0){C=1}thi
 s.shim=new Element("iframe",{src:(window.location.protocol=="https")?"://0":"javascript:void(0)",scrolling:"no",frameborder:0,styles:{zIndex:C,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this);var A=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject")}).bind(this);if(Browser.Engine.trident&&!IframeShim.ready){window.addEvent("load",A)}else{A()}}else{this.position=this.hide=this.show=this.dispose=$lambda(this)}},position:function(){if(!IframeShim.ready){return this}var A=this.element.measure(function(){return this.getSize()});if($type(this.options.margin)){A.x=A.x-(this.options.margin*2);A.y=A.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin}if(this.shim){this.shim.set({width:A.x,height:A.y}).position({relativeTo:this.element,offset:this.op
 tions.offset})}return this},hide:function(){if(this.shim){this.shim.setStyle("display","none")}return this},show:function(){if(this.shim){this.shim.setStyle("display","block")}return this.position()},dispose:function(){if(this.shim){this.shim.dispose()}return this},destroy:function(){if(this.shim){this.shim.destroy()}return this}});window.addEvent("load",function(){IframeShim.ready=true});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B)},fps:50},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.listener=($type(this.element)!="element")?$(this.element.getDocument().body):this.element;this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)}},start:function(){this.listener.addEvents({mouseenter:this.bound.attach,mouseleave:this.bound.detach})},stop:function(){this.listener.removeEvents({mouseenter:this.bound.attach
 ,mouseleave:this.bound.detach});this.timer=$clear(this.timer)},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords)},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords);this.timer=$clear(this.timer)},getCoords:function(A){this.page=(this.listener.get("tag")=="body")?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this)}},scroll:function(){var B=this.element.getSize(),A=this.element.getScroll(),F=this.element.getOffsets(),C=this.element.getScrollSize(),E={x:0,y:0};for(var D in this.page){if(this.page[D]<(this.options.area+F[D])&&A[D]!=0){E[D]=(this.page[D]-this.options.area-F[D])*this.options.velocity}else{if(this.page[D]+this.options.area>(B[D]+F[D])&&A[D]+B[D]!=C[D]){E[D]=(this.page[D]-B[D]+this.options.area-F[D])*this.options.velocity}}}if(E.y||E.x){this.fireEvent("change",[A.x+E.x,A.y+E.y])}}});var Tips=new Class({Implements:[Events,Options],options:{onShow:function(A){A.se
 tStyle("visibility","visible")},onHide:function(A){A.setStyle("visibility","hidden")},title:"title",text:function(A){return A.get("rel")||A.get("href")},showDelay:100,hideDelay:100,className:null,offset:{x:16,y:16},fixed:false},initialize:function(){var A=Array.link(arguments,{options:Object.type,elements:$defined});if(A.options&&A.options.offsets){A.options.offset=A.options.offsets}this.setOptions(A.options);this.container=new Element("div",{"class":"tip"});this.tip=this.getTip();if(A.elements){this.attach(A.elements)}},getTip:function(){return new Element("div",{"class":this.options.className,styles:{visibility:"hidden",display:"none",position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body)},attach:function(B){var A=function(D,C){if(D==null){return""}return $type(D)=="function"?D(C):C.get(D)};$$(B).each(function(D){var E=A(this.options.title,D);D.erase("title").store("ti
 p:native",E).retrieve("tip:title",E);D.retrieve("tip:text",A(this.options.text,D));var C=["enter","leave"];if(!this.options.fixed){C.push("move")}C.each(function(F){D.addEvent("mouse"+F,D.retrieve("tip:"+F,this["element"+F.capitalize()].bindWithEvent(this,D)))},this)},this);return this},detach:function(A){$$(A).each(function(C){["enter","leave","move"].each(function(D){C.removeEvent("mouse"+D,C.retrieve("tip:"+D)||$empty)});C.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");if($type(this.options.title)=="string"&&this.options.title=="title"){var B=C.retrieve("tip:native");if(B){C.set("title",B)}}},this);return this},elementEnter:function(B,A){$A(this.container.childNodes).each(Element.dispose);["title","text"].each(function(D){var C=A.retrieve("tip:"+D);if(!C){return }this[D+"Element"]=new Element("div",{"class":"tip-"+D}).inject(this.container);this.fill(this[D+"Element"],C)},this);this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.show
 Delay,this,A);this.tip.setStyle("display","block");this.position((!this.options.fixed)?B:{page:A.getPosition()})},elementLeave:function(B,A){$clear(this.timer);this.tip.setStyle("display","none");this.timer=this.hide.delay(this.options.hideDelay,this,A)},elementMove:function(A){this.position(A)},position:function(D){var B=window.getSize(),A=window.getScroll(),E={x:this.tip.offsetWidth,y:this.tip.offsetHeight},C={x:"left",y:"top"},F={};for(var G in C){F[C[G]]=D.page[G]+this.options.offset[G];if((F[C[G]]+E[G]-A[G])>B[G]){F[C[G]]=D.page[G]-this.options.offset[G]-E[G]}}this.tip.setStyles(F)},fill:function(A,B){if(typeof B=="string"){A.set("html",B)}else{A.adopt(B)}},show:function(A){this.fireEvent("show",[this.tip,A])},hide:function(A){this.fireEvent("hide",[this.tip,A])}});MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday
 ","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(A){return(A>3&&A<21)?"th":["th","st","nd","rd","th"][Math.min(A%10,4)]},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now"});MooTools.lang.set("en-US","FormValidator",{required:"This field is required.",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in t
 his field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").',digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use letters only (a-z) with in this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred at domain.com".',url:"Please enter a valid URL such as http://www.google.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: ",noSpace:"There c
 an be no spaces in this input.",reqChkByNode:"No items are selected.",requiredChk:"This field is required.",reqChkByName:"Please select a {label}.",match:"This field needs to match the {matchName} field",startDate:"the start date",endDate:"the end date",currendDate:"the current date",afterDate:"The date should be the same or after {label}.",beforeDate:"The date should be the same or before {label}.",startMonth:"Please select a start month",sameMonth:"These two dates must be in the same month - you must change one or the other."});window.addEvent("load",function(){if(!("console" in window)||!("firebug" in window.console)){var B=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var A=0;A<B.length;++A){window.console[B[A]]=function(){}}}});Class.Mutators.Family=function(A,B){if($defined(B)){A.$family={name:B};$[B]=$.object;return A}else{this.implement("$family",{name:A})
 }};if(typeof Jx=="undefined"){var Jx={};(function(){var C=document.getElementsByTagName("SCRIPT");for(var A=0;A<C.length;A++){var B=C[A].src;var D=/(.*[jx|js|lib])\/jxlib(.*)/.exec(B);if(D&&D[0]){Jx.aPixel=document.createElement("img",{alt:"",title:""});Jx.aPixel.src=D[1]+"/a_pixel.png";Jx.baseURL=Jx.aPixel.src.substring(0,Jx.aPixel.src.indexOf("a_pixel.png"))}}var E=C[0].src;if(E.contains("app:")){Jx.isAir=true}else{Jx.isAir=false}})()}Jx.applyPNGFilter=function(C){var A=Jx.aPixel.src;if(C.src!=A){var B=C.src;C.src=A;C.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B+"',sizingMethod='scale')"}};Jx.imgQueue=[];Jx.imgLoaded={};Jx.imagesLoading=0;Jx.addToImgQueue=function(A){if(Jx.imgLoaded[A.src]){A.element.src=A.src}else{Jx.imgQueue.push(A);Jx.imgLoaded[A.src]=true}Jx.checkImgQueue()};Jx.checkImgQueue=function(){while(Jx.imagesLoading<2&&Jx.imgQueue.length>0){Jx.loadNextImg()}};Jx.loadNextImg=function(){var A=Jx.imgQueue.shift();if(A){++Jx.ima
 gesLoading;A.element.onload=function(){--Jx.imagesLoading;Jx.checkImgQueue()};A.element.onerror=function(){--Jx.imagesLoading;Jx.checkImgQueue()};A.element.src=A.src}};Jx.createIframeShim=function(){return new Element("iframe",{"class":"jxIframeShim",scrolling:"no",frameborder:0})};Jx.getNumber=function(C,B){var A=C===null||isNaN(parseInt(C,10))?(B||0):parseInt(C,10);return A};Jx.getPageDimensions=function(){return{width:window.getWidth(),height:window.getHeight()}};Element.implement({getBoxSizing:function(){var B="content-box";if(Browser.Engine.trident||Browser.Engine.presto){var A=document.compatMode;if(A=="BackCompat"||A=="QuirksMode"){B="border-box"}else{B="content-box"}}else{if(arguments.length===0){node=document.documentElement}var C=this.getStyle("-moz-box-sizing");if(!C){C=this.getStyle("box-sizing")}B=(C?C:"content-box")}return B},getContentBoxSize:function(){var A=this.offsetWidth;var C=this.offsetHeight;var D=this.getPaddingSize();var B=this.getBorderSize();A=A-D.
 left-D.right-B.left-B.right;C=C-D.bottom-D.top-B.bottom-B.top;return{width:A,height:C}},getBorderBoxSize:function(){var A=this.offsetWidth;var B=this.offsetHeight;return{width:A,height:B}},getMarginBoxSize:function(){var C=this.getMarginSize();var A=this.offsetWidth+C.left+C.right;var B=this.offsetHeight+C.top+C.bottom;return{width:A,height:B}},setContentBoxSize:function(C){if(this.getBoxSizing()=="border-box"){var E=this.getPaddingSize();var B=this.getBorderSize();if(typeof C.width!="undefined"){var D=(C.width+E.left+E.right+B.left+B.right);if(D<0){D=0}this.style.width=D+"px"}if(typeof C.height!="undefined"){var A=(C.height+E.top+E.bottom+B.top+B.bottom);if(A<0){A=0}this.style.height=A+"px"}}else{if(typeof C.width!="undefined"){this.style.width=C.width+"px"}if(typeof C.height!="undefined"){this.style.height=C.height+"px"}}},setBorderBoxSize:function(C){if(this.getBoxSizing()=="content-box"){var F=this.getPaddingSize();var B=this.getBorderSize();var E=this.getMarginSize();if
 (typeof C.width!="undefined"){var D=(C.width-F.left-F.right-B.left-B.right-E.left-E.right);if(D<0){D=0}this.style.width=D+"px"}if(typeof C.height!="undefined"){var A=(C.height-F.top-F.bottom-B.top-B.bottom-E.top-E.bottom);if(A<0){A=0}this.style.height=A+"px"}}else{if(typeof C.width!="undefined"&&C.width>=0){this.style.width=C.width+"px"}if(typeof C.height!="undefined"&&C.height>=0){this.style.height=C.height+"px"}}},getPaddingSize:function(){var B=Jx.getNumber(this.getStyle("padding-left"));var C=Jx.getNumber(this.getStyle("padding-top"));var D=Jx.getNumber(this.getStyle("padding-right"));var A=Jx.getNumber(this.getStyle("padding-bottom"));return{left:B,top:C,right:D,bottom:A}},getBorderSize:function(){var B=Jx.getNumber(this.getStyle("border-left-width"));var C=Jx.getNumber(this.getStyle("border-top-width"));var D=Jx.getNumber(this.getStyle("border-right-width"));var A=Jx.getNumber(this.getStyle("border-bottom-width"));return{left:B,top:C,right:D,bottom:A}},getMarginSize:fu
 nction(){var B=Jx.getNumber(this.getStyle("margin-left"));var C=Jx.getNumber(this.getStyle("margin-top"));var D=Jx.getNumber(this.getStyle("margin-right"));var A=Jx.getNumber(this.getStyle("margin-bottom"));return{left:B,top:C,right:D,bottom:A}},descendantOf:function(B){var A=$(this.parentNode);while(A!=B&&A&&A.parentNode&&A.parentNode!=A){A=$(A.parentNode)}return A==B},findElement:function(B){var C=this;var A=C.tagName;while(C.tagName!=B&&C&&C.parentNode&&C.parentNode!=C){C=$(C.parentNode)}return C.tagName==B?C:false}});Jx.ContentLoader=new Class({contentIsLoaded:false,loadContent:function(A){A=$(A);if(this.options.content){var C;if(this.options.content.domObj){C=$(this.options.content.domObj)}else{C=$(this.options.content)}if(C){if(this.options.content.addTo){this.options.content.addTo(A)}else{A.appendChild(C)}this.contentIsLoaded=true}else{A.innerHTML=this.options.content;this.contentIsLoaded=true}}else{if(this.options.contentURL){this.contentIsLoaded=false;this.req=new R
 equest({url:this.options.contentURL,method:"get",evalScripts:true,onSuccess:(function(D){A.innerHTML=D;this.contentIsLoaded=true;if(Jx.isAir){$clear(this.reqTimeout)}this.fireEvent("contentLoaded",this)}).bind(this),onFailure:(function(){this.contentIsLoaded=true;this.fireEvent("contentLoadFailed",this)}).bind(this),headers:{"If-Modified-Since":"Sat, 1 Jan 2000 00:00:00 GMT"}});this.req.send();if(Jx.isAir){var B=$defined(this.options.timeout)?this.options.timeout:10000;this.reqTimeout=this.checkRequest.delay(B,this)}}else{this.contentIsLoaded=true}}if(this.options.contentId){A.id=this.options.contentId}if(this.contentIsLoaded){this.fireEvent("contentLoaded",this)}},processContent:function(A){$A(A.childNodes).each(function(B){if(B.tagName=="INPUT"||B.tagName=="SELECT"||B.tagName=="TEXTAREA"){if(B.type=="button"){B.addEvent("click",function(){this.fireEvent("click",this,B)})}else{B.addEvent("change",function(){this.fireEvent("change",B)})}}else{if(B.childNodes){this.processCon
 tent(B)}}},this)}});if(Jx.isAir){Jx.ContentLoader.implement({checkRequest:function(){if(this.req.xhr.readyState===1){$clear(this.reqTimeout);this.req.cancel();this.contentIsLoaded=true;this.fireEvent("contentLoadFailed",this)}}})}Jx.AutoPosition=new Class({position:function(G,C,P){G=$(G);C=$(C);var B=$splat(P.horizontal||["center center"]);var H=$splat(P.vertical||["center center"]);var F=$merge({top:0,right:0,bottom:0,left:0},P.offsets||{});var M=C.getCoordinates();var J;var L;if(!$(G.parentNode)||G.parentNode==document.body){J=Jx.getPageDimensions();L=$(document.body).getScroll()}else{J=$(G.parentNode).getContentBoxSize();L=$(G.parentNode).getScroll()}if(C==document.body){M.left+=L.x;M.top+=L.y}else{if(G.parentNode==C){M.left=0;M.top=0}}var O=G.getMarginBoxSize();var E;var N;var K;var A;var D;if(!B.some(function(Q){var R=Q.split(" ");if(R.length!=2){return false}if(!isNaN(parseInt(R[0],10))){D=parseInt(R[0],10);if(D>=0){E=D}else{E=M.left+M.width+D}}else{switch(R[0]){case"r
 ight":E=M.left+M.width;break;case"center":E=M.left+Math.round(M.width/2);break;case"left":default:E=M.left;break}}if(!isNaN(parseInt(R[1],10))){D=parseInt(R[1],10);if(D<0){N=E+D;E=N-O.width}else{E+=D;N=E+O.width}N=M.left+M.width+parseInt(R[1],10);E=N-O.width}else{switch(R[1]){case"left":E-=F.left;N=E+O.width;break;case"right":E+=F.right;N=E;E=E-O.width;break;case"center":default:E=E-Math.round(O.width/2);N=E+O.width;break}}return(E>=L.x&&N<=L.x+J.width)})){if(N>J.width){E=L.x+J.width-O.width}if(E<0){E=0}}G.setStyle("left",E);if(!H.some(function(Q){var R=Q.split(" ");if(R.length!=2){return false}if(!isNaN(parseInt(R[0],10))){K=parseInt(R[0],10)}else{switch(R[0]){case"bottom":K=M.top+M.height;break;case"center":K=M.top+Math.round(M.height/2);break;case"top":default:K=M.top;break}}if(!isNaN(parseInt(R[1],10))){var S=parseInt(R[1],10);if(S>=0){K+=S;A=K+O.height}else{A=K+S;K=A-O.height}}else{switch(R[1]){case"top":K-=F.top;A=K+O.height;break;case"bottom":K+=F.bottom;A=K;K=K-O.hei
 ght;break;case"center":default:K=K-Math.round(O.height/2);A=K+O.height;break}}return(K>=L.y&&A<=L.y+J.height)})){if(A>J.height){K=L.y+J.height-O.height}if(K<0){K=0}}G.setStyle("top",K);var I=G.retrieve("jxLayout");if(I){I.options.left=E;I.options.top=K}}});Jx.Chrome=new Class({chrome:null,makeChrome:function(A){var C=new Element("div",{"class":"jxChrome",events:{contextmenu:function(D){D.stop()}}});A.adopt(C);this.chromeOffsets=C.getPaddingSize();C.setStyle("padding",0);var B=C.getStyle("backgroundImage");if(!(B.contains("http://")||B.contains("https://")||B.contains("file://")||B.contains("app:/"))){B=null}else{B=B.slice(4,-1);if(B.charAt(0)=='"'){B=B.slice(1,-1)}C.setStyle("backgroundImage","none");["TR","TL","BL","BR"].each(function(D){C.adopt(new Element("div",{"class":"jxChrome"+D}).adopt(new Element("img",{"class":"png24",src:B,alt:"",title:""})))},this)}if(!window.opera){C.adopt(Jx.createIframeShim())}C.dispose();this.chrome=C},showChrome:function(A){A=$(A);if(!this.c
 hrome){this.makeChrome(A)}this.resizeChrome(A);if(A&&this.chrome.parentNode!==A){A.adopt(this.chrome)}},hideChrome:function(){if(this.chrome){this.chrome.dispose()}},resizeChrome:function(A){if(this.chrome&&Browser.Engine.trident4){this.chrome.setContentBoxSize($(A).getBorderBoxSize())}}});Jx.Addable=new Class({addable:null,addTo:function(A,B){$(this.addable||this.domObj).inject(A,B);this.fireEvent("addTo",this);return this},toElement:function(){return this.addable||this.domObj}});Jx.Button=new Class({Family:"Jx.Button",Implements:[Options,Events,Jx.Addable],domObj:null,options:{id:"",type:"Button",image:"",tooltip:"",label:"",toggle:false,toggleClass:"Toggle",halign:"center",valign:"middle",active:false,enabled:true,container:"div"},initialize:function(D){this.setOptions(D);var H=new Element(this.options.container,{"class":"jx"+this.options.type+"Container"});if(this.options.toggle&&this.options.toggleClass){H.addClass("jx"+this.options.type+this.options.toggleClass)}var G;
 var A;var C=new Element("a",{"class":"jx"+this.options.type,href:"javascript:void(0)",title:this.options.tooltip,alt:this.options.tooltip,events:{click:this.clicked.bindWithEvent(this),drag:(function(I){I.stop()}).bindWithEvent(this),mousedown:(function(I){this.domA.addClass("jx"+this.options.type+"Pressed");G=true;A=true;this.focus()}).bindWithEvent(this),mouseup:(function(I){this.domA.removeClass("jx"+this.options.type+"Pressed");A=false}).bindWithEvent(this),mouseleave:(function(I){this.domA.removeClass("jx"+this.options.type+"Pressed")}).bindWithEvent(this),mouseenter:(function(I){if(G&&A){this.domA.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keydown:(function(I){if(I.key=="enter"){this.domA.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keyup:(function(I){if(I.key=="enter"){this.domA.removeClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),blur:function(){G=false}}});H.adopt(C);if(typeof Drag!="undefined"){new Drag(C,
 {onStart:function(){this.stop()}})}var F=new Element("span",{"class":"jx"+this.options.type+"Content"});C.adopt(F);if(this.options.image||!this.options.label){var E=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,title:this.options.tooltip,alt:this.options.tooltip});if(this.options.image&&this.options.image.indexOf("a_pixel.png")==-1){E.setStyle("backgroundImage","url("+this.options.image+")")}F.appendChild(E);if(this.options.imageClass){E.addClass(this.options.imageClass)}this.domImg=E}var B=new Element("span",{html:this.options.label});if(this.options.label){B.addClass("jx"+this.options.type+"Label")}F.appendChild(B);if(this.options.id){H.id=this.options.id}if(this.options.halign=="left"){H.addClass("jx"+this.options.type+"ContentLeft")}if(this.options.valign=="top"){H.addClass("jx"+this.options.type+"ContentTop")}this.domA=C;this.domLabel=B;this.domObj=H;this.setEnabled(this.options.enabled);if(this.options.active){this.options.active=false;this
 .setActive(true)}},clicked:function(A){if(this.options.enabled){if(this.options.toggle){this.setActive(!this.options.active)}else{this.fireEvent("click",{obj:this,event:A})}}},isEnabled:function(){return this.options.enabled},setEnabled:function(A){this.options.enabled=A;if(this.options.enabled){this.domObj.removeClass("jxDisabled")}else{this.domObj.addClass("jxDisabled")}},isActive:function(){return this.options.active},setActive:function(A){if(this.options.active==A){return }this.options.active=A;if(this.options.active){this.domA.addClass("jx"+this.options.type+"Active");this.fireEvent("down",this)}else{this.domA.removeClass("jx"+this.options.type+"Active");this.fireEvent("up",this)}},setImage:function(B){this.options.image=B;if(B){if(!this.domImg){var A=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.imageClass){A.addClass(this.options.imageClass)}this.domA.firstChild.grab(A,"top");this.domImg=A}this.domImg.setS
 tyle("backgroundImage","url("+this.options.image+")")}else{if(this.domImg){this.domImg.dispose();this.domImg=null}}},setLabel:function(A){this.domLabel.set("html",A);if(!A&&this.domLabel.hasClass("jxButtonLabel")){this.domLabel.removeClass("jxButtonLabel")}else{if(A&&!this.domLabel.hasClass("jxButtonLabel")){this.domLabel.addClass("jxButtonLabel")}}},getLabel:function(){return this.domLabel?this.domLabel.innerHTML:""},setTooltip:function(A){if(this.domA){this.domA.set({title:A,alt:A})}},focus:function(){this.domA.focus()},blur:function(){this.domA.blur()}});Jx.Button.Flyout=new Class({Family:"Jx.Button.Flyout",Extends:Jx.Button,Implements:[Jx.ContentLoader,Jx.AutoPosition,Jx.Chrome],content:null,initialize:function(A){if(!Jx.Button.Flyout.Stack){Jx.Button.Flyout.Stack=[]}this.parent(A);this.domA.addClass("jx"+this.options.type+"Flyout");this.contentContainer=new Element("div",{"class":"jxFlyout"});this.content=new Element("div",{"class":"jxFlyoutContent"});if(this.options.co
 ntentClass){this.content.addClass(this.options.contentClass)}this.contentContainer.adopt(this.content);this.content.store("jxFlyout",this);this.loadContent(this.content);this.keypressWatcher=this.keypressHandler.bindWithEvent(this);this.hideWatcher=this.clickHandler.bindWithEvent(this)},clicked:function(C){if(!this.options.enabled){return }if(!this.owner){this.owner=document.body;var B=$(this.domObj.parentNode);while(B!=document.body&&this.owner==document.body){var A=B.retrieve("jxFlyout");if(A){this.owner=A;break}else{B=$(B.parentNode)}}}if(Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1]==this){this.hide();return }else{if(this.owner!=document.body){if(this.owner.currentFlyout==this){this.hide();return }else{if(this.owner.currentFlyout){this.owner.currentFlyout.hide()}}this.owner.currentFlyout=this}else{while(Jx.Button.Flyout.Stack.length){Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1].hide()}}}Jx.Button.Flyout.Stack.push(this);this.options.active=true;this.
 domA.addClass("jx"+this.options.type+"Active");this.contentContainer.setStyle("visibility","hidden");$(document.body).adopt(this.contentContainer);this.content.getChildren().each(function(D){if(D.resize){D.resize()}});this.showChrome(this.contentContainer);this.position(this.contentContainer,this.domObj,{horizontal:["left left","right right"],vertical:["bottom top","top bottom"],offsets:this.chromeOffsets});this.contentContainer.setContentBoxSize($(this.content).getMarginBoxSize());this.contentContainer.setStyle("visibility","");document.addEvent("keydown",this.keypressWatcher);document.addEvent("click",this.hideWatcher);this.fireEvent("open",this)},hide:function(){if(this.owner!=document.body){this.owner.currentFlyout=null}Jx.Button.Flyout.Stack.pop();this.setActive(false);this.contentContainer.dispose();document.removeEvent("keydown",this.keypressWatcher);document.removeEvent("click",this.hideWatcher);this.fireEvent("close",this)},clickHandler:function(B){B=new Event(B);va
 r C=$(B.target);var A=Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1];if(!C.descendantOf(A.content)&&!C.descendantOf(A.domObj)){A.hide()}},keypressHandler:function(A){A=new Event(A);if(A.key=="esc"){Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1].hide()}}});Jx.Layout=new Class({Family:"Jx.Layout",Implements:[Options,Events],options:{propagate:true,position:"absolute",left:0,right:0,top:0,bottom:0,width:null,height:null,minWidth:0,minHeight:0,maxWidth:-1,maxHeight:-1},initialize:function(B,A){this.setOptions(A);this.domObj=$(B);this.domObj.resize=this.resize.bind(this);this.domObj.setStyle("position",this.options.position);this.domObj.store("jxLayout",this);if(document.body==this.domObj.parentNode){window.addEvent("resize",this.windowResize.bindWithEvent(this));window.addEvent("load",this.windowResize.bind(this))}},windowResize:function(){this.resize();if(this.resizeTimer){$clear(this.resizeTimer);this.resizeTimer=null}this.resizeTimer=this.resize.delay(50,thi
 s)},resize:function(K){this.resizeTimer=null;var B=false;if(K){for(var F in K){if(F=="forceResize"){continue}if(this.options[F]!=K[F]){B=true;this.options[F]=K[F]}}if(K.forceResize){B=true}}if(!$(this.domObj.parentNode)){return }var C;if(this.domObj.parentNode.tagName=="BODY"){C=Jx.getPageDimensions()}else{C=$(this.domObj.parentNode).getContentBoxSize()}if(this.lastParentSize&&!B){B=(this.lastParentSize.width!=C.width||this.lastParentSize.height!=C.height)}else{B=true}this.lastParentSize=C;if(!B){return }var D,J,I,G;if(this.options.left!=null){D=this.options.left;if(this.options.right==null){if(this.options.width==null){I=C.width-D;if(I<this.options.minWidth){I=this.options.minWidth}if(this.options.maxWidth>=0&&I>this.options.maxWidth){I=this.options.maxWidth}}else{I=this.options.width}}else{if(this.options.width==null){I=C.width-D-this.options.right;if(I<this.options.minWidth){I=this.options.minWidth}if(this.options.maxWidth>=0&&I>this.options.maxWidth){I=this.options.maxWi
 dth}}else{I=this.options.width}}}else{if(this.options.right==null){if(this.options.width==null){D=0;I=C.width;if(this.options.maxWidth>=0&&I>this.options.maxWidth){D=D+parseInt(I-this.options.maxWidth)/2;I=this.options.maxWidth}}else{I=this.options.width;D=parseInt((C.width-I)/2);if(D<0){D=0}}}else{if(this.options.width!=null){I=this.options.width;D=C.width-I-this.options.right;if(D<0){D=0}}else{D=0;I=C.width-this.options.right;if(I<this.options.minWidth){I=this.options.minWidth}if(this.options.maxWidth>=0&&I>this.options.maxWidth){D=I-this.options.maxWidth-this.options.right;I=this.options.maxWidth}}}}if(this.options.top!=null){J=this.options.top;if(this.options.bottom==null){if(this.options.height==null){G=C.height-J;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){G=this.options.maxHeight}}else{G=this.options.height;if(this.options.maxHeight>=0&&G>this.options.maxHeight){J=G-this.options.maxHeight;G=this.options
 .maxHeight}}}else{if(this.options.height==null){G=C.height-J-this.options.bottom;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){G=this.options.maxHeight}}else{G=this.options.height}}}else{if(this.options.bottom==null){if(this.options.height==null){J=0;G=C.height;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){J=parseInt((C.height-this.options.maxHeight)/2);G=this.options.maxHeight}}else{G=this.options.height;J=parseInt((C.height-G)/2);if(J<0){J=0}}}else{if(this.options.height!=null){G=this.options.height;J=C.height-G-this.options.bottom;if(J<0){J=0}}else{J=0;G=C.height-this.options.bottom;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){J=C.height-this.options.maxHeight-this.options.bottom;G=this.options.maxHeight}}}}var E={width:I};if(this.options.position=="absolute"){var H=$(this.domObj.pa
 rentNode).getPaddingSize();this.domObj.setStyles({position:this.options.position,left:D+H.left,top:J+H.top});E.height=G}else{if(this.options.height){E.height=this.options.height}}this.domObj.setBorderBoxSize(E);if(this.options.propagate){var A={forceResize:K?K.forceResize:false};$A(this.domObj.childNodes).each(function(L){if(L.resize&&L.getStyle("display")!="none"){L.resize.delay(0,L,A)}})}this.fireEvent("sizeChange",this)}});Jx.Button.Tab=new Class({Family:"Jx.Button.Tab",Extends:Jx.Button,Implements:[Jx.ContentLoader],content:null,initialize:function(B){this.parent($merge(B,{type:"Tab",toggle:true}));this.content=new Element("div",{"class":"tabContent"});new Jx.Layout(this.content,B);this.loadContent(this.content);var C=this;this.addEvent("down",function(){C.content.addClass("tabContentActive")});this.addEvent("up",function(){C.content.removeClass("tabContentActive")});if(this.options.close){this.domObj.addClass("jxTabClose");var A=new Element("a",{"class":"jxTabClose",eve
 nts:{click:(function(){this.fireEvent("close")}).bind(this)}});A.adopt(new Element("img",{src:Jx.aPixel.src,alt:"",title:""}));this.domObj.adopt(A)}},clicked:function(A){if(this.options.enabled){this.setActive(true)}}});Jx.ColorPalette=new Class({Family:"Jx.ColorPalette",Implements:[Options,Events,Jx.Addable],domObj:null,options:{parent:null,color:"#000000",alpha:1,hexColors:["00","33","66","99","CC","FF"],alphaLabel:"alpha (%)"},initialize:function(C){this.setOptions(C);this.domObj=new Element("div",{id:this.options.id,"class":"jxColorPalette"});var H=new Element("div",{"class":"jxColorBar"});var Q=new Element("div",{"class":"jxColorPreview"});this.selectedSwatch=new Element("div",{"class":"jxColorSelected"});this.previewSwatch=new Element("div",{"class":"jxColorHover"});Q.adopt(this.selectedSwatch);Q.adopt(this.previewSwatch);H.adopt(Q);this.colorInputLabel=new Element("label",{"class":"jxColorLabel",html:"#"});H.adopt(this.colorInputLabel);var K=this.changed.bind(this);th
 is.colorInput=new Element("input",{"class":"jxHexInput",type:"text",maxLength:6,events:{keyup:K,blur:K,change:K}});H.adopt(this.colorInput);this.alphaLabel=new Element("label",{"class":"jxAlphaLabel",html:this.options.alphaLabel});H.adopt(this.alphaLabel);this.alphaInput=new Element("input",{"class":"jxAlphaInput",type:"text",maxLength:3,events:{keyup:this.alphaChanged.bind(this)}});H.adopt(this.alphaInput);this.domObj.adopt(H);var I=this.swatchClick.bindWithEvent(this);var G=this.swatchOver.bindWithEvent(this);var P=new Element("table",{"class":"jxColorGrid"});var A=new Element("tbody");P.adopt(A);for(var N=0;N<12;N++){var B=new Element("tr");for(var L=-3;L<18;L++){var F=false;var J,O,R;if(L<0){if(L==-3||L==-1){J=O=R=0;F=true}else{if(N<6){J=O=R=N}else{if(N==6){J=5;O=0;R=0}else{if(N==7){J=0;O=5;R=0}else{if(N==8){J=0;O=0;R=5}else{if(N==9){J=5;O=5;R=0}else{if(N==10){J=0;O=5;R=5}else{if(N==11){J=5;O=0;R=5}}}}}}}}}else{J=parseInt(N/6)*3+parseInt(L/6);O=L%6;R=N%6}var D="#"+this.o
 ptions.hexColors[J]+this.options.hexColors[O]+this.options.hexColors[R];var E=new Element("td");if(!F){E.setStyle("backgroundColor",D);var S=new Element("a",{"class":"colorSwatch "+(((J>2&&O>2)||(J>2&&R>2)||(O>2&&R>2))?"borderBlack":"borderWhite"),href:"javascript:void(0)",title:D,alt:D,events:{mouseover:G,click:I}});S.store("swatchColor",D);E.adopt(S)}else{var M=new Element("span",{"class":"emptyCell"});E.adopt(M)}B.adopt(E)}A.adopt(B)}this.domObj.adopt(P);this.updateSelected();if(this.options.parent){this.addTo(this.options.parent)}},swatchOver:function(B){var A=B.target;this.previewSwatch.setStyle("backgroundColor",A.retrieve("swatchColor"))},swatchClick:function(B){var A=B.target;this.options.color=A.retrieve("swatchColor");this.updateSelected();this.fireEvent("click",this)},changed:function(){var A=this.colorInput.value;if(A.substring(0,1)=="#"){A=A.substring(1)}if(A.toLowerCase().match(/^[0-9a-f]{6}$/)){this.options.color="#"+A.toUpperCase();this.updateSelected()}},alp
 haChanged:function(){var A=this.alphaInput.value;if(A.match(/^[0-9]{1,3}$/)){this.options.alpha=parseFloat(A/100);this.updateSelected()}},setColor:function(A){this.colorInput.value=A;this.changed()},setAlpha:function(A){this.alphaInput.value=A;this.alphaChanged()},updateSelected:function(){var A={backgroundColor:this.options.color};this.colorInput.value=this.options.color.substring(1);this.alphaInput.value=parseInt(this.options.alpha*100);if(this.options.alpha<1){A.opacity=this.options.alpha;A.filter="Alpha(opacity="+(this.options.alpha*100)+")"}else{A.opacity="";A.filter=""}this.selectedSwatch.setStyles(A);this.previewSwatch.setStyles(A);this.fireEvent("change",this)}});Jx.Button.Color=new Class({Family:"Jx.Button.Color",Extends:Jx.Button.Flyout,swatch:null,options:{color:"#000000",alpha:100},initialize:function(A){if(!Jx.Button.Color.ColorPalette){Jx.Button.Color.ColorPalette=new Jx.ColorPalette(this.options)}var B=new Element("span",{"class":"jxButtonSwatch"});this.select
 edSwatch=new Element("span");B.appendChild(this.selectedSwatch);this.colorChangeFn=this.changed.bind(this);this.hideFn=this.hide.bind(this);A.image=Jx.aPixel.src;this.parent(A);B.replaces(this.domImg);this.updateSwatch()},clicked:function(){if(Jx.Button.Color.ColorPalette.currentButton){Jx.Button.Color.ColorPalette.currentButton.hide()}Jx.Button.Color.ColorPalette.currentButton=this;Jx.Button.Color.ColorPalette.addEvent("change",this.colorChangeFn);Jx.Button.Color.ColorPalette.addEvent("click",this.hideFn);this.content.appendChild(Jx.Button.Color.ColorPalette.domObj);Jx.Button.Color.ColorPalette.domObj.setStyle("display","block");Jx.Button.Flyout.prototype.clicked.apply(this,arguments);Jx.Button.Color.ColorPalette.options.color=this.options.color;Jx.Button.Color.ColorPalette.options.alpha=this.options.alpha/100;Jx.Button.Color.ColorPalette.updateSelected()},hide:function(){this.setActive(false);Jx.Button.Color.ColorPalette.removeEvent("change",this.colorChangeFn);Jx.Button.C
 olor.ColorPalette.removeEvent("click",this.hideFn);Jx.Button.Flyout.prototype.hide.apply(this,arguments);Jx.Button.Color.ColorPalette.currentButton=null},setColor:function(A){this.options.color=A;this.updateSwatch()},setAlpha:function(A){this.options.alpha=A;this.updateSwatch()},changed:function(A){var B=false;if(this.options.color!=A.options.color){this.options.color=A.options.color;B=true}if(this.options.alpha!=A.options.alpha*100){this.options.alpha=A.options.alpha*100;B=true}if(B){this.updateSwatch();this.fireEvent("change",this)}},updateSwatch:function(){var A={backgroundColor:this.options.color};if(this.options.alpha<100){A.filter="Alpha(opacity="+(this.options.alpha)+")";A.opacity=this.options.alpha/100}else{A.opacity="";A.filter=""}this.selectedSwatch.setStyles(A)}});Jx.Menu=new Class({Family:"Jx.Menu",Implements:[Options,Events,Jx.AutoPosition,Jx.Chrome,Jx.Addable],domObj:null,button:null,subDomObj:null,items:null,initialize:function(A){this.setOptions(A);if(!Jx.Men
 u.Menus){Jx.Menu.Menus=[]}this.items=[];this.contentContainer=new Element("div",{"class":"jxMenuContainer",events:{contextmenu:function(B){B.stop()}}});this.subDomObj=new Element("ul",{"class":"jxMenu"});this.contentContainer.adopt(this.subDomObj);if(A){this.button=new Jx.Button($merge(A,{onClick:this.show.bind(this)}));this.button.domA.addClass("jxButtonMenu");this.button.domA.addEvent("mouseover",this.onMouseOver.bindWithEvent(this));this.domObj=this.button.domObj}this.hideWatcher=this.hide.bindWithEvent(this);this.keypressWatcher=this.keypressHandler.bindWithEvent(this);if(this.options.parent){this.addTo(this.options.parent)}},add:function(){$A(arguments).flatten().each(function(A){this.items.push(A);A.setOwner(this);this.subDomObj.adopt(A.domObj)},this);return this},deactivate:function(){this.hide()},onMouseOver:function(A){if(Jx.Menu.Menus[0]&&Jx.Menu.Menus[0]!=this){this.show({event:A})}},eventInMenu:function(D){var C=$(D.target);if(!C){return false}if(C.descendantOf(t
 his.domObj)||C.descendantOf(this.subDomObj)){return true}else{var B=C.findElement("ul");if(B){var E=B.retrieve("jxSubMenu");if(E){var A=E.owner;while(A){if(A==this){return true}A=A.owner}}}return false}},hide:function(A){if(A){if(this.visibleItem&&this.visibleItem.eventInMenu){if(this.visibleItem.eventInMenu(A)){return }}else{if(this.eventInMenu(A)){return }}}if(Jx.Menu.Menus[0]&&Jx.Menu.Menus[0]==this){Jx.Menu.Menus[0]=null}if(this.button&&this.button.domA){this.button.domA.removeClass("jx"+this.button.options.type+"Active")}this.items.each(function(B){B.hide(A)});document.removeEvent("mousedown",this.hideWatcher);document.removeEvent("keydown",this.keypressWatcher);this.contentContainer.setStyle("display","none");this.fireEvent("hide",this)},show:function(B){var A=B.event;if(Jx.Menu.Menus[0]){if(Jx.Menu.Menus[0]!=this){Jx.Menu.Menus[0].button.blur();Jx.Menu.Menus[0].hide(A)}else{this.hide();return }}if(this.items.length===0){return }Jx.Menu.Menus[0]=this;this.button.focus(
 );this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.showChrome(this.contentContainer);this.position(this.contentContainer,this.button.domObj,{horizontal:["left left"],vertical:["bottom top","top bottom"],offsets:this.chromeOffsets});this.contentContainer.setStyle("visibility","");if(this.button&&this.button.domA){this.button.domA.addClass("jx"+this.button.options.type+"Active")}if(A){}document.addEvent("mousedown",this.hideWatcher);document.addEvent("keydown",this.keypressWatcher);this.fireEvent("show",this)},setVisibleItem:function(A){if(this.visibleItem!=A){if(this.visibleItem&&this.visibleItem.hide){this.visibleItem.hide()}this.visibleItem=A;this.visibleItem.show()}},keypressHandler:function(A){A=new Event(A);if(A.key=="esc"){this.hide()}}});Jx.ButtonSet=new Class({Family:"Jx.ButtonSet",Implemen
 ts:[Options,Events],buttons:null,initialize:function(A){this.setOptions(A);this.buttons=[];this.buttonChangedHandler=this.buttonChanged.bind(this)},add:function(){$A(arguments).each(function(A){if(A.domObj.hasClass("jx"+A.options.type+"Toggle")){A.domObj.removeClass("jx"+A.options.type+"Toggle");A.domObj.addClass("jx"+A.options.type+"Set")}A.addEvent("down",this.buttonChangedHandler);var B=this;A.setActive=function(C){if(this.options.active&&B.activeButton==this){return }else{Jx.Button.prototype.setActive.apply(this,[C])}};if(!this.activeButton||A.options.active){A.options.active=false;A.setActive(true)}this.buttons.push(A)},this);return this},remove:function(A){this.buttons.erase(A);if(this.activeButton==A){if(this.buttons.length){this.buttons[0].setActive(true)}A.removeEvent("down",this.buttonChangedHandler);A.setActive=Jx.Button.prototype.setActive}},setActiveButton:function(B){var A=this.activeButton;this.activeButton=B;if(A&&A!=B){A.setActive(false)}},buttonChanged:func
 tion(A){this.setActiveButton(A);this.fireEvent("change",this)}});Jx.Button.Multi=new Class({Family:"Jx.Button.Multi",Extends:Jx.Button,activeButton:null,buttons:null,initialize:function(C){this.parent(C);this.buttons=[];this.domA.addClass("jxButtonMulti");this.menu=new Jx.Menu();this.menu.button=this;this.buttonSet=new Jx.ButtonSet();this.clickHandler=this.clicked.bind(this);var A=new Element("a",{"class":"jxButtonDisclose",href:"javascript:void(0)"});var B=this;var D;A.addEvents({click:(function(E){if(this.items.length===0){return }if(!B.options.enabled){return }this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.showChrome(this.contentContainer);this.position(this.contentContainer,this.button.domObj,{horizontal:["right right"],vertical:["bottom top","top bottom"],offsets:this.chromeOffsets});this.c
 ontentContainer.setStyle("visibility","");document.addEvent("mousedown",this.hideWatcher);document.addEvent("keyup",this.keypressWatcher);this.fireEvent("show",this)}).bindWithEvent(this.menu),mouseenter:(function(){$(this.domObj.firstChild).addClass("jxButtonHover");if(D){A.addClass("jx"+this.options.type+"Pressed")}}).bind(this),mouseleave:(function(){$(this.domObj.firstChild).removeClass("jxButtonHover");A.removeClass("jx"+this.options.type+"Pressed")}).bind(this),mousedown:(function(E){A.addClass("jx"+this.options.type+"Pressed");D=true;this.focus()}).bindWithEvent(this),mouseup:(function(E){A.removeClass("jx"+this.options.type+"Pressed")}).bindWithEvent(this),keydown:(function(E){if(E.key=="enter"){A.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keyup:(function(E){if(E.key=="enter"){A.removeClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),blur:function(){D=false}});if(typeof Drag!="undefined"){new Drag(A,{onStart:function(){this.stop()}
 })}this.menu.addEvents({show:(function(){this.domA.addClass("jxButtonActive")}).bind(this),hide:(function(){if(this.options.active){this.domA.addClass("jxButtonActive")}}).bind(this)});A.adopt(new Element("img",{src:Jx.aPixel.src,alt:"",title:""}));this.domObj.adopt(A);this.discloser=A;if(this.options.items){this.add(this.options.items)}},add:function(){$A(arguments).flatten().each(function(B){if(!B instanceof Jx.Button){return }this.buttons.push(B);var D=this.setButton.bind(this,B);var C=$merge(B.options,{toggle:true,onClick:D});if(!C.label){C.label="&nbsp;"}if(!C.image||C.image.indexOf("a_pixel")!=-1){delete C.image}var A=new Jx.Menu.Item(C);this.buttonSet.add(A);this.menu.add(A);B.multiButton=A;B.domA.addClass("jxButtonMulti");if(!this.activeButton){this.domA.dispose();this.setActiveButton(B)}},this)},remove:function(A){if(!A||!A.multiButton){return }if(this.menu.remove(A.multiButton)){A.multiButton=null;if(this.activeButton==A){if(!this.buttons.some(function(B){if(B!=A){
 this.setActiveButton(B);return true}else{return false}},this)){this.setActiveButton(null)}}this.buttons.erase(A)}},setActiveButton:function(A){if(this.activeButton){this.activeButton.domA.dispose();this.activeButton.domA.removeEvent(this.clickHandler)}if(A&&A.domA){this.domObj.grab(A.domA,"top");this.domA=A.domA;this.domA.addEvent("click",this.clickHandler);if(this.options.toggle){this.options.active=false;this.setActive(true)}}this.activeButton=A},setButton:function(A){this.setActiveButton(A);A.clicked()}});Jx.Menu.Item=new Class({Family:"Jx.Menu.Item",Extends:Jx.Button,owner:null,options:{enabled:true,image:null,label:"&nbsp;",toggleClass:"Toggle"},initialize:function(A){this.parent($merge({image:Jx.aPixel.src},A,{container:"li",type:"MenuItem",toggleClass:(A.image?null:this.options.toggleClass)}));this.domObj.addEvent("mouseover",this.onMouseOver.bindWithEvent(this))},setOwner:function(A){this.owner=A},hide:function(){this.blur()},show:$empty,clicked:function(A){if(this.o
 ptions.enabled){if(this.options.toggle){this.setActive(!this.options.active)}this.fireEvent("click",this);if(this.owner&&this.owner.deactivate){this.owner.deactivate(A.event)}}},onMouseOver:function(A){if(this.owner&&this.owner.setVisibleItem){this.owner.setVisibleItem(this)}this.show(A)}});Jx.Button.Combo=new Class({Family:"Jx.Button.Combo",Extends:Jx.Button.Multi,domObj:null,ul:null,currentSelection:null,options:{editable:false,label:""},initialize:function(A){this.parent();this.setOptions(A);this.domA.removeClass("jxButtonMulti");if(this.options.editable){var B=new Element("span",{"class":"jxButton"});B.adopt(this.domA.firstChild);this.domA=B.replaces(this.domA);this.domA.addClass("jxButtonComboDefault");this.domA.addClass("jxButtonEditCombo");this.domInput=new Element("input",{type:"text",events:{change:this.valueChanged.bindWithEvent(this),keydown:this.onKeyPress.bindWithEvent(this),focus:(function(){if(this.domA.hasClass("jxButtonComboDefault")){this.domInput.value="";
 this.domA.removeClass("jxButtonComboDefault")}}).bind(this)},value:this.options.label});this.domLabel.empty();this.domLabel.addClass("jxComboInput");this.domLabel.adopt(this.domInput)}else{this.discloser.dispose();this.domA.addClass("jxButtonCombo");this.addEvent("click",(function(C){this.discloser.fireEvent("click",C)}).bindWithEvent(this))}this.buttonSet=new Jx.ButtonSet({onChange:(function(F){var E=F.activeButton;this.domA.removeClass("jxButtonComboDefault");if(this.options.editable){this.domInput.value=E.options.label}else{var C=E.options.label;if(C=="&nbsp;"){C=""}this.setLabel(C)}var D=E.options.image;if(D.indexOf("a_pixel")!=-1){D=""}this.setImage(D);if(this.options.imageClass&&this.domImg){this.domImg.removeClass(this.options.imageClass)}if(E.options.imageClass&&this.domImg){this.options.imageClass=E.options.imageClass;this.domImg.addClass(E.options.imageClass)}this.fireEvent("change",this)}).bind(this)});if(this.options.items){this.add(this.options.items)}this.setEn
 abled(this.options.enabled)},setEnabled:function(A){this.options.enabled=A;if(this.options.enabled){this.domObj.removeClass("jxDisabled");if(this.domInput){this.domInput.disabled=false}}else{this.domObj.addClass("jxDisabled");if(this.domInput){this.domInput.disabled=true}}},valueChanged:function(){this.fireEvent("change",this)},onKeyPress:function(A){if(A.key=="enter"){this.valueChanged()}},add:function(){$A(arguments).flatten().each(function(B){var A=new Jx.Menu.Item($merge(B,{toggle:true}));this.menu.add(A);this.buttonSet.add(A)},this)},remove:function(A){},setValue:function(A){if(this.options.editable){this.domInput.value=A}else{this.setLabel(A)}},getValue:function(){value="";if(this.options.editable){value=this.domInput.value}else{value=this.getLabel()}return value}});Jx.Panel=new Class({Family:"Jx.Panel",Implements:[Options,Events,Jx.ContentLoader,Jx.Addable],toolbarContainers:{top:null,right:null,bottom:null,left:null},options:{position:"absolute",type:"Panel",id:"",la
 bel:"&nbsp;",height:null,collapse:true,collapseTooltip:"Collapse/Expand Panel",collapseLabel:"Collapse",expandLabel:"Expand",maximizeTooltip:"Maximize Panel",maximizeLabel:"Maximize",close:false,closeTooltip:"Close Panel",closeLabel:"Close",closed:false,hideTitle:false,toolbars:[]},initialize:function(I){this.setOptions(I);this.toolbars=I?I.toolbars||[]:[];if($defined(this.options.height)&&!$defined(I.position)){this.options.position="relative"}this.title=new Element("div",{"class":"jx"+this.options.type+"Title"});var A=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.image){A.setStyle("backgroundImage","url("+this.options.image+")")}this.title.adopt(A);this.labelObj=new Element("span",{"class":"jx"+this.options.type+"Label",html:this.options.label});this.title.adopt(this.labelObj);var F=new Element("div",{"class":"jx"+this.options.type+"Controls"});var B=new Element("div");F.adopt(B);this.toolbar=new Jx.Toolbar({pa
 rent:B});this.title.adopt(F);var C=this;if(this.options.menu){this.menu=new Jx.Menu({image:Jx.aPixel.src});this.menu.domObj.addClass("jx"+this.options.type+"Menu");this.menu.domObj.addClass("jxButtonContentLeft");this.toolbar.add(this.menu)}if(this.options.collapse){var E=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.collapseTooltip,onClick:function(){C.toggleCollapse()}});E.domObj.addClass("jx"+this.options.type+"Collapse");this.toolbar.add(E);if(this.menu){var H=new Jx.Menu.Item({label:this.options.collapseLabel,onClick:function(){C.toggleCollapse()}});this.addEvents({collapse:function(){H.setLabel(this.options.expandLabel)},expand:function(){H.setLabel(this.options.collapseLabel)}});this.menu.add(H)}}if(this.options.maximize){var E=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.maximizeTooltip,onClick:function(){C.maximize()}});E.domObj.addClass("jx"+this.options.type+"Maximize");this.toolbar.add(E);if(this.menu){var H=new Jx.Menu.Item({label:this.optio
 ns.maximizeLabel,onClick:function(){C.maximize()}});this.menu.add(H)}}if(this.options.close){var E=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.closeTooltip,onClick:function(){C.close()}});E.domObj.addClass("jx"+this.options.type+"Close");this.toolbar.add(E);if(this.menu){var H=new Jx.Menu.Item({label:this.options.closeLabel,onClick:function(){C.close()}});this.menu.add(H)}}this.title.addEvent("dblclick",function(){C.toggleCollapse()});this.domObj=new Element("div",{"class":"jx"+this.options.type});if(this.options.id){this.domObj.id=this.options.id}var D=new Jx.Layout(this.domObj,$merge(this.options,{propagate:false}));var G=this.layoutContent.bind(this);D.addEvent("sizeChange",G);if(!this.options.hideTitle){this.domObj.adopt(this.title)}this.contentContainer=new Element("div",{"class":"jx"+this.options.type+"ContentContainer"});this.domObj.adopt(this.contentContainer);if($type(this.options.toolbars)=="array"){this.options.toolbars.each(function(K){var J=K.options
 .position;var L=this.toolbarContainers[J];if(!L){var L=new Element("div");new Jx.Layout(L);this.contentContainer.adopt(L);this.toolbarContainers[J]=L}K.addTo(L)},this)}this.content=new Element("div",{"class":"jx"+this.options.type+"Content"});this.contentContainer.adopt(this.content);new Jx.Layout(this.contentContainer);new Jx.Layout(this.content);this.loadContent(this.content);this.toggleCollapse(this.options.closed);this.addEvent("addTo",function(){this.domObj.resize()});if(this.options.parent){this.addTo(this.options.parent)}},layoutContent:function(){var F=0;var G=0;var A=0;var C=0;var I=0;var H;var D;var E;if(!this.options.hideTitle&&this.title.parentNode==this.domObj){F=this.title.getMarginBoxSize().height}var B=this.domObj.getContentBoxSize();if(B.height>F){this.contentContainer.setStyle("display","block");this.options.closed=false;this.contentContainer.resize({top:F,height:null,bottom:0});["left","right"].each(function(J){if(this.toolbarContainers[J]){this.toolbarCon
 tainers[J].style.width="auto"}},this);["top","bottom"].each(function(J){if(this.toolbarContainers[J]){this.toolbarContainers[J].style.height=""}},this);if($type(this.options.toolbars)=="array"){this.options.toolbars.each(function(J){E=J.options.position;H=this.toolbarContainers[E];if(Browser.Engine.trident4){var L=$(H.parentNode);H.style.visibility="hidden";$(document.body).adopt(H)}var K=H.getBorderBoxSize();if(Browser.Engine.trident4){L.adopt(H);H.style.visibility=""}switch(E){case"top":G=K.height;break;case"bottom":A=K.height;break;case"left":C=K.width;break;case"right":I=K.width;break}},this)}H=this.toolbarContainers.top;if(H){H.resize({top:0,left:C,right:I,bottom:null,height:G,width:null})}H=this.toolbarContainers.bottom;if(H){H.resize({top:null,left:C,right:I,bottom:0,height:A,width:null})}H=this.toolbarContainers.left;if(H){H.resize({top:G,left:0,right:null,bottom:A,height:null,width:C})}H=this.toolbarContainers.right;if(H){H.resize({top:G,left:null,right:0,bottom:A,h
 eight:null,width:I})}this.content.resize({top:G,bottom:A,left:C,right:I})}else{this.contentContainer.setStyle("display","none");this.options.closed=true}this.fireEvent("sizeChange",this)},setLabel:function(A){this.labelObj.innerHTML=A},getLabel:function(){return this.labelObj.innerHTML},finalize:function(){this.domObj=null;this.deregisterIds()},maximize:function(){if(this.manager){this.manager.maximizePanel(this)}},setContent:function(A){this.content.innerHTML=A;this.bContentReady=true},setContentURL:function(B){this.bContentReady=false;this.setBusy(true);if(arguments[1]){this.onContentReady=arguments[1]}if(B.indexOf("?")==-1){B=B+"?"}var A=new Request({url:B,method:"get",evalScripts:true,onSuccess:this.panelContentLoaded.bind(this),requestHeaders:["If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT"]}).send()},panelContentLoaded:function(A){this.content.innerHTML=A;this.bContentReady=true;this.setBusy(false);if(this.onContentReady){window.setTimeout(this.onContentReady.bind(t
 his),1)}},setBusy:function(A){this.busyCount+=A?1:-1;if(this.loadingObj){this.loadingObj.img.style.visibility=(this.busyCount>0)?"visible":"hidden"}},toggleCollapse:function(C){if($defined(C)){this.options.closed=C}else{this.options.closed=!this.options.closed}if(this.options.closed){if(!this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.addClass("jx"+this.options.type+"Min");this.contentContainer.setStyle("display","none");var B=this.domObj.getMarginSize();var A=B.top+B.bottom;if(this.title.parentNode==this.domObj){A+=this.title.getMarginBoxSize().height}this.domObj.resize({height:A});this.fireEvent("collapse",this)}}else{if(this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.removeClass("jx"+this.options.type+"Min");this.contentContainer.setStyle("display","block");this.domObj.resize({height:this.options.height});this.fireEvent("expand",this)}}},close:function(){this.domObj.dispose();this.fireEvent("close",this)}});Jx.Dialog=new Class({Family:"Jx.D
 ialog",Extends:Jx.Panel,Implements:[Jx.AutoPosition,Jx.Chrome],blanket:null,options:{modal:true,position:"absolute",width:250,height:250,horizontal:"center center",vertical:"center center",label:"New Dialog",id:"",parent:null,resize:false,resizeTooltip:"",move:true,close:true},initialize:function(A){this.isOpening=false;this.firstShow=true;this.parent($merge({parent:document.body},A,{type:"Dialog",position:"absolute"}));this.options.parent=$(this.options.parent);if(this.options.modal){this.blanket=new Element("div",{"class":"jxDialogModal",styles:{display:"none",zIndex:-1}});this.blanket.resize=(function(){var B=$(document.body).getScrollSize();this.setStyles({width:B.x,height:B.y})}).bind(this.blanket);this.options.parent.adopt(this.blanket);window.addEvent("resize",this.blanket.resize)}this.domObj.setStyle("display","none");this.options.parent.adopt(this.domObj);if(this.options.move&&typeof Drag!="undefined"){this.title.addClass("jxDialogMoveable");new Drag(this.domObj,{ha
 ndle:this.title,onBeforeStart:(function(){Jx.Dialog.orderDialogs(this)}).bind(this),onStart:(function(){this.contentContainer.setStyle("visibility","hidden");this.chrome.addClass("jxChromeDrag")}).bind(this),onComplete:(function(){this.chrome.removeClass("jxChromeDrag");this.contentContainer.setStyle("visibility","");var C=Math.max(this.chromeOffsets.left,parseInt(this.domObj.style.left,10));var B=Math.max(this.chromeOffsets.top,parseInt(this.domObj.style.top,10));this.options.horizontal=C+" left";this.options.vertical=B+" top";this.position(this.domObj,this.options.parent,this.options);this.options.left=parseInt(this.domObj.style.left,10);this.options.top=parseInt(this.domObj.style.top,10);if(!this.options.closed){this.domObj.resize(this.options)}}).bind(this)})}if(this.options.resize&&typeof Drag!="undefined"){this.resizeHandle=new Element("div",{"class":"jxDialogResize",title:this.options.resizeTooltip,styles:{display:this.options.closed?"none":"block"}});this.domObj.appe
 ndChild(this.resizeHandle);this.resizeHandleSize=this.resizeHandle.getSize();this.resizeHandle.setStyles({bottom:this.resizeHandleSize.height,right:this.resizeHandleSize.width});this.domObj.makeResizable({handle:this.resizeHandle,onStart:(function(){this.contentContainer.setStyle("visibility","hidden");this.chrome.addClass("jxChromeDrag")}).bind(this),onDrag:(function(){this.resizeChrome(this.domObj)}).bind(this),onComplete:(function(){this.chrome.removeClass("jxChromeDrag");var B=this.domObj.getMarginBoxSize();this.options.width=B.width;this.options.height=B.height;this.layoutContent();this.domObj.resize(this.options);this.contentContainer.setStyle("visibility","");this.fireEvent("resize");this.resizeChrome(this.domObj)}).bind(this)})}this.domObj.addEvent("mousedown",(function(){Jx.Dialog.orderDialogs(this)}).bind(this))},resize:function(B,A,C){this.options.width=B;this.options.height=A;if(this.domObj.getStyle("display")!="none"){this.layoutContent();this.domObj.resize(this
 .options);this.fireEvent("resize");this.resizeChrome(this.domObj);if(C){this.position(this.domObj,this.options.parent,this.options)}}else{this.firstShow=false}},sizeChanged:function(){if(!this.options.closed){this.layoutContent()}},toggleCollapse:function(C){if($defined(C)){this.options.closed=C}else{this.options.closed=!this.options.closed}if(this.options.closed){if(!this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.addClass("jx"+this.options.type+"Min")}this.contentContainer.setStyle("display","none");if(this.resizeHandle){this.resizeHandle.setStyle("display","none")}}else{if(this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.removeClass("jx"+this.options.type+"Min")}this.contentContainer.setStyle("display","block");if(this.resizeHandle){this.resizeHandle.setStyle("display","block")}}if(this.options.closed){var B=this.domObj.getMarginSize();var A=this.title.getMarginBoxSize();this.domObj.resize({height:B.top+A.height+B.bottom});this.fireEvent("co
 llapse")}else{this.domObj.resize(this.options);this.fireEvent("expand")}this.showChrome(this.domObj)},show:function(){this.domObj.setStyles({display:"block",visibility:"hidden"});if(this.blanket){this.blanket.resize()}Jx.Dialog.orderDialogs(this);if(this.blanket){this.blanket.setStyles({visibility:"visible",display:"block"})}if(this.options.closed){var B=this.domObj.getMarginSize();var A=this.title.getMarginBoxSize();this.domObj.resize({height:B.top+A.height+B.bottom})}else{this.domObj.resize(this.options)}if(this.firstShow){this.contentContainer.resize({forceResize:true});this.layoutContent();this.firstShow=false;if(this.chrome){this.chrome.dispose();this.chrome=null}}this.showChrome(this.domObj);this.position(this.domObj,this.options.parent,this.options);this.domObj.setStyle("visibility","")},hide:function(){Jx.Dialog.Stack.erase(this);Jx.Dialog.ZIndex--;this.domObj.setStyle("display","none");if(this.blanket){this.blanket.setStyle("visibility","hidden");Jx.Dialog.ZIndex--}
 },openURL:function(A){if(A){this.options.contentURL=A;this.loadContent(this.content)}else{this.open()}},open:function(){if(!this.isOpening){this.isOpening=true}if(this.contentIsLoaded){this.show();this.fireEvent("open",this);this.isOpening=false}else{this.addEvent("contentLoaded",this.open.bind(this))}},close:function(){this.isOpening=false;this.hide();this.fireEvent("close")}});Jx.Dialog.Stack=[];Jx.Dialog.BaseZIndex=null;Jx.Dialog.orderDialogs=function(A){Jx.Dialog.Stack.erase(A).push(A);if(Jx.Dialog.BaseZIndex===null){Jx.Dialog.BaseZIndex=Math.max(Jx.Dialog.Stack[0].domObj.getStyle("zIndex").toInt(),1)}Jx.Dialog.Stack.each(function(D,B){var C=Jx.Dialog.BaseZIndex+B;if(D.blanket){D.blanket.setStyle("zIndex",C)}D.domObj.setStyle("zIndex",C)})};Jx.Splitter=new Class({Family:"Jx.Splitter",Implements:[Options],domObj:null,elements:null,bars:null,firstUpdate:true,options:{useChildren:false,splitInto:2,elements:null,containerOptions:[],barOptions:[],layout:"horizontal",snaps:[],
 barTooltip:"drag this bar to resize",onStart:null,onFinish:null},initialize:function(A,L){this.setOptions(L);this.domObj=$(A);this.domObj.addClass("jxSplitContainer");var K=this.domObj.retrieve("jxLayout");if(K){K.addEvent("sizeChange",this.sizeChanged.bind(this))}this.elements=[];this.bars=[];var J=2;if(this.options.useChildren){this.elements=this.domObj.getChildren();J=this.elements.length}else{J=this.options.elements?this.options.elements.length:this.options.splitInto;for(var G=0;G<J;G++){var D;if(this.options.elements&&this.options.elements[G]){if(L.elements[G].domObj){D=L.elements[G].domObj}else{D=$(this.options.elements[G])}if(!D){D=this.prepareElement();D.id=this.options.elements[G]}}else{D=this.prepareElement()}this.elements[G]=D;this.domObj.adopt(this.elements[G])}}this.elements.each(function(M){M.addClass("jxSplitArea")});for(var G=0;G<J;G++){var I=this.elements[G].retrieve("jxLayout");if(!I){new Jx.Layout(this.elements[G],this.options.containerOptions[G])}else{I.r
 esize({position:"absolute"})}}for(var G=1;G<J;G++){var H;if(this.options.prepareBar){H=this.options.prepareBar(G-1)}else{H=this.prepareBar()}H.store("splitterObj",this);H.store("leftSide",this.elements[G-1]);H.store("rightSide",this.elements[G]);this.elements[G-1].store("rightBar",H);this.elements[G].store("leftBar",H);this.domObj.adopt(H);this.bars[G-1]=H}if($defined(Drag)){this.establishConstraints()}for(var G=0;G<this.options.barOptions.length;G++){if(!this.bars[G]){continue}var B=this.options.barOptions[G];if(B&&B.snap&&(B.snap=="before"||B.snap=="after")){var F;if(B.snap=="before"){F=this.bars[G].retrieve("leftSide")}else{if(B.snap=="after"){F=this.bars[G].retrieve("rightSide")}}var E;var C;if(B.snapElement){E=B.snapElement;C=B.snapEvents||["click","dblclick"]}else{E=this.bars[G];C=B.snapEvents||["dblclick"]}if(!E.parentNode){this.bars[G].adopt(E)}new Jx.Splitter.Snap(E,F,this,C)}}for(var G=0;G<this.options.snaps.length;G++){if(this.options.snaps[G]){new Jx.Splitter.Sna
 p(this.options.snaps[G],this.elements[G],this)}}this.sizeChanged()},prepareElement:function(){var A=new Element("div",{styles:{position:"absolute"}});return A},prepareBar:function(){var A=new Element("div",{"class":"jxSplitBar"+this.options.layout.capitalize(),title:this.options.barTitle});return A},establishConstraints:function(){var A={x:null,y:null};var B;if(this.options.layout=="horizontal"){A.x="left";B=this.dragHorizontal}else{A.y="top";B=this.dragVertical}if(typeof Drag!="undefined"){this.bars.each(function(D){var C;new Drag(D,{modifiers:A,onSnap:function(E){E.addClass("jxSplitBarDrag")},onComplete:(function(E){C.destroy();E.removeClass("jxSplitBarDrag");if(E.retrieve("splitterObj")!=this){return }B.apply(this,[E])}).bind(this),onStart:(function(E){C=new Element("div",{"class":"jxSplitterMask"}).inject(E,"after");if(this.options.onStart){this.options.onStart()}}).bind(this),onFinish:(function(){if(this.options.onFinish){this.options.onFinish()}}).bind(this)})},this)}}
 ,dragHorizontal:function(F){var A=parseInt(F.style.left);var H=F.retrieve("leftSide");var C=F.retrieve("rightSide");var D=H.retrieve("jxLayout");var G=C.retrieve("jxLayout");var E=this.domObj.getPaddingSize().left;var I,O,K;var N=F.retrieve("size");if(!N){N=F.getBorderBoxSize();F.store("size",N)}I=A+N.width-E;var B=this.domObj.getContentBoxSize();if(G.options.width!=null){O=G.options.width+G.options.left-I;K=B.width-I-O}else{O=B.width-G.options.right-I;K=G.options.right}if(O<0){O=0}if(O<G.options.minWidth){O=G.options.minWidth}if(G.options.maxWidth>=0&&O>G.options.maxWidth){O=G.options.maxWidth}I=B.width-K-O;A=I-N.width;var J,M;J=D.options.left;M=A-J;if(M<0){M=0}if(M<D.options.minWidth){M=D.options.minWidth}if(D.options.maxWidth>=0&&M>D.options.maxWidth){M=D.options.maxWidth}if(J+M!=A){A=J+M;var L=A+N.width-I;I+=L;O-=L}F.style.left=E+A+"px";if(D.options.width==null){var B=this.domObj.getContentBoxSize();H.resize({right:B.width-J-M})}else{H.resize({width:M})}if(G.options.widt
 h==null){C.resize({left:I})}else{C.resize({left:I,width:O})}},dragVertical:function(F){var J=parseInt(F.style.top);var D=F.retrieve("leftSide");var A=F.retrieve("rightSide");var E=D.retrieve("jxLayout");var H=A.retrieve("jxLayout");var N=this.domObj.getPaddingSize().top;var O=F.retrieve("size");if(!O){O=F.getBorderBoxSize();F.store("size",O)}var B=this.domObj.getContentBoxSize();var C,M,K;C=J+O.height-N;if(H.options.height!=null){M=H.options.height+H.options.top-C;K=B.height-C-M}else{M=B.height-H.options.bottom-C;K=H.options.bottom}if(M<0){M=0}if(M<H.options.minHeight){M=H.options.minHeight}if(H.options.maxHeight>=0&&M>H.options.maxHeight){M=H.options.maxHeight}C=B.height-K-M;J=C-O.height;var I,G;I=E.options.top;G=J-I;if(G<0){G=0}if(G<E.options.minHeight){G=E.options.minHeight}if(E.options.maxHeight>=0&&G>E.options.maxHeight){G=E.options.maxHeight}if(I+G!=J){J=I+G;var L=J+O.height-C;C+=L;M-=L}F.style.top=N+J+"px";if(E.options.height==null){D.resize({bottom:B.height-I-G})}els
 e{D.resize({height:G})}if(H.options.height==null){A.resize({top:C})}else{A.resize({top:C,height:M})}},sizeChanged:function(){if(this.options.layout=="horizontal"){this.horizontalResize()}else{this.verticalResize()}},horizontalResize:function(){var O=this.domObj.getContentBoxSize().width;var D=O;for(var E=0;E<this.bars.length;E++){var L=this.bars[E];var Q=L.retrieve("size");if(!Q||Q.width==0){Q=L.getBorderBoxSize();L.store("size",Q)}O-=Q.width}var I=0;var H;for(var E=0;E<this.elements.length;E++){var K=this.elements[E];H=K.retrieve("jxLayout").options;if(H.width!=null){O-=parseInt(H.width)}else{var N=0;if(H.right!=0||H.left!=0){N=K.getBorderBoxSize().width}O-=N;I++}}if(I==0){O+=H.width;H.width=null;I=1}var G=parseInt(O/I);var P=O%I;var B=this.domObj.getPaddingSize().left;var C=0;for(var E=0;E<this.elements.length;E++){var K=this.elements[E];var J=K.retrieve("jxLayout");var H=J.options;if(H.width!=null){J.resize({left:C});C+=H.width}else{var M=G;if(I==1){M+=P}I--;var N=0;if(H.
 right!=0||H.left!=0){N=K.getBorderBoxSize().width+M}else{N=M}if(N<0){if(I>0){G=G+N/I}N=0}if(N<H.minWidth){if(I>0){G=G+(N-H.minWidth)/I}N=H.minWidth}if(H.maxWidth>=0&&N>H.maxWidth){if(I>0){G=G+(N-H.maxWidth)/I}N=K.options.maxWidth}var A=D-C-N;J.resize({left:C,right:A});C+=N}var F=K.retrieve("rightBar");if(F){F.setStyle("left",B+C);C+=F.retrieve("size").width}}},verticalResize:function(){var N=this.domObj.getContentBoxSize().height;var B=N;for(var D=0;D<this.bars.length;D++){var L=this.bars[D];var Q=L.retrieve("size");if(!Q||Q.height==0){Q=L.getBorderBoxSize();L.store("size",Q)}N-=Q.height}var I=0;var H;for(var D=0;D<this.elements.length;D++){var K=this.elements[D];H=K.retrieve("jxLayout").options;if(H.height!=null){N-=parseInt(H.height)}else{var G=0;if(H.bottom!=0||H.top!=0){G=K.getBorderBoxSize().height}N-=G;I++}}if(I==0){N+=H.height;H.height=null;I=1}var F=parseInt(N/I);var O=N%I;var P=this.domObj.getPaddingSize().top;var C=0;for(var D=0;D<this.elements.length;D++){var K=th
 is.elements[D];var J=K.retrieve("jxLayout");var H=J.options;if(H.height!=null){J.resize({top:C});C+=H.height}else{var M=F;if(I==1){M+=O}I--;var G=0;if(H.bottom!=0||H.top!=0){G=K.getBorderBoxSize().height+M}else{G=M}if(G<0){if(I>0){F=F+G/I}G=0}if(G<H.minHeight){if(I>0){F=F+(G-H.minHeight)/I}G=H.minHeight}if(H.maxHeight>=0&&G>H.maxHeight){if(I>0){F=F+(G-H.maxHeight)/I}G=H.maxHeight}var A=B-C-G;J.resize({top:C,bottom:A});C+=G}var E=K.retrieve("rightBar");if(E){E.style.top=P+C+"px";C+=E.retrieve("size").height}}}});Jx.PanelSet=new Class({Family:"Jx.PanelSet",Implements:[Options,Events,Jx.Addable],options:{parent:null,panels:[],barTooltip:"drag this bar to resize"},panels:null,height:null,firstLayout:true,initialize:function(A){if(A&&A.panels){this.panels=A.panels;A.panels=null}this.setOptions(A);this.domObj=new Element("div");new Jx.Layout(this.domObj);var C=new Element("div",{styles:{position:"absolute"}});new Jx.Layout(C,{minHeight:0,maxHeight:0,height:0});var B=[C];this.panel
 s.each(function(D){B.push(D.domObj);D.options.hideTitle=true;D.contentContainer.resize({top:0});D.toggleCollapse=this.maximizePanel.bind(this,D);D.domObj.store("Jx.Panel",D);D.manager=this},this);this.splitter=new Jx.Splitter(this.domObj,{splitInto:this.panels.length+1,layout:"vertical",elements:B,prepareBar:(function(F){var G=new Element("div",{"class":"jxPanelBar",title:this.options.barTooltip});var D=this.panels[F];D.title.setStyle("visibility","hidden");$(document.body).adopt(D.title);var E=D.title.getBorderBoxSize();G.adopt(D.title);D.title.setStyle("visibility","");G.setStyle("height",E.height);G.store("size",E);return G}).bind(this)});this.addEvent("addTo",function(){$(this.domObj.parentNode).setStyle("overflow","hidden");this.domObj.resize()});if(this.options.parent){this.addTo(this.options.parent)}},maximizePanel:function(C){var F=this.domObj.getContentBoxSize().height;var B=F;var K=C.domObj.retrieve("jxLayout").options.maxHeight;var I;for(var H=1;H<this.splitter.el
 ements.length;H++){var D=this.splitter.elements[H];B-=D.retrieve("leftBar").getBorderBoxSize().height;if(D!==C.domObj){var G=D.retrieve("Jx.Panel");var E=D.retrieve("jxLayout").options;B-=E.minHeight}else{I=H}}if(K==-1||K>=B){K=B;B=0}else{B=B-K}var L=0;for(var H=1;H<this.splitter.elements.length;H++){var D=this.splitter.elements[H];L+=D.retrieve("leftBar").getBorderBoxSize().height;if(D!==C.domObj){var G=D.retrieve("Jx.Panel");var E=D.retrieve("jxLayout").options;var J=$chk(E.height)?E.height:D.getBorderBoxSize().height;if(B>0){if(B>=J){B-=J;D.resize({top:L,height:J});L+=J}else{if(B>E.minHeight){D.resize({top:L,height:B});L+=B;B=0}else{D.resize({top:L,height:E.minHeight});L+=E.minHeight}}}else{D.resize({top:L,height:E.minHeight});L+=E.minHeight}D.retrieve("rightBar").style.top=L+"px"}else{break}}var A=F;for(var H=this.splitter.elements.length-1;H>0;H--){D=this.splitter.elements[H];if(D!==C.domObj){var E=D.retrieve("jxLayout").options;var J=$chk(E.height)?E.height:D.getBorder
 BoxSize().height;if(B>0){if(B>=J){A-=J;B-=J;D.resize({top:A,height:J})}else{if(B>E.minHeight){A-=B;D.resize({top:A,height:B});B=0}else{A-=E.minHeight;D.resize({top:A,height:E.minHeight})}}}else{A-=E.minHeight;D.resize({top:A,height:E.minHeight,bottom:null})}A-=D.retrieve("leftBar").getBorderBoxSize().height;D.retrieve("leftBar").style.top=A+"px"}else{break}}C.domObj.resize({top:L,height:K,bottom:null})}});Jx.Grid=new Class({Family:"Jx.Grid",Implements:[Options,Events,Jx.Addable],domObj:null,model:null,options:{parent:null,alternateRowColors:false,rowHeaders:false,columnHeaders:false,rowSelection:false,columnSelection:false,cellPrelight:false,rowPrelight:false,columnPrelight:false,rowHeaderPrelight:false,columnHeaderPrelight:false,cellSelection:false},initialize:function(A){this.setOptions(A);this.domObj=new Element("div");new Jx.Layout(this.domObj,{onSizeChange:this.resize.bind(this)});if(this.options.parent){this.addTo(this.options.parent)}this.rowColObj=new Element("div",{
 "class":"jxGridContainer"});this.colObj=new Element("div",{"class":"jxGridContainer"});this.colTable=new Element("table",{"class":"jxGridTable"});this.colTableHead=new Element("thead");this.colTable.appendChild(this.colTableHead);this.colTableBody=new Element("tbody");this.colTable.appendChild(this.colTableBody);this.colObj.appendChild(this.colTable);this.rowObj=new Element("div",{"class":"jxGridContainer"});this.rowTable=new Element("table",{"class":"jxGridTable"});this.rowTableHead=new Element("thead");this.rowTable.appendChild(this.rowTableHead);this.rowObj.appendChild(this.rowTable);this.gridObj=new Element("div",{"class":"jxGridContainer",styles:{overflow:"scroll"}});this.gridTable=new Element("table",{"class":"jxGridTable"});this.gridTableBody=new Element("tbody");this.gridTable.appendChild(this.gridTableBody);this.gridObj.appendChild(this.gridTable);this.domObj.appendChild(this.rowColObj);this.domObj.appendChild(this.rowObj);this.domObj.appendChild(this.colObj);this.d
 omObj.appendChild(this.gridObj);this.gridObj.addEvent("scroll",this.onScroll.bind(this));this.gridObj.addEvent("click",this.onClickGrid.bindWithEvent(this));this.rowObj.addEvent("click",this.onClickRowHeader.bindWithEvent(this));this.colObj.addEvent("click",this.onClickColumnHeader.bindWithEvent(this));this.gridObj.addEvent("mousemove",this.onMouseMoveGrid.bindWithEvent(this));this.rowObj.addEvent("mousemove",this.onMouseMoveRowHeader.bindWithEvent(this));this.colObj.addEvent("mousemove",this.onMouseMoveColumnHeader.bindWithEvent(this))},onScroll:function(){this.colObj.scrollLeft=this.gridObj.scrollLeft;this.rowObj.scrollTop=this.gridObj.scrollTop},resize:function(){if(!this.model){return }var C=this.options.columnHeaders?this.model.getColumnHeaderHeight():1;var A=this.options.rowHeaders?this.model.getRowHeaderWidth():1;var B=Element.getContentBoxSize(this.domObj);this.rowColObj.setStyles({width:A-1,height:C-1});this.rowObj.setStyles({top:C,left:0,width:A-1,height:B.height-C
 -1});this.colObj.setStyles({top:0,left:A,width:B.width-A-1,height:C-1});this.gridObj.setStyles({top:C,left:A,width:B.width-A-1,height:B.height-C-1})},setModel:function(A){this.model=A;if(this.model){if(this.domObj.resize){this.domObj.resize()}this.createGrid();this.resize()}else{this.destroyGrid()}},destroyGrid:function(){var A=this.colTableHead.cloneNode(false);this.colTable.replaceChild(A,this.colTableHead);this.colTableHead=A;A=this.colTableBody.cloneNode(false);this.colTable.replaceChild(A,this.colTableBody);this.colTableBody=A;A=this.rowTableHead.cloneNode(false);this.rowTable.replaceChild(A,this.rowTableHead);this.rowTableHead=A;A=this.gridTableBody.cloneNode(false);this.gridTable.replaceChild(A,this.gridTableBody);this.gridTableBody=A},createGrid:function(){this.destroyGrid();if(this.model){var L=this.model;var E=L.getColumnCount();var Q=L.getRowCount();if(this.options.columnHeaders){var N=L.getColumnHeaderHeight();var P=new Element("tr");this.colTableHead.appendChild
 (P);var M=new Element("tr");this.colTableBody.appendChild(M);var C=new Element("th",{styles:{width:0,height:0}});P.appendChild(C);C=C.cloneNode(true);C.setStyle("height",N);M.appendChild(C);for(var K=0;K<E;K++){var J=L.getColumnWidth(K);C=new Element("th",{"class":"jxGridColHeadHide",styles:{width:J}});var B=new Element("p",{styles:{height:0,width:J}});C.appendChild(B);P.appendChild(C);C=new Element("th",{"class":"jxGridColHead",html:L.getColumnHeaderHTML(K)});M.appendChild(C)}var C=new Element("th",{styles:{width:1000,height:0}});P.appendChild(C);C=C.cloneNode(true);C.setStyle("height",N-1);C.className="jxGridColHead";M.appendChild(C)}if(this.options.rowHeaders){var H=L.getRowHeaderWidth();var O=new Element("tr");var G=new Element("td",{styles:{width:0,height:0}});O.appendChild(G);var C=new Element("th",{styles:{width:H,height:0}});O.appendChild(C);this.rowTableHead.appendChild(O);for(var K=0;K<Q;K++){var A=L.getRowHeight(K);var O=new Element("tr");var G=new Element("td",{"
 class":"jxGridRowHeadHide",styles:{width:0,height:A}});var B=new Element("p",{styles:{width:0,height:A}});G.appendChild(B);O.appendChild(G);var C=new Element("th",{"class":"jxGridRowHead",html:L.getRowHeaderHTML(K)});O.appendChild(C);this.rowTableHead.appendChild(O)}var O=new Element("tr");var G=new Element("td",{styles:{width:0,height:1000}});O.appendChild(G);var C=new Element("th",{"class":"jxGridRowHead",styles:{width:H,height:1000}});O.appendChild(C);this.rowTableHead.appendChild(O)}var N=L.getColumnHeaderHeight();var M=new Element("tr");this.gridTableBody.appendChild(M);var G=new Element("td",{styles:{width:0,height:0}});M.appendChild(G);for(var K=0;K<E;K++){var J=L.getColumnWidth(K);G=new Element("td",{"class":"jxGridColHeadHide",styles:{width:J}});var B=new Element("p",{styles:{width:J,height:0}});G.appendChild(B);M.appendChild(G)}for(var I=0;I<Q;I++){var A=L.getRowHeight(I);var D=A;var O=new Element("tr");this.gridTableBody.appendChild(O);var G=new Element("td",{"cla
 ss":"jxGridRowHeadHide",styles:{width:0,height:A}});var B=new Element("p",{styles:{height:A}});G.appendChild(B);O.appendChild(G);for(var K=0;K<E;K++){var J=L.getColumnWidth(K);G=new Element("td",{"class":"jxGridCell"});G.innerHTML=L.getValueAt(I,K);O.appendChild(G);var F=G.getSize();if(F.height>D){D=F.height}}if(document.all){D-=1}if(this.options.rowHeaders){this.setRowHeaderHeight(I,D)}if(this.options.alternateRowColors){O.className=(I%2)?"jxGridRowOdd":"jxGridRowEven"}else{O.className="jxGridRowAll"}}}},setRowHeaderHeight:function(B,A){this.rowTableHead.childNodes[B+1].childNodes[0].childNodes[0].style.height=(A)+"px"},gridChanged:function(B,D,A,C){if(this.model==B){this.gridObj.childNodes[D].childNodes[A].innerHTML=C}},prelightRowHeader:function(B){var A=(B>=0&&B<this.rowTableHead.rows.length-1)?this.rowTableHead.rows[B+1].cells[1]:null;if(this.prelitRowHeader!=A){if(this.prelitRowHeader){this.prelitRowHeader.removeClass("jxGridRowHeaderPrelight")}this.prelitRowHeader=A;i
 f(this.prelitRowHeader){this.prelitRowHeader.addClass("jxGridRowHeaderPrelight")}}},prelightColumnHeader:function(B){if(this.colTableBody.rows.length==0){return }var A=(B>=0&&B<this.colTableBody.rows[0].cells.length-1)?this.colTableBody.rows[0].cells[B+1]:null;if(this.prelitColumnHeader!=A){if(this.prelitColumnHeader){this.prelitColumnHeader.removeClass("jxGridColumnHeaderPrelight")}this.prelitColumnHeader=A;if(this.prelitColumnHeader){this.prelitColumnHeader.addClass("jxGridColumnHeaderPrelight")}}},prelightRow:function(B){var A=(B>=0&&B<this.gridTableBody.rows.length-1)?this.gridTableBody.rows[B+1]:null;if(this.prelitRow!=B){if(this.prelitRow){this.prelitRow.removeClass("jxGridRowPrelight")}this.prelitRow=A;if(this.prelitRow){this.prelightRowHeader(B);this.prelitRow.addClass("jxGridRowPrelight")}}},prelightColumn:function(A){if(A>=0&&A<this.gridTable.rows[0].cells.length){if($chk(this.prelitColumn)){for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells
 [this.prelitColumn+1].removeClass("jxGridColumnPrelight")}}this.prelitColumn=A;for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells[A+1].addClass("jxGridColumnPrelight")}}this.prelightColumnHeader(A)},prelightCell:function(B,A){var C=(B>=0&&A>=0&&B<this.gridTableBody.rows.length-1&&A<this.gridTableBody.rows[B+1].cells.length-1)?this.gridTableBody.rows[B+1].cells[A+1]:null;if(this.prelitCell!=C){if(this.prelitCell){this.prelitCell.removeClass("jxGridCellPrelight")}this.prelitCell=C;if(this.prelitCell){this.prelitCell.addClass("jxGridCellPrelight")}}},selectCell:function(B,A){var C=(B>=0&&A>=0&&B<this.gridTableBody.rows.length-1&&A<this.gridTableBody.rows[B+1].cells.length-1)?this.gridTableBody.rows[B+1].cells[A+1]:null;if(!C){return }if(this.selectedCell){this.selectedCell.removeClass("jxGridCellSelected")}this.selectedCell=C;this.selectedCell.addClass("jxGridCellSelected")},selectRowHeader:function(C,B){var A=(C>=0&&C<this.rowTableHead.rows.length-1)?th
 is.rowTableHead.rows[C+1].cells[1]:null;if(!A){return }if(B){A.addClass("jxGridRowHeaderSelected")}else{A.removeClass("jxGridRowHeaderSelected")}},selectRow:function(C,A){var B=(C>=0&&C<this.gridTableBody.rows.length-1)?this.gridTableBody.rows[C+1]:null;if(B){if(A){B.addClass("jxGridRowSelected")}else{B.removeClass("jxGridRowSelected")}this.selectRowHeader(C,A)}},selectColumnHeader:function(B,C){if(this.colTableBody.rows.length==0){return }var A=(B>=0&&B<this.colTableBody.rows[0].cells.length-1)?this.colTableBody.rows[0].cells[B+1]:null;if(A==null){return }if(C){A.addClass("jxGridColumnHeaderSelected")}else{A.removeClass("jxGridColumnHeaderSelected")}},selectColumn:function(A,C){if(A>=0&&A<this.gridTable.rows[0].cells.length){if(C){for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells[A+1].addClass("jxGridColumnSelected")}}else{for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells[A+1].removeClass("jxGridColumnSelected")}}this.select
 ColumnHeader(A,C)}},onMouseMoveGrid:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.cellPrelight){this.prelightCell(A.row,A.column)}if(this.options.rowPrelight){this.prelightRow(A.row)}if(this.options.rowHeaderPrelight){this.prelightRowHeader(A.row)}if(this.options.columnPrelight){this.prelightColumn(A.column)}if(this.options.columnHeaderPrelight){this.prelightColumnHeader(A.column)}},onMouseMoveRowHeader:function(B){if(this.options.rowPrelight){var A=this.getRowColumnFromEvent(B);this.prelightRow(A.row)}},onMouseMoveColumnHeader:function(B){if(this.options.columnPrelight){var A=this.getRowColumnFromEvent(B);this.prelightColumn(A.column)}},onClickGrid:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.cellSelection&&this.model.cellSelected){this.model.cellSelected(this,A.row,A.column)}if(this.options.rowSelection&&this.model.rowSelected){this.model.rowSelected(this,A.row)}if(this.options.columnSelection&&this.model.columnSelected){this.model.colu
 mnSelected(this,A.column)}},onClickRowHeader:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.rowSelection&&this.model.rowSelected){this.model.rowSelected(this,A.row)}},onClickColumnHeader:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.columnSelection&&this.model.columnSelected){this.model.columnSelected(this,A.column)}},getRowColumnFromEvent:function(D){var F=D.target;if(F.tagName!="TD"&&F.tagName!="TH"){return{row:-1,column:-1}}var C=F.parentNode;var A=F.cellIndex-1;var E=C.rowIndex-1;if(A==-1){for(var B=0;B<C.childNodes.length;B++){if(C.childNodes[B]==F){A=B-1;break}}}return{row:E,column:A}}});Jx.Grid.Model=new Class({Family:"Jx.Grid.Model",Implements:[Events,Options],options:{colHeaderHeight:28,rowHeaderWidth:28,colWidth:50,rowHeight:20,rowHeaders:null,columnHeaders:null},data:null,initialize:function(B,A){this.data=B||[];this.setOptions(A)},getColumnCount:function(){return(this.data&&this.data[0])?this.data[0].length:0},getColumnHeaderHTM
 L:function(A){return this.options.columnHeaders?this.options.columnHeaders[A]:A+1},getColumnHeaderHeight:function(){return this.options.colHeaderHeight},getColumnWidth:function(A){return this.options.colWidth},getRowHeaderHTML:function(A){return this.options.rowHeaders?this.options.rowHeaders[A]:A+1},getRowHeaderWidth:function(){return this.options.rowHeaderWidth},getRowHeight:function(A){return this.options.rowHeight},getRowCount:function(){return this.data.length},getValueAt:function(B,A){return(this.data&&$chk(this.data[B]))?this.data[B][A]:""},setColumnWidth:function(){},isCellEditable:function(){return false},setValueAt:function(C,A,B){},rowSelected:function(A,B){if(this.selectedRow!=null){A.selectRow(this.selectedRow,false)}this.selectedRow=B;A.selectRow(B,true);this.fireEvent("select-row",B)},columnSelected:function(B,A){if(this.selectedCol!=null){B.selectColumn(this.selectedCol,false)}this.selectedCol=A;B.selectColumn(A,true);this.fireEvent("select-column",A)},cellSe
 lected:function(B,C,A){B.selectCell(C,A);this.fireEvent("select-cell",[C,A])}});Jx.Menu.Context=new Class({Family:"Jx.Menu.Context",Extends:Jx.Menu,initialize:function(A){this.parent();if($(A)){$(A).addEvent("contextmenu",this.show.bindWithEvent(this))}},show:function(A){if(this.items.length==0){return }this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.position(this.contentContainer,document.body,{horizontal:[A.page.x+" left"],vertical:[A.page.y+" top",A.page.y+" bottom"],offsets:this.chromeOffsets});this.contentContainer.setStyle("visibility","");this.showChrome(this.contentContainer);document.addEvent("mousedown",this.hideWatcher);document.addEvent("keyup",this.keypressWatcher);A.stop()}});Jx.Menu.Separator=new Class({Family:"Jx.Menu.Separator",domObj:null,owner:null,initialize:function(){this.do
 mObj=new Element("li",{"class":"jxMenuItem"});var A=new Element("span",{"class":"jxMenuSeparator",html:"&nbsp;"});this.domObj.appendChild(A)},setOwner:function(A){this.owner=A},hide:$empty,show:$empty});Jx.Menu.SubMenu=new Class({Family:"Jx.Menu.SubMenu",Extends:Jx.Menu.Item,Implements:[Jx.AutoPosition,Jx.Chrome],subDomObj:null,owner:null,visibleItem:null,items:null,initialize:function(A){this.open=false;this.items=[];this.parent(A);this.domA.addClass("jxButtonSubMenu");this.contentContainer=new Element("div",{"class":"jxMenuContainer"});this.subDomObj=new Element("ul",{"class":"jxSubMenu"});this.contentContainer.adopt(this.subDomObj)},setOwner:function(A){this.owner=A},show:function(){if(this.open||this.items.length==0){return }this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.showChrome(this.cont
 entContainer);this.position(this.contentContainer,this.domObj,{horizontal:["right left","left right"],vertical:["top top"],offsets:this.chromeOffsets});this.open=true;this.contentContainer.setStyle("visibility","");this.setActive(true)},eventInMenu:function(A){if(this.visibleItem&&this.visibleItem.eventInMenu&&this.visibleItem.eventInMenu(A)){return true}return $(A.target).descendantOf(this.domObj)||$(A.target).descendantOf(this.subDomObj)||this.items.some(function(B){return B instanceof Jx.Menu.SubMenu&&B.eventInMenu(A)})},hide:function(){if(!this.open){return }this.open=false;this.items.each(function(A){A.hide()});this.contentContainer.setStyle("display","none");this.visibleItem=null},add:function(){var A=this;$A(arguments).each(function(B){A.items.push(B);B.setOwner(A);A.subDomObj.adopt(B.domObj)});return this},insertBefore:function(C,D){var B=false;for(var A=0;A<this.items.length;A++){if(this.items[A]==D){this.items.splice(A,0,C);this.subDomObj.insertBefore(C.domObj,D.do
 mObj);B=true;break}}if(!B){this.add(C)}},remove:function(B){for(var A=0;A<this.items.length;A++){if(this.items[A]==B){this.items.splice(A,1);this.subDomObj.removeChild(B.domObj);break}}},deactivate:function(A){if(this.owner){this.owner.deactivate(A)}},isActive:function(){if(this.owner){return this.owner.isActive()}else{return false}},setActive:function(A){if(this.owner&&this.owner.setActive){this.owner.setActive(A)}},setVisibleItem:function(A){if(this.visibleItem!=A){if(this.visibleItem&&this.visibleItem.hide){this.visibleItem.hide()}this.visibleItem=A;this.visibleItem.show()}}});Jx.Splitter.Snap=new Class({Family:"Jx.Splitter.Snap",snap:null,element:null,splitter:null,layout:"vertical",initialize:function(A,F,G,E){this.snap=A;this.element=F;var D=F.retrieve("jxLayout");D.addEvent("sizeChange",this.sizeChange.bind(this));this.splitter=G;this.layout=G.options.layout;var B=D.options;var C=this.element.getContentBoxSize();if(this.layout=="vertical"){this.originalSize=C.height;t
 his.minimumSize=B.minHeight?B.minHeight:0}else{this.originalSize=C.width;this.minimumSize=B.minWidth?B.minWidth:0}E.each(function(H){A.addEvent(H,this.toggleElement.bind(this))},this)},toggleElement:function(){var B=this.element.getContentBoxSize();var A={};if(this.layout=="vertical"){if(B.height==this.minimumSize){A.height=this.originalSize}else{this.originalSize=B.height;A.height=this.minimumSize}}else{if(B.width==this.minimumSize){A.width=this.originalSize}else{this.originalSize=B.width;A.width=this.minimumSize}}this.element.resize(A);this.splitter.sizeChanged()},sizeChange:function(){var A=this.element.getContentBoxSize();if(this.layout=="vertical"){if(A.height==this.minimumSize){this.snap.addClass("jxSnapClosed");this.snap.removeClass("jxSnapOpened")}else{this.snap.addClass("jxSnapOpened");this.snap.removeClass("jxSnapClosed")}}else{if(A.width==this.minimumSize){this.snap.addClass("jxSnapClosed");this.snap.removeClass("jxSnapOpened")}else{this.snap.addClass("jxSnapOpene
 d");this.snap.removeClass("jxSnapClosed")}}}});Jx.Toolbar=new Class({Family:"Jx.Toolbar",Implements:[Options,Events],items:null,domObj:null,isActive:false,options:{type:"Toolbar",parent:null,autoSize:false,scroll:true},initialize:function(A){this.setOptions(A);this.items=[];this.domObj=new Element("ul",{id:this.options.id,"class":"jx"+this.options.type});if(this.options.parent){this.addTo(this.options.parent)}this.deactivateWatcher=this.deactivate.bindWithEvent(this);if(this.options.items){this.add(this.options.items)}},addTo:function(A){var B=$(A).retrieve("jxBarContainer");if(!B){B=new Jx.Toolbar.Container({parent:A,position:this.options.position,autoSize:this.options.autoSize,scroll:this.options.scroll})}B.add(this);return this},add:function(){$A(arguments).flatten().each(function(A){if(A.domObj){A=A.domObj}if(A.tagName=="LI"){if(!A.hasClass("jxToolItem")){A.addClass("jxToolItem")}this.domObj.appendChild(A)}else{var B=new Jx.Toolbar.Item(A);this.domObj.appendChild(B.domOb
 j)}},this);if(arguments.length>0){this.fireEvent("add",this)}return this},remove:function(B){if(B.domObj){B=B.domObj}var A=B.findElement("LI");if(A&&A.parentNode==this.domObj){B.dispose();A.dispose();this.fireEvent("remove",this)}else{return null}},deactivate:function(){this.items.each(function(A){A.hide()});this.setActive(false)},isActive:function(){return this.isActive},setActive:function(A){this.isActive=A;if(this.isActive){document.addEvent("click",this.deactivateWatcher)}else{document.removeEvent("click",this.deactivateWatcher)}},setVisibleItem:function(A){if(this.visibleItem&&this.visibleItem.hide&&this.visibleItem!=A){this.visibleItem.hide()}this.visibleItem=A;if(this.isActive()){this.visibleItem.show()}},showItem:function(A){this.fireEvent("show",A)}});Jx.TabSet=new Class({Family:"Jx.TabSet",Implements:[Options,Events],tabs:null,domObj:null,initialize:function(B,A){this.setOptions(A);this.tabs=[];this.domObj=$(B);if(!this.domObj.hasClass("jxTabSetContainer")){this.do
 mObj.addClass("jxTabSetContainer")}this.setActiveTabFn=this.setActiveTab.bind(this)},resizeTabBox:function(){if(this.activeTab&&this.activeTab.content.resize){this.activeTab.content.resize({forceResize:true})}},add:function(){$A(arguments).each(function(A){if(A instanceof Jx.Button.Tab){A.addEvent("down",this.setActiveTabFn);A.tabSet=this;this.domObj.appendChild(A.content);this.tabs.push(A);if((!this.activeTab||A.options.active)&&A.options.enabled){A.options.active=false;A.setActive(true)}}},this);return this},remove:function(A){if(A instanceof Jx.Button.Tab&&this.tabs.indexOf(A)!=-1){this.tabs.erase(A);if(this.activeTab==A){if(this.tabs.length){this.tabs[0].setActive(true)}}A.removeEvent("down",this.setActiveTabFn);A.content.dispose()}},setActiveTab:function(A){if(this.activeTab&&this.activeTab!=A){this.activeTab.setActive(false)}this.activeTab=A;if(this.activeTab.content.resize){this.activeTab.content.resize({forceResize:true})}this.fireEvent("tabChange",[this,A])}});Jx.Ta
 bBox=new Class({Family:"Jx.TabBox",Implements:[Options,Events,Jx.Addable],options:{parent:null,position:"top",height:null,width:null,scroll:true},tabBar:null,tabSet:null,initialize:function(A){this.setOptions(A);this.tabBar=new Jx.Toolbar({type:"TabBar",position:this.options.position,scroll:this.options.scroll});this.panel=new Jx.Panel({toolbars:[this.tabBar],hideTitle:true,height:this.options.height,width:this.options.width});this.panel.domObj.addClass("jxTabBox");this.tabSet=new Jx.TabSet(this.panel.content);this.tabSet.addEvent("tabChange",function(B,C){this.showItem(C)}.bind(this.tabBar));this.domObj=this.panel.domObj;this.panel.addEvent("sizeChange",(function(){this.tabSet.resizeTabBox();this.tabBar.domObj.getParent(".jxBarContainer").retrieve("jxBarContainer").update()}).bind(this));this.tabBar.addEvents({add:(function(){this.domObj.resize({forceResize:true})}).bind(this),remove:(function(){this.domObj.resize({forceResize:true})}).bind(this)});this.addEvent("addTo",fun
 ction(){this.domObj.resize({forceResize:true})});if(this.options.parent){this.addTo(this.options.parent)}},add:function(){this.tabBar.add.apply(this.tabBar,arguments);this.tabSet.add.apply(this.tabSet,arguments);$A(arguments).flatten().each(function(A){A.addEvents({close:(function(){this.tabBar.remove(A);this.tabSet.remove(A)}).bind(this)})},this);return this},remove:function(A){this.tabBar.remove(A);this.tabSet.remove(A)}});Jx.Toolbar.Container=new Class({Family:"Jx.Toolbar.Container",Implements:[Options,Events,Jx.Addable],domObj:null,options:{parent:null,position:"top",autoSize:false,scroll:true},initialize:function(A){this.setOptions(A);var B=$(this.options.parent);this.domObj=B||new Element("div");this.domObj.addClass("jxBarContainer");if(this.options.scroll){this.scroller=new Element("div",{"class":"jxBarScroller"});this.domObj.adopt(this.scroller)}this.domObj.store("jxBarContainer",this);if(["top","right","bottom","left"].contains(this.options.position)){this.domObj.ad
 dClass("jxBar"+this.options.position.capitalize())}else{this.domObj.addClass("jxBarTop");this.options.position="top"}if(this.options.scroll&&["top","bottom"].contains(this.options.position)){this.addEvent("addTo",this.update.bind(this));if(typeof Fx!="undefined"&&typeof Fx.Tween!="undefined"){this.scrollFx=scrollFx=new Fx.Tween(this.scroller,{link:"chain"})}this.scrollLeft=new Jx.Button({image:Jx.aPixel.src}).addTo(this.domObj);this.scrollLeft.domObj.addClass("jxBarScrollLeft");this.scrollLeft.addEvents({click:(function(){var D=this.scroller.getStyle("left").toInt();if(isNaN(D)){D=0}var C=Math.min(D+100,0);if(C>=0){this.scrollLeft.domObj.setStyle("visibility","hidden")}this.scrollRight.domObj.setStyle("visibility","");if($defined(this.scrollFx)){this.scrollFx.start("left",D,C)}else{this.scroller.setStyle("left",C)}}).bind(this)});this.scrollRight=new Jx.Button({image:Jx.aPixel.src}).addTo(this.domObj);this.scrollRight.domObj.addClass("jxBarScrollRight");this.scrollRight.addE
 vents({click:(function(){var D=this.scroller.getStyle("left").toInt();if(isNaN(D)){D=0}var C=Math.max(D-100,this.scrollWidth);if(C==this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden")}this.scrollLeft.domObj.setStyle("visibility","");if($defined(this.scrollFx)){this.scrollFx.start("left",D,C)}else{this.scroller.setStyle("left",C)}}).bind(this)})}else{this.options.scroll=false}if(this.options.toolbars){this.add(this.options.toolbars)}},update:function(){if(this.options.autoSize){(function(){var A=0;this.scroller.getChildren().each(function(B){A+=B.getSize().x});this.domObj.setStyles({width:A});this.measure()}).delay(1,this)}else{this.measure()}},measure:function(){if((!this.scrollLeftSize||!this.scrollLeftSize.x)&&this.domObj.parentNode){this.scrollLeftSize=this.scrollLeft.domObj.getSize();this.scrollRightSize=this.scrollRight.domObj.getSize()}this.scrollWidth=this.domObj.getSize().x;this.scroller.getChildren().each(function(C){this.scrollWidth-=C.getSize
 ().x},this);if(this.scrollWidth<0){var A=this.scroller.getStyle("left").toInt();if(A<0){this.scrollLeft.domObj.setStyle("visibility","")}else{this.scrollLeft.domObj.setStyle("visibility","hidden")}if(A<=this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden");if(A<this.scrollWidth){if($defined(this.scrollFx)){this.scrollFx.start("left",A,this.scrollWidth)}else{this.scroller.setStyle("left",this.scrollWidth)}}}else{this.scrollRight.domObj.setStyle("visibility","")}}else{this.scrollLeft.domObj.setStyle("visibility","hidden");this.scrollRight.domObj.setStyle("visibility","hidden");var B=this.scroller.getStyle("left").toInt();if(!isNaN(B)&&B!==0){if($defined(this.scrollFx)){this.scrollFx.start("left",0)}else{this.scroller.setStyle("left",0)}}}},add:function(){$A(arguments).flatten().each(function(A){if(this.options.scroll){A.addEvent("add",this.update.bind(this));A.addEvent("remove",this.update.bind(this));A.addEvent("show",this.scrollIntoView.bind(this))}if(thi
 s.scroller){this.scroller.adopt(A.domObj)}else{this.domObj.adopt(A.domObj)}this.domObj.addClass("jx"+A.options.type+this.options.position.capitalize())},this);if(this.options.scroll){this.update()}if(arguments.length>0){this.fireEvent("add",this)}return this},remove:function(A){},scrollIntoView:function(D){var C=this.domObj.getSize().x;var E=D.domObj.getCoordinates(this.scroller);var B=this.scroller.getStyle("left");if(B==="auto"||B.length<=0){B=0}else{B=B.toInt()}var G=this.scrollLeftSize?this.scrollLeftSize.x:0;var A=this.scrollRightSize?this.scrollRightSize.x:0;var F=B;if(B<-E.left+G){F=-E.left+G;if(F>=0){F=0}}else{if(C-E.right-A<B){F=C-E.right-A;if(F<this.scrollWidth){F=this.scrollWidth}}}if(F<0){this.scrollLeft.domObj.setStyle("visibility","")}else{this.scrollLeft.domObj.setStyle("visibility","hidden")}if(F<=this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden")}else{this.scrollRight.domObj.setStyle("visibility","")}if(F!=B){if($defined(this.scrollFx)
 ){this.scrollFx.start("left",F)}else{this.scroller.setStyle("left",F)}}}});Jx.Toolbar.Item=new Class({Family:"Jx.Toolbar.Item",Implements:[Options],options:{active:true},domObj:null,initialize:function(A){this.al=[];this.domObj=new Element("li",{"class":"jxToolItem"});if(A){if(A.domObj){this.domObj.appendChild(A.domObj);if(A instanceof Jx.Button.Tab){this.domObj.addClass("jxTabItem")}}else{this.domObj.appendChild(A);if(A.hasClass("jxTab")){this.domObj.addClass("jxTabItem")}}}}});Jx.Toolbar.Separator=new Class({Family:"Jx.Toolbar.Separator",domObj:null,initialize:function(){this.domObj=new Element("li",{"class":"jxToolItem"});this.domSpan=new Element("span",{"class":"jxBarSeparator"});this.domObj.appendChild(this.domSpan)}});Jx.TreeItem=new Class({Family:"Jx.TreeItem",Implements:[Options,Events],domObj:null,owner:null,options:{label:"",data:null,contextMenu:null,enabled:true,type:"Item",image:null,imageClass:""},initialize:function(A){this.setOptions(A);this.domObj=new Elemen
 t("li",{"class":"jxTree"+this.options.type});if(this.options.id){this.domObj.id=this.options.id}this.domNode=new Element("img",{"class":"jxTreeImage",src:Jx.aPixel.src,alt:"",title:""});this.domObj.appendChild(this.domNode);this.domLabel=(this.options.draw)?this.options.draw.apply(this):this.draw();this.domObj.appendChild(this.domLabel);this.domObj.store("jxTreeItem",this);if(!this.options.enabled){this.domObj.addClass("jxDisabled")}},draw:function(){var C=new Element("img",{"class":"jxTreeIcon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.image){C.setStyle("backgroundImage","url("+this.options.image+")")}if(this.options.imageClass){C.addClass(this.options.imageClass)}var D;var A;var B=new Element("a",{href:"javascript:void(0)",html:this.options.label});B.addEvents({click:this.selected.bind(this),dblclick:this.selected.bind(this),drag:function(E){E.stop()},contextmenu:function(E){E.stop()},mousedown:(function(E){B.addClass("jxTreeItemPressed");D=true;A=true;B.focus();
 if(E.rightClick&&this.options.contextMenu){this.options.contextMenu.show(E)}}).bind(this),mouseup:function(E){B.removeClass("jxTreeItemPressed");A=false},mouseleave:function(E){B.removeClass("jxTreeItemPressed")},mouseenter:function(E){if(D&&A){B.addClass("jxTreeItemPressed")}},keydown:function(E){if(E.key=="enter"){B.addClass("jxTreeItemPressed")}},keyup:function(E){if(E.key=="enter"){B.removeClass("jxTreeItemPressed")}},blur:function(){D=false}});B.appendChild(C);if(typeof Drag!="undefined"){new Drag(B,{onStart:function(){this.stop()}})}return B},finalize:function(){this.finalizeItem()},finalizeItem:function(){if(!this.domObj){return }this.options=null;this.domObj.dispose();this.domObj=null;this.owner=null},clone:function(){return new Jx.TreeItem(this.options)},update:function(B){var A=(arguments.length>1)?arguments[1]:(this.owner&&this.owner.isLastNode(this));if(A){this.domObj.removeClass("jxTree"+this.options.type);this.domObj.addClass("jxTree"+this.options.type+"Last")}
 else{this.domObj.removeClass("jxTree"+this.options.type+"Last");this.domObj.addClass("jxTree"+this.options.type)}},selected:function(A){this.fireEvent("click",this)},getName:function(){return this.options.label},propertyChanged:function(A){this.options.enabled=A.isEnabled();if(this.options.enabled){this.domObj.removeClass("jxDisabled")}else{this.domObj.addClass("jxDisabled")}}});Jx.TreeFolder=new Class({Family:"Jx.TreeFolder",Extends:Jx.TreeItem,subDomObj:null,nodes:null,options:{open:false},initialize:function(A){this.parent($merge(A,{type:"Branch"}));$(this.domNode).addEvent("click",this.clicked.bindWithEvent(this));this.addEvent("click",this.clicked.bindWithEvent(this));this.nodes=[];this.subDomObj=new Element("ul",{"class":"jxTree"});this.domObj.appendChild(this.subDomObj);if(this.options.open){this.expand()}else{this.collapse()}},finalize:function(){this.finalizeFolder();this.finalizeItem();this.subDomObj.dispose();this.subDomObj=null},finalizeFolder:function(){this.dom
 Obj.childNodes[0].removeEvents();for(var A=this.nodes.length-1;A>=0;A--){this.nodes[A].finalize();this.nodes.pop()}},clone:function(){var A=new Jx.TreeFolder(this.options);this.nodes.each(function(B){A.append(B.clone())});return A},isLastNode:function(A){if(this.nodes.length==0){return false}else{return this.nodes[this.nodes.length-1]==A}},update:function(C){if(!this.parent){return }var B=false;if(arguments.length>1){B=arguments[1]}else{B=(this.owner&&this.owner.isLastNode(this))}var D="jxTree"+this.options.type;D+=B?"Last":"";D+=this.options.open?"Open":"Closed";this.domObj.className=D;if(B){this.subDomObj.className="jxTree"}else{this.subDomObj.className="jxTree jxTreeNest"}if(this.nodes&&C){var A=this;this.nodes.each(function(F,E){F.update(false,E==A.nodes.length-1)})}},append:function(A){A.owner=this;this.nodes.push(A);this.subDomObj.appendChild(A.domObj);this.update(true);return this},insert:function(D,B){D.owner=this;if(!B){this.nodes.unshift(D);if(this.subDomObj.childN
 odes.length==0){this.subDomObj.appendChild(D.domObj)}else{this.subDomObj.insertBefore(D.domObj,this.subDomObj.childNodes[0])}}else{var A=false;for(var C=0;C<this.nodes.length;C++){if(this.nodes[C]==B){C=C+1;if(C<this.nodes.length){this.nodes.splice(C,0,D);this.subDomObj.insertBefore(D.domObj,this.subDomObj.childNodes[C]);A=true;break}}}if(!A){this.nodes.push(D);this.subDomObj.appendChild(D.domObj)}}this.update(true);return this},remove:function(B){B.owner=null;for(var A=0;A<this.nodes.length;A++){if(this.nodes[A]==B){this.nodes.splice(A,1);this.subDomObj.removeChild(this.subDomObj.childNodes[A]);break}}this.update(true);return this},replace:function(D,B){var A=false;for(var C=0;C<this.nodes.length;C++){if(this.nodes[C]==B){if(C<this.nodes.length){D.owner=this;this.nodes.splice(C,1,D);this.subDomObj.replaceChild(D.domObj,B.domObj);return true}}}return false},clicked:function(A){if(this.options.open){this.collapse()}else{this.expand()}},expand:function(){this.options.open=true
 ;this.subDomObj.setStyle("display","block");this.update(true);this.fireEvent("disclosed",this)},collapse:function(){this.options.open=false;this.subDomObj.setStyle("display","none");this.update(true);this.fireEvent("disclosed",this)},findChild:function(C){if(C.length==0){return this}if(C.length==1){for(var B=0;B<this.nodes.length;B++){if(this.nodes[B].getName()==C[0]){return this.nodes[B]}}return null}var A=C.shift();for(var B=0;B<this.nodes.length;B++){if(this.nodes[B].getName()==A&&this.nodes[B].findChild){return this.nodes[B].findChild(C)}}return null}});Jx.Tree=new Class({Extends:Jx.TreeFolder,Implements:[Jx.Addable],Family:"Jx.Tree",initialize:function(A){this.parent(A);this.subDomObj=new Element("ul",{"class":"jxTreeRoot"});this.nodes=[];this.isOpen=true;this.addable=this.subDomObj;if(this.options.parent){this.addTo(this.options.parent)}},finalize:function(){this.clear();this.subDomObj.parentNode.removeChild(this.subDomObj)},clear:function(){for(var A=this.nodes.length
 -1;A>=0;A--){this.subDomObj.removeChild(this.nodes[A].domObj);this.nodes[A].finalize();this.nodes.pop()}},update:function(A){var B=true;if(this.subDomObj){if(B){this.subDomObj.removeClass("jxTreeNest")}else{this.subDomObj.addClass("jxTreeNest")}}if(this.nodes&&A){this.nodes.each(function(C){C.update(false)})}},append:function(A){A.owner=this;this.nodes.push(A);this.subDomObj.appendChild(A.domObj);this.update(true);return this}});
\ No newline at end of file


Property changes on: trunk/MgDev/Web/src/viewerfiles/jxlib.js
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/jxtheme.css
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/jxtheme.css	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/jxtheme.css	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,177 +1,177 @@
- * @project         Jx
- * @revision        $Id: dialog.css 1035 2008-09-22 17:05:20Z pspencer $
- * @author          Fred Warnock (fwarnock at dmsolutions.ca)
- * @copyright       (c) 2006 DM Solutions Group Inc.
- */
-
-/* ============= */
-/* DIALOG STYLES */
-/* ============= */
-
-.jxDialog .jxChrome {
-  background-image: url("images/dialog_chrome.png");
-}
-
-.jxDialog .jxChrome img {
-  width: 500px;
-  height: 500px;
-}
-
-.jxDialog {
-  /* Base setup */
-  display: block;
-  /* starting default z-index for dialogs. Multiple dialogs will get 
-   * incremental values starting from this value
-   */
-  z-index: 1000;
-}
-
-.jxDialogContentContainer {
-  z-index: 1;
-  margin: 0px 11px 16px 11px;
-  border: none;
-  background-color: #f0f0f0;
-}
-
-.jxDialogModal {
-  /* Base setup */
-  position: absolute;
-  display: block;
-  top: 0px;
-  left: 0px;
-  width: 100%;
-  height: 100%;
-
-  background-color: #000;
-  opacity: .2;
-  -ms-filter: "Alpha(opacity=20)";
-}
-
-.jxDialogContent {
-  /* Base setup */
-  display: block;
-  position:relative;
-  overflow: auto;
-
-  padding: 0px;
-  z-index: 1;
-}
-
-.jxDialogTitle {
-   /* Base setup */
-  display: block;
-  position: relative;
-
-  /* this makes the dialog draggable by the title bar in IE
-   * Without it, only the label is draggable
-   */
-  background-image: url("images/a_pixel.png");
-
-  text-align: center;
-  /* note: height is hard coded into jx.js Jx.Dialog initialize function - change there as well as here */
-  height: 16px;
-  z-index: 1;
-
-  margin: 10px 10px 0px 10px;
-}
-
-.jxDialogMin .jxDialogTitle {
-  margin-bottom: 8px;
-}
-
-.jxDialogMoveable {
-  cursor: move;
-}
-
-.jxDialogIcon {
-  position: absolute;
-  left: 10px;
-  top: 0px;
-  width: 16px;
-  height: 16px;
-  border: none;
-  padding: 0px;
-  margin: 0px;
-}
-
-.jxDialogLabel {
-  font-family: Verdana, Arial, Helvetica, sans-serif;
-  font-size: 11px;
-  font-weight: bold;
-  /* line-height vertically aligns the label in the containing div. */
-  line-height:15px;
-  color: #000;
-  white-space: nowrap;
-}
-
-.jxDialogResize {
-  /* Base setup */
-  position: absolute;
-
-  bottom: 7px;
-  right: 6px;
-  width: 16px;
-  height: 16px;
-  z-index: 2;
-  border: 0px;
-  cursor: se-resize;
-  background-image: url("images/dialog_resize.png");
-}
-
-.jxDialogControls {
-  position: absolute;
-  top: 0px;
-  right: 2px;
-  height: 16px;
-  width: 80px;
-}
-
-.jxDialogControls img {
-  background-image: url('images/dialog_controls.png');
-  background-repeat: no-repeat;
-  border: 0px;
-  /* the margin needs to make up the difference between it's width/height
-     and the width/height of the parent a */
-  margin: 0px;
-  /* width/height has to be the actual image width/height */
-  width: 16px;
-  height: 16px;
-}
-
-.jxDialogClose img {
-  background-position: 0px -32px;
-}
-
-.jxDialogMenu img {
-  background-position: 0px -48px;
-}
-
-.jxDialogHelp img {
-  background-position: 0px -64px;
-}
-
-.jxDialogCollapse img {
-  background-position: 0px -16px;
-}
-
-.jxDialogMin .jxDialogCollapse img {
-  background-position: 0px 0px;
-}
-
-.jxDialogMax .jxDialogCollapse img {
-  background-position: 0px -16px;
-}
-
-.jxDialogLoading img {
-  border: 0px;
-  /* the margin needs to make up the difference between it's width/height
-     and the width/height of the parent a */
-  margin: 0px;
-  /* width/height has to be the actual image width/height */
-  width: 16px;
-  height: 16px;
-  visibility:hidden;
-  position: absolute;
-  top: 1px;
-  left: 2px;
-}
+ * @project         Jx
+ * @revision        $Id: dialog.css 1035 2008-09-22 17:05:20Z pspencer $
+ * @author          Fred Warnock (fwarnock at dmsolutions.ca)
+ * @copyright       (c) 2006 DM Solutions Group Inc.
+ */
+
+/* ============= */
+/* DIALOG STYLES */
+/* ============= */
+
+.jxDialog .jxChrome {
+  background-image: url("images/dialog_chrome.png");
+}
+
+.jxDialog .jxChrome img {
+  width: 500px;
+  height: 500px;
+}
+
+.jxDialog {
+  /* Base setup */
+  display: block;
+  /* starting default z-index for dialogs. Multiple dialogs will get 
+   * incremental values starting from this value
+   */
+  z-index: 1000;
+}
+
+.jxDialogContentContainer {
+  z-index: 1;
+  margin: 0px 11px 16px 11px;
+  border: none;
+  background-color: #f0f0f0;
+}
+
+.jxDialogModal {
+  /* Base setup */
+  position: absolute;
+  display: block;
+  top: 0px;
+  left: 0px;
+  width: 100%;
+  height: 100%;
+
+  background-color: #000;
+  opacity: .2;
+  -ms-filter: "Alpha(opacity=20)";
+}
+
+.jxDialogContent {
+  /* Base setup */
+  display: block;
+  position:relative;
+  overflow: auto;
+
+  padding: 0px;
+  z-index: 1;
+}
+
+.jxDialogTitle {
+   /* Base setup */
+  display: block;
+  position: relative;
+
+  /* this makes the dialog draggable by the title bar in IE
+   * Without it, only the label is draggable
+   */
+  background-image: url("images/a_pixel.png");
+
+  text-align: center;
+  /* note: height is hard coded into jx.js Jx.Dialog initialize function - change there as well as here */
+  height: 16px;
+  z-index: 1;
+
+  margin: 10px 10px 0px 10px;
+}
+
+.jxDialogMin .jxDialogTitle {
+  margin-bottom: 8px;
+}
+
+.jxDialogMoveable {
+  cursor: move;
+}
+
+.jxDialogIcon {
+  position: absolute;
+  left: 10px;
+  top: 0px;
+  width: 16px;
+  height: 16px;
+  border: none;
+  padding: 0px;
+  margin: 0px;
+}
+
+.jxDialogLabel {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  font-weight: bold;
+  /* line-height vertically aligns the label in the containing div. */
+  line-height:15px;
+  color: #000;
+  white-space: nowrap;
+}
+
+.jxDialogResize {
+  /* Base setup */
+  position: absolute;
+
+  bottom: 7px;
+  right: 6px;
+  width: 16px;
+  height: 16px;
+  z-index: 2;
+  border: 0px;
+  cursor: se-resize;
+  background-image: url("images/dialog_resize.png");
+}
+
+.jxDialogControls {
+  position: absolute;
+  top: 0px;
+  right: 2px;
+  height: 16px;
+  width: 80px;
+}
+
+.jxDialogControls img {
+  background-image: url('images/dialog_controls.png');
+  background-repeat: no-repeat;
+  border: 0px;
+  /* the margin needs to make up the difference between it's width/height
+     and the width/height of the parent a */
+  margin: 0px;
+  /* width/height has to be the actual image width/height */
+  width: 16px;
+  height: 16px;
+}
+
+.jxDialogClose img {
+  background-position: 0px -32px;
+}
+
+.jxDialogMenu img {
+  background-position: 0px -48px;
+}
+
+.jxDialogHelp img {
+  background-position: 0px -64px;
+}
+
+.jxDialogCollapse img {
+  background-position: 0px -16px;
+}
+
+.jxDialogMin .jxDialogCollapse img {
+  background-position: 0px 0px;
+}
+
+.jxDialogMax .jxDialogCollapse img {
+  background-position: 0px -16px;
+}
+
+.jxDialogLoading img {
+  border: 0px;
+  /* the margin needs to make up the difference between it's width/height
+     and the width/height of the parent a */
+  margin: 0px;
+  /* width/height has to be the actual image width/height */
+  width: 16px;
+  height: 16px;
+  visibility:hidden;
+  position: absolute;
+  top: 1px;
+  left: 2px;
+}


Property changes on: trunk/MgDev/Web/src/viewerfiles/jxtheme.css
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/quickplot.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/quickplot.js	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/quickplot.js	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,1100 +1,1100 @@
-MapCapturer = function() 
-{ 
-    this.initialize();
-};
-
-MapCapturer.prototype =
-{
-    active : false,
-    inCommand : false,
-    moving : false,
-    rotating : false,
-    isRotating : false,
-    isMoving : false,
-    lastPixel : null,
-    
-    rotation : 0.0,
-    boxCanvas : null,
-    boxCanvasID : "QuickPlotBoxCanvasDiv",
-    handleCanvas : null,
-    handleCanvasID : "QuickPlotHandleCanvasDiv",
-    gripCanvas : null,
-    gripCanvasID : "QuickPlotGripCanvasDiv",
-    bgCanvas : null,
-    bgCanvasID : "QuickPlotBgCanvasDiv",
-    boxGraphics : null,
-    handleGraphics : null,
-    gripGraphics : null,
-    bgGraphics : null,
-
-    mapWindow : null,
-    mapDoc : null,
-    
-    captureBox : null,
-    rotateHandleStart : null,
-    rotateHandleEnd : null,
-    
-    fillColor : "#476387",
-    strokeColor : "#39506F",
-    rotateHandleLength : 30,
-    rotateGripDiameter : 8,
-    rotateSnappingStep : 45,
-    rotateSnappingTolerance : 2,
-    
-    resolutionWarning : "",
-    paperSize : {width : 0, height : 0},
-    scaleDenominator : 1,
-    
-    initialize : function()
-    {
-        this.mapWindow = window;
-        
-        this.mapDoc    = this.mapWindow.document;
-        
-        this.boxCanvas      = this.createCanvas(this.boxCanvasID, 902);
-        this.handleCanvas   = this.createCanvas(this.handleCanvasID, 901);
-        this.gripCanvas     = this.createCanvas(this.gripCanvasID, 903);
-        this.bgCanvas       = this.createCanvas(this.bgCanvasID, 900);
-        this.refreshCanvasSize();
-        
-        this.boxGraphics    = new jsGraphics(this.boxCanvasID);
-        this.handleGraphics = new jsGraphics(this.handleCanvasID);
-        this.gripGraphics   = new jsGraphics(this.gripCanvasID);
-        this.bgGraphics     = new jsGraphics(this.bgCanvasID);
-        
-        // Add event listener
-        this.mapWindow.OnMouseMove = this.onMouseMove.bindWithEvent(this, this.mapWindow.OnMouseMove);
-        this.mapWindow.OnMouseDown = this.onMouseDown.bindWithEvent(this, this.mapWindow.OnMouseDown);
-        this.mapWindow.OnMouseUp   = this.onMouseUp.bindWithEvent(this, this.mapWindow.OnMouseUp);
-        this.mapWindow.OnMouseOut  = this.onMouseOut.bindWithEvent(this, this.mapWindow.OnMouseOut);
-        this.mapWindow.PanFeedback = this.panFeedback.bindWithEvent(this, this.mapWindow.PanFeedback);
-        // Function.bindWithEvent / Function.bind cannot handle more than arguments, so workaround...
-        this.mouseWheelHandlerBackup = this.mapWindow.HandleMouseWheelEvent;
-        this.mapWindow.HandleMouseWheelEvent = this.handleMouseWheelEvent.bind(this);
-        
-        // Overload MAP_LOADED event handler
-        this.mapWindow.OnMapLoaded = this.onMapLoaded.bind(this, this.mapWindow.OnMapLoaded);
-    },
-
-    createCanvas : function (id, zIndex)
-    {
-        var div           = this.mapDoc.createElement("div");
-        div.style.cssText = "position:absolute; top:0px; left:0px; z-index:" + zIndex + "; width:1px; height:1px; visibility:hidden";
-        div.id            = id;
-        this.mapWindow.$("img1").appendChild(div);
-        return $(div);
-    },
-    
-    refreshCanvasSize : function()
-    {
-        var width   = this.mapWindow.mapDevW + "px";
-        var height  = this.mapWindow.mapDevH + "px";
-        var opacity = 0.8;
-        
-        this.boxCanvas.style.width     = width;
-        this.boxCanvas.style.height    = height;
-        this.boxCanvas.setOpacity(opacity);
-        this.handleCanvas.style.width  = width;
-        this.handleCanvas.style.height = height;
-        this.handleCanvas.setOpacity(opacity);
-        // Don't set the grip canvas' size
-        this.bgCanvas.style.width      = width;
-        this.bgCanvas.style.height     = height;
-        this.bgCanvas.setOpacity(opacity);
-    },
-    
-    activate : function()
-    {
-        this.active                        = true;
-        this.boxCanvas.style.visibility    = "visible";
-        this.handleCanvas.style.visibility = "visible";
-        this.gripCanvas.style.visibility   = "visible";
-        this.bgCanvas.style.visibility     = "visible";
-    },
-    
-    deactivate : function()
-    {
-        this.active                        = false;
-        this.boxCanvas.style.visibility    = "hidden";
-        this.handleCanvas.style.visibility = "hidden";
-        this.gripCanvas.style.visibility   = "hidden";
-        this.bgCanvas.style.visibility     = "hidden";
-        this.captureBox                    = null;
-        this.rotation                      = 0.0;
-        this.inCommand                     = false;
-        this.moving                        = false;
-        this.rotating                      = false;
-        this.mapWindow.ClearMapMessage();
-        this.clear();
-        this.clearSnappingHint();
-    },
-
-    setSize : function(paperSize, scale)
-    {
-        this.paperSize        = paperSize;
-        this.scaleDenominator = scale;
-        
-        var res    = this.mapWindow.GetMetersPerUnits();
-
-        // Create the capture box
-        var size   = {width : paperSize.width * scale / 1000 / res , height : paperSize.height * scale / 1000 / res};
-        var center = this.mapWindow.GetCenter();
-        if (this.captureBox != null)
-        {
-            center = this.captureBox.getCentroid();
-        }
-        
-        var coordinates = 
-            [
-                {x : center.X - size.width / 2, y : center.Y - size.height / 2},
-                {x : center.X + size.width / 2, y : center.Y - size.height / 2},
-                {x : center.X + size.width / 2, y : center.Y + size.height / 2},
-                {x : center.X - size.width / 2, y : center.Y + size.height / 2},
-                {x : center.X - size.width / 2, y : center.Y - size.height / 2}
-            ];
-            
-        this.captureBox = this.createPolygon(coordinates);
-        
-        if (this.rotation != 0)
-        {
-            this.captureBox.rotate(this.rotation, center);
-        }
-        
-        if (this.active)
-        {
-            if (this.validateResolution())
-            {
-                this.mapWindow.ClearMapMessage();
-                this.draw();
-            }
-            else
-            {
-                this.mapWindow.ShowMapMessage(this.resolutionWarning, "warning");
-                this.clear();
-            }
-        }
-    },
-    
-    // The coordinates is a collection of a coordinate which is in following format:
-    // {x: coordinate, y: coordinate}
-    createPolygon : function (coordinates)
-    {
-        var polygon = new Polygon();
-        
-        var coordinate = null;
-        for (var i = 0; i < coordinates.length; ++i)
-        {
-            coordinate = coordinates[i];
-            polygon.AddPoint(new Point(coordinate.x, coordinate.y));
-        }
-        
-        return polygon;
-    },
-    
-    refreshRotateHandle : function(captureBox)
-    {
-        var box    = captureBox.clone();
-        var center = captureBox.getCentroid();
-        
-        if (this.rotation != 0)
-        {
-            box.rotate(-this.rotation, center);
-        }
-        
-        var size = box.getBounds().size;
-        this.rotateHandleStart = new Point(center.X, center.Y);
-        var length = size.height / 2 + this.rotateHandleLength / this.getPixelsPerMapUnits();
-        point      = new Point(center.X, center.Y + length);
-        this.rotateHandleEnd   = new Point(point.X, point.Y);
-        
-        if (this.rotation != 0)
-        {
-            this.rotateHandleStart.rotate(this.rotation, center);
-            this.rotateHandleEnd.rotate(this.rotation, center);
-        }
-    },
-
-    drawPolygon : function(polygon)
-    {
-        this.boxGraphics.setColor(this.fillColor);
-        this.boxGraphics.setStroke(1);
-        
-        var xs     = new Array();
-        var ys     = new Array();
-        var point  = null;
-        for (var i = 0; i < polygon.points.length; ++i)
-        {
-            point  = this.mapUnitsToScreen(polygon.Point(i));
-            xs.push(point.X);
-            ys.push(point.Y);
-        }
-        
-        // Draw the polygon
-        this.boxGraphics.fillPolygon(xs, ys);
-        
-        // Draw the border
-        this.boxGraphics.setColor(this.strokeColor);
-        this.boxGraphics.drawPolygon(xs, ys);
-    },
-    
-    draw : function()
-    {
-        this.clear();
-        // Draw the captureBox first
-        this.drawPolygon(this.captureBox);
-        // Refresh the rotate handle
-        this.refreshRotateHandle(this.captureBox);
-        
-        // Draw the rotate handle
-        var start = this.mapUnitsToScreen(this.rotateHandleStart);
-        var end   = this.mapUnitsToScreen(this.rotateHandleEnd);
-        this.handleGraphics.setColor(this.strokeColor);
-        this.handleGraphics.setStroke(2);
-        this.handleGraphics.drawLine(start.X, start.Y, end.X, end.Y);
-        
-        // Draw the rotate start point
-        this.gripGraphics.fillEllipse(start.X - this.rotateGripDiameter / 2, start.Y - this.rotateGripDiameter / 2, this.rotateGripDiameter, this.rotateGripDiameter);
-        // Draw the end point 
-        this.gripGraphics.setColor(this.strokeColor);
-        this.gripGraphics.fillEllipse(end.X - this.rotateGripDiameter / 2, end.Y - this.rotateGripDiameter / 2, this.rotateGripDiameter, this.rotateGripDiameter);
-        
-        this.boxGraphics.paint();
-        this.handleGraphics.paint();
-        this.gripGraphics.paint();
-        
-        // Set the cursor styles
-        var nodes = this.boxCanvas.childNodes;
-        for (var i = 0; i < nodes.length; ++i)
-        {
-            nodes[i].style.cursor = "move";
-        }
-        
-        nodes = this.gripCanvas.childNodes;
-        for (var i = 0; i < nodes.length; ++i)
-        {
-            nodes[i].style.cursor = "url(../stdicons/rotate.cur), default";
-        }
-    },
-    
-    validateResolution : function()
-    {
-        if (this.captureBox)
-        {
-            var viewerSize = {width: this.mapWindow.extX2 - this.mapWindow.extX1, height: this.mapWindow.extY1 - this.mapWindow.extY2};
-            var boxSize    = this.captureBox.getBounds().size;
-            
-            return boxSize.width < viewerSize.width || boxSize.height < viewerSize.height; 
-        }
-        
-        return true;
-    },
-    
-    clear : function()
-    {
-        this.boxGraphics.clear();
-        this.handleGraphics.clear();
-        this.gripGraphics.clear();
-    },
-
-    onMouseDown : function(evt, originalHandler)
-    {
-        var result = false;
-        
-        this.inCommand = this.rotating || this.moving && this.validateResolution();
-        
-        if ((!this.active || !this.inCommand) && originalHandler != null)
-        {
-            result = originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
-        }
-        
-        this.lastPixel = this.getMousePosition(evt);
-        
-        return result;
-    },
-    
-    onMouseUp : function(evt, originalHandler)
-    {
-        var result = false;
-        
-        this.inCommand = this.rotating || this.moving && this.validateResolution();
-        if ((!this.active || !this.inCommand) && originalHandler != null)
-        {
-            result = originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
-        }
-        
-        this.rotating  = false;
-        this.moving    = false;
-        this.inCommand = false;
-        this.clearSnappingHint();
-
-        return result;
-    },
-    
-    onMouseMove : function(evt, originalHandler)
-    {
-        if (this.active)
-        {
-            var point  = this.getMousePosition(evt);
-
-            if (!this.inCommand)
-            {
-                if (originalHandler != null)
-                {
-                    originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
-                }
-                
-                this.checkCommand(point);
-            }
-            else
-            {
-                if (this.rotating)
-                {
-                    this.rotate(evt);
-                }
-                else if (this.moving)
-                {
-                    this.move(evt);
-                }
-            }
-        }
-        else
-        {
-            if (originalHandler != null)
-            {
-                originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
-            }
-        }
-    },
-    
-    panFeedback : function(evt, originalHandler)
-    {
-        if (originalHandler != null)
-        {
-            originalHandler(evt);
-        }
-        
-        if (this.active && this.validateResolution())
-        {
-            var res = this.getPixelsPerMapUnits();
-            var feedback = this.captureBox.clone();
-            
-            feedback.move(offx / res, -offy / res);
-            this.draw(feedback);
-        }
-    },
-    
-    handleMouseWheelEvent : function(delta, evt)
-    {
-        originalHandler = this.mouseWheelHandlerBackup;
-        if (originalHandler != null)
-        {
-            originalHandler(delta, evt);
-        }
-        
-        if (this.active && this.validateResolution() && (mapInit && !mapLoading))
-        {
-            // Following functions are defined in ajaxmappane.templ
-            var currentScale = CalculateScale();
-            var newScale     = GetNewScale(currentScale, wheelZoomDelta);
-            var zoomChange   = currentScale / newScale;
-            
-            //Determine the center of the new, zoomed map, in current screen device coords
-            var x = wheelZoomCursor.X;
-            var y = wheelZoomCursor.Y;
-            var center = this.mapWindow.ScreenToMapUnits(x, y);
-            
-            var feedback = this.captureBox.clone();
-            feedback.resize(zoomChange, center);
-            this.draw(feedback);
-        }
-    },
-    
-    checkCommand : function (point)
-    {
-        if (this.validateResolution())
-        {
-            this.moving   = false;
-            this.rotating = false;
-            
-            if (this.inRotateRange(point))
-            {
-                this.rotating = true;
-            }
-            else if (this.inMoveRange(point))
-            {
-                this.moving   = true;
-            }
-        }
-    },
-    
-    inRotateRange : function(point)
-    {
-        var p1 = this.mapWindow.ScreenToMapUnits(0, 0);
-        var p2 = this.mapWindow.ScreenToMapUnits(this.rotateGripDiameter, 0);
-        var radius = p1.distanceTo(p2) / 2;
-        var distance = this.rotateHandleEnd.distanceTo(point);
-        
-        return distance <= radius;
-    },
-    
-    inMoveRange : function(point)
-    {
-        var box    = this.captureBox.clone();
-        var p      = point.clone();
-        
-        if (this.rotation != 0)
-        {
-            var origin = box.getCentroid();
-            box.rotate(-this.rotation, origin);
-            p.rotate(-this.rotation, origin);
-        }
-        
-        var x1 = Math.min(box.Point(0).X, box.Point(1).X, box.Point(2).X, box.Point(3).X);   
-        var x2 = Math.max(box.Point(0).X, box.Point(1).X, box.Point(2).X, box.Point(3).X);
-        var y1 = Math.min(box.Point(0).Y, box.Point(1).Y, box.Point(2).Y, box.Point(3).Y);
-        var y2 = Math.max(box.Point(0).Y, box.Point(1).Y, box.Point(2).Y, box.Point(3).Y);
-
-        return (p.X <= x2 && p.X >= x1) && (p.Y <= y2 && p.Y >= y1);
-    },
-    
-    onMouseOut : function(evt, originalHandler)
-    {
-        console.info("mouse out");
-    },
-    
-    onMapLoaded : function(originalHandler, args)
-    {
-        if (originalHandler != null)
-        {
-            if (!args)
-            {
-                args = [];
-            }
-            
-            originalHandler.apply(this.mapWindow, args);
-        }
-        
-        this.refreshCanvasSize();
-        
-        if (this.active)
-        {
-            if (this.validateResolution())
-            {
-                this.mapWindow.ClearMapMessage();
-                this.draw(this.captureBox);
-            }
-            else
-            {
-                this.mapWindow.ShowMapMessage(this.resolutionWarning, "warning");
-                this.clear();
-            }
-        }
-    },
-    
-    getMousePosition : function(evt)
-    {
-        var offset = this.getScreenOffset();
-        var pixel  = new Point(evt.clientX - offset.left, evt.clientY - offset.top);
-        
-        return this.mapWindow.ScreenToMapUnits(pixel.X, pixel.Y);
-    },
-    
-    move : function(evt)
-    {
-        var pixel      = this.getMousePosition(evt);
-        var x          = pixel.X - this.lastPixel.X;
-        var y          = pixel.Y - this.lastPixel.Y;
-        this.captureBox.move(x, y);
-        this.rotateHandleStart.move(x, y);
-        this.rotateHandleEnd.move(x, y);
-        this.lastPixel = pixel;
-        
-        this.draw(this.captureBox);
-    },
-    
-    rotate : function(evt)
-    {
-        var pixel  = this.getMousePosition(evt);
-        
-        // Calculate the rotate angle, in degrees / counterclockwise
-        var origin = this.captureBox.getCentroid();
-        var angle1 = Math.atan2(this.lastPixel.Y - origin.Y, this.lastPixel.X - origin.X);  
-        var angle2 = Math.atan2(pixel.Y - origin.Y, pixel.X - origin.X);
-        var angle  = (angle2 - angle1) * 180 / Math.PI;
-
-        var rotation = this.rotation + angle;
-        if (evt.shiftKey)
-        {
-            var a = rotation % this.rotateSnappingStep;
-            var b = Math.round(rotation / this.rotateSnappingStep);
-            var targetRotation = rotation;
-            
-            if (Math.abs(a) <= this.rotateSnappingTolerance || Math.abs(a)>= this.rotateSnappingStep - this.rotateSnappingTolerance)
-            {
-                targetRotation = b * this.rotateSnappingStep;
-                
-                // Draw the snapping guide
-                this.drawSnappingHint(targetRotation);
-            }
-            else
-            {
-                this.clearSnappingHint();
-            }
-            
-            angle = targetRotation - this.rotation;
-        }
-        else
-        {
-            this.clearSnappingHint();
-        }
-        
-        this.captureBox.rotate(angle, origin);
-        this.rotateHandleStart.rotate(angle, origin);
-        this.rotateHandleEnd.rotate(angle, origin);
-        this.lastPixel = pixel;
-        this.rotation += angle;
-        
-        this.draw(this.captureBox);
-    },
-    
-    drawSnappingHint : function(angle)
-    {
-        this.clearSnappingHint();
-        
-        this.bgGraphics.setColor("black");
-        var length = Math.sqrt(Math.pow(this.mapWindow.mapDevW, 2), Math.pow(this.mapWindow.mapDevH, 2));
-        var origin = this.mapUnitsToScreen(this.captureBox.getCentroid());
-        var line   = new LineString();
-        line.AddPoint(new Point(origin.X, origin.Y - length));
-        line.AddPoint(new Point(origin.X, origin.Y + length));
-        
-        if (angle != 0)
-        {
-            line.rotate(-angle, origin);
-            
-        }
-        
-        var start = line.Point(0);
-        var end   = line.Point(1);
-        this.bgGraphics.drawLine(start.X, start.Y, end.X, end.Y);
-        
-        this.bgGraphics.paint();
-    },
-    
-    clearSnappingHint : function()
-    {
-        this.bgGraphics.clear();
-    },
-
-    getCaptureBox : function()
-    {
-        return this.captureBox;
-    },
-    
-    getNormalizedCapture : function()
-    {
-        var capture = this.captureBox.clone();
-        
-        if (this.rotation != 0)
-        {
-            capture.rotate(-this.rotation, capture.getCentroid());
-        }
-        
-        return capture;
-    },
-    
-    getPixelsPerMapUnits : function()
-    {
-        var p1 = this.mapWindow.ScreenToMapUnits(0, 0);
-        var p2 = this.mapWindow.ScreenToMapUnits(1, 0);
-        return 1 / (p2.X - p1.X);
-    },
-    
-    mapUnitsToScreen : function(point)
-    {
-        var x = (point.X - this.mapWindow.extX1) * this.mapWindow.mapDevW / (this.mapWindow.extX2 - this.mapWindow.extX1);
-        var y = (point.Y - this.mapWindow.extY1) * this.mapWindow.mapDevH / (this.mapWindow.extY2 - this.mapWindow.extY1);
-        return new Point(x, y);
-    },
-    
-    getScreenOffset : function()
-    {
-        return this.getContentPosition(this.mapWindow.$("img1"));
-    },
-    
-    getContentPosition: function(element)
-    {
-        var offsetLeft = 0;
-        var offsetTop  = 0;
-        var border     = 0;
-        
-        while (element && element.tagName.toLowerCase() != "body" && element.tagName.toLowerCase() != "html")
-        {
-            offsetLeft += element.offsetLeft;
-            offsetTop  += element.offsetTop;
-            
-            border      = parseInt(element.style.borderLeftWidth);
-            if (!isNaN(border))
-            {
-                offsetLeft += border;
-            }
-            
-            border      = parseInt(element.style.borderTopWidth);
-            if (!isNaN(border))
-            {
-                offsetTop += border;
-            }
-            
-            element     = element.offsetParent;
-        }
-        
-        return {left: offsetLeft, top: offsetTop};
-    }
-};
-
-/////////////////////////////
-
-var PreviewDialog = function()
-{
-};
-
-PreviewDialog.prototype = 
-{
-    jxDialog : null,
-    previewFrame : null,
-    innerDoc : null,
-    indicator : null,
-    previewPicture : null,
-    printPicture : null,
-    topLeftXYLabel : null,
-    bottomRightXYLabel : null,
-    previewContainer : null,
-    pictureContainer : null,
-    printButton : null,
-    cancelButton : null,
-    loadingErrorMessage : null,
-    printStyle: null,
-    previewStyle: null,
-    rendererName: null,
-    // The offset from the border of the paper, in px 
-    csLabelOffset : 5,
-    // The print margin, in inches
-    printMargin: 0,
-    mapInfo : {sessionID: "", name: ""},
-    captureInfo : {topLeftCs : {x : 0, y : 0}, bottomRightCs : {x : 0, y : 0}, paperSize:{w : 0, h : 0}, scaleDenominator : 0, rotation : 0, params1 : "", params2 : ""},
-    params : null,
-    
-    // The callback will be called right after the JxDialog content has been loaded.
-    // The callback accepts 1 parameter: windowName (string)
-    // Here it is used to submit the quick plot form to the preview frame.
-    contentLoadedCallback : null,
-    
-    initialize : function(options)
-    {
-        this.mapInfo      = options.mapInfo;
-        this.captureInfo  = options.captureInfo;
-        this.rendererName = options.rendererName;
-        this.params       = options.params;
-        
-        this.jxDialog = new Jx.Dialog(
-        {
-            modal: true,
-            width:400,
-            height: 400,
-            content: '<table border="0" cellspacing="0" cellpadding="0" id="PreviewContainer">' + 
-                     '	<tr>' + 
-                     '		<td>' + 
-                     '			<iframe id="PreviewFrame" scrolling="no" frameborder="0" style="border: 0px; width: 400px; height: 300px;" src="about:blank"></iframe>' +
-                     '		</td>' +
-                     '  </tr>' +
-                     '</table>'
-        });
-        
-        this.jxDialog.addEvent("open", this.jxDialogOpened.bind(this, true));
-        this.jxDialog.addEvent("contentLoaded", this.jxDialogContentLoaded.bind(this));
-        // Listen to the fade complete event to close the dialog
-        var o = this.jxDialog.domObj.get("tween").addEvent("complete", this.closeJxDialog.bind(this));
-    },
-    
-    open : function(contentLoadedCallback, openedCallback, closedCallback)
-    {
-        this.contentLoadedCallback = contentLoadedCallback;
-        this.openedCallback        = openedCallback;
-        this.closedCallback        = closedCallback;
-        this.jxDialog.loadContent(this.jxDialog.content);
-        this.jxDialog.open();
-    },
-    
-    print : function()
-    {
-        //
-        this.previewFrame.contentWindow.doPrint();
-    },
-    
-    cancel : function()
-    {
-        this.indicator.style.display     = "inline";
-        this.indicator.style.visibility  = "visible";
-        this.indicator.setOpacity(1);
-        
-        this.loadingErrorMessage.fade(0);
-        this.loadingErrorMessage.style.display = "none";
-        // Hide the picture but don't set the 'display' style property to avoid messing the print layout up
-        this.printPicture.style.height   = "0px";
-        
-        if (this.topLeftXYLabel && this.bottomRightXYLabel)
-        {
-            this.topLeftXYLabel.setOpacity(0);
-            this.bottomRightXYLabel.setOpacity(0);
-            this.printLabel.setOpacity(0);
-            // Remove the labels
-            this.topLeftXYLabel.parentNode.removeChild(this.topLeftXYLabel);
-            this.topLeftXYLabel     = null;
-            this.bottomRightXYLabel.parentNode.removeChild(this.bottomRightXYLabel);
-            this.bottomRightXYLabel = null;
-            this.printLabel.parentNode.removeChild(this.printLabel);
-            this.printLabel         = null;
-        }
-        
-        this.isClosing = true;
-        this.jxDialog.blanket.fade(0);
-        this.jxDialog.domObj.fade(0);
-        
-        // Inform the listener that the dialog is closed
-        if (this.closedCallback)
-        {
-            this.closedCallback();
-        }
-    },
-    
-    jxDialogContentLoaded : function()
-    {
-        // Set the window name for the preview frame
-        this.previewFrame = $("PreviewFrame");
-        this.previewFrame.contentWindow.name = "QuickPlotPreviewFrame";
-        
-        // Inform the listener that the content is ready, then the Quick Plot panel can submit its data to the preview frame
-        if (this.contentLoadedCallback)
-        {
-            this.contentLoadedCallback(this.previewFrame.contentWindow.name);
-        }
-    },
-    
-    jxDialogOpened : function(setFrameUrl)
-    {
-        if (this.previewInnerIsLoaded)
-        {
-            // Resize the preview frame according to the monitor resolution
-            this.innerDoc         = this.previewFrame.contentWindow.document;
-            var box       = $(document.body).getDimensions();
-            // Width of preview dialog = screen width * factor
-            var factor    = 0.5;
-            this.previewContainer = $(this.innerDoc.getElementById("PreviewContainer"));
-            this.previewContainer.style.width = box.width * factor + "px";
-            this.pictureContainer = $(this.innerDoc.getElementById("PictureContainer"));
-            var pcBox = this.pictureContainer.getContentBoxSize();
-            
-            this.indicator        = $(this.innerDoc.getElementById("ProgressIndicator"));
-            
-            var paperSize  = this.captureInfo.paperSize;
-            this.paperSize = paperSize;
-            
-            var ratio = paperSize.w / paperSize.h;
-            
-            // Resize the indicator
-            this.indicator.style.width  = pcBox.width + "px";
-            this.indicator.style.height = pcBox.width / ratio + "px";
-            // Set a explicit size to the container
-            this.pictureContainer.style.width  = this.indicator.style.width;
-            this.pictureContainer.style.height = this.indicator.style.height;
-            // Get the styles for the print picture
-            var rules = this.innerDoc.styleSheets[1].cssRules || this.innerDoc.styleSheets[1].rules;
-            this.previewStyle = rules[0];
-            rules     = this.innerDoc.styleSheets[2].cssRules || this.innerDoc.styleSheets[2].rules;
-            this.printStyle   = rules[0];
-            
-            // Reset the background
-            this.indicator.style.background = "url(../stdicons/progress_indicator.gif) no-repeat cneter center";
-            
-            this.loadingErrorMessage = $(this.innerDoc.getElementById("PictureLoadingErrorMessage"));
-            this.loadingErrorMessage.setOpacity(0);
-            
-            // Set the picture url
-            var src = this.rendererName + "?session_id=" + this.mapInfo.sessionID +
-                  "&map_name=" + this.mapInfo.name + 
-                  "&print_dpi=" + this.params.printDpi + 
-                  "&paper_size=" + this.captureInfo.paperSize.w + "," + this.captureInfo.paperSize.h + 
-                  "&box=" + this.captureInfo.params1 +
-                  "&normalized_box=" + this.captureInfo.params2 + 
-                  "&scale_denominator=" + this.captureInfo.scaleDenominator + 
-                  "&rotation=" + this.captureInfo.rotation; 
-                
-            this.printPicture       = $(this.innerDoc.getElementById("PrintPicture"));
-            this.printPicture.src   = src;
-            
-            // Listen to print picture onload vent
-            this.printPicture.addEvent("load", this.printPictureLoaded.bind(this));
-            this.printPicture.addEvent("error", this.printPictureLoadError.bind(this));
-            
-            var innerBox  = this.previewContainer.getMarginBoxSize();
-            // Resize the frame according to the inner container's 
-            this.previewFrame.style.width  = innerBox.width + "px";
-            this.previewFrame.style.height = innerBox.height + "px";
-            
-            // Hide the title bar
-            this.jxDialog.title.style.display  = "none";
-            // Hide the chrome
-            this.jxDialog.chrome.style.display = "none";
-            
-            // Disable the print button until the image is ready
-            this.printButton           = this.innerDoc.getElementById("PrintButton");
-            this.cancelButton          = this.innerDoc.getElementById("CancelButton");
-            this.printButton.disabled  = true;
-            this.cancelButton.disabled = true;
-            
-            var delta     = {x: 22, y: 43};
-            var container = $("PreviewContainer");
-            var size      = container.getMarginBoxSize();
-            this.jxDialog.resize(size.width + delta.x, size.height + delta.y, true);
-
-            // Inform the listeners that the dialog is opened
-            if (this.openedCallback)
-            {
-                this.openedCallback();
-            }
-            this.jxDialog.blanket.fade(0.2);
-            this.jxDialog.domObj.fade(1);
-            this.resizeIsPending = false;
-            
-            this.previewInnerIsLoaded = false;
-        }
-        else
-        {
-            this.jxDialog.blanket.setOpacity(0);
-            this.jxDialog.domObj.setOpacity(0);
-            this.resizeIsPending = true;
-        }
-    },
-    
-    previewInnerLoaded: function()
-    {
-        this.previewInnerIsLoaded = true;
-        if (this.resizeIsPending)
-        {
-            this.jxDialogOpened(false);
-        }
-    },
-    
-    closeJxDialog : function()
-    {
-        if (this.isClosing)
-        {
-            this.jxDialog.close();
-            this.isClosing = false;
-        }
-    },
-    
-    printPictureLoaded : function()
-    {
-        var size = {width: parseInt(this.indicator.style.width), height: parseInt(this.indicator.style.height)};
-        
-        this.indicator.fade(0);
-        this.indicator.style.display = "none";
-        
-        // Set the preview size
-        this.printPicture.setOpacity(0);
-        // Clear the inline style
-        this.printPicture.style.width   = "";
-        this.previewStyle.style.width   = size.width + "px";
-        this.previewStyle.style.height  = size.height + "px";
-        this.printPicture.fade(1);
-        
-        // Set the print size
-        // NOTE: It works only with a 96 dpi device dpi
-        var deviceDpi  = 96;
-        var idealSize  = {width:(this.paperSize.w / 25.4 - 2 * this.printMargin) * deviceDpi, height:(this.paperSize.h / 25.4 - 2 * this.printMargin) * deviceDpi};
-        // Get the size of the print frame
-        var docSize    = $(this.innerDoc.body).getContentBoxSize();
-        var realHeight = idealSize.height - (docSize.height - size.height);
-        var realWidth  = realHeight * this.paperSize.w / this.paperSize.h;
-        if (realWidth > idealSize.width)
-        {
-            realWidth = idealSize.width;
-            realHeight = realWidth / (this.paperSize.w / this.paperSize.h);
-        }
-        
-        this.printStyle.style.width  = realWidth + "px";
-        this.printStyle.style.height = realHeight + "px";
-        
-        // Create the coordinates labels
-        if (!this.topLeftXYLabel)
-        {
-            this.topLeftXYLabel = this.createCoordinateLabel(this.pictureContainer, this.captureInfo.topLeftCs.x, this.captureInfo.topLeftCs.y, "TopLeftXYLabel");
-            this.topLeftXYLabel.setOpacity(0);
-        }
-        
-        if (!this.bottomRightXYLabel)
-        {
-            this.bottomRightXYLabel = this.createCoordinateLabel(this.pictureContainer, this.captureInfo.bottomRightCs.x, this.captureInfo.bottomRightCs.y, "BottomRightXYLabel");
-            this.bottomRightXYLabel.setOpacity(0);
-        }
-        
-        if (!this.printLabel)
-        {
-            this.printLabel = this.createCoordinateLabel(this.pictureContainer, this.captureInfo.bottomRightCs.x, this.captureInfo.bottomRightCs.y, "PrintLabel");
-        }
-        
-        // Set the correct positions for the labels
-        var pos    = this.getContentPosition(this.pictureContainer);
-        var picDim = this.pictureContainer.getContentBoxSize();
-        this.topLeftXYLabel.style.left     = pos.left + this.csLabelOffset + "px";
-        this.topLeftXYLabel.style.top      = pos.top + this.csLabelOffset + "px"; 
-        var labelDim = this.bottomRightXYLabel.getMarginBoxSize();
-        this.bottomRightXYLabel.className  = "ScreenOnly";
-        this.bottomRightXYLabel.style.left = pos.left + picDim.width - this.csLabelOffset - labelDim.width + "px";
-        this.bottomRightXYLabel.style.top  = pos.top + picDim.height - this.csLabelOffset - labelDim.height + "px";
-        labelDim = this.printLabel.getMarginBoxSize();
-        this.printLabel.className          = "PrintOnly";
-        this.printLabel.style.left         = pos.left + realWidth - this.csLabelOffset - labelDim.width + "px";
-        this.printLabel.style.top          = pos.top + realHeight - this.csLabelOffset - labelDim.height + "px";
-        
-        this.topLeftXYLabel.fade(1);
-        this.bottomRightXYLabel.fade(1);
-        // Enable the print button
-        this.printButton.disabled  = false;
-        this.cancelButton.disabled = false;
-    },
-    
-    printPictureLoadError : function()
-    {
-        this.indicator.fade(0);
-        this.indicator.style.display = "none";
-        this.loadingErrorMessage.style.display = "inline";
-        this.loadingErrorMessage.setOpacity(0);
-        this.loadingErrorMessage.fade(1);
-        this.cancelButton.disabled = false;
-    },
-    
-    createCoordinateLabel: function(container, cX, cY, id)
-    {
-        cX = cX + "";
-        cY = cY + "";
-        var digits = 6;
-        
-        var index = cX.indexOf(".");
-        if (index > -1)
-        {
-            cX = cX.substr(0, index + digits + 1);
-        }
-        
-        index = cY.indexOf(".");
-        if (index > -1)
-        {
-            cY = cY.substr(0, index + digits + 1);
-        }
-        
-        var label = this.innerDoc.createElement("div");
-        container.appendChild(label);
-        label.id  = id;
-        label.style.cssText = "border:solid 1px black; padding:1px; background:#F2F2F2; color:black; font-size:8pt; z-index:1000; " +
-                              "position:absolute; white-space:nowrap";
-        label.innerHTML     = "X: " + cX + " Y: " + cY;
-        
-        return $(label);
-    },
-    
-    getContentPosition: function(element)
-    {
-        var offsetLeft = 0;
-        var offsetTop  = 0;
-        var border     = 0;
-        
-        while (element && element.tagName.toLowerCase() != "body" && element.tagName.toLowerCase() != "html")
-        {
-            offsetLeft += element.offsetLeft;
-            offsetTop  += element.offsetTop;
-            
-            border      = parseInt(element.style.borderLeftWidth);
-            if (!isNaN(border))
-            {
-                offsetLeft += border;
-            }
-            
-            border      = parseInt(element.style.borderTopWidth);
-            if (!isNaN(border))
-            {
-                offsetTop += border;
-            }
-            
-            element     = element.offsetParent;
-        }
-        
-        return {left: offsetLeft, top: offsetTop};
-    }
-};
-
-/////////////////////////
-
-function previewQuickPlot(dialogConentLoadedCallback, dialogOpenedCallback, dialogClosedCallback, printDpi, rendererName)
-{
-    var mapInfo     = {sessionID : GetSessionId(), name : GetMapName()};
-    
-    var capture     = mapCapturer.getCaptureBox();
-    var vertices    = capture.points;
-    
-    var params1     = "";
-    for (var i = 0; i < vertices.length; ++i)
-    {
-        var vertice = vertices[i];
-        params1    += vertice.X + "," + vertice.Y + ",";
-    }
-    params1         = params1.substr(0, params1.length - 1);
-    
-    var vertices2   = mapCapturer.getNormalizedCapture().points;
-    var params2     = "";
-    for (var i = 0; i < vertices2.length; ++i)
-    {
-        var vertice = vertices2[i];
-        params2    += vertice.X + "," + vertice.Y + ",";
-    }
-    params2         = params2.substr(0, params2.length - 1);
-    
-    var captureInfo = {topLeftCs : {x : vertices[3].X, y : vertices[3].Y},
-                       bottomRightCs : {x : vertices[1].X, y : vertices[1].Y},
-                       paperSize : {w : mapCapturer.paperSize.width, h : mapCapturer.paperSize.height},
-                       scaleDenominator : mapCapturer.scaleDenominator,
-                       rotation : mapCapturer.rotation,
-                       params1 : params1,
-                       params2 : params2}; 
-    // Change the parameters here to control the print dpi and if
-    // handle the label font unit type automatically
-    var params      = {printDpi : printDpi};
-    
-    if (!quickPlotPreviewDialog)
-    {
-        quickPlotPreviewDialog = new PreviewDialog();
-        quickPlotPreviewDialog.initialize({mapInfo : mapInfo, captureInfo : captureInfo, rendererName : rendererName, params : params});
-    }
-    else
-    {
-        quickPlotPreviewDialog.mapInfo      = mapInfo;
-        quickPlotPreviewDialog.captureInfo  = captureInfo;
-        quickPlotPreviewDialog.rendererName = rendererName;
-        quickPlotPreviewDialog.params       = params;
-    }
-
-    quickPlotPreviewDialog.open(dialogConentLoadedCallback, dialogOpenedCallback, dialogClosedCallback);
-}
-
-function endPlotPreview()
-{
-    if (quickPlotPreviewDialog != null)
-    {
-        quickPlotPreviewDialog.cancel();
-    }
-}
-
-var mapCapturer = new MapCapturer();
-var quickPlotPreviewDialog = null;
-var message     = null;
-
+MapCapturer = function() 
+{ 
+    this.initialize();
+};
+
+MapCapturer.prototype =
+{
+    active : false,
+    inCommand : false,
+    moving : false,
+    rotating : false,
+    isRotating : false,
+    isMoving : false,
+    lastPixel : null,
+    
+    rotation : 0.0,
+    boxCanvas : null,
+    boxCanvasID : "QuickPlotBoxCanvasDiv",
+    handleCanvas : null,
+    handleCanvasID : "QuickPlotHandleCanvasDiv",
+    gripCanvas : null,
+    gripCanvasID : "QuickPlotGripCanvasDiv",
+    bgCanvas : null,
+    bgCanvasID : "QuickPlotBgCanvasDiv",
+    boxGraphics : null,
+    handleGraphics : null,
+    gripGraphics : null,
+    bgGraphics : null,
+
+    mapWindow : null,
+    mapDoc : null,
+    
+    captureBox : null,
+    rotateHandleStart : null,
+    rotateHandleEnd : null,
+    
+    fillColor : "#476387",
+    strokeColor : "#39506F",
+    rotateHandleLength : 30,
+    rotateGripDiameter : 8,
+    rotateSnappingStep : 45,
+    rotateSnappingTolerance : 2,
+    
+    resolutionWarning : "",
+    paperSize : {width : 0, height : 0},
+    scaleDenominator : 1,
+    
+    initialize : function()
+    {
+        this.mapWindow = window;
+        
+        this.mapDoc    = this.mapWindow.document;
+        
+        this.boxCanvas      = this.createCanvas(this.boxCanvasID, 902);
+        this.handleCanvas   = this.createCanvas(this.handleCanvasID, 901);
+        this.gripCanvas     = this.createCanvas(this.gripCanvasID, 903);
+        this.bgCanvas       = this.createCanvas(this.bgCanvasID, 900);
+        this.refreshCanvasSize();
+        
+        this.boxGraphics    = new jsGraphics(this.boxCanvasID);
+        this.handleGraphics = new jsGraphics(this.handleCanvasID);
+        this.gripGraphics   = new jsGraphics(this.gripCanvasID);
+        this.bgGraphics     = new jsGraphics(this.bgCanvasID);
+        
+        // Add event listener
+        this.mapWindow.OnMouseMove = this.onMouseMove.bindWithEvent(this, this.mapWindow.OnMouseMove);
+        this.mapWindow.OnMouseDown = this.onMouseDown.bindWithEvent(this, this.mapWindow.OnMouseDown);
+        this.mapWindow.OnMouseUp   = this.onMouseUp.bindWithEvent(this, this.mapWindow.OnMouseUp);
+        this.mapWindow.OnMouseOut  = this.onMouseOut.bindWithEvent(this, this.mapWindow.OnMouseOut);
+        this.mapWindow.PanFeedback = this.panFeedback.bindWithEvent(this, this.mapWindow.PanFeedback);
+        // Function.bindWithEvent / Function.bind cannot handle more than arguments, so workaround...
+        this.mouseWheelHandlerBackup = this.mapWindow.HandleMouseWheelEvent;
+        this.mapWindow.HandleMouseWheelEvent = this.handleMouseWheelEvent.bind(this);
+        
+        // Overload MAP_LOADED event handler
+        this.mapWindow.OnMapLoaded = this.onMapLoaded.bind(this, this.mapWindow.OnMapLoaded);
+    },
+
+    createCanvas : function (id, zIndex)
+    {
+        var div           = this.mapDoc.createElement("div");
+        div.style.cssText = "position:absolute; top:0px; left:0px; z-index:" + zIndex + "; width:1px; height:1px; visibility:hidden";
+        div.id            = id;
+        this.mapWindow.$("img1").appendChild(div);
+        return $(div);
+    },
+    
+    refreshCanvasSize : function()
+    {
+        var width   = this.mapWindow.mapDevW + "px";
+        var height  = this.mapWindow.mapDevH + "px";
+        var opacity = 0.8;
+        
+        this.boxCanvas.style.width     = width;
+        this.boxCanvas.style.height    = height;
+        this.boxCanvas.setOpacity(opacity);
+        this.handleCanvas.style.width  = width;
+        this.handleCanvas.style.height = height;
+        this.handleCanvas.setOpacity(opacity);
+        // Don't set the grip canvas' size
+        this.bgCanvas.style.width      = width;
+        this.bgCanvas.style.height     = height;
+        this.bgCanvas.setOpacity(opacity);
+    },
+    
+    activate : function()
+    {
+        this.active                        = true;
+        this.boxCanvas.style.visibility    = "visible";
+        this.handleCanvas.style.visibility = "visible";
+        this.gripCanvas.style.visibility   = "visible";
+        this.bgCanvas.style.visibility     = "visible";
+    },
+    
+    deactivate : function()
+    {
+        this.active                        = false;
+        this.boxCanvas.style.visibility    = "hidden";
+        this.handleCanvas.style.visibility = "hidden";
+        this.gripCanvas.style.visibility   = "hidden";
+        this.bgCanvas.style.visibility     = "hidden";
+        this.captureBox                    = null;
+        this.rotation                      = 0.0;
+        this.inCommand                     = false;
+        this.moving                        = false;
+        this.rotating                      = false;
+        this.mapWindow.ClearMapMessage();
+        this.clear();
+        this.clearSnappingHint();
+    },
+
+    setSize : function(paperSize, scale)
+    {
+        this.paperSize        = paperSize;
+        this.scaleDenominator = scale;
+        
+        var res    = this.mapWindow.GetMetersPerUnits();
+
+        // Create the capture box
+        var size   = {width : paperSize.width * scale / 1000 / res , height : paperSize.height * scale / 1000 / res};
+        var center = this.mapWindow.GetCenter();
+        if (this.captureBox != null)
+        {
+            center = this.captureBox.getCentroid();
+        }
+        
+        var coordinates = 
+            [
+                {x : center.X - size.width / 2, y : center.Y - size.height / 2},
+                {x : center.X + size.width / 2, y : center.Y - size.height / 2},
+                {x : center.X + size.width / 2, y : center.Y + size.height / 2},
+                {x : center.X - size.width / 2, y : center.Y + size.height / 2},
+                {x : center.X - size.width / 2, y : center.Y - size.height / 2}
+            ];
+            
+        this.captureBox = this.createPolygon(coordinates);
+        
+        if (this.rotation != 0)
+        {
+            this.captureBox.rotate(this.rotation, center);
+        }
+        
+        if (this.active)
+        {
+            if (this.validateResolution())
+            {
+                this.mapWindow.ClearMapMessage();
+                this.draw();
+            }
+            else
+            {
+                this.mapWindow.ShowMapMessage(this.resolutionWarning, "warning");
+                this.clear();
+            }
+        }
+    },
+    
+    // The coordinates is a collection of a coordinate which is in following format:
+    // {x: coordinate, y: coordinate}
+    createPolygon : function (coordinates)
+    {
+        var polygon = new Polygon();
+        
+        var coordinate = null;
+        for (var i = 0; i < coordinates.length; ++i)
+        {
+            coordinate = coordinates[i];
+            polygon.AddPoint(new Point(coordinate.x, coordinate.y));
+        }
+        
+        return polygon;
+    },
+    
+    refreshRotateHandle : function(captureBox)
+    {
+        var box    = captureBox.clone();
+        var center = captureBox.getCentroid();
+        
+        if (this.rotation != 0)
+        {
+            box.rotate(-this.rotation, center);
+        }
+        
+        var size = box.getBounds().size;
+        this.rotateHandleStart = new Point(center.X, center.Y);
+        var length = size.height / 2 + this.rotateHandleLength / this.getPixelsPerMapUnits();
+        point      = new Point(center.X, center.Y + length);
+        this.rotateHandleEnd   = new Point(point.X, point.Y);
+        
+        if (this.rotation != 0)
+        {
+            this.rotateHandleStart.rotate(this.rotation, center);
+            this.rotateHandleEnd.rotate(this.rotation, center);
+        }
+    },
+
+    drawPolygon : function(polygon)
+    {
+        this.boxGraphics.setColor(this.fillColor);
+        this.boxGraphics.setStroke(1);
+        
+        var xs     = new Array();
+        var ys     = new Array();
+        var point  = null;
+        for (var i = 0; i < polygon.points.length; ++i)
+        {
+            point  = this.mapUnitsToScreen(polygon.Point(i));
+            xs.push(point.X);
+            ys.push(point.Y);
+        }
+        
+        // Draw the polygon
+        this.boxGraphics.fillPolygon(xs, ys);
+        
+        // Draw the border
+        this.boxGraphics.setColor(this.strokeColor);
+        this.boxGraphics.drawPolygon(xs, ys);
+    },
+    
+    draw : function()
+    {
+        this.clear();
+        // Draw the captureBox first
+        this.drawPolygon(this.captureBox);
+        // Refresh the rotate handle
+        this.refreshRotateHandle(this.captureBox);
+        
+        // Draw the rotate handle
+        var start = this.mapUnitsToScreen(this.rotateHandleStart);
+        var end   = this.mapUnitsToScreen(this.rotateHandleEnd);
+        this.handleGraphics.setColor(this.strokeColor);
+        this.handleGraphics.setStroke(2);
+        this.handleGraphics.drawLine(start.X, start.Y, end.X, end.Y);
+        
+        // Draw the rotate start point
+        this.gripGraphics.fillEllipse(start.X - this.rotateGripDiameter / 2, start.Y - this.rotateGripDiameter / 2, this.rotateGripDiameter, this.rotateGripDiameter);
+        // Draw the end point 
+        this.gripGraphics.setColor(this.strokeColor);
+        this.gripGraphics.fillEllipse(end.X - this.rotateGripDiameter / 2, end.Y - this.rotateGripDiameter / 2, this.rotateGripDiameter, this.rotateGripDiameter);
+        
+        this.boxGraphics.paint();
+        this.handleGraphics.paint();
+        this.gripGraphics.paint();
+        
+        // Set the cursor styles
+        var nodes = this.boxCanvas.childNodes;
+        for (var i = 0; i < nodes.length; ++i)
+        {
+            nodes[i].style.cursor = "move";
+        }
+        
+        nodes = this.gripCanvas.childNodes;
+        for (var i = 0; i < nodes.length; ++i)
+        {
+            nodes[i].style.cursor = "url(../stdicons/rotate.cur), default";
+        }
+    },
+    
+    validateResolution : function()
+    {
+        if (this.captureBox)
+        {
+            var viewerSize = {width: this.mapWindow.extX2 - this.mapWindow.extX1, height: this.mapWindow.extY1 - this.mapWindow.extY2};
+            var boxSize    = this.captureBox.getBounds().size;
+            
+            return boxSize.width < viewerSize.width || boxSize.height < viewerSize.height; 
+        }
+        
+        return true;
+    },
+    
+    clear : function()
+    {
+        this.boxGraphics.clear();
+        this.handleGraphics.clear();
+        this.gripGraphics.clear();
+    },
+
+    onMouseDown : function(evt, originalHandler)
+    {
+        var result = false;
+        
+        this.inCommand = this.rotating || this.moving && this.validateResolution();
+        
+        if ((!this.active || !this.inCommand) && originalHandler != null)
+        {
+            result = originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
+        }
+        
+        this.lastPixel = this.getMousePosition(evt);
+        
+        return result;
+    },
+    
+    onMouseUp : function(evt, originalHandler)
+    {
+        var result = false;
+        
+        this.inCommand = this.rotating || this.moving && this.validateResolution();
+        if ((!this.active || !this.inCommand) && originalHandler != null)
+        {
+            result = originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
+        }
+        
+        this.rotating  = false;
+        this.moving    = false;
+        this.inCommand = false;
+        this.clearSnappingHint();
+
+        return result;
+    },
+    
+    onMouseMove : function(evt, originalHandler)
+    {
+        if (this.active)
+        {
+            var point  = this.getMousePosition(evt);
+
+            if (!this.inCommand)
+            {
+                if (originalHandler != null)
+                {
+                    originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
+                }
+                
+                this.checkCommand(point);
+            }
+            else
+            {
+                if (this.rotating)
+                {
+                    this.rotate(evt);
+                }
+                else if (this.moving)
+                {
+                    this.move(evt);
+                }
+            }
+        }
+        else
+        {
+            if (originalHandler != null)
+            {
+                originalHandler.apply(this.mapWindow, Array.prototype.slice.call(arguments, 0, arguments.length - 1));
+            }
+        }
+    },
+    
+    panFeedback : function(evt, originalHandler)
+    {
+        if (originalHandler != null)
+        {
+            originalHandler(evt);
+        }
+        
+        if (this.active && this.validateResolution())
+        {
+            var res = this.getPixelsPerMapUnits();
+            var feedback = this.captureBox.clone();
+            
+            feedback.move(offx / res, -offy / res);
+            this.draw(feedback);
+        }
+    },
+    
+    handleMouseWheelEvent : function(delta, evt)
+    {
+        originalHandler = this.mouseWheelHandlerBackup;
+        if (originalHandler != null)
+        {
+            originalHandler(delta, evt);
+        }
+        
+        if (this.active && this.validateResolution() && (mapInit && !mapLoading))
+        {
+            // Following functions are defined in ajaxmappane.templ
+            var currentScale = CalculateScale();
+            var newScale     = GetNewScale(currentScale, wheelZoomDelta);
+            var zoomChange   = currentScale / newScale;
+            
+            //Determine the center of the new, zoomed map, in current screen device coords
+            var x = wheelZoomCursor.X;
+            var y = wheelZoomCursor.Y;
+            var center = this.mapWindow.ScreenToMapUnits(x, y);
+            
+            var feedback = this.captureBox.clone();
+            feedback.resize(zoomChange, center);
+            this.draw(feedback);
+        }
+    },
+    
+    checkCommand : function (point)
+    {
+        if (this.validateResolution())
+        {
+            this.moving   = false;
+            this.rotating = false;
+            
+            if (this.inRotateRange(point))
+            {
+                this.rotating = true;
+            }
+            else if (this.inMoveRange(point))
+            {
+                this.moving   = true;
+            }
+        }
+    },
+    
+    inRotateRange : function(point)
+    {
+        var p1 = this.mapWindow.ScreenToMapUnits(0, 0);
+        var p2 = this.mapWindow.ScreenToMapUnits(this.rotateGripDiameter, 0);
+        var radius = p1.distanceTo(p2) / 2;
+        var distance = this.rotateHandleEnd.distanceTo(point);
+        
+        return distance <= radius;
+    },
+    
+    inMoveRange : function(point)
+    {
+        var box    = this.captureBox.clone();
+        var p      = point.clone();
+        
+        if (this.rotation != 0)
+        {
+            var origin = box.getCentroid();
+            box.rotate(-this.rotation, origin);
+            p.rotate(-this.rotation, origin);
+        }
+        
+        var x1 = Math.min(box.Point(0).X, box.Point(1).X, box.Point(2).X, box.Point(3).X);   
+        var x2 = Math.max(box.Point(0).X, box.Point(1).X, box.Point(2).X, box.Point(3).X);
+        var y1 = Math.min(box.Point(0).Y, box.Point(1).Y, box.Point(2).Y, box.Point(3).Y);
+        var y2 = Math.max(box.Point(0).Y, box.Point(1).Y, box.Point(2).Y, box.Point(3).Y);
+
+        return (p.X <= x2 && p.X >= x1) && (p.Y <= y2 && p.Y >= y1);
+    },
+    
+    onMouseOut : function(evt, originalHandler)
+    {
+        console.info("mouse out");
+    },
+    
+    onMapLoaded : function(originalHandler, args)
+    {
+        if (originalHandler != null)
+        {
+            if (!args)
+            {
+                args = [];
+            }
+            
+            originalHandler.apply(this.mapWindow, args);
+        }
+        
+        this.refreshCanvasSize();
+        
+        if (this.active)
+        {
+            if (this.validateResolution())
+            {
+                this.mapWindow.ClearMapMessage();
+                this.draw(this.captureBox);
+            }
+            else
+            {
+                this.mapWindow.ShowMapMessage(this.resolutionWarning, "warning");
+                this.clear();
+            }
+        }
+    },
+    
+    getMousePosition : function(evt)
+    {
+        var offset = this.getScreenOffset();
+        var pixel  = new Point(evt.clientX - offset.left, evt.clientY - offset.top);
+        
+        return this.mapWindow.ScreenToMapUnits(pixel.X, pixel.Y);
+    },
+    
+    move : function(evt)
+    {
+        var pixel      = this.getMousePosition(evt);
+        var x          = pixel.X - this.lastPixel.X;
+        var y          = pixel.Y - this.lastPixel.Y;
+        this.captureBox.move(x, y);
+        this.rotateHandleStart.move(x, y);
+        this.rotateHandleEnd.move(x, y);
+        this.lastPixel = pixel;
+        
+        this.draw(this.captureBox);
+    },
+    
+    rotate : function(evt)
+    {
+        var pixel  = this.getMousePosition(evt);
+        
+        // Calculate the rotate angle, in degrees / counterclockwise
+        var origin = this.captureBox.getCentroid();
+        var angle1 = Math.atan2(this.lastPixel.Y - origin.Y, this.lastPixel.X - origin.X);  
+        var angle2 = Math.atan2(pixel.Y - origin.Y, pixel.X - origin.X);
+        var angle  = (angle2 - angle1) * 180 / Math.PI;
+
+        var rotation = this.rotation + angle;
+        if (evt.shiftKey)
+        {
+            var a = rotation % this.rotateSnappingStep;
+            var b = Math.round(rotation / this.rotateSnappingStep);
+            var targetRotation = rotation;
+            
+            if (Math.abs(a) <= this.rotateSnappingTolerance || Math.abs(a)>= this.rotateSnappingStep - this.rotateSnappingTolerance)
+            {
+                targetRotation = b * this.rotateSnappingStep;
+                
+                // Draw the snapping guide
+                this.drawSnappingHint(targetRotation);
+            }
+            else
+            {
+                this.clearSnappingHint();
+            }
+            
+            angle = targetRotation - this.rotation;
+        }
+        else
+        {
+            this.clearSnappingHint();
+        }
+        
+        this.captureBox.rotate(angle, origin);
+        this.rotateHandleStart.rotate(angle, origin);
+        this.rotateHandleEnd.rotate(angle, origin);
+        this.lastPixel = pixel;
+        this.rotation += angle;
+        
+        this.draw(this.captureBox);
+    },
+    
+    drawSnappingHint : function(angle)
+    {
+        this.clearSnappingHint();
+        
+        this.bgGraphics.setColor("black");
+        var length = Math.sqrt(Math.pow(this.mapWindow.mapDevW, 2), Math.pow(this.mapWindow.mapDevH, 2));
+        var origin = this.mapUnitsToScreen(this.captureBox.getCentroid());
+        var line   = new LineString();
+        line.AddPoint(new Point(origin.X, origin.Y - length));
+        line.AddPoint(new Point(origin.X, origin.Y + length));
+        
+        if (angle != 0)
+        {
+            line.rotate(-angle, origin);
+            
+        }
+        
+        var start = line.Point(0);
+        var end   = line.Point(1);
+        this.bgGraphics.drawLine(start.X, start.Y, end.X, end.Y);
+        
+        this.bgGraphics.paint();
+    },
+    
+    clearSnappingHint : function()
+    {
+        this.bgGraphics.clear();
+    },
+
+    getCaptureBox : function()
+    {
+        return this.captureBox;
+    },
+    
+    getNormalizedCapture : function()
+    {
+        var capture = this.captureBox.clone();
+        
+        if (this.rotation != 0)
+        {
+            capture.rotate(-this.rotation, capture.getCentroid());
+        }
+        
+        return capture;
+    },
+    
+    getPixelsPerMapUnits : function()
+    {
+        var p1 = this.mapWindow.ScreenToMapUnits(0, 0);
+        var p2 = this.mapWindow.ScreenToMapUnits(1, 0);
+        return 1 / (p2.X - p1.X);
+    },
+    
+    mapUnitsToScreen : function(point)
+    {
+        var x = (point.X - this.mapWindow.extX1) * this.mapWindow.mapDevW / (this.mapWindow.extX2 - this.mapWindow.extX1);
+        var y = (point.Y - this.mapWindow.extY1) * this.mapWindow.mapDevH / (this.mapWindow.extY2 - this.mapWindow.extY1);
+        return new Point(x, y);
+    },
+    
+    getScreenOffset : function()
+    {
+        return this.getContentPosition(this.mapWindow.$("img1"));
+    },
+    
+    getContentPosition: function(element)
+    {
+        var offsetLeft = 0;
+        var offsetTop  = 0;
+        var border     = 0;
+        
+        while (element && element.tagName.toLowerCase() != "body" && element.tagName.toLowerCase() != "html")
+        {
+            offsetLeft += element.offsetLeft;
+            offsetTop  += element.offsetTop;
+            
+            border      = parseInt(element.style.borderLeftWidth);
+            if (!isNaN(border))
+            {
+                offsetLeft += border;
+            }
+            
+            border      = parseInt(element.style.borderTopWidth);
+            if (!isNaN(border))
+            {
+                offsetTop += border;
+            }
+            
+            element     = element.offsetParent;
+        }
+        
+        return {left: offsetLeft, top: offsetTop};
+    }
+};
+
+/////////////////////////////
+
+var PreviewDialog = function()
+{
+};
+
+PreviewDialog.prototype = 
+{
+    jxDialog : null,
+    previewFrame : null,
+    innerDoc : null,
+    indicator : null,
+    previewPicture : null,
+    printPicture : null,
+    topLeftXYLabel : null,
+    bottomRightXYLabel : null,
+    previewContainer : null,
+    pictureContainer : null,
+    printButton : null,
+    cancelButton : null,
+    loadingErrorMessage : null,
+    printStyle: null,
+    previewStyle: null,
+    rendererName: null,
+    // The offset from the border of the paper, in px 
+    csLabelOffset : 5,
+    // The print margin, in inches
+    printMargin: 0,
+    mapInfo : {sessionID: "", name: ""},
+    captureInfo : {topLeftCs : {x : 0, y : 0}, bottomRightCs : {x : 0, y : 0}, paperSize:{w : 0, h : 0}, scaleDenominator : 0, rotation : 0, params1 : "", params2 : ""},
+    params : null,
+    
+    // The callback will be called right after the JxDialog content has been loaded.
+    // The callback accepts 1 parameter: windowName (string)
+    // Here it is used to submit the quick plot form to the preview frame.
+    contentLoadedCallback : null,
+    
+    initialize : function(options)
+    {
+        this.mapInfo      = options.mapInfo;
+        this.captureInfo  = options.captureInfo;
+        this.rendererName = options.rendererName;
+        this.params       = options.params;
+        
+        this.jxDialog = new Jx.Dialog(
+        {
+            modal: true,
+            width:400,
+            height: 400,
+            content: '<table border="0" cellspacing="0" cellpadding="0" id="PreviewContainer">' + 
+                     '	<tr>' + 
+                     '		<td>' + 
+                     '			<iframe id="PreviewFrame" scrolling="no" frameborder="0" style="border: 0px; width: 400px; height: 300px;" src="about:blank"></iframe>' +
+                     '		</td>' +
+                     '  </tr>' +
+                     '</table>'
+        });
+        
+        this.jxDialog.addEvent("open", this.jxDialogOpened.bind(this, true));
+        this.jxDialog.addEvent("contentLoaded", this.jxDialogContentLoaded.bind(this));
+        // Listen to the fade complete event to close the dialog
+        var o = this.jxDialog.domObj.get("tween").addEvent("complete", this.closeJxDialog.bind(this));
+    },
+    
+    open : function(contentLoadedCallback, openedCallback, closedCallback)
+    {
+        this.contentLoadedCallback = contentLoadedCallback;
+        this.openedCallback        = openedCallback;
+        this.closedCallback        = closedCallback;
+        this.jxDialog.loadContent(this.jxDialog.content);
+        this.jxDialog.open();
+    },
+    
+    print : function()
+    {
+        //
+        this.previewFrame.contentWindow.doPrint();
+    },
+    
+    cancel : function()
+    {
+        this.indicator.style.display     = "inline";
+        this.indicator.style.visibility  = "visible";
+        this.indicator.setOpacity(1);
+        
+        this.loadingErrorMessage.fade(0);
+        this.loadingErrorMessage.style.display = "none";
+        // Hide the picture but don't set the 'display' style property to avoid messing the print layout up
+        this.printPicture.style.height   = "0px";
+        
+        if (this.topLeftXYLabel && this.bottomRightXYLabel)
+        {
+            this.topLeftXYLabel.setOpacity(0);
+            this.bottomRightXYLabel.setOpacity(0);
+            this.printLabel.setOpacity(0);
+            // Remove the labels
+            this.topLeftXYLabel.parentNode.removeChild(this.topLeftXYLabel);
+            this.topLeftXYLabel     = null;
+            this.bottomRightXYLabel.parentNode.removeChild(this.bottomRightXYLabel);
+            this.bottomRightXYLabel = null;
+            this.printLabel.parentNode.removeChild(this.printLabel);
+            this.printLabel         = null;
+        }
+        
+        this.isClosing = true;
+        this.jxDialog.blanket.fade(0);
+        this.jxDialog.domObj.fade(0);
+        
+        // Inform the listener that the dialog is closed
+        if (this.closedCallback)
+        {
+            this.closedCallback();
+        }
+    },
+    
+    jxDialogContentLoaded : function()
+    {
+        // Set the window name for the preview frame
+        this.previewFrame = $("PreviewFrame");
+        this.previewFrame.contentWindow.name = "QuickPlotPreviewFrame";
+        
+        // Inform the listener that the content is ready, then the Quick Plot panel can submit its data to the preview frame
+        if (this.contentLoadedCallback)
+        {
+            this.contentLoadedCallback(this.previewFrame.contentWindow.name);
+        }
+    },
+    
+    jxDialogOpened : function(setFrameUrl)
+    {
+        if (this.previewInnerIsLoaded)
+        {
+            // Resize the preview frame according to the monitor resolution
+            this.innerDoc         = this.previewFrame.contentWindow.document;
+            var box       = $(document.body).getDimensions();
+            // Width of preview dialog = screen width * factor
+            var factor    = 0.5;
+            this.previewContainer = $(this.innerDoc.getElementById("PreviewContainer"));
+            this.previewContainer.style.width = box.width * factor + "px";
+            this.pictureContainer = $(this.innerDoc.getElementById("PictureContainer"));
+            var pcBox = this.pictureContainer.getContentBoxSize();
+            
+            this.indicator        = $(this.innerDoc.getElementById("ProgressIndicator"));
+            
+            var paperSize  = this.captureInfo.paperSize;
+            this.paperSize = paperSize;
+            
+            var ratio = paperSize.w / paperSize.h;
+            
+            // Resize the indicator
+            this.indicator.style.width  = pcBox.width + "px";
+            this.indicator.style.height = pcBox.width / ratio + "px";
+            // Set a explicit size to the container
+            this.pictureContainer.style.width  = this.indicator.style.width;
+            this.pictureContainer.style.height = this.indicator.style.height;
+            // Get the styles for the print picture
+            var rules = this.innerDoc.styleSheets[1].cssRules || this.innerDoc.styleSheets[1].rules;
+            this.previewStyle = rules[0];
+            rules     = this.innerDoc.styleSheets[2].cssRules || this.innerDoc.styleSheets[2].rules;
+            this.printStyle   = rules[0];
+            
+            // Reset the background
+            this.indicator.style.background = "url(../stdicons/progress_indicator.gif) no-repeat cneter center";
+            
+            this.loadingErrorMessage = $(this.innerDoc.getElementById("PictureLoadingErrorMessage"));
+            this.loadingErrorMessage.setOpacity(0);
+            
+            // Set the picture url
+            var src = this.rendererName + "?session_id=" + this.mapInfo.sessionID +
+                  "&map_name=" + this.mapInfo.name + 
+                  "&print_dpi=" + this.params.printDpi + 
+                  "&paper_size=" + this.captureInfo.paperSize.w + "," + this.captureInfo.paperSize.h + 
+                  "&box=" + this.captureInfo.params1 +
+                  "&normalized_box=" + this.captureInfo.params2 + 
+                  "&scale_denominator=" + this.captureInfo.scaleDenominator + 
+                  "&rotation=" + this.captureInfo.rotation; 
+                
+            this.printPicture       = $(this.innerDoc.getElementById("PrintPicture"));
+            this.printPicture.src   = src;
+            
+            // Listen to print picture onload vent
+            this.printPicture.addEvent("load", this.printPictureLoaded.bind(this));
+            this.printPicture.addEvent("error", this.printPictureLoadError.bind(this));
+            
+            var innerBox  = this.previewContainer.getMarginBoxSize();
+            // Resize the frame according to the inner container's 
+            this.previewFrame.style.width  = innerBox.width + "px";
+            this.previewFrame.style.height = innerBox.height + "px";
+            
+            // Hide the title bar
+            this.jxDialog.title.style.display  = "none";
+            // Hide the chrome
+            this.jxDialog.chrome.style.display = "none";
+            
+            // Disable the print button until the image is ready
+            this.printButton           = this.innerDoc.getElementById("PrintButton");
+            this.cancelButton          = this.innerDoc.getElementById("CancelButton");
+            this.printButton.disabled  = true;
+            this.cancelButton.disabled = true;
+            
+            var delta     = {x: 22, y: 43};
+            var container = $("PreviewContainer");
+            var size      = container.getMarginBoxSize();
+            this.jxDialog.resize(size.width + delta.x, size.height + delta.y, true);
+
+            // Inform the listeners that the dialog is opened
+            if (this.openedCallback)
+            {
+                this.openedCallback();
+            }
+            this.jxDialog.blanket.fade(0.2);
+            this.jxDialog.domObj.fade(1);
+            this.resizeIsPending = false;
+            
+            this.previewInnerIsLoaded = false;
+        }
+        else
+        {
+            this.jxDialog.blanket.setOpacity(0);
+            this.jxDialog.domObj.setOpacity(0);
+            this.resizeIsPending = true;
+        }
+    },
+    
+    previewInnerLoaded: function()
+    {
+        this.previewInnerIsLoaded = true;
+        if (this.resizeIsPending)
+        {
+            this.jxDialogOpened(false);
+        }
+    },
+    
+    closeJxDialog : function()
+    {
+        if (this.isClosing)
+        {
+            this.jxDialog.close();
+            this.isClosing = false;
+        }
+    },
+    
+    printPictureLoaded : function()
+    {
+        var size = {width: parseInt(this.indicator.style.width), height: parseInt(this.indicator.style.height)};
+        
+        this.indicator.fade(0);
+        this.indicator.style.display = "none";
+        
+        // Set the preview size
+        this.printPicture.setOpacity(0);
+        // Clear the inline style
+        this.printPicture.style.width   = "";
+        this.previewStyle.style.width   = size.width + "px";
+        this.previewStyle.style.height  = size.height + "px";
+        this.printPicture.fade(1);
+        
+        // Set the print size
+        // NOTE: It works only with a 96 dpi device dpi
+        var deviceDpi  = 96;
+        var idealSize  = {width:(this.paperSize.w / 25.4 - 2 * this.printMargin) * deviceDpi, height:(this.paperSize.h / 25.4 - 2 * this.printMargin) * deviceDpi};
+        // Get the size of the print frame
+        var docSize    = $(this.innerDoc.body).getContentBoxSize();
+        var realHeight = idealSize.height - (docSize.height - size.height);
+        var realWidth  = realHeight * this.paperSize.w / this.paperSize.h;
+        if (realWidth > idealSize.width)
+        {
+            realWidth = idealSize.width;
+            realHeight = realWidth / (this.paperSize.w / this.paperSize.h);
+        }
+        
+        this.printStyle.style.width  = realWidth + "px";
+        this.printStyle.style.height = realHeight + "px";
+        
+        // Create the coordinates labels
+        if (!this.topLeftXYLabel)
+        {
+            this.topLeftXYLabel = this.createCoordinateLabel(this.pictureContainer, this.captureInfo.topLeftCs.x, this.captureInfo.topLeftCs.y, "TopLeftXYLabel");
+            this.topLeftXYLabel.setOpacity(0);
+        }
+        
+        if (!this.bottomRightXYLabel)
+        {
+            this.bottomRightXYLabel = this.createCoordinateLabel(this.pictureContainer, this.captureInfo.bottomRightCs.x, this.captureInfo.bottomRightCs.y, "BottomRightXYLabel");
+            this.bottomRightXYLabel.setOpacity(0);
+        }
+        
+        if (!this.printLabel)
+        {
+            this.printLabel = this.createCoordinateLabel(this.pictureContainer, this.captureInfo.bottomRightCs.x, this.captureInfo.bottomRightCs.y, "PrintLabel");
+        }
+        
+        // Set the correct positions for the labels
+        var pos    = this.getContentPosition(this.pictureContainer);
+        var picDim = this.pictureContainer.getContentBoxSize();
+        this.topLeftXYLabel.style.left     = pos.left + this.csLabelOffset + "px";
+        this.topLeftXYLabel.style.top      = pos.top + this.csLabelOffset + "px"; 
+        var labelDim = this.bottomRightXYLabel.getMarginBoxSize();
+        this.bottomRightXYLabel.className  = "ScreenOnly";
+        this.bottomRightXYLabel.style.left = pos.left + picDim.width - this.csLabelOffset - labelDim.width + "px";
+        this.bottomRightXYLabel.style.top  = pos.top + picDim.height - this.csLabelOffset - labelDim.height + "px";
+        labelDim = this.printLabel.getMarginBoxSize();
+        this.printLabel.className          = "PrintOnly";
+        this.printLabel.style.left         = pos.left + realWidth - this.csLabelOffset - labelDim.width + "px";
+        this.printLabel.style.top          = pos.top + realHeight - this.csLabelOffset - labelDim.height + "px";
+        
+        this.topLeftXYLabel.fade(1);
+        this.bottomRightXYLabel.fade(1);
+        // Enable the print button
+        this.printButton.disabled  = false;
+        this.cancelButton.disabled = false;
+    },
+    
+    printPictureLoadError : function()
+    {
+        this.indicator.fade(0);
+        this.indicator.style.display = "none";
+        this.loadingErrorMessage.style.display = "inline";
+        this.loadingErrorMessage.setOpacity(0);
+        this.loadingErrorMessage.fade(1);
+        this.cancelButton.disabled = false;
+    },
+    
+    createCoordinateLabel: function(container, cX, cY, id)
+    {
+        cX = cX + "";
+        cY = cY + "";
+        var digits = 6;
+        
+        var index = cX.indexOf(".");
+        if (index > -1)
+        {
+            cX = cX.substr(0, index + digits + 1);
+        }
+        
+        index = cY.indexOf(".");
+        if (index > -1)
+        {
+            cY = cY.substr(0, index + digits + 1);
+        }
+        
+        var label = this.innerDoc.createElement("div");
+        container.appendChild(label);
+        label.id  = id;
+        label.style.cssText = "border:solid 1px black; padding:1px; background:#F2F2F2; color:black; font-size:8pt; z-index:1000; " +
+                              "position:absolute; white-space:nowrap";
+        label.innerHTML     = "X: " + cX + " Y: " + cY;
+        
+        return $(label);
+    },
+    
+    getContentPosition: function(element)
+    {
+        var offsetLeft = 0;
+        var offsetTop  = 0;
+        var border     = 0;
+        
+        while (element && element.tagName.toLowerCase() != "body" && element.tagName.toLowerCase() != "html")
+        {
+            offsetLeft += element.offsetLeft;
+            offsetTop  += element.offsetTop;
+            
+            border      = parseInt(element.style.borderLeftWidth);
+            if (!isNaN(border))
+            {
+                offsetLeft += border;
+            }
+            
+            border      = parseInt(element.style.borderTopWidth);
+            if (!isNaN(border))
+            {
+                offsetTop += border;
+            }
+            
+            element     = element.offsetParent;
+        }
+        
+        return {left: offsetLeft, top: offsetTop};
+    }
+};
+
+/////////////////////////
+
+function previewQuickPlot(dialogConentLoadedCallback, dialogOpenedCallback, dialogClosedCallback, printDpi, rendererName)
+{
+    var mapInfo     = {sessionID : GetSessionId(), name : GetMapName()};
+    
+    var capture     = mapCapturer.getCaptureBox();
+    var vertices    = capture.points;
+    
+    var params1     = "";
+    for (var i = 0; i < vertices.length; ++i)
+    {
+        var vertice = vertices[i];
+        params1    += vertice.X + "," + vertice.Y + ",";
+    }
+    params1         = params1.substr(0, params1.length - 1);
+    
+    var vertices2   = mapCapturer.getNormalizedCapture().points;
+    var params2     = "";
+    for (var i = 0; i < vertices2.length; ++i)
+    {
+        var vertice = vertices2[i];
+        params2    += vertice.X + "," + vertice.Y + ",";
+    }
+    params2         = params2.substr(0, params2.length - 1);
+    
+    var captureInfo = {topLeftCs : {x : vertices[3].X, y : vertices[3].Y},
+                       bottomRightCs : {x : vertices[1].X, y : vertices[1].Y},
+                       paperSize : {w : mapCapturer.paperSize.width, h : mapCapturer.paperSize.height},
+                       scaleDenominator : mapCapturer.scaleDenominator,
+                       rotation : mapCapturer.rotation,
+                       params1 : params1,
+                       params2 : params2}; 
+    // Change the parameters here to control the print dpi and if
+    // handle the label font unit type automatically
+    var params      = {printDpi : printDpi};
+    
+    if (!quickPlotPreviewDialog)
+    {
+        quickPlotPreviewDialog = new PreviewDialog();
+        quickPlotPreviewDialog.initialize({mapInfo : mapInfo, captureInfo : captureInfo, rendererName : rendererName, params : params});
+    }
+    else
+    {
+        quickPlotPreviewDialog.mapInfo      = mapInfo;
+        quickPlotPreviewDialog.captureInfo  = captureInfo;
+        quickPlotPreviewDialog.rendererName = rendererName;
+        quickPlotPreviewDialog.params       = params;
+    }
+
+    quickPlotPreviewDialog.open(dialogConentLoadedCallback, dialogOpenedCallback, dialogClosedCallback);
+}
+
+function endPlotPreview()
+{
+    if (quickPlotPreviewDialog != null)
+    {
+        quickPlotPreviewDialog.cancel();
+    }
+}
+
+var mapCapturer = new MapCapturer();
+var quickPlotPreviewDialog = null;
+var message     = null;
+


Property changes on: trunk/MgDev/Web/src/viewerfiles/quickplot.js
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/quickplotpanel.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/quickplotpanel.js	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/quickplotpanel.js	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,323 +1,323 @@
-function getMapFrame()
-{
-    if (targetType == 1)
-    {
-        // In task pane
-        return parent.parent.mapFrame;
-    }
-    else if (targetType == 2)
-    {
-        // In a new window
-        return opener.parent.parent.mapFrame;
-    }
-    else if (targetType == 3)
-    {
-        // In a specified frame. The administrator needs to implement this method
-        // according to the nested level of this frame
-    }
-}
-
-
-function restoreUI()
-{
-    setAdvancedOptionsUI(false);
-    
-    // Read the last used options
-    lastPaperSize = Cookie.read("QuickPlotLastUsedPaperSize");
-    lastScale     = Cookie.read("QuickPlotLastUsedScaling");
-    lastDPI       = Cookie.read("QuickPlotLastUsedDPI");
-    
-    if (lastPaperSize != null)
-    {
-        document.getElementById("PaperList").value   = lastPaperSize;
-    }
-    
-    if (lastScale != null)
-    {
-        document.getElementById("ScalingList").value = lastScale;
-    }
-    
-    if (lastDPI != null)
-    {
-        document.getElementById("DPIList").value     = lastDPI;
-    }
-    
-    // Set the string resource
-    var mapCapturer = getMapFrame().mapCapturer;
-    mapCapturer.resolutionWarning = captureWarningMessage;
-}
-
-function cleanup()
-{
-    // Remove the map capture box
-    var mapCapturer = getMapFrame().mapCapturer;
-    if (mapCapturer)
-    {
-        mapCapturer.deactivate();
-    }
-    
-    // Detach the dialog closed callback to prevent calling a function from an unloaded document
-    // which will lead to a runtime error
-    var dialog = getMapFrame().quickPlotPreviewDialog;
-    if (dialog)
-    {
-        dialog.closedCallback = null;
-    }
-
-    // Close the preview dialog if it is opened.
-    getMapFrame().endPlotPreview();
-}
-
-function setAdvancedOptionsUI(enabled)
-{
-    document.getElementById("AdvancedOptionsCheckBox").checked = enabled;
-    document.getElementById("PaperList").disabled   = !enabled;
-    document.getElementById("ScalingList").disabled = !enabled;
-    document.getElementById("DPIList").disabled     = !enabled;
-    
-    var mapCapturer = getMapFrame().mapCapturer;
-    
-    if (enabled)
-    {
-        mapCapturer.activate();
-        drawCaptureBox();
-    }
-    else
-    {
-        mapCapturer.deactivate();
-    }
-}
-
-function updateUI(enabled)
-{
-    var doc   = $(document);
-    var cover = $(doc.getElementById("ModalDialogCover"));
-    
-    if (cover == null)
-    {
-        cover = doc.createElement("div");
-        cover = $(cover);
-        cover.setOpacity(0);
-        doc.body.appendChild(cover);
-        cover.id = "ModalDialogCover";
-        cover.style.display    = "block";
-        cover.style.position   = "absolute";
-        cover.style.left       = "0px";
-        cover.style.top        = "0px";
-        cover.style.zIndex     = 1000;
-        cover.style.background = "black";
-        cover.style.opacity    = 0;
-        cover.style.visibility = "hidden";
-    }
-    
-    // Set a proper size to the cover
-    var box = $(doc.body).getDimensions();
-    cover.style.width  = box.width + "px";
-    cover.style.height = box.height + "px";
-    
-    if (enabled)
-    {
-        cover.fade(0);
-    }
-    else
-    {
-        cover.fade(0.2);
-        doc.getElementById("GeneratePlotButton").blur();
-    }
-}
-
-function generatePlot()
-{
-    var mapCapturer = getMapFrame().mapCapturer;
-
-    if (!advancedOptionsOn())
-    {
-        // Get paper size. Use the last used paper size by default
-        mapCapturer.setSize(getPaperSize(), getScale());
-    }
-    
-    getMapFrame().previewQuickPlot(onPreviewDialogContentLoaded, onPreviewDialogOpened, onPreviewDialogClosed, getPrintDpi(), rendererName);
-}
-
-function onPreviewDialogContentLoaded(windowName)
-{
-    // Save the advanced options to a cookie
-    var cookieDuration = 365;
-    Cookie.write("QuickPlotLastUsedPaperSize", document.getElementById("PaperList").value, {duration:cookieDuration});
-    Cookie.write("QuickPlotLastUsedScaling", document.getElementById("ScalingList").value, {duration:cookieDuration});
-    Cookie.write("QuickPlotLastUsedDPI", document.getElementById("DPIList").value, {duration:cookieDuration});
-
-    // Submit the form
-    var form = document.getElementById("Form1");
-    form.target = windowName;
-    form.submit();
-}
-
-function onPreviewDialogOpened()
-{
-    updateUI(false);
-}
-
-function onPreviewDialogClosed()
-{
-    updateUI(true);
-}
-
-function advancedOptionsOn()
-{
-    var o = document.getElementById("AdvancedOptionsCheckBox");
-    if (o && o.checked)
-    {
-        return true;
-    }
-    
-    return false;
-}
-
-function getPaperSize()
-{
-    var value = document.getElementById("PaperList").value.split(",");
-    var size = {width: parseFloat(value[0]), height: parseFloat(value[1])};
-
-    if (!advancedOptionsOn())
-    {
-        // Calculate the paper size to make sure it has a same ratio with the viweport
-        var paperRatio = size.width / size.height;
-        var w          = getMapFrame().window;
-        var viewRatio  = w.mapDevW / w.mapDevH;
-
-        if (paperRatio > viewRatio)
-        {
-            size.width  = size.height * viewRatio;
-        }
-        else
-        {
-            size.height = size.width / viewRatio;
-        }
-    }
-
-    return size;
-}
-
-function getScale()
-{
-    var scale = 0;
-    if (advancedOptionsOn())
-    {
-        scale = document.getElementById("ScalingList").value;
-    }
-    else
-    {
-        var map        = getMapFrame();
-        var paperSize  = getPaperSize();
-        var viewerSize = {width: map.extX2 - map.extX1, height: map.extY1 - map.extY2};
-        var factor     = map.GetMetersPerUnits();
-        
-        if (paperSize.width / paperSize.height > viewerSize.width / viewerSize.height)
-        {
-            scale = viewerSize.height * factor * 1000 / paperSize.height;
-        } 
-        else
-        {
-            scale = viewerSize.width * factor * 1000 / paperSize.width;
-        }
-    }
-
-    scale = parseInt(scale);
-    // Set the value to a hidden field so that it could be sent by POST method
-    // We cannot rely on the ScalingList.value because we have to handle also the viewport print 
-    document.getElementById("ScaleDenominator").value = scale;
-    
-    return scale;
-}
-
-function getPrintDpi()
-{
-    return document.getElementById("DPIList").value;
-}
-
-function drawCaptureBox()
-{
-    var mapCapturer = getMapFrame().mapCapturer;
-    mapCapturer.setSize(getPaperSize(), getScale());
-}
-
-/*
-Script: Cookie.js
-    Class for creating, loading, and saving browser Cookies.
-
-License:
-    MIT-style license.
-
-Credits:
-    Based on the functions by Peter-Paul Koch (http://quirksmode.org).
-*/
-
-var Cookie = function(key, options)
-{
-    this.initialize(key, options);
-};
-
-Cookie.prototype = 
-{
-    options: {
-        path: false,
-        domain: false,
-        duration: false,
-        secure: false,
-        document: document
-    },
-
-    initialize: function(key, options){
-        this.key = key;
-        
-        if (options != null)
-        {
-            for (var key in this.options)
-            {
-                if (options[key] != null)
-                {
-                    this.options[key] = options[key];
-                }
-            }
-        }
-    },
-
-    write: function(value){
-        value = encodeURIComponent(value);
-        if (this.options.domain) value += '; domain=' + this.options.domain;
-        if (this.options.path) value += '; path=' + this.options.path;
-        if (this.options.duration){
-            var date = new Date();
-            date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000);
-            value += '; expires=' + date.toGMTString();
-        }
-        if (this.options.secure) value += '; secure';
-        this.options.document.cookie = this.key + '=' + value;
-        return this;
-    },
-
-    read: function(){
-        var escapedKey = this.key.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1');
-        var value = this.options.document.cookie.match('(?:^|;)\\s*' + escapedKey + '=([^;]*)');
-        return (value) ? decodeURIComponent(value[1]) : null;
-    },
-
-    dispose: function(){
-        new Cookie(this.key, $merge(this.options, {duration: -1})).write('');
-        return this;
-    }
-
-};
-
-Cookie.write = function(key, value, options){
-    return new Cookie(key, options).write(value);
-};
-
-Cookie.read = function(key){
-    return new Cookie(key).read();
-};
-
-Cookie.dispose = function(key, options){
-    return new Cookie(key, options).dispose();
-};
+function getMapFrame()
+{
+    if (targetType == 1)
+    {
+        // In task pane
+        return parent.parent.mapFrame;
+    }
+    else if (targetType == 2)
+    {
+        // In a new window
+        return opener.parent.parent.mapFrame;
+    }
+    else if (targetType == 3)
+    {
+        // In a specified frame. The administrator needs to implement this method
+        // according to the nested level of this frame
+    }
+}
+
+
+function restoreUI()
+{
+    setAdvancedOptionsUI(false);
+    
+    // Read the last used options
+    lastPaperSize = Cookie.read("QuickPlotLastUsedPaperSize");
+    lastScale     = Cookie.read("QuickPlotLastUsedScaling");
+    lastDPI       = Cookie.read("QuickPlotLastUsedDPI");
+    
+    if (lastPaperSize != null)
+    {
+        document.getElementById("PaperList").value   = lastPaperSize;
+    }
+    
+    if (lastScale != null)
+    {
+        document.getElementById("ScalingList").value = lastScale;
+    }
+    
+    if (lastDPI != null)
+    {
+        document.getElementById("DPIList").value     = lastDPI;
+    }
+    
+    // Set the string resource
+    var mapCapturer = getMapFrame().mapCapturer;
+    mapCapturer.resolutionWarning = captureWarningMessage;
+}
+
+function cleanup()
+{
+    // Remove the map capture box
+    var mapCapturer = getMapFrame().mapCapturer;
+    if (mapCapturer)
+    {
+        mapCapturer.deactivate();
+    }
+    
+    // Detach the dialog closed callback to prevent calling a function from an unloaded document
+    // which will lead to a runtime error
+    var dialog = getMapFrame().quickPlotPreviewDialog;
+    if (dialog)
+    {
+        dialog.closedCallback = null;
+    }
+
+    // Close the preview dialog if it is opened.
+    getMapFrame().endPlotPreview();
+}
+
+function setAdvancedOptionsUI(enabled)
+{
+    document.getElementById("AdvancedOptionsCheckBox").checked = enabled;
+    document.getElementById("PaperList").disabled   = !enabled;
+    document.getElementById("ScalingList").disabled = !enabled;
+    document.getElementById("DPIList").disabled     = !enabled;
+    
+    var mapCapturer = getMapFrame().mapCapturer;
+    
+    if (enabled)
+    {
+        mapCapturer.activate();
+        drawCaptureBox();
+    }
+    else
+    {
+        mapCapturer.deactivate();
+    }
+}
+
+function updateUI(enabled)
+{
+    var doc   = $(document);
+    var cover = $(doc.getElementById("ModalDialogCover"));
+    
+    if (cover == null)
+    {
+        cover = doc.createElement("div");
+        cover = $(cover);
+        cover.setOpacity(0);
+        doc.body.appendChild(cover);
+        cover.id = "ModalDialogCover";
+        cover.style.display    = "block";
+        cover.style.position   = "absolute";
+        cover.style.left       = "0px";
+        cover.style.top        = "0px";
+        cover.style.zIndex     = 1000;
+        cover.style.background = "black";
+        cover.style.opacity    = 0;
+        cover.style.visibility = "hidden";
+    }
+    
+    // Set a proper size to the cover
+    var box = $(doc.body).getDimensions();
+    cover.style.width  = box.width + "px";
+    cover.style.height = box.height + "px";
+    
+    if (enabled)
+    {
+        cover.fade(0);
+    }
+    else
+    {
+        cover.fade(0.2);
+        doc.getElementById("GeneratePlotButton").blur();
+    }
+}
+
+function generatePlot()
+{
+    var mapCapturer = getMapFrame().mapCapturer;
+
+    if (!advancedOptionsOn())
+    {
+        // Get paper size. Use the last used paper size by default
+        mapCapturer.setSize(getPaperSize(), getScale());
+    }
+    
+    getMapFrame().previewQuickPlot(onPreviewDialogContentLoaded, onPreviewDialogOpened, onPreviewDialogClosed, getPrintDpi(), rendererName);
+}
+
+function onPreviewDialogContentLoaded(windowName)
+{
+    // Save the advanced options to a cookie
+    var cookieDuration = 365;
+    Cookie.write("QuickPlotLastUsedPaperSize", document.getElementById("PaperList").value, {duration:cookieDuration});
+    Cookie.write("QuickPlotLastUsedScaling", document.getElementById("ScalingList").value, {duration:cookieDuration});
+    Cookie.write("QuickPlotLastUsedDPI", document.getElementById("DPIList").value, {duration:cookieDuration});
+
+    // Submit the form
+    var form = document.getElementById("Form1");
+    form.target = windowName;
+    form.submit();
+}
+
+function onPreviewDialogOpened()
+{
+    updateUI(false);
+}
+
+function onPreviewDialogClosed()
+{
+    updateUI(true);
+}
+
+function advancedOptionsOn()
+{
+    var o = document.getElementById("AdvancedOptionsCheckBox");
+    if (o && o.checked)
+    {
+        return true;
+    }
+    
+    return false;
+}
+
+function getPaperSize()
+{
+    var value = document.getElementById("PaperList").value.split(",");
+    var size = {width: parseFloat(value[0]), height: parseFloat(value[1])};
+
+    if (!advancedOptionsOn())
+    {
+        // Calculate the paper size to make sure it has a same ratio with the viweport
+        var paperRatio = size.width / size.height;
+        var w          = getMapFrame().window;
+        var viewRatio  = w.mapDevW / w.mapDevH;
+
+        if (paperRatio > viewRatio)
+        {
+            size.width  = size.height * viewRatio;
+        }
+        else
+        {
+            size.height = size.width / viewRatio;
+        }
+    }
+
+    return size;
+}
+
+function getScale()
+{
+    var scale = 0;
+    if (advancedOptionsOn())
+    {
+        scale = document.getElementById("ScalingList").value;
+    }
+    else
+    {
+        var map        = getMapFrame();
+        var paperSize  = getPaperSize();
+        var viewerSize = {width: map.extX2 - map.extX1, height: map.extY1 - map.extY2};
+        var factor     = map.GetMetersPerUnits();
+        
+        if (paperSize.width / paperSize.height > viewerSize.width / viewerSize.height)
+        {
+            scale = viewerSize.height * factor * 1000 / paperSize.height;
+        } 
+        else
+        {
+            scale = viewerSize.width * factor * 1000 / paperSize.width;
+        }
+    }
+
+    scale = parseInt(scale);
+    // Set the value to a hidden field so that it could be sent by POST method
+    // We cannot rely on the ScalingList.value because we have to handle also the viewport print 
+    document.getElementById("ScaleDenominator").value = scale;
+    
+    return scale;
+}
+
+function getPrintDpi()
+{
+    return document.getElementById("DPIList").value;
+}
+
+function drawCaptureBox()
+{
+    var mapCapturer = getMapFrame().mapCapturer;
+    mapCapturer.setSize(getPaperSize(), getScale());
+}
+
+/*
+Script: Cookie.js
+    Class for creating, loading, and saving browser Cookies.
+
+License:
+    MIT-style license.
+
+Credits:
+    Based on the functions by Peter-Paul Koch (http://quirksmode.org).
+*/
+
+var Cookie = function(key, options)
+{
+    this.initialize(key, options);
+};
+
+Cookie.prototype = 
+{
+    options: {
+        path: false,
+        domain: false,
+        duration: false,
+        secure: false,
+        document: document
+    },
+
+    initialize: function(key, options){
+        this.key = key;
+        
+        if (options != null)
+        {
+            for (var key in this.options)
+            {
+                if (options[key] != null)
+                {
+                    this.options[key] = options[key];
+                }
+            }
+        }
+    },
+
+    write: function(value){
+        value = encodeURIComponent(value);
+        if (this.options.domain) value += '; domain=' + this.options.domain;
+        if (this.options.path) value += '; path=' + this.options.path;
+        if (this.options.duration){
+            var date = new Date();
+            date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000);
+            value += '; expires=' + date.toGMTString();
+        }
+        if (this.options.secure) value += '; secure';
+        this.options.document.cookie = this.key + '=' + value;
+        return this;
+    },
+
+    read: function(){
+        var escapedKey = this.key.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1');
+        var value = this.options.document.cookie.match('(?:^|;)\\s*' + escapedKey + '=([^;]*)');
+        return (value) ? decodeURIComponent(value[1]) : null;
+    },
+
+    dispose: function(){
+        new Cookie(this.key, $merge(this.options, {duration: -1})).write('');
+        return this;
+    }
+
+};
+
+Cookie.write = function(key, value, options){
+    return new Cookie(key, options).write(value);
+};
+
+Cookie.read = function(key){
+    return new Cookie(key).read();
+};
+
+Cookie.dispose = function(key, options){
+    return new Cookie(key, options).dispose();
+};


Property changes on: trunk/MgDev/Web/src/viewerfiles/quickplotpanel.js
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/quickplotpanel.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/quickplotpanel.templ	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/quickplotpanel.templ	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,134 +1,134 @@
-<html>
-<head>
-<title>__#QUICKPLOT_HEADER#__</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-body, table, td, div, select, input 
-{
-    font: 8pt/1em __#@font#__;
-}
-
-div.Label
-{
-    padding:5px 0px;
-}
-
-div.Ctrl
-{
-    padding:5px 0px;
-}
-
-div.Title
-{
-    font-size: 14px;
-    font-weight: bold;
-    padding: 10px 0px;
-}
-
-div.HPlaceholder5px
-{
-    font-size:0px;
-    height:5px;
-}
-
-div.ButtonContainer
-{
-    padding: 5px 0px;
-    text-align: right;
-}
-
-.FixWidth
-{
-    width: 100%%;
-}
-
-input.Button
-{
-    width:75px;
-    height:23px;
-    margin-left:7px;
-}
-</style>
-
-<script language="javascript" type="text/javascript" src="%sjxlib.js"></script>
-<script language="javascript" type="text/javascript" src="%squickplotpanel.js"></script>
-<script language="javascript" type="text/javascript">
-var captureWarningMessage = "__#QUICKPLOT_RESOLUTION_WARNING#__";
-var failToPreviewMessage  = "__#QUICKPLOT_PREVIEW_ERROR#__";
-var targetType            = %s;
-var rendererName          = "%s";
-</script>
-</head>
-<body onload="restoreUI()" onunload="cleanup()">
-    <form id="Form1" name="Form1" method="post" action="%s">
-        <div class="Title FixWidth">__#QUICKPLOT_HEADER#__</div>
-        <div class="Label ">__#QUICKPLOT_TITLE#__</div>
-        <div class="Ctrl">
-            <input type="text" class="FixWidth" name="{field:title}" maxLength=100"/>
-        </div>
-        <div class="HPlaceholder5px"></div>
-        <div class="HPlaceholder5px"></div>
-        <div class="Label">__#QUICKPLOT_SUBTITLE#__</div>
-        <div class="Ctrl">
-            <input type="text" class="FixWidth" name="{field:sub_title}" maxLength=100"/>
-        </div>
-        <div class="HPlaceholder5px"></div>
-        <div class="HPlaceholder5px"></div>
-        <div class="HPlaceholder5px"></div>
-        <div class="Label">
-            <table cellspacing="0" cellpadding="0">
-                <tr>
-                    <td><input type="checkbox" id="AdvancedOptionsCheckBox" onclick="setAdvancedOptionsUI(this.checked)" /></td>
-                    <td><label for="AdvancedOptionsCheckBox">__#QUICKPLOT_ADVANCED_OPTIONS#__</label></td>
-                </tr>
-            </table>
-        </div>
-        <div class="HPlaceholder5px"></div>
-        <div class="Label">__#QUICKPLOT_PAPER_SIZE#__</div>
-        <div class="Ctrl">
-            <!--
-                The pre-defined paper size list. The value for each "option" item is in this format: [width,height]. The unit is in millimeter.
-                We can change the html code to add more paper size or remove some ones.
-            -->
-            <select class="FixWidth" id="PaperList" onchange="drawCaptureBox(this)">
-                <option value="297.0,210.0">A4 (210 MM x 297 MM)</option>
-                <option value="420.0,297.0">A3 (297 MM) x 420 MM</option>
-                <option value="279.4,215.9">Letter (8.50 x 11.00 Inches)</option>
-                <option value="355.6,215.9">Legal (8.50 x 14.00 Inches)</option>
-            </select>
-        </div>
-        <div class="HPlaceholder5px"></div>
-        <div class="HPlaceholder5px"></div>
-        <div class="Label">__#QUICKPLOT_SCALING#__</div>
-        <div class="Ctrl">
-            <!--
-                The pre-defined scales. The value for each "option" item is the scale denominator.
-                We can change the html code to extend the pre-defined scales
-            -->
-            <select class="FixWidth" id="ScalingList" onchange="drawCaptureBox(this)">
-                <option value="500">1 : 500</option>
-                <option value="1000">1 : 1000</option>
-                <option value="2500">1 : 2500</option>
-                <option value="5000">1 : 5000</option>
-            </select>
-        </div>
-        <div class="Label">__#QUICKPLOT_DPI#__</div>
-        <div class="Ctrl">
-            <!--
-                The pre-defined print DPI. 
-                We can change the html code to extend the pre-defined values
-            -->
-            <select class="FixWidth" id="DPIList">
-                <option value="96">96</option>
-                <option value="150" selected>150</option>
-                <option value="300">300</option>
-                <option value="600">600</option>
-            </select>
-        </div>
-        <input type="hidden" id="ScaleDenominator" name="scale_denominator" />
-        <div class="ButtonContainer FixWidth">
-            <input type="button" class="Button" id="GeneratePlotButton" value="__#QUICKPLOT_GENERATE#__" onclick="generatePlot()" />
-        </div>
-    </form>
-</body>
-</html>
+<html>
+<head>
+<title>__#QUICKPLOT_HEADER#__</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+body, table, td, div, select, input 
+{
+    font: 8pt/1em __#@font#__;
+}
+
+div.Label
+{
+    padding:5px 0px;
+}
+
+div.Ctrl
+{
+    padding:5px 0px;
+}
+
+div.Title
+{
+    font-size: 14px;
+    font-weight: bold;
+    padding: 10px 0px;
+}
+
+div.HPlaceholder5px
+{
+    font-size:0px;
+    height:5px;
+}
+
+div.ButtonContainer
+{
+    padding: 5px 0px;
+    text-align: right;
+}
+
+.FixWidth
+{
+    width: 100%%;
+}
+
+input.Button
+{
+    width:75px;
+    height:23px;
+    margin-left:7px;
+}
+</style>
+
+<script language="javascript" type="text/javascript" src="%sjxlib.js"></script>
+<script language="javascript" type="text/javascript" src="%squickplotpanel.js"></script>
+<script language="javascript" type="text/javascript">
+var captureWarningMessage = "__#QUICKPLOT_RESOLUTION_WARNING#__";
+var failToPreviewMessage  = "__#QUICKPLOT_PREVIEW_ERROR#__";
+var targetType            = %s;
+var rendererName          = "%s";
+</script>
+</head>
+<body onload="restoreUI()" onunload="cleanup()">
+    <form id="Form1" name="Form1" method="post" action="%s">
+        <div class="Title FixWidth">__#QUICKPLOT_HEADER#__</div>
+        <div class="Label ">__#QUICKPLOT_TITLE#__</div>
+        <div class="Ctrl">
+            <input type="text" class="FixWidth" name="{field:title}" maxLength=100"/>
+        </div>
+        <div class="HPlaceholder5px"></div>
+        <div class="HPlaceholder5px"></div>
+        <div class="Label">__#QUICKPLOT_SUBTITLE#__</div>
+        <div class="Ctrl">
+            <input type="text" class="FixWidth" name="{field:sub_title}" maxLength=100"/>
+        </div>
+        <div class="HPlaceholder5px"></div>
+        <div class="HPlaceholder5px"></div>
+        <div class="HPlaceholder5px"></div>
+        <div class="Label">
+            <table cellspacing="0" cellpadding="0">
+                <tr>
+                    <td><input type="checkbox" id="AdvancedOptionsCheckBox" onclick="setAdvancedOptionsUI(this.checked)" /></td>
+                    <td><label for="AdvancedOptionsCheckBox">__#QUICKPLOT_ADVANCED_OPTIONS#__</label></td>
+                </tr>
+            </table>
+        </div>
+        <div class="HPlaceholder5px"></div>
+        <div class="Label">__#QUICKPLOT_PAPER_SIZE#__</div>
+        <div class="Ctrl">
+            <!--
+                The pre-defined paper size list. The value for each "option" item is in this format: [width,height]. The unit is in millimeter.
+                We can change the html code to add more paper size or remove some ones.
+            -->
+            <select class="FixWidth" id="PaperList" onchange="drawCaptureBox(this)">
+                <option value="297.0,210.0">A4 (210 MM x 297 MM)</option>
+                <option value="420.0,297.0">A3 (297 MM) x 420 MM</option>
+                <option value="279.4,215.9">Letter (8.50 x 11.00 Inches)</option>
+                <option value="355.6,215.9">Legal (8.50 x 14.00 Inches)</option>
+            </select>
+        </div>
+        <div class="HPlaceholder5px"></div>
+        <div class="HPlaceholder5px"></div>
+        <div class="Label">__#QUICKPLOT_SCALING#__</div>
+        <div class="Ctrl">
+            <!--
+                The pre-defined scales. The value for each "option" item is the scale denominator.
+                We can change the html code to extend the pre-defined scales
+            -->
+            <select class="FixWidth" id="ScalingList" onchange="drawCaptureBox(this)">
+                <option value="500">1 : 500</option>
+                <option value="1000">1 : 1000</option>
+                <option value="2500">1 : 2500</option>
+                <option value="5000">1 : 5000</option>
+            </select>
+        </div>
+        <div class="Label">__#QUICKPLOT_DPI#__</div>
+        <div class="Ctrl">
+            <!--
+                The pre-defined print DPI. 
+                We can change the html code to extend the pre-defined values
+            -->
+            <select class="FixWidth" id="DPIList">
+                <option value="96">96</option>
+                <option value="150" selected>150</option>
+                <option value="300">300</option>
+                <option value="600">600</option>
+            </select>
+        </div>
+        <input type="hidden" id="ScaleDenominator" name="scale_denominator" />
+        <div class="ButtonContainer FixWidth">
+            <input type="button" class="Button" id="GeneratePlotButton" value="__#QUICKPLOT_GENERATE#__" onclick="generatePlot()" />
+        </div>
+    </form>
+</body>
+</html>


Property changes on: trunk/MgDev/Web/src/viewerfiles/quickplotpanel.templ
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/quickplotpreview.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/quickplotpreview.js	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/quickplotpreview.js	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,20 +1,20 @@
-function innerLoaded()
-{
-    parent.quickPlotPreviewDialog.previewInnerLoaded();
-}
-
-function printIt()
-{
-    parent.quickPlotPreviewDialog.print();
-}
-
-function cancelPreview()
-{
-    parent.quickPlotPreviewDialog.cancel();
-}
-
-function doPrint()
-{
-    window.focus();
-    window.print();
-}
+function innerLoaded()
+{
+    parent.quickPlotPreviewDialog.previewInnerLoaded();
+}
+
+function printIt()
+{
+    parent.quickPlotPreviewDialog.print();
+}
+
+function cancelPreview()
+{
+    parent.quickPlotPreviewDialog.cancel();
+}
+
+function doPrint()
+{
+    window.focus();
+    window.print();
+}


Property changes on: trunk/MgDev/Web/src/viewerfiles/quickplotpreview.js
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/Web/src/viewerfiles/quickplotpreviewinner.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/quickplotpreviewinner.templ	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/Web/src/viewerfiles/quickplotpreviewinner.templ	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,92 +1,92 @@
-<html>
-<head>
-<title>__#QUICKPLOT_HEADER#__</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-body, table, td, div, input
-{
-    font: 9pt/1.5em __#@font#__;
-}
-
-td.LegalNotice
-{
-    font-size: 8pt;
-}
-
-input.Button
-{
-    width:75px;
-    height:23px;
-    margin-left:7px;
-}
-</style>
-
-<style type="text/css" media="screen">
-#PrintPicture { display:block}
-
-.PrintOnly
-{
-    display:none;
-}
-</style>
-
-<style type="text/css" media="print">
-#PrintPicture { }
-input.Button
-{
-    visibility:hidden;
-}
-
-.ScreenOnly
-{
-    display: none;
-}
-</style>
-
-<script language="javascript" type="text/javascript" src="%squickplotpreview.js"></script>
-</head>
-<body style="margin:0px" onLoad="innerLoaded()">
-<table cellspacing="10" cellpadding="0" style="width:100%%; border-width:0px" id="PreviewContainer">
-  <tr>
-    <td><table style="width:100%%" border="0" cellspacing="0" cellpadding="0" id="AnnotationContainer">
-        <tr>
-          <td style="width:100%%">{field:title}</td>
-          <!-- 
-            The date format mask 
-            For PHP, it follows the php date() function's instruction and please
-            see also here for more reference: http://cn.php.net/manual/en/function.date.php
-            
-            For .Net, it follows the DateTime.Format(String) rules and please
-            reference to MSDN development network
-            
-            For Java, it follows String.format() rules. Reference here for more information:
-            http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html
-           -->
-          <td style="white-space:nowrap">{date:[php=m/d/Y][net=d][java=%%1$tm/%%1$te/%%1$tY]}</td>
-        </tr>
-        <tr>
-          <td>{field:sub_title}</td>
-          <td style="white-space:nowrap">__#QUICKPLOT_SCALE_LABEL#__: {scale}</td>
-        </tr>
-      </table></td>
-  </tr>
-  <tr>
-    <td id="PictureContainer" style="border: solid 1px black; text-align:center; vertical-align:center;">
-        <img style="width:1px; background:url(../stdicons/progress_indicator.gif) no-repeat center center" id="ProgressIndicator" src="../stdicons/pixel.gif" />
-        <img style="width:1px" id="PrintPicture" src="../stdicons/pixel.gif" />
-        <span id="PictureLoadingErrorMessage" style="display:none; text-align:center">__#QUICKPLOT_PREVIEW_ERROR#__</span>
-    </td>
-  </tr>
-  <tr>
-    <td><table width="100%%" border="0" cellspacing="0" cellpadding="0">
-        <tr>
-          <!-- Legal notice. Just replace it with the necessary statement -->
-          <td style="width:100%%" class="LegalNotice">The materials available at this web site are for informational purposes only and do not constitute a legal document.</td>
-          <td style="white-space:nowrap"><input type="button" id="PrintButton" class="Button" onClick="printIt()" value="__#QUICKPLOT_PRINT#__" /><input type="button" id="CancelButton" class="Button" onClick="cancelPreview()" value="__#QUICKPLOT_CANCEL#__" />
-          </td>
-        </tr>
-      </table></td>
-  </tr>
-</table>
-</body>
-</html>
+<html>
+<head>
+<title>__#QUICKPLOT_HEADER#__</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+body, table, td, div, input
+{
+    font: 9pt/1.5em __#@font#__;
+}
+
+td.LegalNotice
+{
+    font-size: 8pt;
+}
+
+input.Button
+{
+    width:75px;
+    height:23px;
+    margin-left:7px;
+}
+</style>
+
+<style type="text/css" media="screen">
+#PrintPicture { display:block}
+
+.PrintOnly
+{
+    display:none;
+}
+</style>
+
+<style type="text/css" media="print">
+#PrintPicture { }
+input.Button
+{
+    visibility:hidden;
+}
+
+.ScreenOnly
+{
+    display: none;
+}
+</style>
+
+<script language="javascript" type="text/javascript" src="%squickplotpreview.js"></script>
+</head>
+<body style="margin:0px" onLoad="innerLoaded()">
+<table cellspacing="10" cellpadding="0" style="width:100%%; border-width:0px" id="PreviewContainer">
+  <tr>
+    <td><table style="width:100%%" border="0" cellspacing="0" cellpadding="0" id="AnnotationContainer">
+        <tr>
+          <td style="width:100%%">{field:title}</td>
+          <!-- 
+            The date format mask 
+            For PHP, it follows the php date() function's instruction and please
+            see also here for more reference: http://cn.php.net/manual/en/function.date.php
+            
+            For .Net, it follows the DateTime.Format(String) rules and please
+            reference to MSDN development network
+            
+            For Java, it follows String.format() rules. Reference here for more information:
+            http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html
+           -->
+          <td style="white-space:nowrap">{date:[php=m/d/Y][net=d][java=%%1$tm/%%1$te/%%1$tY]}</td>
+        </tr>
+        <tr>
+          <td>{field:sub_title}</td>
+          <td style="white-space:nowrap">__#QUICKPLOT_SCALE_LABEL#__: {scale}</td>
+        </tr>
+      </table></td>
+  </tr>
+  <tr>
+    <td id="PictureContainer" style="border: solid 1px black; text-align:center; vertical-align:center;">
+        <img style="width:1px; background:url(../stdicons/progress_indicator.gif) no-repeat center center" id="ProgressIndicator" src="../stdicons/pixel.gif" />
+        <img style="width:1px" id="PrintPicture" src="../stdicons/pixel.gif" />
+        <span id="PictureLoadingErrorMessage" style="display:none; text-align:center">__#QUICKPLOT_PREVIEW_ERROR#__</span>
+    </td>
+  </tr>
+  <tr>
+    <td><table width="100%%" border="0" cellspacing="0" cellpadding="0">
+        <tr>
+          <!-- Legal notice. Just replace it with the necessary statement -->
+          <td style="width:100%%" class="LegalNotice">The materials available at this web site are for informational purposes only and do not constitute a legal document.</td>
+          <td style="white-space:nowrap"><input type="button" id="PrintButton" class="Button" onClick="printIt()" value="__#QUICKPLOT_PRINT#__" /><input type="button" id="CancelButton" class="Button" onClick="cancelPreview()" value="__#QUICKPLOT_CANCEL#__" />
+          </td>
+        </tr>
+      </table></td>
+  </tr>
+</table>
+</body>
+</html>


Property changes on: trunk/MgDev/Web/src/viewerfiles/quickplotpreviewinner.templ
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/build64.bat
===================================================================
--- trunk/MgDev/build64.bat	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/build64.bat	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,525 +1,525 @@
- at echo off
-rem MapGuide build script for windows
-rem
-rem Author: Jackie Ng (jumpinjackie at gmail.com)
-rem
-rem This script will build all the MapGuide components, if the output path is specified
-rem it will also copy all binaries to the output path. Otherwise it will use the default
-rem value of MG_OUTPUT defined in this file
-rem 
-rem Before you start, please make sure you have done the following:
-rem
-rem 1) Build the FDO source and place the files in \Oem\FDO (or alternatively download and extract the latest FDO 3.4 binary sdk)
-rem    with the following structure:
-rem     - Bin\%CONFIG% (where %CONFIG% is debug or release)
-rem		- Inc
-rem		- Lib
-rem    
-rem 2) Download and install the following:
-rem     - Java SDK (http://java.sun.com)
-rem     - ant (http://ant.apache.org)
-rem     - doxygen (http://www.doxygen.org)
-rem
-rem 3) Change the values of JAVA_HOME, ANT_HOME and DOXYGEN to match the paths of your Java SDK, Apache Ant and Doxygen installations respectively
-rem     
-rem For a "cleaner" build experience, run this script from an exported copy of the
-rem MapGuide source code (ie. without subversion folders). 
-rem
-rem Usage:
-rem
-rem build.bat [-h]
-rem           [-v]
-rem           [-c=BuildType]
-rem           [-w=Component]
-rem           [-a=Action]
-rem           [-o=OutputDirectory]
-rem
-rem BuildType: Release(default), Debug, Release64, Debug64
-rem Component: all(default), oem, server, web, doc, common
-rem Action: build(default), install, clean
-rem OutputDirectory: The directory where files will be copied to if -a=install, if -o=default or -o=def then 
-rem files will be copied to %MG_DEFAULT_INSTALLDIR%
-rem
-rem Please note that -a=install does nothing if -w=oem
-
-rem ==================================================
-rem Top-level vars
-rem ==================================================
-SET OLDPATH=%PATH%
-SET TYPEACTION=build
-SET TYPEBUILD=Release64
-SET CONFIGURATION=Release
-SET PLATFORM=x64
-SET TYPECOMPONENT=all
-
-rem ==================================================
-rem MapGuide vars
-rem ==================================================
-SET MG_DEV=%CD%
-SET MG_OEM=%MG_DEV%\Oem
-SET MG_COMMON=%MG_DEV%\Common
-SET MG_SERVER=%MG_DEV%\Server
-SET MG_WEB=%MG_DEV%\Web
-SET MG_WEB_SRC=%MG_WEB%\src
-SET MG_WEB_BIN=%MG_WEB%\bin
-SET MG_UNIT_TEST=%MG_DEV%\UnitTest
-SET MG_FUSION=%MG_OEM%\Fusion
-SET MG_DOC=%MG_DEV%\Doc
-SET MG_DOC_OUTPUT=%MG_DOC%\MgOpensource_WebAPIReference
-SET MG_DOC_DEVGUIDE_SAMPLES=%MG_DOC%\samples\phpsamples
-SET MG_BUILD_TEMP=%MG_DEV%\BuildTemp
-
-SET MG_OUTPUT=%MG_DEV%\%TYPEBUILD%
-SET MG_OUTPUT_SERVER=%MG_OUTPUT%\Server
-SET MG_OUTPUT_WEB=%MG_OUTPUT%\Web
-SET MG_OUTPUT_CSMAP=%MG_OUTPUT%\CS-Map
-SET MG_BUILD_COMPONENT=
-
-SET MG_DEFAULT_INSTALLDIR=C:\Program Files\MapGuideOpenSource2.0
-SET MG_ERROR=0
-
-rem ==================================================
-rem Extra tool paths
-rem 
-rem Your paths may be different, adjust accordingly or
-rem set the appropriate environment variables before
-rem running
-rem ==================================================
-
-IF "%JAVA_HOME%" == "" SET JAVA_HOME=C:\Program Files\Java\jdk1.5.0_18
-IF "%DOXYGEN%" == "" SET DOXYGEN=%MG_DEV%\BuildTools\doxygen
-IF "%GNUWIN32%" == "" SET GNUWIN32=C:\Program Files\GnuWin32\bin
-IF "%SEVENZ%" == "" SET SEVENZ=%MG_DEV%\BuildTools\WebTools\7-Zip
-IF "%ANT_HOME%" == "" SET ANT_HOME=%MG_DEV%\BuildTools\apache-ant-1.7.1
-
-SET PATH=%PATH%;%DOXYGEN%;%GNUWIN32%;%SEVENZ%;%ANT_HOME%\bin
-
-rem ==================================================
-rem MSBuild Settings
-rem ==================================================
-
-rem If the NUMBER_OF_PROCESSORS environment variable is wrong for any reason. Change this value.
-rem Multi core builds seem to be broken
-rem SET CPU_CORES=%NUMBER_OF_PROCESSORS%
-SET CPU_CORES=1
-
-rem Uncomment the line below to enable msbuild logging
-rem SET MSBUILD_LOG=/l:FileLogger,Microsoft.Build.Engine;logfile=Build.log;verbosity=diagnostic
-SET MSBUILD_VERBOSITY=/v:q
-
-rem ==================================================
-rem Command aliases
-rem ==================================================
-rem SET XCOPY=xcopy /E /Y /I /F
-SET XCOPY=xcopy /E /Y /I /Q
-SET XCOPY_SINGLE=xcopy /Y /I /Q
-SET MSBUILD=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %MSBUILD_VERBOSITY% %MSBUILD_LOG%
-SET MSBUILD_CLEAN=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% /t:Clean %MSBUILD_VERBOSITY%
-SET ANT=ant
-
-rem ==================================================
-rem Parameter Handling
-rem ==================================================
-
-:study_params
-if (%1)==() goto pre_build_check
-
-if "%1"=="-help"    goto help_show
-if "%1"=="-h"       goto help_show
-
-if "%1"=="-c"       goto get_conf
-if "%1"=="-config"  goto get_conf
-
-if "%1"=="-a"       goto get_action
-if "%1"=="-action"  goto get_action
-
-if "%1"=="-w"       goto get_component
-if "%1"=="-with"    goto get_component
-
-if "%1"=="-v"       goto get_verbose
-if "%1"=="-o"       goto get_output
-
-goto custom_error
-
-:next_param
-shift
-shift
-goto study_params
-
-:get_verbose
-SET MSBUILD_VERBOSITY=/v:d
-SET MSBUILD=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %MSBUILD_VERBOSITY% %MSBUILD_LOG%
-SET MSBUILD_CLEAN=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% /t:Clean %MSBUILD_VERBOSITY%
-goto next_param
-
-:get_output
-SET MG_OUTPUT=%2
-if "%2" == "default" SET MG_OUTPUT=%MG_DEFAULT_INSTALLDIR%
-if "%2" == "def" SET MG_OUTPUT=%MG_DEFAULT_INSTALLDIR%
-SET MG_OUTPUT_SERVER=%MG_OUTPUT%\Server
-SET MG_OUTPUT_WEB=%MG_OUTPUT%\Web
-goto next_param
-
-:get_conf
-SET TYPEBUILD=%2
-SET CONFIGURATION=invalid
-SET PLATFORM=invalid
-
-IF "%2"=="Release" (
-SET CONFIGURATION=Release
-SET PLATFORM=Win32
-)
-
-IF "%2"=="Release64" (
-SET CONFIGURATION=Release
-SET PLATFORM=x64
-)
-
-if "%2"=="Debug" (
-SET CONFIGURATION=Debug
-SET PLATFORM=Win32
-)
-
-if "%2"=="Debug64" (
-SET CONFIGURATION=Debug
-SET PLATFORM=x64
-)
-
-SET MSBUILD=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %MSBUILD_VERBOSITY% %MSBUILD_LOG%
-SET MSBUILD_CLEAN=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% /t:Clean %MSBUILD_VERBOSITY%
-SET MG_OUTPUT=%MG_DEV%\%TYPEBUILD%
-SET MG_OUTPUT_SERVER=%MG_OUTPUT%\Server
-SET MG_OUTPUT_WEB=%MG_OUTPUT%\Web
-
-if NOT %CONFIGURATION%=="invalid" goto next_param
-SET ERRORMSG=Unrecognised configuration: %2
-goto custom_error
-
-:get_action
-SET TYPEACTION=%2
-if "%2"=="build" goto next_param
-if "%2"=="clean" goto next_param
-if "%2"=="install" goto next_param
-SET ERRORMSG=Unrecognised action: %2
-goto custom_error
-
-:get_component
-SET TYPECOMPONENT=%2
-if "%2"=="oem" goto next_param
-if "%2"=="common" goto next_param
-if "%2"=="server" goto next_param
-if "%2"=="web" goto next_param
-if "%2"=="doc" goto next_param
-if "%2"=="all" goto next_param
-if "%2"=="allnodoc" goto next_param
-SET ERRORMSG=Unrecognised component: %2
-goto custom_error
-
-rem ==================================================
-rem Check Environment Vars
-rem ==================================================
-
-:pre_build_check
-:check_java
-if exist "%JAVA_HOME%" goto check_ant
-SET ERRORMSG=Unable to find java sdk installation. Please install the java sdk and set the JAVA_HOME environment variable
-goto custom_error_no_help
-:check_ant
-if exist "%ANT_HOME%" goto check_fdo
-SET ERRORMSG=Unable to find Apache ant installation. Please install apache ant and set the ANT_HOME environment variable
-goto custom_error_no_help
-:check_fdo
-:check_fdo_bin
-if exist "%MG_OEM%\FDO\Bin\%TYPEBUILD%" goto check_fdo_inc
-SET ERRORMSG=Unable to find FDO binaries. Copy the FDO binaries %MG_OEM%\FDO\Bin\%TYPEBUILD%
-goto custom_error_no_help
-:check_fdo_inc
-if exist "%MG_OEM%\FDO\Bin\%TYPEBUILD%" goto check_fdo_lib
-SET ERRORMSG=Unable to find FDO headers. Copy the FDO headers into %MG_OEM%\Inc
-goto custom_error_no_help
-:check_fdo_lib
-if exist "%MG_OEM%\FDO\Bin\%TYPEBUILD%" goto start_build
-SET ERRORMSG=Unable to find FDO lib files. Copy the FDO lib files into %MG_OEM%\Lib
-goto custom_error_no_help
-
-:start_build
-echo ===================================================
-echo Configuration is [%TYPEBUILD%, "%CONFIGURATION%|%PLATFORM%"]
-echo Action is [%TYPEACTION%] on [%TYPECOMPONENT%]
-echo Deployment Directory for Server: %MG_OUTPUT_SERVER%
-echo Deployment Directory for Web: %MG_OUTPUT_WEB%
-echo CPU cores: %CPU_CORES%
-echo ===================================================
-
-if "%TYPEACTION%"=="build" goto build
-if "%TYPEACTION%"=="clean" goto clean
-if "%TYPEACTION%"=="install" goto install
-
-:clean
-if "%TYPECOMPONENT%"=="oem" goto clean_oem
-if "%TYPECOMPONENT%"=="common" goto clean_common
-if "%TYPECOMPONENT%"=="server" goto clean_server
-if "%TYPECOMPONENT%"=="web" goto clean_web
-if "%TYPECOMPONENT%"=="doc" goto clean_doc
-
-:clean_oem
-echo [clean]: Clean Oem
-%MSBUILD_CLEAN% %MG_OEM%\Oem.sln
-echo [clean]: Clean Oem - CS-Map
-%MSBUILD_CLEAN% %MG_OEM%\CSMap\OpenSource.sln
-if not "%TYPECOMPONENT%"=="all" goto quit
-
-:clean_common
-echo [clean]: Clean Common
-%MSBUILD_CLEAN% %MG_COMMON%\Common.sln
-if not "%TYPECOMPONENT%"=="all" goto quit
-
-:clean_server
-echo [clean]: Clean Server
-%MSBUILD_CLEAN% %MG_SERVER%\Server.sln
-if not "%TYPECOMPONENT%"=="all" goto quit
-
-:clean_web
-echo [clean]: Clean Web
-%MSBUILD_CLEAN% %MG_WEB_SRC%\WebTier.sln
-echo [clean]: Clean fusion
-%ANT% clean -f %MG_OEM%\fusion\build.xml
-if not "%TYPECOMPONENT%"=="all" goto quit
-
-:clean_doc
-echo [clean]: Clean Doc
-if exist %MG_DOC_OUTPUT% rd /S /Q %MG_DOC_OUTPUT%
-goto quit
-
-
-rem =======================================================
-rem Build Targets.... the all targets just carry on
-rem =======================================================
-
-:build
-if "%TYPECOMPONENT%"=="oem" goto build_oem
-if "%TYPECOMPONENT%"=="common" goto build_common
-if "%TYPECOMPONENT%"=="server" goto build_server
-if "%TYPECOMPONENT%"=="web" goto build_web
-if "%TYPECOMPONENT%"=="doc" goto build_doc
-if "%TYPECOMPONENT%"=="all" goto build_oem
-if "%TYPECOMPONENT%"=="allnodoc" goto build_oem
-SET ERRORMSG=Unrecognised component: %TYPECOMPONENT%
-goto custom_error
-
-
-
-:build_oem
-echo [build]: Building Oem
-%MSBUILD% %MG_OEM%\Oem.sln
-if "%errorlevel%"=="1" goto error
-rem CsMap is not in Oem.sln, so we need to build that separately
-echo [build]: Building Oem - CSMap
-%MSBUILD% %MG_OEM%\CsMap\OpenSource.sln
-if "%errorlevel%"=="1" goto error
-if "%TYPECOMPONENT%"=="oem" 	goto quit
-if "%TYPECOMPONENT%"=="common" 	goto quit
-if "%TYPECOMPONENT%"=="server" 	goto quit
-if "%TYPECOMPONENT%"=="web" 	goto quit
-if "%TYPECOMPONENT%"=="doc" 	goto quit
-
-:build_common
-echo [build]: Building Common
-%MSBUILD% %MG_COMMON%\Common.sln
-if "%errorlevel%"=="1" goto error
-if "%TYPECOMPONENT%"=="oem" 	goto quit
-if "%TYPECOMPONENT%"=="common" 	goto quit
-if "%TYPECOMPONENT%"=="server" 	goto quit
-if "%TYPECOMPONENT%"=="web" 	goto quit
-if "%TYPECOMPONENT%"=="doc" 	goto quit
-
-:build_server
-echo [build]: Building Server
-%MSBUILD% %MG_SERVER%\Server.sln
-if "%errorlevel%"=="1" goto error
-if "%TYPECOMPONENT%"=="oem" 	goto quit
-if "%TYPECOMPONENT%"=="common" 	goto quit
-if "%TYPECOMPONENT%"=="server" 	goto quit
-if "%TYPECOMPONENT%"=="web" 	goto quit
-if "%TYPECOMPONENT%"=="doc" 	goto quit
-
-:build_web
-echo [build]: Building Web Tier
-%MSBUILD% %MG_WEB_SRC%\WebTier.sln
-if "%errorlevel%"=="1" goto error
-if "%TYPECOMPONENT%"=="oem" 	 goto quit
-if "%TYPECOMPONENT%"=="common" 	 goto quit
-if "%TYPECOMPONENT%"=="server" 	 goto quit
-if "%TYPECOMPONENT%"=="web" 	 goto quit
-if "%TYPECOMPONENT%"=="doc" 	 goto quit
-if "%TYPECOMPONENT%"=="allnodoc" goto quit
-
-rem this is left out with component allnodoc
-
-:build_doc
-echo [build]: Building Doc
-pushd %MG_DOC%
-call MgOpenSource_run_doxygen.bat
-popd
-goto quit
-
-rem =======================================================
-rem INSTALL Targets.... the all targets just carry on
-rem =======================================================
-
-
-:install
-if "%TYPECOMPONENT%"=="all" goto install_server
-if "%TYPECOMPONENT%"=="allnodoc" goto install_server
-if "%TYPECOMPONENT%"=="server" goto install_server
-if "%TYPECOMPONENT%"=="web" goto install_web
-if "%TYPECOMPONENT%"=="doc" goto install_doc
-SET ERRORMSG=Unrecognised component: %TYPECOMPONENT%
-goto custom_error
-
-:install_server
-echo [install]: Server
-echo [install]: Server - Binaries
-%XCOPY_SINGLE% "%MG_SERVER%\bin\%TYPEBUILD%" "%MG_OUTPUT_SERVER%\bin" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - FDO
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\FDO" "%MG_OUTPUT_SERVER%\FDO" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - Logs
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Logs" "%MG_OUTPUT_SERVER%\Logs" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - Packages
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Packages" "%MG_OUTPUT_SERVER%\Packages" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - Repositories
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Repositories" "%MG_OUTPUT_SERVER%\Repositories" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - Resources
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Resources" "%MG_OUTPUT_SERVER%\Resources" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - Schema
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Schema" "%MG_OUTPUT_SERVER%\Schema" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - Temp
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Temp" "%MG_OUTPUT_SERVER%\Temp" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - WFS
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\wfs" "%MG_OUTPUT_SERVER%\wfs" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - WMS
-%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\wms" "%MG_OUTPUT_SERVER%\wms" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Server - DBXML
-copy /Y "%MG_OEM%\dbxml-2.3.10\db-4.5.20\build_windows\%TYPEBUILD%\*.exe" "%MG_OUTPUT_SERVER%\bin"
-copy /Y "%MG_OEM%\dbxml-2.3.10\bin64\*.exe" "%MG_OUTPUT_SERVER%\bin"
-echo [install]: Server - RepositoryAdmin
-%XCOPY% "%MG_SERVER%\RepositoryAdmin" "%MG_OUTPUT_SERVER%\RepositoryAdmin" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: CsMap Dictionaries
-%XCOPY% "%MG_OEM%\CsMap\Dictionaries" "%MG_OUTPUT_CSMAP%\Dictionaries" /EXCLUDE:svn_excludes.txt+csmap_excludes.txt+%CONFIGURATION%_excludes.txt
-if "%TYPECOMPONENT%"=="server" goto quit
-if "%TYPECOMPONENT%"=="web" goto quit
-
-:install_web
-echo [install]: web Tier
-
-echo [install]: Web Tier - localized
-%XCOPY% "%MG_WEB_SRC%\localized" "%MG_OUTPUT_WEB%\www\localized" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - mapadmin
-%XCOPY% "%MG_WEB_SRC%\mapadmin" "%MG_OUTPUT_WEB%\www\mapadmin" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - mapagent
-%XCOPY% "%MG_WEB_SRC%\mapagent64" "%MG_OUTPUT_WEB%\www\mapagent" /EXCLUDE:svn_excludes.txt+mapagent_excludes.txt+%CONFIGURATION%_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - MapGuide API unmanaged binaries
-%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\www\mapagent" /EXCLUDE:php_excludes.txt+dotnetapi_excludes.txt+java_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - mapagent test forms
-%XCOPY% "%MG_UNIT_TEST%\WebTier\MapAgent\MapAgentForms" "%MG_OUTPUT_WEB%\www\mapagent" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - stdicons
-%XCOPY% "%MG_WEB_SRC%\stdicons" "%MG_OUTPUT_WEB%\www\stdicons" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - viewerfiles
-%XCOPY% "%MG_WEB_SRC%\viewerfiles" "%MG_OUTPUT_WEB%\www\viewerfiles" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - schemareport
-%XCOPY% "%MG_WEB_SRC%\schemareport" "%MG_OUTPUT_WEB%\www\schemareport" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - webconfig.ini
-copy /Y "%MG_WEB_SRC%\webconfig.ini" "%MG_OUTPUT_WEB%\www"
-echo [install]: Web Tier - mapviewerphp
-%XCOPY% "%MG_WEB_SRC%\mapviewerphp" "%MG_OUTPUT_WEB%\www\mapviewerphp" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - Tomcat - MapGuide API unmanaged binaries
-%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\Tomcat\bin"/EXCLUDE:java_excludes.txt+dotnetapi_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - php - MapGuide API unmanaged binaries
-%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\Php"/EXCLUDE:php_excludes.txt+dotnetapi_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - php ext - MapGuide API unmanaged binaries
-%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\Php\ext" /EXCLUDE:php_excludes.txt+dotnetapi_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - mapviewernet
-%XCOPY% "%MG_WEB_SRC%\mapviewernet" "%MG_OUTPUT_WEB%\www\mapviewernet" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - mapviewernet - MapGuide API unmanaged binaries
-%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\www\mapviewernet\bin" /EXCLUDE:dotnet_excludes.txt+%CONFIGURATION%_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - mapviewerjava
-%XCOPY% "%MG_WEB_SRC%\mapviewerjava" "%MG_OUTPUT_WEB%\www\mapviewerjava" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - mapviewerjava - WEB-INF
-%XCOPY% "%MG_WEB_SRC%\WEB-INF" "%MG_OUTPUT_WEB%\www\WEB-INF" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - fusion templates
-%XCOPY% "%MG_OEM%\fusionMG" "%MG_OUTPUT_WEB%\www\fusion" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Web Tier - Apache module
-if not exist "%MG_OUTPUT_WEB%\Apache2\modules" mkdir "%MG_OUTPUT_WEB%\Apache2\modules"
-%XCOPY% /F "%MG_WEB_SRC%\mapagent64\mod_mgmapagent.so" "%MG_OUTPUT_WEB%\Apache2\modules"
-echo [install]: Web Tier - fusion
-call %ANT% deploy -Ddeploy.home="%MG_OUTPUT_WEB%\www\fusion" -f "%MG_OEM%\fusion\build.xml"
-if "%TYPECOMPONENT%"=="server" goto quit
-if "%TYPECOMPONENT%"=="web" goto quit
-
-:install_doc
-echo [install]: Documentation
-%XCOPY% "%MG_DOC_OUTPUT%" "%MG_OUTPUT_WEB%\www\help\webapi" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Developer's Guide Sample Code
-%XCOPY% "%MG_DOC_DEVGUIDE_SAMPLES%" "%MG_OUTPUT_WEB%\www\devguide" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-echo [install]: Viewer API documentation
-%XCOPY% "%MG_DOC%\viewerapi" "%MG_OUTPUT_WEB%\www\help\viewerapi" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
-
-goto quit
-
-:error
-echo [ERROR]: There was an error building the component
-exit /B 1
-
-:custom_error_no_help
-echo [ERROR]: %ERRORMSG%
-SET ERRORMSG=
-exit /B 1
-
-:custom_error
-echo [ERROR]: %ERRORMSG%
-SET ERRORMSG=
-echo Please use the format:
-:help_show
-echo ************************************************************************
-echo build.bat [-h]
-echo           [-v]
-echo           [-c=BuildType]
-echo           [-w=Component]
-echo           [-a=Action]
-echo           [-o=OutputDirectory]
-echo Help:                  -h[elp]
-echo Verbose:               -v
-echo BuildType:             -c[onfig]=Release(default), Debug, Release64, Debug64
-echo Action:                -a[ction]=build(default),
-echo                                  install,
-echo                                  clean,
-echo Component:             -w[ith]=all(default),
-echo                                oem,
-echo                                common,
-echo                                server,
-echo                                web,
-echo                                doc
-echo ************************************************************************
-:quit
-SET TYPEACTION=
-SET TYPEBUILD=
-SET MG_OUTPUT=
-SET MG_BUILD_COMPONENT=
-SET MG_DEV=
-SET MG_INSTALLER=
-SET MG_OEM=
-SET MG_SERVER=
-SET MG_WEB=
-SET MG_WEB_SRC=
-SET MG_WEB_BIN=
-SET MG_UNIT_TEST=
-SET MG_FUSION=
-SET MG_DOC=
-SET MG_DOC_OUTPUT=
-SET MG_ERROR=
-
-SET MSBUILD_LOG=
-SET MSBUILD_VERBOSITY=
-SET XCOPY=
-SET MSBUILD=
-SET PATH=%OLDPATH%
+ at echo off
+rem MapGuide build script for windows
+rem
+rem Author: Jackie Ng (jumpinjackie at gmail.com)
+rem
+rem This script will build all the MapGuide components, if the output path is specified
+rem it will also copy all binaries to the output path. Otherwise it will use the default
+rem value of MG_OUTPUT defined in this file
+rem 
+rem Before you start, please make sure you have done the following:
+rem
+rem 1) Build the FDO source and place the files in \Oem\FDO (or alternatively download and extract the latest FDO 3.4 binary sdk)
+rem    with the following structure:
+rem     - Bin\%CONFIG% (where %CONFIG% is debug or release)
+rem		- Inc
+rem		- Lib
+rem    
+rem 2) Download and install the following:
+rem     - Java SDK (http://java.sun.com)
+rem     - ant (http://ant.apache.org)
+rem     - doxygen (http://www.doxygen.org)
+rem
+rem 3) Change the values of JAVA_HOME, ANT_HOME and DOXYGEN to match the paths of your Java SDK, Apache Ant and Doxygen installations respectively
+rem     
+rem For a "cleaner" build experience, run this script from an exported copy of the
+rem MapGuide source code (ie. without subversion folders). 
+rem
+rem Usage:
+rem
+rem build.bat [-h]
+rem           [-v]
+rem           [-c=BuildType]
+rem           [-w=Component]
+rem           [-a=Action]
+rem           [-o=OutputDirectory]
+rem
+rem BuildType: Release(default), Debug, Release64, Debug64
+rem Component: all(default), oem, server, web, doc, common
+rem Action: build(default), install, clean
+rem OutputDirectory: The directory where files will be copied to if -a=install, if -o=default or -o=def then 
+rem files will be copied to %MG_DEFAULT_INSTALLDIR%
+rem
+rem Please note that -a=install does nothing if -w=oem
+
+rem ==================================================
+rem Top-level vars
+rem ==================================================
+SET OLDPATH=%PATH%
+SET TYPEACTION=build
+SET TYPEBUILD=Release64
+SET CONFIGURATION=Release
+SET PLATFORM=x64
+SET TYPECOMPONENT=all
+
+rem ==================================================
+rem MapGuide vars
+rem ==================================================
+SET MG_DEV=%CD%
+SET MG_OEM=%MG_DEV%\Oem
+SET MG_COMMON=%MG_DEV%\Common
+SET MG_SERVER=%MG_DEV%\Server
+SET MG_WEB=%MG_DEV%\Web
+SET MG_WEB_SRC=%MG_WEB%\src
+SET MG_WEB_BIN=%MG_WEB%\bin
+SET MG_UNIT_TEST=%MG_DEV%\UnitTest
+SET MG_FUSION=%MG_OEM%\Fusion
+SET MG_DOC=%MG_DEV%\Doc
+SET MG_DOC_OUTPUT=%MG_DOC%\MgOpensource_WebAPIReference
+SET MG_DOC_DEVGUIDE_SAMPLES=%MG_DOC%\samples\phpsamples
+SET MG_BUILD_TEMP=%MG_DEV%\BuildTemp
+
+SET MG_OUTPUT=%MG_DEV%\%TYPEBUILD%
+SET MG_OUTPUT_SERVER=%MG_OUTPUT%\Server
+SET MG_OUTPUT_WEB=%MG_OUTPUT%\Web
+SET MG_OUTPUT_CSMAP=%MG_OUTPUT%\CS-Map
+SET MG_BUILD_COMPONENT=
+
+SET MG_DEFAULT_INSTALLDIR=C:\Program Files\MapGuideOpenSource2.0
+SET MG_ERROR=0
+
+rem ==================================================
+rem Extra tool paths
+rem 
+rem Your paths may be different, adjust accordingly or
+rem set the appropriate environment variables before
+rem running
+rem ==================================================
+
+IF "%JAVA_HOME%" == "" SET JAVA_HOME=C:\Program Files\Java\jdk1.5.0_18
+IF "%DOXYGEN%" == "" SET DOXYGEN=%MG_DEV%\BuildTools\doxygen
+IF "%GNUWIN32%" == "" SET GNUWIN32=C:\Program Files\GnuWin32\bin
+IF "%SEVENZ%" == "" SET SEVENZ=%MG_DEV%\BuildTools\WebTools\7-Zip
+IF "%ANT_HOME%" == "" SET ANT_HOME=%MG_DEV%\BuildTools\apache-ant-1.7.1
+
+SET PATH=%PATH%;%DOXYGEN%;%GNUWIN32%;%SEVENZ%;%ANT_HOME%\bin
+
+rem ==================================================
+rem MSBuild Settings
+rem ==================================================
+
+rem If the NUMBER_OF_PROCESSORS environment variable is wrong for any reason. Change this value.
+rem Multi core builds seem to be broken
+rem SET CPU_CORES=%NUMBER_OF_PROCESSORS%
+SET CPU_CORES=1
+
+rem Uncomment the line below to enable msbuild logging
+rem SET MSBUILD_LOG=/l:FileLogger,Microsoft.Build.Engine;logfile=Build.log;verbosity=diagnostic
+SET MSBUILD_VERBOSITY=/v:q
+
+rem ==================================================
+rem Command aliases
+rem ==================================================
+rem SET XCOPY=xcopy /E /Y /I /F
+SET XCOPY=xcopy /E /Y /I /Q
+SET XCOPY_SINGLE=xcopy /Y /I /Q
+SET MSBUILD=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %MSBUILD_VERBOSITY% %MSBUILD_LOG%
+SET MSBUILD_CLEAN=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% /t:Clean %MSBUILD_VERBOSITY%
+SET ANT=ant
+
+rem ==================================================
+rem Parameter Handling
+rem ==================================================
+
+:study_params
+if (%1)==() goto pre_build_check
+
+if "%1"=="-help"    goto help_show
+if "%1"=="-h"       goto help_show
+
+if "%1"=="-c"       goto get_conf
+if "%1"=="-config"  goto get_conf
+
+if "%1"=="-a"       goto get_action
+if "%1"=="-action"  goto get_action
+
+if "%1"=="-w"       goto get_component
+if "%1"=="-with"    goto get_component
+
+if "%1"=="-v"       goto get_verbose
+if "%1"=="-o"       goto get_output
+
+goto custom_error
+
+:next_param
+shift
+shift
+goto study_params
+
+:get_verbose
+SET MSBUILD_VERBOSITY=/v:d
+SET MSBUILD=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %MSBUILD_VERBOSITY% %MSBUILD_LOG%
+SET MSBUILD_CLEAN=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% /t:Clean %MSBUILD_VERBOSITY%
+goto next_param
+
+:get_output
+SET MG_OUTPUT=%2
+if "%2" == "default" SET MG_OUTPUT=%MG_DEFAULT_INSTALLDIR%
+if "%2" == "def" SET MG_OUTPUT=%MG_DEFAULT_INSTALLDIR%
+SET MG_OUTPUT_SERVER=%MG_OUTPUT%\Server
+SET MG_OUTPUT_WEB=%MG_OUTPUT%\Web
+goto next_param
+
+:get_conf
+SET TYPEBUILD=%2
+SET CONFIGURATION=invalid
+SET PLATFORM=invalid
+
+IF "%2"=="Release" (
+SET CONFIGURATION=Release
+SET PLATFORM=Win32
+)
+
+IF "%2"=="Release64" (
+SET CONFIGURATION=Release
+SET PLATFORM=x64
+)
+
+if "%2"=="Debug" (
+SET CONFIGURATION=Debug
+SET PLATFORM=Win32
+)
+
+if "%2"=="Debug64" (
+SET CONFIGURATION=Debug
+SET PLATFORM=x64
+)
+
+SET MSBUILD=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %MSBUILD_VERBOSITY% %MSBUILD_LOG%
+SET MSBUILD_CLEAN=msbuild.exe /nologo /m:%CPU_CORES% /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% /t:Clean %MSBUILD_VERBOSITY%
+SET MG_OUTPUT=%MG_DEV%\%TYPEBUILD%
+SET MG_OUTPUT_SERVER=%MG_OUTPUT%\Server
+SET MG_OUTPUT_WEB=%MG_OUTPUT%\Web
+
+if NOT %CONFIGURATION%=="invalid" goto next_param
+SET ERRORMSG=Unrecognised configuration: %2
+goto custom_error
+
+:get_action
+SET TYPEACTION=%2
+if "%2"=="build" goto next_param
+if "%2"=="clean" goto next_param
+if "%2"=="install" goto next_param
+SET ERRORMSG=Unrecognised action: %2
+goto custom_error
+
+:get_component
+SET TYPECOMPONENT=%2
+if "%2"=="oem" goto next_param
+if "%2"=="common" goto next_param
+if "%2"=="server" goto next_param
+if "%2"=="web" goto next_param
+if "%2"=="doc" goto next_param
+if "%2"=="all" goto next_param
+if "%2"=="allnodoc" goto next_param
+SET ERRORMSG=Unrecognised component: %2
+goto custom_error
+
+rem ==================================================
+rem Check Environment Vars
+rem ==================================================
+
+:pre_build_check
+:check_java
+if exist "%JAVA_HOME%" goto check_ant
+SET ERRORMSG=Unable to find java sdk installation. Please install the java sdk and set the JAVA_HOME environment variable
+goto custom_error_no_help
+:check_ant
+if exist "%ANT_HOME%" goto check_fdo
+SET ERRORMSG=Unable to find Apache ant installation. Please install apache ant and set the ANT_HOME environment variable
+goto custom_error_no_help
+:check_fdo
+:check_fdo_bin
+if exist "%MG_OEM%\FDO\Bin\%TYPEBUILD%" goto check_fdo_inc
+SET ERRORMSG=Unable to find FDO binaries. Copy the FDO binaries %MG_OEM%\FDO\Bin\%TYPEBUILD%
+goto custom_error_no_help
+:check_fdo_inc
+if exist "%MG_OEM%\FDO\Bin\%TYPEBUILD%" goto check_fdo_lib
+SET ERRORMSG=Unable to find FDO headers. Copy the FDO headers into %MG_OEM%\Inc
+goto custom_error_no_help
+:check_fdo_lib
+if exist "%MG_OEM%\FDO\Bin\%TYPEBUILD%" goto start_build
+SET ERRORMSG=Unable to find FDO lib files. Copy the FDO lib files into %MG_OEM%\Lib
+goto custom_error_no_help
+
+:start_build
+echo ===================================================
+echo Configuration is [%TYPEBUILD%, "%CONFIGURATION%|%PLATFORM%"]
+echo Action is [%TYPEACTION%] on [%TYPECOMPONENT%]
+echo Deployment Directory for Server: %MG_OUTPUT_SERVER%
+echo Deployment Directory for Web: %MG_OUTPUT_WEB%
+echo CPU cores: %CPU_CORES%
+echo ===================================================
+
+if "%TYPEACTION%"=="build" goto build
+if "%TYPEACTION%"=="clean" goto clean
+if "%TYPEACTION%"=="install" goto install
+
+:clean
+if "%TYPECOMPONENT%"=="oem" goto clean_oem
+if "%TYPECOMPONENT%"=="common" goto clean_common
+if "%TYPECOMPONENT%"=="server" goto clean_server
+if "%TYPECOMPONENT%"=="web" goto clean_web
+if "%TYPECOMPONENT%"=="doc" goto clean_doc
+
+:clean_oem
+echo [clean]: Clean Oem
+%MSBUILD_CLEAN% %MG_OEM%\Oem.sln
+echo [clean]: Clean Oem - CS-Map
+%MSBUILD_CLEAN% %MG_OEM%\CSMap\OpenSource.sln
+if not "%TYPECOMPONENT%"=="all" goto quit
+
+:clean_common
+echo [clean]: Clean Common
+%MSBUILD_CLEAN% %MG_COMMON%\Common.sln
+if not "%TYPECOMPONENT%"=="all" goto quit
+
+:clean_server
+echo [clean]: Clean Server
+%MSBUILD_CLEAN% %MG_SERVER%\Server.sln
+if not "%TYPECOMPONENT%"=="all" goto quit
+
+:clean_web
+echo [clean]: Clean Web
+%MSBUILD_CLEAN% %MG_WEB_SRC%\WebTier.sln
+echo [clean]: Clean fusion
+%ANT% clean -f %MG_OEM%\fusion\build.xml
+if not "%TYPECOMPONENT%"=="all" goto quit
+
+:clean_doc
+echo [clean]: Clean Doc
+if exist %MG_DOC_OUTPUT% rd /S /Q %MG_DOC_OUTPUT%
+goto quit
+
+
+rem =======================================================
+rem Build Targets.... the all targets just carry on
+rem =======================================================
+
+:build
+if "%TYPECOMPONENT%"=="oem" goto build_oem
+if "%TYPECOMPONENT%"=="common" goto build_common
+if "%TYPECOMPONENT%"=="server" goto build_server
+if "%TYPECOMPONENT%"=="web" goto build_web
+if "%TYPECOMPONENT%"=="doc" goto build_doc
+if "%TYPECOMPONENT%"=="all" goto build_oem
+if "%TYPECOMPONENT%"=="allnodoc" goto build_oem
+SET ERRORMSG=Unrecognised component: %TYPECOMPONENT%
+goto custom_error
+
+
+
+:build_oem
+echo [build]: Building Oem
+%MSBUILD% %MG_OEM%\Oem.sln
+if "%errorlevel%"=="1" goto error
+rem CsMap is not in Oem.sln, so we need to build that separately
+echo [build]: Building Oem - CSMap
+%MSBUILD% %MG_OEM%\CsMap\OpenSource.sln
+if "%errorlevel%"=="1" goto error
+if "%TYPECOMPONENT%"=="oem" 	goto quit
+if "%TYPECOMPONENT%"=="common" 	goto quit
+if "%TYPECOMPONENT%"=="server" 	goto quit
+if "%TYPECOMPONENT%"=="web" 	goto quit
+if "%TYPECOMPONENT%"=="doc" 	goto quit
+
+:build_common
+echo [build]: Building Common
+%MSBUILD% %MG_COMMON%\Common.sln
+if "%errorlevel%"=="1" goto error
+if "%TYPECOMPONENT%"=="oem" 	goto quit
+if "%TYPECOMPONENT%"=="common" 	goto quit
+if "%TYPECOMPONENT%"=="server" 	goto quit
+if "%TYPECOMPONENT%"=="web" 	goto quit
+if "%TYPECOMPONENT%"=="doc" 	goto quit
+
+:build_server
+echo [build]: Building Server
+%MSBUILD% %MG_SERVER%\Server.sln
+if "%errorlevel%"=="1" goto error
+if "%TYPECOMPONENT%"=="oem" 	goto quit
+if "%TYPECOMPONENT%"=="common" 	goto quit
+if "%TYPECOMPONENT%"=="server" 	goto quit
+if "%TYPECOMPONENT%"=="web" 	goto quit
+if "%TYPECOMPONENT%"=="doc" 	goto quit
+
+:build_web
+echo [build]: Building Web Tier
+%MSBUILD% %MG_WEB_SRC%\WebTier.sln
+if "%errorlevel%"=="1" goto error
+if "%TYPECOMPONENT%"=="oem" 	 goto quit
+if "%TYPECOMPONENT%"=="common" 	 goto quit
+if "%TYPECOMPONENT%"=="server" 	 goto quit
+if "%TYPECOMPONENT%"=="web" 	 goto quit
+if "%TYPECOMPONENT%"=="doc" 	 goto quit
+if "%TYPECOMPONENT%"=="allnodoc" goto quit
+
+rem this is left out with component allnodoc
+
+:build_doc
+echo [build]: Building Doc
+pushd %MG_DOC%
+call MgOpenSource_run_doxygen.bat
+popd
+goto quit
+
+rem =======================================================
+rem INSTALL Targets.... the all targets just carry on
+rem =======================================================
+
+
+:install
+if "%TYPECOMPONENT%"=="all" goto install_server
+if "%TYPECOMPONENT%"=="allnodoc" goto install_server
+if "%TYPECOMPONENT%"=="server" goto install_server
+if "%TYPECOMPONENT%"=="web" goto install_web
+if "%TYPECOMPONENT%"=="doc" goto install_doc
+SET ERRORMSG=Unrecognised component: %TYPECOMPONENT%
+goto custom_error
+
+:install_server
+echo [install]: Server
+echo [install]: Server - Binaries
+%XCOPY_SINGLE% "%MG_SERVER%\bin\%TYPEBUILD%" "%MG_OUTPUT_SERVER%\bin" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - FDO
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\FDO" "%MG_OUTPUT_SERVER%\FDO" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - Logs
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Logs" "%MG_OUTPUT_SERVER%\Logs" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - Packages
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Packages" "%MG_OUTPUT_SERVER%\Packages" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - Repositories
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Repositories" "%MG_OUTPUT_SERVER%\Repositories" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - Resources
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Resources" "%MG_OUTPUT_SERVER%\Resources" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - Schema
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Schema" "%MG_OUTPUT_SERVER%\Schema" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - Temp
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\Temp" "%MG_OUTPUT_SERVER%\Temp" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - WFS
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\wfs" "%MG_OUTPUT_SERVER%\wfs" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - WMS
+%XCOPY% "%MG_SERVER%\bin\%TYPEBUILD%\wms" "%MG_OUTPUT_SERVER%\wms" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Server - DBXML
+copy /Y "%MG_OEM%\dbxml-2.3.10\db-4.5.20\build_windows\%TYPEBUILD%\*.exe" "%MG_OUTPUT_SERVER%\bin"
+copy /Y "%MG_OEM%\dbxml-2.3.10\bin64\*.exe" "%MG_OUTPUT_SERVER%\bin"
+echo [install]: Server - RepositoryAdmin
+%XCOPY% "%MG_SERVER%\RepositoryAdmin" "%MG_OUTPUT_SERVER%\RepositoryAdmin" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: CsMap Dictionaries
+%XCOPY% "%MG_OEM%\CsMap\Dictionaries" "%MG_OUTPUT_CSMAP%\Dictionaries" /EXCLUDE:svn_excludes.txt+csmap_excludes.txt+%CONFIGURATION%_excludes.txt
+if "%TYPECOMPONENT%"=="server" goto quit
+if "%TYPECOMPONENT%"=="web" goto quit
+
+:install_web
+echo [install]: web Tier
+
+echo [install]: Web Tier - localized
+%XCOPY% "%MG_WEB_SRC%\localized" "%MG_OUTPUT_WEB%\www\localized" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - mapadmin
+%XCOPY% "%MG_WEB_SRC%\mapadmin" "%MG_OUTPUT_WEB%\www\mapadmin" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - mapagent
+%XCOPY% "%MG_WEB_SRC%\mapagent64" "%MG_OUTPUT_WEB%\www\mapagent" /EXCLUDE:svn_excludes.txt+mapagent_excludes.txt+%CONFIGURATION%_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - MapGuide API unmanaged binaries
+%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\www\mapagent" /EXCLUDE:php_excludes.txt+dotnetapi_excludes.txt+java_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - mapagent test forms
+%XCOPY% "%MG_UNIT_TEST%\WebTier\MapAgent\MapAgentForms" "%MG_OUTPUT_WEB%\www\mapagent" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - stdicons
+%XCOPY% "%MG_WEB_SRC%\stdicons" "%MG_OUTPUT_WEB%\www\stdicons" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - viewerfiles
+%XCOPY% "%MG_WEB_SRC%\viewerfiles" "%MG_OUTPUT_WEB%\www\viewerfiles" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - schemareport
+%XCOPY% "%MG_WEB_SRC%\schemareport" "%MG_OUTPUT_WEB%\www\schemareport" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - webconfig.ini
+copy /Y "%MG_WEB_SRC%\webconfig.ini" "%MG_OUTPUT_WEB%\www"
+echo [install]: Web Tier - mapviewerphp
+%XCOPY% "%MG_WEB_SRC%\mapviewerphp" "%MG_OUTPUT_WEB%\www\mapviewerphp" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - Tomcat - MapGuide API unmanaged binaries
+%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\Tomcat\bin"/EXCLUDE:java_excludes.txt+dotnetapi_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - php - MapGuide API unmanaged binaries
+%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\Php"/EXCLUDE:php_excludes.txt+dotnetapi_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - php ext - MapGuide API unmanaged binaries
+%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\Php\ext" /EXCLUDE:php_excludes.txt+dotnetapi_excludes.txt+svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - mapviewernet
+%XCOPY% "%MG_WEB_SRC%\mapviewernet" "%MG_OUTPUT_WEB%\www\mapviewernet" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - mapviewernet - MapGuide API unmanaged binaries
+%XCOPY% "%MG_WEB_BIN%\%TYPEBUILD%" "%MG_OUTPUT_WEB%\www\mapviewernet\bin" /EXCLUDE:dotnet_excludes.txt+%CONFIGURATION%_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - mapviewerjava
+%XCOPY% "%MG_WEB_SRC%\mapviewerjava" "%MG_OUTPUT_WEB%\www\mapviewerjava" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - mapviewerjava - WEB-INF
+%XCOPY% "%MG_WEB_SRC%\WEB-INF" "%MG_OUTPUT_WEB%\www\WEB-INF" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - fusion templates
+%XCOPY% "%MG_OEM%\fusionMG" "%MG_OUTPUT_WEB%\www\fusion" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Web Tier - Apache module
+if not exist "%MG_OUTPUT_WEB%\Apache2\modules" mkdir "%MG_OUTPUT_WEB%\Apache2\modules"
+%XCOPY% /F "%MG_WEB_SRC%\mapagent64\mod_mgmapagent.so" "%MG_OUTPUT_WEB%\Apache2\modules"
+echo [install]: Web Tier - fusion
+call %ANT% deploy -Ddeploy.home="%MG_OUTPUT_WEB%\www\fusion" -f "%MG_OEM%\fusion\build.xml"
+if "%TYPECOMPONENT%"=="server" goto quit
+if "%TYPECOMPONENT%"=="web" goto quit
+
+:install_doc
+echo [install]: Documentation
+%XCOPY% "%MG_DOC_OUTPUT%" "%MG_OUTPUT_WEB%\www\help\webapi" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Developer's Guide Sample Code
+%XCOPY% "%MG_DOC_DEVGUIDE_SAMPLES%" "%MG_OUTPUT_WEB%\www\devguide" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+echo [install]: Viewer API documentation
+%XCOPY% "%MG_DOC%\viewerapi" "%MG_OUTPUT_WEB%\www\help\viewerapi" /EXCLUDE:svn_excludes.txt+%CONFIGURATION%_excludes.txt
+
+goto quit
+
+:error
+echo [ERROR]: There was an error building the component
+exit /B 1
+
+:custom_error_no_help
+echo [ERROR]: %ERRORMSG%
+SET ERRORMSG=
+exit /B 1
+
+:custom_error
+echo [ERROR]: %ERRORMSG%
+SET ERRORMSG=
+echo Please use the format:
+:help_show
+echo ************************************************************************
+echo build.bat [-h]
+echo           [-v]
+echo           [-c=BuildType]
+echo           [-w=Component]
+echo           [-a=Action]
+echo           [-o=OutputDirectory]
+echo Help:                  -h[elp]
+echo Verbose:               -v
+echo BuildType:             -c[onfig]=Release(default), Debug, Release64, Debug64
+echo Action:                -a[ction]=build(default),
+echo                                  install,
+echo                                  clean,
+echo Component:             -w[ith]=all(default),
+echo                                oem,
+echo                                common,
+echo                                server,
+echo                                web,
+echo                                doc
+echo ************************************************************************
+:quit
+SET TYPEACTION=
+SET TYPEBUILD=
+SET MG_OUTPUT=
+SET MG_BUILD_COMPONENT=
+SET MG_DEV=
+SET MG_INSTALLER=
+SET MG_OEM=
+SET MG_SERVER=
+SET MG_WEB=
+SET MG_WEB_SRC=
+SET MG_WEB_BIN=
+SET MG_UNIT_TEST=
+SET MG_FUSION=
+SET MG_DOC=
+SET MG_DOC_OUTPUT=
+SET MG_ERROR=
+
+SET MSBUILD_LOG=
+SET MSBUILD_VERBOSITY=
+SET XCOPY=
+SET MSBUILD=
+SET PATH=%OLDPATH%


Property changes on: trunk/MgDev/build64.bat
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/MgDev/dotnetapi_excludes.txt
===================================================================
--- trunk/MgDev/dotnetapi_excludes.txt	2010-09-07 00:53:59 UTC (rev 5116)
+++ trunk/MgDev/dotnetapi_excludes.txt	2010-09-07 01:26:17 UTC (rev 5117)
@@ -1,12 +1,12 @@
-OSGeo.MapGuide.Foundation.dll
-OSGeo.MapGuide.Geometry.dll
-OSGeo.MapGuide.MapGuideCommon.dll
-OSGeo.MapGuide.PlatformBase.dll
-OSGeo.MapGuide.Web.dll
-FoundationUnmanagedApi.dll
-GeometryUnmanagedApi.dll
-MapGuideCommonUnmanagedApi.dll
-PlatformBaseUnmanagedApi.dll
-WebUnmanagedApi.dll
-MapGuideDotNetApi.dll
+OSGeo.MapGuide.Foundation.dll
+OSGeo.MapGuide.Geometry.dll
+OSGeo.MapGuide.MapGuideCommon.dll
+OSGeo.MapGuide.PlatformBase.dll
+OSGeo.MapGuide.Web.dll
+FoundationUnmanagedApi.dll
+GeometryUnmanagedApi.dll
+MapGuideCommonUnmanagedApi.dll
+PlatformBaseUnmanagedApi.dll
+WebUnmanagedApi.dll
+MapGuideDotNetApi.dll
 MapGuideUnmanagedApi.dll
\ No newline at end of file


Property changes on: trunk/MgDev/dotnetapi_excludes.txt
___________________________________________________________________
Added: svn:eol-style
   + native



More information about the mapguide-commits mailing list