var dragableWindows;
var dragableWindowsLanguage="de";

function changeLanguage(flag)
{
    dragableWindowsLanguage=flag;
    init_dragableWindows();
    showDragDiv(dragableWindows["popup"][0]);
    showDragDiv(dragableWindows["popup"][0]);
}

function init_dragableWindows()
{
    if(dragableWindowsLanguage=="de")
    {
        dragableWindows = { popup : [
        //{ name : ""                       , wid : null, div : "dg00", counter : 0, w : {x : 130, y :  20, w : 100, h : 100}, c : {x : 0, y : 0, w : 0, h : 0}, visible : false, closedatonce : false, HTML : null, target : "OLC_DEBUG"          , url : ""}},

          { name : "Beschreibung"           , wid : null, div : "dg00", counter : 0, w : {x : 120, y : 180, w : 450, h : 400}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_SUNDIAL"        , url : "Request"},
          { name : "Einstellungen"          , wid : null, div : "dg01", counter : 0, w : {x : 150, y : 225, w : 280, h : 230}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_WIKI"           , url : "Request"},
          { name : "Wiki Summary"           , wid : null, div : "dg02", counter : 0, w : {x : 240, y : 370, w : 230, h : 300}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_KATALOG"        , url : "PopupWindows/OLC_Katalog.html"},

          { name : "Werkzeuge"              , wid : null, div : "dg03", counter : 0, w : {x : 120, y : 210, w : 300, h : 400}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, target : "OLC_GETFEATUREINFO" , url : "Request"},
          { name : "Application ClipBoard"  , wid : null, div : "dg04", counter : 0, w : {x : 120, y : 210, w : 350, h : 400}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, target : "OLC_LAYERCONTROL"   , url : "Request"},

          { name : "Panoramio"              , wid : null, div : "dg05", counter : 0, w : {x : 240, y : 370, w : 430, h : 300}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_KATALOG"        , url : "PopupWindows/OLC_Katalog.html"},
          { name : "Geoobjekt"              , wid : null, div : "dg06", counter : 0, w : {x : 240, y : 370, w : 320, h : 462}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_KATALOG"        , url : "PopupWindows/OLC_Katalog.html"}
        ]};
    }
    else
    {
        dragableWindows = { popup : [
        //{ name : ""                       , wid : null, div : "dg00", counter : 0, w : {x : 130, y :  20, w : 100, h : 100}, c : {x : 0, y : 0, w : 0, h : 0}, visible : false, closedatonce : false, HTML : null, target : "OLC_DEBUG"          , url : ""}},

          { name : "Description"            , wid : null, div : "dg00", counter : 0, w : {x : 120, y : 180, w : 450, h : 400}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_SUNDIAL"        , url : "Request"},
          { name : "Options"                , wid : null, div : "dg01", counter : 0, w : {x : 150, y : 225, w : 280, h : 230}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_WIKI"           , url : "Request"},
          { name : "Wiki Summary"           , wid : null, div : "dg02", counter : 0, w : {x : 240, y : 370, w : 230, h : 300}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_KATALOG"        , url : "PopupWindows/OLC_Katalog.html"},

          { name : "Tools"                  , wid : null, div : "dg03", counter : 0, w : {x : 120, y : 210, w : 300, h : 400}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, target : "OLC_GETFEATUREINFO" , url : "Request"},
          { name : "Application ClipBoard"  , wid : null, div : "dg04", counter : 0, w : {x : 120, y : 210, w : 350, h : 400}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, target : "OLC_LAYERCONTROL"   , url : "Request"},

          { name : "Panoramio"              , wid : null, div : "dg05", counter : 0, w : {x : 240, y : 370, w : 430, h : 300}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_KATALOG"        , url : "PopupWindows/OLC_Katalog.html"},
          { name : "Geoobjekt"              , wid : null, div : "dg06", counter : 0, w : {x : 240, y : 370, w : 320, h : 462}, c : {x : 0, y : 0, w : 0, h : 0}, visible : "visible", closedatonce : false, HTML : null, target : "OLC_KATALOG"        , url : "PopupWindows/OLC_Katalog.html"}
        ]};
    }

    //######################
    //Geoobjekt
    //######################
    var theHTML = '';

    theHTML += '<table>';
    theHTML += '<tbody><tr>';
    theHTML += '<td>&#160;</td>';
    theHTML += '</tr>';
    theHTML += '</tbody></table>';

    dragableWindows["popup"][6].HTML = theHTML;

    //######################
    //Panoramio
    //######################
    var theHTML = '';

    theHTML += '<table>';
    theHTML += '<tbody><tr>';
    theHTML += '<td>&#160;</td>';
    theHTML += '</tr>';
    theHTML += '</tbody></table>';

    dragableWindows["popup"][5].HTML = theHTML;

    //######################
    //Wiki Summary
    //######################
    var theHTML = '';

    theHTML += '<table>';
    theHTML += '<tbody><tr>';
    theHTML += '<td>&#160;</td>';
    theHTML += '</tr>';
    theHTML += '</tbody></table>';

    dragableWindows["popup"][2].HTML = theHTML;

    //######################
    //Werkzeuge
    //######################
    var theHTML = '';

    var menuFunctions = [];
    //menuFunctions[menuFunctions.length] = ["onclick", "img src", "title"];
    //menuFunctions[menuFunctions.length] = ["tbMove();",      "icons/tbMove.gif", "Move"];
    menuFunctions[menuFunctions.length] = ["tbNearBySearch('Panoramio', 0);",      "icons/tbPanoramioOnMap.gif", "NearBy Panoramio (on map)"];
    menuFunctions[menuFunctions.length] = ["tbNearBySearch('Panoramio', 1);",      "icons/tbPanoramio.gif", "NearBy Panoramio (on result)"];
    menuFunctions[menuFunctions.length] = ["tbNearBySearch('Wikipedia', 0);",      "icons/tbWikipediaOnMap.gif", "NearBy Wikipedia (on map)"];
    menuFunctions[menuFunctions.length] = ["tbNearBySearch('Wikipedia', 1);",      "icons/tbWikipedia.gif", "NearBy Wikipedia (on result)"];
    //menuFunctions[menuFunctions.length] = ["tbNearBySearch('Factbook' , 0);",      "icons/dark_search_blue.gif", "NearBy Factbook (on map)"];
    //menuFunctions[menuFunctions.length] = ["tbNearBySearch('Factbook' , 1);",      "icons/search_blue.gif", "NearBy Factbook (on result)"];

    menuFunctions[menuFunctions.length] = ["tbCenterSmallMaps();",        "icons/target.gif",           "CenterSmallMaps"];
    menuFunctions[menuFunctions.length] = ["tbSetCenterFromResult();",    "icons/dark_target_view.gif", "setCenterFromResult"];
    menuFunctions[menuFunctions.length] = ["tbCenter2POIS();",            "icons/dark_window.gif",      "Center2POIS"];
    menuFunctions[menuFunctions.length] = ["gKMLdiv();",                  "icons/add.gif",              "Result2KML"];
    menuFunctions[menuFunctions.length] = ["tbResults2Features();",       "icons/add_red.gif",          "Result2Features"];
    menuFunctions[menuFunctions.length] = ["tbKML2Features();KML2POI();", "icons/add_lila.gif",         "KML2Features"];
    menuFunctions[menuFunctions.length] = ["tbDeleteFeatures();",         "icons/subtract.gif",         "DeleteFeatures"];
    //menuFunctions[menuFunctions.length] = ["tbDisplayTextArea();",        "icons/cancel.png",           "Display TextArea"];
    //menuFunctions[menuFunctions.length] = ["tbevalCode();",             "icons/cancel.png",           "eval"];

    var theMenu = "";
    for(var i=0;i<menuFunctions.length;i++)
    {
        theMenu += '<img title="' + menuFunctions[i][2] + '" onclick="' + menuFunctions[i][0] + '" src="' + menuFunctions[i][1] + '" class="ico" id="menuFunctions' + (100+i) + '"/>&#160;&#160;';
    }

    var theHTML = "";
    theHTML += "<table style='width:100%;height:100%;'>";
    theHTML += "<tr><td style='390px;height:25px;background-color:#BEBEBE'>&#160;" + theMenu + "</td></tr>";
    theHTML += "<tr><td><textarea id='kmlPut' style='display:none;width:100%;height:100%;overflow-x:hidden'></textarea></td></tr>";
    theHTML += "</table>";

    dragableWindows["popup"][3].HTML = theHTML;
    //if(!window.ActiveXObject)
    //    dragableWindows["popup"][3].w.w="256";
    dragableWindows["popup"][3].w.h="50";

    //######################
    //Output
    //######################
    var theHTML = '';

    theHTML += '<table>';
    theHTML += '<tbody><tr>';
    theHTML += '<td>&#160;</td>';
    theHTML += '</tr>';
    theHTML += '</tbody></table>';

    dragableWindows["popup"][4].HTML = theHTML;

    //######################
    //ClickPoint Description
    //######################
    var derEText = [];
    derEText[derEText.length] = ["ClickPoint Game <span style='cursor:pointer;' onclick='changeLanguage(\"de\");'>[deutsch]</span>","ClickPoint Introduction at <a href='http://de.youtube.com/watch?v=Fb0vtS6hrac'>YouTube</a><BR><BR>ClickPoint is a little game with OpenLayers and Google Maps.<BR><BR>With the start of the page a place are choosen from a static list and you can  immediately try your luke.<BR><BR> The goal of the game is to find the place on the left map, which is displayed in the right maps in higher zoomlevels.<BR><BR>Click on the left map where you mean the place could be. The background-color between the maps shows you in which of the eight ranges of distance you are clicked. The colorscale above the large map shows the extent of the ranges. Green is the range nearest the place.<BR><BR><img src=\"images/clickpoint.png\"><BR><BR>When you click near enough the large map will automatically displayed in one or more zoomlevels higher. In this way you reach eventually a zoomlevel, where it is possible to come near enough the place and end the game.<BR><BR>The number of clicks needed are shown above the maps behind the name of the place."];
    derEText[derEText.length] = ["Start a new game","To start a new round choose a point from the static list or search for places with geonames.org.<BR><BR><img src=\"images/clickpoint_select_150.png\"><BR><BR>After the choose of a place you can start the game with the button right to the search result."];
    derEText[derEText.length] = ["Layerswitcher","To toggle the layerswitcher click on the plus sign at the right top of each map.<BR><BR><img src=\"images/clickpoint_layer_400.png\">"];
    derEText[derEText.length] = ["Search Options","The click on the cogwheel opens the options dialog for the search.<BR><BR><img src=\"images/clickpoint_tools.png\">"];

    var Eicons = "";
    Eicons += "<table>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/help.gif\">              </td><td>show help</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/cog.png\">               </td><td>open the search options</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/dark_search.gif\">       </td><td>start search</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/search_yellow.gif\">     </td><td>search by Panoramio (search on result)</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/dark_search_yellow.gif\"></td><td>searche by Panoramio (search on map center)</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/search_red.gif\">        </td><td>search by Wikipedia (search on result)</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/dark_search_red.gif\">   </td><td>search by Wikipedia (search on map center)</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/dark_target_play.gif\">  </td><td>mode game, start game</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/dark_target_view.gif\">  </td><td>mode view, center maps</td></tr>";
    Eicons += "<tr><td width=30><IMG SRC=\"icons/arrow_refresh.png\">     </td><td>refresh map</td></tr>";
    Eicons += "</table>";

    derEText[derEText.length] = ["Toolbar (Search) Functions", Eicons];

    var textModeView  = "";
        textModeView += "In viewmode ClickPoint can used to navigate to interesting points, to display Panoramio pictures and Wikipedia summaries.<BR><BR>The Toolbar (View) have special functions for this task.";

    derEText[derEText.length] = ["ClickPoint (Mode View)", textModeView];

    var icons = "";
    icons += "<table>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbPanoramioOnMap.gif\"> </td><td>search by Panoramio (search on map center)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbPanoramio.gif\">      </td><td>search by Panoramio (search on result)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbWikipediaOnMap.gif\"> </td><td>search by Wikipedia (search on map center)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbWikipedia.gif\">      </td><td>search by Wikipedia (search on result)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/target.gif\">           </td><td>center right maps</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_target_view.gif\"> </td><td>center maps</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_window.gif\">      </td><td>target coordinate</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/add.gif\">              </td><td>Results to KML</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/add_red.gif\">          </td><td>Results to Pointfeatures</td></tr>";
    icons += "<tr><td width=30>&#160;                                   </td><td>the points are selectable for displaying the picture or summary</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/add_lila.gif\">         </td><td>KML to Features</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/subtract.gif\">         </td><td>delete Features</td></tr>";
    icons += "</table>";

    derEText[derEText.length] = ["Toolbar (View) Funktions", icons];

    var Ecredits = "";
    Ecredits += "<table>";
    Ecredits += "<tr><td width=100>Web Map API</td><td><A HREF=\"http://openlayers.org/\">OpenLayers</A></td></tr>";
    Ecredits += "<tr><td>Karten</td><td><A HREF=\"http://maps.google.com/\">Google Maps</A></td></tr>";
    Ecredits += "<tr><td>Geocoder</td><td><A HREF=\"http://geonames.org/\">geonames.org</A></td></tr>";
    Ecredits += "<tr><td>Panoramio</td><td><A HREF=\"http://www.panoramio.com/\">Panoramio - Photos of the World</A></td></tr>";
    Ecredits += "<tr><td>Wikipedia</td><td><A HREF=\"http://en.wikipedia.org/wiki/Main_Page\">Wikipedia Mainpage</A></td></tr>";
    Ecredits += "<tr><td>Icons 1</td><td>Sanscons <A HREF=\"http://somerandomdude.net/srd-projects/sanscons/\">Some Random Dude</A></td></tr>";
    Ecredits += "<tr><td>Icons 2</td><td>Silk icon set 1.3 von <A HREF=\"http://www.famfamfam.com/lab/icons/silk/\">Mark James</A></td></tr>";
    Ecredits += "<tr><td>Dialoge</td><td>drag.js von <A HREF=\"http://www.brainjar.com/dhtml/drag/\">Mike Hall</A></td></tr>";
    Ecredits += "<tr><td></td><td></td></tr>";
    Ecredits += "</table>";

    derEText[derEText.length] = ["Used Resources","Using the following resources made it possible to build this littele game.<BR><BR>" + Ecredits];

    //#######################
    //ClickPoint Beschreibung
    //#######################
    var derText = [];

    derText[derText.length] = ["ClickPoint (Modus Spiel) <span style='cursor:pointer;' onclick='changeLanguage(\"en\");'>[english]</span>","ClickPoint Introduction at <a href='http://de.youtube.com/watch?v=Fb0vtS6hrac'>YouTube</a><BR><BR>ClickPoint is ein kleines Spiel mit OpenLayers und Google Maps.<BR><BR>Mit Start der Seite wird aus einer statischen Liste ein Ortspunkt ausgewählt und man kann sofort sein Glück versuchen.<BR><BR>Es ist das Ziel des Spiels einen Ort auf der großen Karte zu finden, der in den kleinen Karten in höheren Zoomstufen dargestellt ist.<BR><BR>Dazu klickt man in der linken Karte an die Stelle, wo man den Ort vermutet. Die Hintergrundfarbe zwischen den Karten zeigt an, in welchem der 8 Entfernungsbereiche man sich befindet. Die Farbskala oberhalb der großen Karte zeigt die Ausdehnung der Bereiche. Grün ist der Bereich direkt um den Ort usw.<BR><BR><img src=\"images/clickpoint.png\"><BR><BR>Klickt man nah genug wird die große Karte automatisch ein oder mehrere Zoomstufen höher dargestellt. Auf diese Weise erreicht man schliesslich eine Zoomstufe in der es möglich ist, sich dem betreffenden Ort auf 10 m zu nähern und damit das Spiel zu beenden.<BR><BR>Die Anzahl Klicks, die man benötigt hat, wird links oben hinter dem Ortsnamen ausgewiesen."];
    derText[derText.length] = ["Ein neues Spiel starten","Für eine weitere Runde kann man mittels des Suchfeldes geonames.org nach Orten durchsuchen.<BR><BR><img src=\"images/clickpoint_select_150.png\"><BR><BR>Nach der Auswahl eines Ortes wird mit dem Button rechts der Anfangszustand des Spiels hergestellt. Die linke Karte wird in den Ursprungszustand versetzt und die beiden kleinen Karten werden für unterschiedliche Zoonmstufen auf den Ort zentriert."];
    derText[derText.length] = ["Layersteuerung","Die Layersteuerung kann rechts oben in den Karten angezeigt werden.<BR><BR><img src=\"images/clickpoint_layer_400.png\">"];
    derText[derText.length] = ["Suchoptionen","Die Aktivierung des Werkzeugsymbols öffnet die Einstellungen für die Suche.<BR><BR><img src=\"images/clickpoint_tools.png\">"];

    var icons = "";
    icons += "<table>";
    icons += "<tr><td width=30><IMG SRC=\"icons/wrench.png\">       </td><td>Werkzeuge anzeigen</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/help.gif\">         </td><td>Hilfe anzeigen</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/cog.png\">          </td><td>Öffnet die Sucheinstellungen</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_search.gif\">  </td><td>Suche starten</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/search_yellow.gif\">       </td><td>Suche bei Panoramio (search on result)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_search_yellow.gif\">       </td><td>Suche bei Panoramio (search on map center)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/search_red.gif\">       </td><td>Suche bei Wikipedia (search on result)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_search_red.gif\">       </td><td>Suche bei Wikipedia (search on map center)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_target_play.gif\">  </td><td>Modus Game, Spiel starten</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_target_view.gif\">  </td><td>Modus View, Karte auf Punkt zentrieren</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/arrow_refresh.png\"></td><td>Karte aktualisieren</td></tr>";
    icons += "</table>";

    derText[derText.length] = ["Werkzeugkasten (Suche) Funktionen", icons];

    var textModeView  = "";
        textModeView += "Im Anzeigemodus kann man ClickPoint für die Navigation und zur Anzeige von Panoramio Bildern und Wikipedia Zusammenfassungen benutzen.<BR><BR>Die Werkzeuge (View) bieten spezielle Funktionen für diese Aufgabe.";

    derText[derText.length] = ["ClickPoint View", textModeView];

    var icons = "";
    icons += "<table>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbPanoramioOnMap.gif\"> </td><td>Suche bei Panoramio (search on map center)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbPanoramio.gif\">      </td><td>Suche bei Panoramio (search on result)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbWikipediaOnMap.gif\"> </td><td>Suche bei Wikipedia (search on map center)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/tbWikipedia.gif\">      </td><td>Suche bei Wikipedia (search on result)</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/target.gif\">           </td><td>Zentriere rechte Karten</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_target_view.gif\"> </td><td>Karten zentrieren</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/dark_window.gif\">      </td><td>Zielkoordinate</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/add.gif\">              </td><td>Results to KML</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/add_red.gif\">          </td><td>Results to Pointfeatures</td></tr>";
    icons += "<tr><td width=30>&#160;                                   </td><td>Die Punkte lassen sich selektieren und zeigen das zugehörige Panoramio Bild oder die zugehörige Wikipedia Zusammenfassung.</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/add_lila.gif\">         </td><td>KML to Features</td></tr>";
    icons += "<tr><td width=30><IMG SRC=\"icons/subtract.gif\">         </td><td>Features löschen</td></tr>";
    icons += "</table>";

    derText[derText.length] = ["Werkzeugkasten (View) Funktionen", icons];

    var credits = "";
    credits += "<table>";
    credits += "<tr><td width=100>Web Map API</td><td><A HREF=\"http://openlayers.org/\">OpenLayers</A></td></tr>";
    credits += "<tr><td>Karten</td><td><A HREF=\"http://maps.google.com/\">Google Maps</A></td></tr>";
    credits += "<tr><td>Geocoder</td><td><A HREF=\"http://geonames.org/\">geonames.org</A></td></tr>";
    credits += "<tr><td>Panoramio</td><td><A HREF=\"http://www.panoramio.com/\">Panoramio - Fotos aus aller Welt</A></td></tr>";
    credits += "<tr><td>Wikipedia</td><td><A HREF=\"http://de.wikipedia.org/wiki/Hauptseite\">Wikipedia Hauptseite</A></td></tr>";
    credits += "<tr><td>Icons 1</td><td>Sanscons <A HREF=\"http://somerandomdude.net/srd-projects/sanscons/\">Some Random Dude</A></td></tr>";
    credits += "<tr><td>Icons 2</td><td>Silk icon set 1.3 von <A HREF=\"http://www.famfamfam.com/lab/icons/silk/\">Mark James</A></td></tr>";
    credits += "<tr><td>Dialoge</td><td>drag.js von <A HREF=\"http://www.brainjar.com/dhtml/drag/\">Mike Hall</A></td></tr>";
    credits += "<tr><td></td><td></td></tr>";
    credits += "</table>";

    derText[derText.length] = ["Verwendete Resourcen","Die Verwendung der folgenden Resourcen machte es möglich dieses kleine Spiel zu erstellen.<BR><BR>" + credits];

    if(dragableWindowsLanguage=="en")
        derText = derEText;

    theHTML = '';
    theHTML += '<table>'
    for(var i=0;i<derText.length;i++)
    {
        theHTML += ''
        theHTML += '<tr>'
        theHTML += '<td>'+(i+1)+'.</td>'
        theHTML += '<td><b>' + derText[i][0] + '</b></td>'
        theHTML += '</tr>'
        theHTML += ''
        theHTML += '<tr>'
        theHTML += '<td>&#160;</td>'
        theHTML += '<td>' + derText[i][1] + '</td>'
        theHTML += '</tr>'

        theHTML += '<tr><td></td><td><HR></td></tr>'
    }

    theHTML += ''
    theHTML += '<tr>'
    theHTML += '<td>' + (derText.length+1) + '.</td>'
    theHTML += '<td><b>Impressum</b></td>'
    theHTML += '</tr>'
    theHTML += ''
    theHTML += '<tr>'
    theHTML += '<td>&#160;</td>'
    theHTML += '<td><br><a href="http://www.ibbeck.de/DE/2128/Impressum.php"><img src="http://www.ibbeck.de/modbfile.php?g=eigenschaftenspeichertext~139413~ID~EigenschaftswertBlob~EigenschaftswertZusatzfeld~~magicobjectslive" width="400px" alt="www.ibbeck.de" BORDER="0" target="_blank"></a></td>'
    theHTML += '</tr>'

    theHTML += '<tr><td></td><td><HR></td></tr>'
    theHTML += '<tr>'
    theHTML += '<td>' + (derText.length+2) + '.</td>'
    theHTML += '<td><b>Kontakt / contact</b></td>'
    theHTML += '</tr>'
    theHTML += '<tr>'
    theHTML += '<td>&#160;</td>'
    theHTML += '<td><a href="mailto:arnd.wippermann@web.de">Arnd Wippermann</a></td>'
    theHTML += '</tr>'
    theHTML += '</table><BR>'

    dragableWindows["popup"][0].HTML = theHTML;


    //######################
    //Einstellungen
    //######################

    var theHTML = '';

    theHTML += '<table id="tbl03" style="padding:4px">';

    theHTML += '<tr><td width=100>Search on name</td><td width=180>';
    theHTML += '';
    theHTML += '<select id="s01" style="width:100%" onChange="oldFilter=\'\';">';
    theHTML += '<option value="searchJSON">geonames.org Search';
    theHTML += '<option value="wikipediaSearchJSON">geonames.org Wikipedia';
    theHTML += '</select>';
    theHTML += '';
    theHTML += '</td></tr>';
    theHTML += '';
    theHTML += '<tr><td>Search on point</td><td>';
    theHTML += '';
    theHTML += '<select id="s02" style="width:100%">';
    if(!window.ActiveXObject)
        theHTML += '<option value="Geoobjekt" disabled>NearBy Geoobjekt</option>';
    theHTML += '<option value="Wikipedia">NearBy Wikipedia</option>';
    theHTML += '<option value="Panoramio" selected>NearBy Panoramio</option>';
    if(!window.ActiveXObject)
    theHTML += '<option value="Factbook" disabled>NearBy Factbook</option>';
    if(!window.ActiveXObject)
    theHTML += '<option value="Flickr" disabled>NearBy Flickr</option>';
    theHTML += '</select>';
    theHTML += '';
    theHTML += '</td></tr>';
    theHTML += '';
    theHTML += '<tr><td>Search on result</td><td>';
    theHTML += '';
    theHTML += '<select id="s03" style="width:50%">';
    theHTML += '<option value="0">false';
    theHTML += '<option value="1" selected>true';
    theHTML += '</select>';
    theHTML += '';
    theHTML += '</td></tr>';
    theHTML += '';
    theHTML += '<tr><td></td><td><hr></td></tr>';
    theHTML += '';
    theHTML += '<tr><td>language</td><td>';
    theHTML += '<select id="s04" style="width:50%">';
    theHTML += '<option value="de" selected>german';
    theHTML += '<option value="fr">french';
    theHTML += '<option value="en">english';
    theHTML += '</select>';
    theHTML += '</td></tr>';
    theHTML += '';
    theHTML += '<tr><td>radius</td><td>';
    theHTML += '<select id="s05" style="width:50%" onChange="oldFilter=\'\';">';
    theHTML += '<option value="25">25';
    theHTML += '<option value="50" selected>50';
    theHTML += '<option value="100">100';
    theHTML += '<option value="250">250';
    theHTML += '<option value="500">500';
    theHTML += '</select>';
    theHTML += '</td></tr>';
    theHTML += '';
    theHTML += '<tr><td>rows</td><td>';
    theHTML += '<select id="s06" style="width:50%" onChange="oldFilter=\'\';">';
    theHTML += '<option value="10">10';
    theHTML += '<option value="50" selected>50';
    theHTML += '<option value="100">100';
    theHTML += '</select>';
    theHTML += '</td></tr>';
    theHTML += '';
    theHTML += '<tr><td></td><td><hr></td></tr>';
    theHTML += '';
    theHTML += '<tr><td>modus</td><td>';
    theHTML += '<select id="s07" style="width:50%">';
    theHTML += '<option value="view">view';
    theHTML += '<option value="play" selected>play';
    theHTML += '</select>';
    theHTML += '</td></tr>';
/*    theHTML += '';
    theHTML += '<tr><td></td><td><hr></td></tr>';
    theHTML += '';
    theHTML += '<tr><td>Input</td><td>';
    theHTML += 'Put your points as <span onclick="pKMLdiv();" style="cursor:pointer;color:blue;font-weight:bold;">KML</span>.';
    theHTML += '</td></tr>';
    theHTML += '<tr><td>Output</td><td>';
    theHTML += 'Get your points as <span onclick="gKMLdiv();" style="cursor:pointer;color:blue;font-weight:bold;">KML</span>.';
    theHTML += '</td></tr>';
    theHTML += '';
*/
    theHTML += '</table>';

    dragableWindows["popup"][1].HTML = theHTML;

    //#########################################
}

function showDragDiv(obj)
{
    for(var i=0;i<dragableWindows["popup"].length;i++)
        try{if(document.getElementById(dragableWindows["popup"][i].div.toUpperCase() + 'container') && i!=3)
            toggleDragDiv(i);
            }catch(err){};

    try{
        var initMsg = obj.div;
    }catch(err){return false};

//alert(obj.HTML);

    var idx = parseInt(obj.div.substr(2,2));

    //dragable_container
    var myDiv          = document.createElement("div");
    myDiv.id           = obj.div.toUpperCase() + "container";
    myDiv.className    = "DIVcontainer";
    myDiv.style.top    = obj.w.x;
    myDiv.style.left   = obj.w.y;
    myDiv.style.width  = obj.w.w;
    myDiv.style.height = obj.w.h;
    myDiv.style.visibility = obj.visible;
    myDiv.style.zIndex = dragObj.zIndex;

    //dragable_head
    var myDivH = document.createElement("div");

    myDivH.id          = obj.div.toUpperCase() + "Head";
    myDivH.className   = "DIVHead";
    myDivH.onmousedown = dragIt;
    myDivH.innerHTML   = obj.name + '&#160;<span  onclick="toggleDragDiv(' + idx + ');" style="cursor: pointer;">[X]</span>';

    myDiv.appendChild(myDivH);

    //dragable_body
    var myDivB          = document.createElement("div");
    myDivB.id           = obj.div.toUpperCase() + "Body";
    myDivB.className    = "DIVBody";
    //myDivB.onmousedown = dragIt;
    if (browser.isIE)
    {   myDivB.style.height = obj.w.h-20-6;
        if(idx==3 || idx==5)
            myDivB.style.overflow = "hidden";
    }
    else
        myDivB.style.height = obj.w.h-20-2;

    if(obj.HTML)
        myDivB.innerHTML = obj.HTML;

    myDiv.appendChild(myDivB);
    document.body.appendChild(myDiv);

    if(idx==1)
    {
        document.getElementById("s01").value = geoNameSearchService;
        document.getElementById("s02").value = geoPointSearchService;
        document.getElementById("s03").value = searchOnResult;
        document.getElementById("s04").value = geoSearchLanguage;
        document.getElementById("s05").value = geoSearchRadius;
        document.getElementById("s06").value = geoSearchRows;
        document.getElementById("s07").value = ClickPointModus;
    }

}

function dragIt(event)
{
    if (browser.isIE)
      dragObj.elNode = window.event.srcElement;
    if (browser.isNS)
      dragObj.elNode = event.target;

    if(!dragObj.elNode.id.substr(0,4))
        return false;

    //document.getElementById("Msg").innerHTML = dragObj.elNode.id.substr(0,4);

    dragStart(event, dragObj.elNode.id.substr(0,4) + 'container');
}

function toggleDragDiv(idx)
{
    if(document.getElementById(dragableWindows["popup"][idx].div.toUpperCase() + 'container'))
    {
        if(idx==1)
        {
            geoNameSearchService  = document.getElementById("s01").value;
            geoPointSearchService = document.getElementById("s02").value;
            searchOnResult        = document.getElementById("s03").value;

            if(searchOnResult == 0 && geoPointSearchService == "Panoramio")
            {   document.getElementById("idNearBy").src = "icons/dark_search_yellow.gif";
                document.getElementById("idNearBy").title = "NearBy Panoramio (on map)";
            }
            else if(searchOnResult == 1 && geoPointSearchService == "Panoramio")
            {   document.getElementById("idNearBy").src = "icons/search_yellow.gif";
                document.getElementById("idNearBy").title = "NearBy Panoramio (on result)";
            }
            else if(searchOnResult == 0 && geoPointSearchService == "Wikipedia")
            {   document.getElementById("idNearBy").src = "icons/dark_search_red.gif";
                document.getElementById("idNearBy").title = "NearBy Wikipedia (on map)";
            }
            else if(searchOnResult == 1 && geoPointSearchService == "Wikipedia")
            {   document.getElementById("idNearBy").src = "icons/search_red.gif";
                document.getElementById("idNearBy").title = "NearBy Wikipedia (on result)";
            }
            else if(searchOnResult == 0 && geoPointSearchService == "Geoobjekt")
            {   document.getElementById("idNearBy").src = "icons/dark_search_green.gif";
                document.getElementById("idNearBy").title = "NearBy Geoobjekt (on map)";
            }
            else if(searchOnResult == 1 && geoPointSearchService == "Geoobjekt")
            {   document.getElementById("idNearBy").src = "icons/search_green.gif";
                document.getElementById("idNearBy").title = "NearBy Geoobjekt (on result)";
            }
            else if(searchOnResult == 0 && geoPointSearchService == "Factbook")
            {   document.getElementById("idNearBy").src = "icons/dark_search_blue.gif";
                document.getElementById("idNearBy").title = "NearBy Factbook (on map)";
            }
            else if(searchOnResult == 1 && geoPointSearchService == "Factbook")
            {   document.getElementById("idNearBy").src = "icons/search_blue.gif";
                document.getElementById("idNearBy").title = "NearBy Factbook (on result)";
            }

            //geoPanoramioSize  = document.getElementById("s07").value;
            //geoPanoramioCount = parseInt(document.getElementById("s08").value);

            geoSearchRadius   = parseInt(document.getElementById("s05").value);
            geoSearchRows     = parseInt(document.getElementById("s06").value);

            ClickPointModus   = document.getElementById("s07").value;
            if(ClickPointModus=="play")
            {   document.getElementById("imgCenter").src   = "icons/dark_target_play.gif";
                document.getElementById("imgCenter").title = "play:center";
            }
            else
            {   document.getElementById("imgCenter").src   = "icons/dark_target_view.gif";
                document.getElementById("imgCenter").title = "view:center";
            }

            geoSearchLanguage = document.getElementById("s04").value;
            geoSearchCountry  = document.getElementById("s04").value;
        }

        var tmp = dragableWindows["popup"][idx].div.toUpperCase() + 'container';
        dragableWindows["popup"][idx].w.x = document.getElementById(tmp).style.top;
        dragableWindows["popup"][idx].w.y = document.getElementById(tmp).style.left;
        document.body.removeChild(document.getElementById(tmp));
    }
    else
        showDragDiv(dragableWindows["popup"][idx]);
}

/*

    <div id="KMLinput"  style="z-index:2003;position:absolute;visibility:hidden;top: 80px;left:50px;padding:5px;font-size:10px;color:black;width:400px;height:400px;overflow:auto;background-color: rgb(204, 204, 221);"></div>
    <div id="KMLoutput" style="z-index:2003;position:absolute;visibility:hidden;top: 80px;left:50px;padding:5px;font-size:10px;color:black;width:400px;height:400px;overflow:auto;background-color: rgb(204, 204, 221);"></div>
    <div id="Wiki"      style="z-index:2002;position:absolute;visibility:hidden;top:200px;left:35px;padding:5px;font-size:10px;color:black;width:200px;height:250px;overflow:auto;background-color:#CCCCDD;border:2px solid blue;" onclick="alert('Hallo Click');"></div>

*/


