
	// Fenster öffnen
	function openWindow(url,width,height,scrollbars,resizeable) {
		posleft = (window.screen.availWidth - width) / 2;
		postop = (window.screen.availHeight - height) / 2;
		rnd = Math.round(Math.random()*10000);
		windowname = 'window' + rnd.toString();
		var windowhandle= window.open(url, windowname,'toolbar=no,status=no,menubar=no,scrollbars='+(scrollbars ?'yes':'no')+',resizable='+(resizeable ?'yes':'no')+',width='+width+',height='+height+',top='+postop+',left='+posleft);
		windowhandle.focus();
	}


/*
	function calculatePrice(qty, price, currency) {
		return (qty * price) + ' €';
	}
*/
	
	/* 
	 * Funktion dient der Live-Kaufpreis-Berechnung im Kauffenster.
	 */
/*
	function onQtyChange(inputbox,price,currency) {

		value = parseInt( inputbox.value);
		if (isNaN(value)) { fillSumPrice('- €'); return true; }
		if (value < 1) { fillSumPrice('- €'); return true; }
		
		value = calculatePrice(value,price,currency);
		fillSumPrice(value);
		return true;
	}
	
	function fillSumPrice(value) {
		el = document.getElementById("fullpricespace");
		el.innerHTML = value;
	}
*/
	
	function calculatePrice(inputbox, outputbox, price, maxquantity) {
		if (inputbox.value == '') return false;
		quantity = Math.abs(parseInt(inputbox.value));
		if (isNaN(quantity) || quantity < 1) {
			quantity = 1;
		} else if (quantity > 20) {
			quantity = 20;
		}
		inputbox.value = quantity;
		if (isNaN(quantity) || quantity < 1) {
			fillSumPrice('- €');
			return;
		}
		price = Math.round(price * 100);
		price *= Math.round(quantity);
		price = price.toString();
		strlen = price.length;
		price = price.substr(0, strlen - 2) + ',' + price.substr(strlen - 2, 2);
		outputbox.value = price + ' €';
	}