      
function load() {
  if (GBrowserIsCompatible()) {    

    if (document.getElementById("cyMap")) {
      
      map = new GMap2(document.getElementById("cyMap"));
      geocoder = new GClientGeocoder();
      map.addControl(new GSmallMapControl(), pos2);
      map.addControl(new GMapTypeControl(), pos);
      map.removeMapType(G_HYBRID_MAP);
      map.setCenter(new GLatLng(51.193115,10.83252), 5);                                  
    }
  }
}

function show_products() {  
  if (document.getElementById("cymerchantsearch_products")) {
    document.getElementById("cymerchantsearch_products").style.display = "block";
  }
  if (document.getElementById("cymerchantsearch_anschrift")) {  
    document.getElementById("cymerchantsearch_anschrift").style.display = "none";
  }        
  if (document.getElementById("cymerchantsearch_address_popup")) {  
    document.getElementById("cymerchantsearch_product_popup").style.backgroundColor = "#0066cc";
  }
  if (document.getElementById("cymerchantsearch_product_popup")) {  
    document.getElementById("cymerchantsearch_address_popup").style.backgroundColor = "#002278";
  }
}
      
function showAdr() {
  if (document.getElementById("cymerchantsearch_products")) {
    document.getElementById("cymerchantsearch_products").style.display = "none";
  }
  if (document.getElementById("cymerchantsearch_anschrift")) {
    document.getElementById("cymerchantsearch_anschrift").style.display = "block";
  }        
  if (document.getElementById("cymerchantsearch_address_popup")) {
    document.getElementById("cymerchantsearch_address_popup").style.backgroundColor = "#0066cc";
  }
  if (document.getElementById("cymerchantsearch_product_popup")) {
    document.getElementById("cymerchantsearch_product_popup").style.backgroundColor = "#002278";
  }
}

function load_products() {
  var productgroup = document.getElementById("tx_cymerchantsearch_pi1productgroup").options[document.getElementById("tx_cymerchantsearch_pi1productgroup").selectedIndex].value;

  var products = "" + array[productgroup] + "";
  var products_array = products.split(",");
  
  for(var t = document.getElementById("tx_cymerchantsearch_pi1products").length; t > 1; t--) {
    document.getElementById("tx_cymerchantsearch_pi1products").options[t-1] = null;
  }  
  
  if(productgroup != 0) {
    for(i=0;i<products_array.length;i++) {
      var productandid = products_array[i].split(":");
      var sel = document.getElementById("tx_cymerchantsearch_pi1products");
      var opt = document.createElement("option");
      var txt = document.createTextNode(productandid[0]);
      opt.appendChild(txt);
      opt.setAttribute("value", productandid[1]);            
      if(""+productandid[0] + ":" + productandid[1]+"" == activ) {
        opt.setAttribute("selected", "selected");
      }            
      sel.appendChild(opt);            
    } 
  } else {
    document.getElementById("tx_cymerchantsearch_pi1products").options[0].selected = true;
  }
  activ = "";
}

function idoc() {
  var productgroup = document.getElementById("tx_cymerchantsearch_pi1productgroup").options[document.getElementById("tx_cymerchantsearch_pi1productgroup").selectedIndex].value;
  var idoc = document.getElementById('tx_cymerchantsearch_pi1_idoc');
  if (idoc && productgroup == 1 || productgroup == 2 ) {
    idoc.style.display = 'block';
  } else if (idoc) {
    idoc.style.display = 'none';
  }    
}
      
function myclick(i) {
  markers[i].openInfoWindowHtml(marker_texts[i]);
  new_position(i);
}

function new_position(i) {
  var zoom = map.getZoom();
  var lat_plus = 89.6;
  var lng_plus = 12.8;
  
  for(j = zoom;j>1;j--) {
    lat_plus /= 2;
    lng_plus /= 2;
  }
  
  var lat = ((markers[i].getPoint().lat() + lat_plus));
  var lng = ((markers[i].getPoint().lng() + lng_plus));

  set_new_center(lat, lng, zoom);
}

function set_new_center(lat,lng,zoom) {
  map.setCenter(new GLatLng(lat,lng,zoom));
}

