﻿var navhtml;
function PicControl(html) 
{
    navhtml = html;
}

//function displayInfo(text) {
PicControl.prototype = new GControl();

PicControl.prototype.initialize = function(amap) {
  var container = document.createElement("div");
  var writer = document.createElement("div");
  container.id = "PicControl";
  writer.innerHTML = navhtml;
  container.appendChild(writer);
  amap.getContainer().appendChild(container);
  return container;
}

PicControl.prototype.resize = function ()
{
    if (map != null) {
        var node = map.getContainer();
        for (var i = 0; i < node.childNodes.length; i++)
            if (node.childNodes[i].id == "PicControl") 
            {
                    map.getContainer().childNodes[i].style.width = map.getSize().width - 100 + "px";
                    //map.getContainer().childNodes[i].style.top = "120px";
            }
                   
    }
}
PicControl.prototype.close = function ()
{
    if (map != null) {
        var node = map.getContainer();
        for (var i = 0; i < node.childNodes.length; i++)
            if (node.childNodes[i].id == "PicControl") 
            {
                    map.getContainer().removeChild(node.childNodes[i]);
            }
                   
    }
}
// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
PicControl.prototype.getDefaultPosition = function() {
    return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10, 10));
        
}





