function confirmLink(theLink, confirmMsg, PermissionMsg) {
	if (PermissionMsg != "")	{
		alert(PermissionMsg);
		return false;
	}
	else	{
		var is_confirmed = confirm(confirmMsg);
		if (is_confirmed) {
			theLink.href += '&is_js_confirmed=1';
		}
	
		return is_confirmed;
	}	
} 



function pop_up(path,window_name,w,h) {
	var prop = 'width=' + w + ',height=' + h + ',status=no,scrollbars=yes,resizeable=yes,toolbar=no,menubar=no';
	window.open(path, window_name, prop);
}

function pop_up1(path,window_name,w,h) {
	var prop = 'width=' + w + ',height=' + h + ',status=no,location=no,scrollbars=no,resizable=no,toolbar=no,menubar=no';
	window.open(path, window_name, prop);
}

function pop_up2(path,window_name,w,h) {
	var prop = 'width=' + w + ',height=' + h + ',status=no,location=no,scrollbars=yes,resizable=no,toolbar=no,menubar=no';
	window.open(path, window_name, prop);
}

function number_format (number, decimals, dec_point, thousands_sep)
{
  var exponent = "";
  var numberstr = number.toString ();
  var eindex = numberstr.indexOf ("e");
  if (eindex > -1)
  {
    exponent = numberstr.substring (eindex);
    number = parseFloat (numberstr.substring (0, eindex));
  }
  
  if (decimals != null)
  {
    var temp = Math.pow (10, decimals);
    number = Math.round (number * temp) / temp;
  }
  var sign = number < 0 ? "-" : "";
  var integer = (number > 0 ? 
      Math.floor (number) : Math.abs (Math.ceil (number))).toString ();
  
  var fractional = number.toString ().substring (integer.length + sign.length);
  dec_point = dec_point != null ? dec_point : ".";
  fractional = decimals != null && decimals > 0 || fractional.length > 1 ? 
               (dec_point + fractional.substring (1)) : "";
  if (decimals != null && decimals > 0)
  {
    for (i = fractional.length - 1, z = decimals; i < z; ++i)
      fractional += "0";
  }
  
  thousands_sep = (thousands_sep != dec_point || fractional.length == 0) ? 
                  thousands_sep : null;
  if (thousands_sep != null && thousands_sep != "")
  {
	for (i = integer.length - 3; i > 0; i -= 3)
      integer = integer.substring (0 , i) + thousands_sep + integer.substring (i);
  }
  
  return sign + integer + fractional + exponent;
}

function numeralsOnly(evt) {
	evt = (evt) ? evt : event;
	var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 
		((evt.which) ? evt.which : 0));
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		//alert("Bitte geben Sie nur ganze Zahlen in die Felder ein.");
		return false;
	}
	return true;
}

function SwitchBeraterInfo() {
	var BeraterSrc=document.getElementById('test').src; 
	
	if(BeraterSrc.search(/berater_plus.gif/)>0) {
		document.getElementById('berater_tel').style.display='none'; 
		document.getElementById('berater_info').style.display='block';
		document.getElementById('test').src='images/berater_minus.gif';
	}

	if(BeraterSrc.search(/berater_minus.gif/)>0) {
		document.getElementById('berater_tel').style.display='block'; 
		document.getElementById('berater_info').style.display='none';
		document.getElementById('test').src='images/berater_plus.gif';
	}
}

