/******************************************************************************
 * @file:  index.js
 * @brief: This JavaScript file is used by main YMmaps page when it is first
 *         loaded
 * @author Kyle Overby
 *
 *  $Revision: YMmaps_Development_koverby/7 $
 *  $Date: 2008/11/04 21:12:48 $
 *  $LastEditedBy: koverby $
 *
 * $Copyright: 2007-2008, Southwest Research Institute.  All rights reserved. $
 *****************************************************************************/

/******************************************************************************
 *  $Log: index.js $
 *  Revision YMmaps_Development_koverby/7 2008/11/04 21:12:48 koverby
 *     Added the distance measurement tool to the map.
 *  
 *  Revision YMmaps_Development_koverby/6 2008/10/20 22:38:24 koverby
 *     Added the search tool to the ymmaps main page.
 *
 *  Revision YMmaps_Development_koverby/5 2008/07/04 00:45:18 koverby
 *     Added the use of IE7 script to make the layout
 *     behave properly in IE6.
 *
 *  Revision YMmaps_Development_koverby/4 2008/06/24 23:54:56 koverby
 *     Moved YMmaps widget into it's own class based
 *     javascript file.
 *
 *  Revision YMmaps_Development_koverby/2 2008/06/20 15:26:34 koverby
 *     Added additional layers to map.
 *
 *
 *****************************************************************************/

/***************************************************************************
 * This function is executed when the SwAG page is first loaded.
 **************************************************************************/
function setupYMmapsPage(){

    /** YMMaps Display */
    var YMmapsTool = new YMmapsWidget();

    /** Add the Map Tool */
    $("main").appendChild(YMmapsTool.toolContainer);

    /** Add the Search Tool */
    $("main").appendChild(YMmapsTool.searchTool.searchToolWindow);

    /** Add the Distance Tool */
    $("main").appendChild(YMmapsTool.distanceTool.distanceToolWindow);

    /** Make the Search Tool Draggable */
    new Draggable(YMmapsTool.searchTool.searchToolWindow, {handle: YMmapsTool.searchTool.searchToolHeader});

    new Draggable(YMmapsTool.distanceTool.distanceToolWindow, {handle: YMmapsTool.distanceTool.distanceToolHeader});

    /** Init the Map */
    YMmapsTool.initMap();
}