function GetInputField(Name, Value) {
    return "<input type='text' name='" + Name + "' value='" + Value + "'/>"
}
var Width = 600
var Height = 450
var Rand = 10
var Background = 'EEFFFF'
var Legendenbreite = 0
var Legendenhoehe = 0
var GoogleServer = 'http://chart.apis.google.com/chart'
var Title = new Array('Rapid-Spiele', 'Rapid-Punkte')
var TitleColor = "008800"
var TitleSize = 24
var NeutraleFarbe = '444444'
var Laender =
    new Array( // Name, ISO2, Spiele, Punkte
        new Array('Albanien', 'AL', 4, 3),
        new Array('Andorra', 'AD', 0, 0),
        new Array('Armenien', 'AM', 0, 0),
        new Array('Aserbaidschan', 'AZ', 0, 0),
        new Array('Belgien', 'BE', 10, 1.4),
        new Array('Bosnien-H.', 'BA', 2, 0.5),
        new Array('Bulgarien', 'BG', 4, 2.0),
        new Array('Daenemark', 'DK', 2, 2.0),
        new Array('Deutschland', 'DE', 45, 1.87),
        new Array('England', 'GB-ENG', 8, 0.5),
        new Array('Estland', 'EE', 0, 0),
        new Array('Faeroeer', 'FO', 0, 0),
        new Array('Finnland', 'FI', 0, 0),
        new Array('Frankreich', 'FR', 9, 1.22),
        new Array('Georgien', 'GE', 2, 3.0),
        new Array('Griechenland', 'GR', 4, 1.25),
        new Array('Irland', 'IE', 2, 3.0),
        new Array('Island', 'IS', 2, 1.5),
        new Array('Israel', 'IL', 4, 1.0),
        new Array('Italien', 'IT', 29, 0.9),
        new Array('Kasachstan', 'KZ', 0, 0),
        new Array('Kroatien', 'HR', 8, 1.38),
        new Array('Lettland', 'LV', 0, 0),
        new Array('Liechtenstein', 'LI', 0, 0),
        new Array('Litauen', 'LT', 2, 3.0),
        new Array('Luxemburg', 'LU', 4, 3.0),
        new Array('Malta', 'MT', 4, 3.0),
        new Array('Mazedonien', 'MK', 0, 0),
        new Array('Moldawien', 'MD', 0, 0),
        new Array('Montenegro', 'ME', 0, 0),
        new Array('Niederlande', 'NL', 10, 1.0),
        new Array('Nordirland', 'GB-NIR', 0, 0),
        new Array('Norwegen', 'NO', 2, 2.0),
        new Array('Oesterreich', 'AT', 3253, 1.91), 
        new Array('Polen', 'PL', 5, 2.0),
        new Array('Portugal', 'PT', 6, 0.83),
        new Array('Rumaenien', 'RO', 4, 1.25),
        new Array('Russland', 'RU', 14, 1.93),
        new Array('San+Marino', 'SM', 2, 3.0),
        new Array('Schottland', 'GB-SCT', 10, 1.4),
        new Array('Schweden', 'SE', 4, 2.5),
        new Array('Schweiz', 'CH', 0, 0),
        new Array('Serbien', 'RS', 6, 1.17),
        new Array('Slowakei', 'SK', 9, 1.33),
        new Array('Slowenien', 'SI', 0, 0),
        new Array('Spanien', 'ES', 11, 0.82),
        new Array('Tschechische+Rep.', 'CZ', 34, 1.53),
        new Array('Tuerkei', 'TR', 16, 1.63),
        new Array('Ukraine', 'UA', 6, 1.5),
        new Array('Ungarn', 'HU', 31, 1.29),
        new Array('Vatikan', 'VA', 0, 0),
        new Array('Wales', 'GB-WLS', 0, 0),
        new Array('Weissrussland', 'BY', 0, 0),
        new Array('Zypern', 'CY', 6, 1.67)
    )
function WriteEuropeMap(Chart) {
    var FormName = 'ifrm_' + Chart
    var sp = GetEuropeMap(Chart)
    var s =
        '<iframe '
        + 'id="' + FormName + '" name="' + FormName + '" '
        + 'width="' + Width + '" height="' + Height + '" '
        + 'scrolling="no" '
        + 'frameborder="0" ></iframe>'
    document.write(s)
    document.close()
    var iframe = getObjectByID(FormName)
    iframe = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument;
    iframe.document.open()
    iframe.document.write(sp)
    iframe.document.close()
    eval('iframe.document.' + FormName + '.submit()')
}
function GetEuropeMap(Chart) {
    var Index = 0
    switch (Chart) {
        case 'games':
            Index = 2
            break;
        case 'points':
            Index = 3
            break;
    }
    // chtVal = 'map:auto=' + Rand + ',' + Rand + ',' + Rand + ',' + Rand
    var chtVal = 'map:fixed=30,-20,65,60'
    var chsVal = Width + 'x' + Height
    var chttVal = escape(Title[Index - 2])
    var chtsVal = TitleColor + ',' + TitleSize
    var chfVal = 'bg,s,' + Background
    var chmaVal = '10,10,10,10|' + Legendenbreite + ',' + Legendenhoehe
    var chldVal = ''
    var chcoVal = NeutraleFarbe
    var chmVal = ''
    var Land = 0
    for (i = 0; i < Laender.length; i++) {
        chldVal += (chldVal == '' ? '' : '|') + Laender[i][1];
        var MyColorRGB
        switch (Index) {
            case 2:
                if (Laender[i][1] == 'AT')
                    MyColorRGB = new RGBobject(0, 128, 0)
                else {
                    var MyColorSat = Laender[i][Index] * 100 * 1.0 / 60
                    var MyColorHSV = new HSVobject(100, MyColorSat, 100)
                    MyColorRGB = new RGBobject(0, 0, 0)
                    HSV2RGB(MyColorHSV, MyColorRGB)
                }
                break;
            case 3:
                if (Laender[i][2] == 0) // keine Spiele
                    MyColorRGB = new RGBobject(255, 255, 255)
                else {
                    var MyColorHue = (Laender[i][Index]) * 100 * 1.0 / 3
                    var MyColorHSV = new HSVobject(MyColorHue, 100, 100)
                    MyColorRGB = new RGBobject(0, 0, 0)
                    HSV2RGB(MyColorHSV, MyColorRGB)
                }
                break;
        }
        chcoVal += '|' + RGB2hex(MyColorRGB).substr(1)
        if (Laender[i][2] > 0) // Legende nur, wenn es Spiele gibt
            chmVal += (chmVal == '' ? '' : '|') +
                'f' + /* escape(Laender[i][1]) + ':' + */Laender[i][Index] + 
                ',000088,0,' + Land + ',8'
        Land++
    }
    var FormName = 'ifrm_' + Chart
    GoogleServer += '?chid=' + new Date().getMilliseconds()
    var sp = "<form action='" + GoogleServer + "' method='POST' id='" + FormName + "' name='" + FormName + "'>"
        + GetInputField('cht', chtVal)
        + GetInputField('chs', chsVal)
        + GetInputField('chld', chldVal)
        + GetInputField('chco', chcoVal)
        + GetInputField('chm', chmVal)
        + GetInputField('chtt', chttVal)
        + GetInputField('chts', chtsVal)
        + GetInputField('chf', chfVal)
        + GetInputField('chma', chmaVal)
        + "</form>"
    return sp
}
