/*
Some of these override earlier varien/product.js methods, therefore
varien/product.js must have been included prior to this file.
*/

//[EXCEED] add in Price From: wording.
Product.Config.prototype.reloadPrice = function() {
    //Replace the content of any spans with the css class
    //"configurable-price-from-label"
    $$('span.configurable-price-from-label').each(function(label) {
        label.innerHTML = '';
    });
	var price = 0;
        for(var i=this.settings.length-1;i>=0;i--){
            var selected = this.settings[i].options[this.settings[i].selectedIndex];
            if(selected.config){
                price += parseFloat(selected.config.price);
            }
        }

        optionsPrice.changePrice('config', price);
        optionsPrice.reload();

        return price;

        if($('product-price-'+this.config.productId)){
            $('product-price-'+this.config.productId).innerHTML = price;
        }
        this.reloadOldPrice();
}
//[EXCEED] change select option labels so that they show the actual price rather than the price difference.
Product.Config.prototype.reloadOptionLabels = function(element){
        for(var i=0;i<element.options.length;i++){
            if(element.options[i].config){
                element.options[i].text = this.getOptionLabel(element.options[i].config, element.options[i].config.price);
            }
        }
    }
Product.Config.prototype.getOptionLabel = function(option, price){
        price = parseFloat(this.config.oldPrice) + parseFloat(price);
        var str = option.label;
        if(price){
            str+= ' (' + this.formatPrice(price, false) + ')';
        }
        return str;
    }
