function getSizeImgName (pop) {
  var img = 'http://www.bymap.org/';
  if (pop >= 5000000)
    img += 'G5000.gif';
  else if (pop >= 1000000)
    img += 'G1000.gif';
  else if (pop >= 500000)
    img += 'G500.gif';
  else if (pop >= 250000)
    img += 'G250.gif';
  else if (pop >= 100000)
    img += 'G100.gif';
  else if (pop >= 50000)
    img += 'G50.gif';
  else if (pop >= 20000)
    img += 'G20.gif';
  else if (pop >= 10000)
    img += 'G10.gif';
  else if (pop >= 5000)
    img += 'G5.gif';
  else if (pop >= 1000)
    img += 'G1.gif';
  else
    img += 'G0.gif';
  return img;
}

function getDensityImgName (density) {
  var img = 'http://www.bymap.org/';
  if (density == null)
    img += 'D0.gif';
  else if (density == 0)
    img += 'D0.gif';
  else if (density >= 8000)
    img += 'D1.gif';
  else if (density >= 4000)
    img += 'D2.gif';
  else if (density >= 2000)
    img += 'D3.gif';
  else if (density >= 1000)
    img += 'D4.gif';
  else if (density >= 500)
    img += 'D5.gif';
  else if (density >= 250)
    img += 'D6.gif';
  else if (density >= 125)
    img += 'D7.gif';
  else 
    img += 'D8.gif';
  return img;
}

function getChangeImgName (incr) {
  var img = 'http://www.bymap.org/';
  if (incr == null)
    img += 'C0.gif';
  else if (incr > 0.75)
    img += 'C1.gif';
  else if (incr > 0.2)
    img += 'C2.gif';
  else if (incr > -0.15)
    img += 'C3.gif';
  else if (incr > -0.5)
    img += 'C4.gif';
  else
    img += 'C5.gif';
  return img;
}

function computeWikiCall (marker) {
  if ((marker.wiki != null) && (marker.wiki != ''))
    return 'http://'+pagelang+'.wikipedia.org/wiki?search='+marker.wiki;
  else
    return 'http://'+pagelang+'.wikipedia.org/wiki?search='+encodeURI(marker.name);
}

function computeGoogleCall(marker, cat) {
  var txt = marker.name;
  if ((marker.wiki != null) && (marker.wiki != ''))
    txt = marker.wiki.replace('_',' ');
  if (pagelang == 'de')
    return "http://www.google.de/cse?q="+encodeURI(txt+' '+cat)+"&lang="+pagelang+"&sa=Suche&cx="+google_cse_client_de+"&ie=UTF-8"
  else
    return "http://www.google.com/cse?q="+encodeURI(txt+' '+cat)+"&lang="+pagelang+"&sa=Search&cx="+google_cse_client+"&ie=UTF-8"
}

function computeZoom (pop) {
  if (pop > 200000)
    return 10;
  else if (pop > 50000)
    return 11;
  else if (pop > 10000)
    return 12;
  else
    return 13;
}

