realms = new Array(
	'http://www.malteser.at',
	'http://burgenland.malteser.at',
	'http://salzburg.malteser.at',
	'http://steiermark.malteser.at',
	'http://tirol.malteser.at',
	'http://wien.malteser.at',
    'http://lourdes.malteser.at'
);

loc = document.location.toString();

if (loc.indexOf('www') != -1) index = 0;
if (loc.indexOf('burgenland') != -1) index = 1;
if (loc.indexOf('salzburg') != -1) index = 2;
if (loc.indexOf('steiermark') != -1) index = 3;
if (loc.indexOf('tirol') != -1) index = 4;
if (loc.indexOf('wien') != -1) index = 5;
if (loc.indexOf('lourdes') != -1) index = 6;

function redirect(el) {
	window.location = realms[el.selectedIndex];
}

code = '<select id="realm" name="realm" size="1" onchange="redirect(this);">';
code += '<option>&Ouml;sterreich</option>';
code += '<option>Bereich Burgenland</option>';
code += '<option>Bereich Salzburg</option>';
code += '<option>Bereich Steiermark</option>';
code += '<option>Bereich Tirol</option>';
code += '<option>Bereich Wien</option>';
code += '<option>Wallfahrt Lourdes</option>';
code += '</select>';

document.write(code);

dropdown = document.getElementById('realm');
dropdown.selectedIndex = index;

