$(document).ready(function()
{	
	var total = 0;
	
	function calcTotal()
	{
		$("input:checked").each(function()
		{
			//This happens for each checked input field
			var value = $(this).attr("value");
			total += parseInt(value); 
		});
	}

	//This happens when the page loads
	calcTotal();	
	$(".cotizar").before('<p class="total">Total: <strong>' + total + '</strong></p>');
		
	$("input:checkbox, input:radio").click(function()
	{
		total = 0;
		calcTotal();
		$("p.total").html("costo total: $ <strong>" + total + "</strong>");
	});
	
	$("label").click(function () {
	$("label").removeClass("myradio").removeClass("onactive");
	$(this).addClass("myradio").css({opacity: 1});
	var title = $(this).text();
	$(".RdSelect").text(title);
	});
	
	$("label").mouseover(
	function(){
	$(this).not(".myradio").addClass("onactive");
	});
	$("label").mouseout(
	function(){
	$(this).removeClass("onactive");
	
});
	
	
});




