

	function delete_question(delete_link, item){
		proceed = confirm('Sicher, dass Sie das gewählte '+item+' jetzt unwiederruflich löschen möchten?');
		if (proceed) self.location.href = delete_link;
	}
	
	function toggle_visibility(whichLayer)
	{
	  var elem, vis;
	  if( document.getElementById ) // this is the way the standards work
	    elem = document.getElementById( whichLayer );
	  else if( document.all ) // this is the way old msie versions work
	      elem = document.all[whichLayer];
	  else if( document.layers ) // this is the way nn4 works
	    elem = document.layers[whichLayer];
	  vis = elem.style;
	  // if the style.display value is blank we try to figure it out here
	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
	}
	
function euro (number)
	{
	  var decimals = 2;
	  var dec_point = ',';
	  var 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 update_youlip_commission(user_commission){
		user_commission = user_commission.replace('.', '');
		user_commission = user_commission.replace(',', '.');
		
		if (user_commission < 2){
			alert("Bitte geben Sie mindestens eine Belohnung von 2 EUR an.");
		}
		
		if (user_commission > 200){
			alert("Bitte geben Sie maximal 200 EUR Belohnung an.");
		}
		
		user_commission = parseFloat(user_commission) ;
		youlip_commission = user_commission / 100 * 20;
		youlip_commission = euro(youlip_commission);
		
		el = document.getElementById("commission_youlip");
		el.value = youlip_commission;
		
	}

	function to_price( mixed_var ) {
		return mixed_var.match(/[0-9]+(\.)?[0-9]{2}/);
	}

		
