function winopen(URL,name,features) {
	window.open(URL,name,features);
}

//configure the two variables below to match yoursite's own info
var bookmarkurl="http://www.ff-portal.it"
var bookmarktitle="Das Portal für Südtirols Feuerwehren"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function compareText (option1, option2) {
  return option1.text < option2.text ? -1 :
    option1.text > option2.text ? 1 : 0;
}

function sortSelect (select) {
  var options = new Array (select.options.length);
  for (var i = 0; i < options.length; i++)
    options[i] = 
      new Option (
        select.options[i].text,
        select.options[i].value,
        select.options[i].defaultSelected,
        select.options[i].selected
      );
  options.sort(compareText);
  select.options.length = 0;
  for (var i = 0; i < options.length; i++)
    select.options[i] = options[i];
}

function set_ff_string(select) {
	for (var i = 0; i < select.length; i++) {
		if (i == 0) { document.schritt1.beteiligte_feuerwehren_string.value = "#"; }
		if (i > 0) { document.schritt1.beteiligte_feuerwehren_string.value = document.schritt1.beteiligte_feuerwehren_string.value + ";#"; }
		document.schritt1.beteiligte_feuerwehren_string.value = document.schritt1.beteiligte_feuerwehren_string.value + select.options[i].value + "#";
	}
}

function von_rechts_nach_links() {
	if (document.schritt1.alle_feuerwehren.selectedIndex>=0) {
		count = document.schritt1.beteiligte_feuerwehren.length;
		text = document.schritt1.alle_feuerwehren.options[document.schritt1.alle_feuerwehren.selectedIndex].text;
		value = document.schritt1.alle_feuerwehren.options[document.schritt1.alle_feuerwehren.selectedIndex].value;
		document.schritt1.beteiligte_feuerwehren.options[count] = new Option(text,value);
		document.schritt1.alle_feuerwehren.options[document.schritt1.alle_feuerwehren.selectedIndex] = null;
		sortSelect(document.schritt1.beteiligte_feuerwehren);
	}
	set_ff_string(document.schritt1.beteiligte_feuerwehren);
}

function von_links_nach_rechts() {
	if (document.schritt1.beteiligte_feuerwehren.selectedIndex>=0) {
		count = document.schritt1.alle_feuerwehren.length;
		text = document.schritt1.beteiligte_feuerwehren.options[document.schritt1.beteiligte_feuerwehren.selectedIndex].text;
		value = document.schritt1.beteiligte_feuerwehren.options[document.schritt1.beteiligte_feuerwehren.selectedIndex].value;
		document.schritt1.alle_feuerwehren.options[count] = new Option(text,value);
		document.schritt1.beteiligte_feuerwehren.options[document.schritt1.beteiligte_feuerwehren.selectedIndex] = null;
		sortSelect(document.schritt1.alle_feuerwehren);
	}
	set_ff_string(document.schritt1.beteiligte_feuerwehren);
}