$(function(){
var current_val;
var price_result;
	if ( typeof global_Current_ProductCode != "undefined" && $("[name^=SELECT___] option").length )
	{
	var product_orig_price = parseFloat($(".price1:eq(0)").text().replace('$','').replace(/,/g,''));
	current_val = product_orig_price;
	$("select[name^='SELECT___'],input[name^='SELECT___'][type='radio']").change(function(){
	$("select[name^='SELECT___'],input[name^='SELECT___'][type='radio']").each(function(){
	var recal_var = $(this).find("option:selected").text();

		if (recal_var.indexOf('[Subtract -$') >0){
		price_result = recal_var.split('$')[1].slice(0,-1).replace(/,/g,'');
		current_val=current_val-price_result;
		}
		else if (recal_var.indexOf('[Add $') >0){
		price_result = parseFloat(recal_var.split('$')[1].slice(0,-1).replace(/,/g,''));
		current_val=current_val+price_result;
		}
	});

	$(".price1").replaceWith('<span class="price1">$' + $.currency(current_val,{s:",",d:".",c:2}) + '</span>');
	current_val=product_orig_price;
	});
	$("a[href^='javascript:change_option']").each(function(){
var current_val2;
var price_result2;
var product_orig_price2 = parseFloat($(".price1:eq(0)").text().replace('$','').replace(/,/g,''));
		$(this).click(function() {
		var result_href = $(this).attr('href').match(/\'(.*?)\'/)[1];
		var result_val = $(this).attr('href').match(/\,(.*?)\)/)[1];
		change_option(result_href,result_val);

current_val2 = product_orig_price2;
$("select[name^='SELECT___'],input[name^='SELECT___'][type='radio']").each(function(){
var recal_var2 = $(this).find("option:selected").text();
		if (recal_var2.indexOf('[Subtract -$') >0){
		price_result2 = recal_var2.split('$')[1].slice(0,-1).replace(/,/g,'');
		current_val2=current_val2-price_result2;
		}
		else if (recal_var2.indexOf('[Add $') >0){
		price_result2 = parseFloat(recal_var2.split('$')[1].slice(0,-1));
		current_val2=current_val2+price_result2;
		}
});
$(".price1").replaceWith('<span class="price1">$' + $.currency(current_val,{s:",",d:".",c:2}) + '</span>');
current_val2=product_orig_price2;
		return false;
		});
	});
	}
});
