//Removes input box options
$(function(){
$("#SortBy option[value='3']").remove(); //remove sort by option
$("#SortBy option[value='4']").remove(); //remove sort by option
$("#SortBy option[value='5']").remove(); //remove sort by option
$("#SortBy option[value='9']").remove(); //remove sort by option
$("#SortBy option[value='11']").remove(); //remove sort by option
});
//Removes input box options


$(function(){
var current_val;
var price_result;
	if ( typeof global_Current_ProductCode != "undefined" && $("[name^=SELECT___] option").length )
	{
	var product_orig_price = parseFloat($('font.pricecolor.colors_productprice:not(.pricecolorsmall)').find('.price1:last').text().replace('$','').replace(/,/g,''));
	current_val = product_orig_price;
	$("select[name^='SELECT___'],").change(function(){
	$("select[name^='SELECT___']").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;
		}
	});

	$('font.pricecolor.colors_productprice:not(.pricecolorsmall)').find('.price1:last').html('$' + $.currency(current_val,{s:",",d:".",c:2}));
	current_val=product_orig_price;
	});

$("a[href^='javascript:change_option']").each(function(){
		var current_val2;
		var price_result2;
		var product_orig_price2 = parseFloat($('font.pricecolor.colors_productprice:not(.pricecolorsmall)').find('.price1:last').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___']").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;
		}
});
	$('font.pricecolor.colors_productprice:not(.pricecolorsmall)').find('.price1:last').html('$' + $.currency(current_val,{s:",",d:".",c:2}));
	current_val2=product_orig_price2;
		return false;
		});
	});
	}
});
