// FlexFenster
function Flexfenster(URL, name, newWidth, newHeight, scroll, resize, menue) {
	scrollen= 'no';
	resizen	= 'yes';
	menubar = 'no';
	tools	= 'no';
	if (scroll) { scrollen = scroll; }
	if (resize) { resizen = resize;  }
	if (menue)	{ menubar = menue;   }
	win=open(URL,name,'status=no,resizable=' + resizen + ',menubar=' + menubar + ',toolbar=' + tools + ',resize=yes,scrollbars=' + scrollen + ',height=' + newHeight + ',width=' + newWidth);
	win.focus();
}

function securityAlert(url, title) {
 Check = confirm(title);
 if(Check == true) {
   location.href = url;
 }
}

function /*out: String*/ number_format( /* in: float   */ number, 
                                        /* in: integer */ laenge, 
                                        /* in: String  */ sep, 
                                        /* in: String  */ th_sep ) {

  number = Math.round( number * Math.pow(10, laenge) ) / Math.pow(10, laenge);
  str_number = number+"";
  str_number = str_number.replace(/\,/,".");
  arr_int = str_number.split(".");
  if(!arr_int[0]) arr_int[0] = "0";
  if(!arr_int[1]) arr_int[1] = "";

  if(arr_int[1].length < laenge){
    nachkomma = arr_int[1];
    for(i=arr_int[1].length+1; i <= laenge; i++){  nachkomma += "0";  }
    arr_int[1] = nachkomma;
  }

  if(th_sep != "" && arr_int[0].length > 3){
    Begriff = arr_int[0];
    arr_int[0] = "";
    for(j = 3; j < Begriff.length ; j+=3){
      Extrakt = Begriff.slice(Begriff.length - j, Begriff.length - j + 3);
      arr_int[0] = th_sep + Extrakt +  arr_int[0] + "";
    }
    str_first = Begriff.substr(0, (Begriff.length % 3 == 0)?3:(Begriff.length % 3));
    arr_int[0] = str_first + arr_int[0];
  }
  return arr_int[0]+sep+arr_int[1];
}
