$(document).ready(function (){
	<!--TODO: tOm: This is for the basket page-->
	if($("#basket-options input:checked").attr("id")) {//If a radio button is checked
		if ($("#basket-options input:checked").attr("id") != "ppd"){//If the radio checked is not pay per download on page load
			$("ul.items div.no-tick").hide();//Hide the prices
			$("ul.items div.tick").show();//Show the ticks
		}
	}
	$("#basket-options input").click(function(){
		var strPrice = $(this).parents("label").find("strong").html(); //Find the value of the price you clicked on
		var intPosition = strPrice.indexOf("&"); //Find the money value only if encoded
		//if(intPosition==-1) {intPosition = strPrice.indexOf("�");} //Find the money value only if unencoded
		if(intPosition==-1) {intPosition = strPrice.indexOf("�");} //Find the money value only if unencoded
		if(intPosition!=-1) {strPrice = strPrice.slice(intPosition, strPrice.length)}
		$("#basket-options strong.highlight").parents("label").find("strong").removeClass("highlight");
		$(this).parents("label").find("strong").addClass("highlight");
		$("fieldset.total strong").html(strPrice);	
		if ($(this).attr("id") != "ppd"){//If the radio checked is not pay per download 
			$("ul.items div.no-tick").hide();//Hide the prices
			$("ul.items div.tick").show();//Show the ticks
			if ($(this).attr("id") == "p30"){//If the radio checked is not pay for 30 days
				$("#basket-pa").hide()//Hides the pay for ongoing item in the basket
				$("#basket-p30").show()//Shows the pay for 30 days item in the basket
			}
			if ($(this).attr("id") == "pa"){//If the radio checked is not ongoing
				$("#basket-p30").hide()//Hides the pay for 30 days item in the basket
				$("#basket-ts").hide()//Hides the pay for trial sub item in the basket
				$("#basket-pa").show()//Shows the pay for 30 days item in the basket
			}
			if ($(this).attr("id") == "ts"){//If the radio checked is not trial sub
				$("#basket-p30").hide()//Hides the pay for 30 days item in the basket
				$("#basket-pa").hide()//Hides the pay for 30 days item in the basket
				$("#basket-ts").show()//Shows the pay for trial sub item in the basket
			}
		}
		else {//If pay per download radio is checked
			$("ul.items div.no-tick").show();//Show the prices
			$("ul.items div.tick").hide();//Hide the ticks
			$("#basket-p30").hide()//Hides the pay for 30 days item in the basket
			$("#basket-pa").hide()//Hides the pay for 30 days item in the basket
			$("#basket-ts").hide()//Hides the pay for trial sub item in the basket
		}
	});
});
