function bundle_article_change(article_id,product_id) {
	try {
		bundle_products_ids = document.getElementById('bundle_products_ids').value;

		if(article_id && product_id) {
			document.getElementById('bundle_selected_article_price['+product_id+']').value = parseFloat(document.getElementById('bundle_article_price['+article_id+']').value);
			document.getElementById('bundle_selected_article_ordernumber['+product_id+']').value = document.getElementById('bundle_article_ordernumber['+article_id+']').value;
			document.getElementById('bundle_product['+product_id+']').value = article_id;
		}
		
		current_article_price = parseFloat(document.getElementById('article_price_plain').value);
		current_article_ordernumber = document.getElementById('article_ordernumber_plain').value;
			
		bundle_products_ids = bundle_products_ids.split(',');
		
		
		for( var i =0; i < bundle_products_ids.length; i++) {

			current_article_price = current_article_price + parseFloat(document.getElementById('bundle_selected_article_price['+bundle_products_ids[i]+']').value);
			if(document.getElementById('bundle_selected_article_ordernumber['+bundle_products_ids[i]+']').value != '') {
				current_article_ordernumber = current_article_ordernumber + '-' + document.getElementById('bundle_selected_article_ordernumber['+bundle_products_ids[i]+']').value;
			}
		}
		
		document.getElementById('main_product_price').innerHTML = formatPrice(current_article_price);
		document.getElementById('main_product_ordernumber').innerHTML = current_article_ordernumber;
		
		
	} catch (err) {
		//alert('FEHLER!\nEs ist ein Fehler aufgetreten [CODE: com_product_bundle#bundle_article_change '+err+']');
	}
}

function formatPrice(price) {
	
	price = "&euro; " + price.toFixed(2).replace('.',',');
	
	return price;
}


$(function() {
    // dieser Code wird ausgef�hrt, wenn das
    // HTML-Dokument geladen ist
    bundle_article_change();
});