update_skier_equipment = function(ele) {
	val = $('#equipment_type').val();
	if (val=="Adult") {
		$('#childrens_equipment,#adult_equipment,#package_deals,#general_equipment').hide();
		$('#childrens_equipment select option').each( function(i) {
			$(this).attr("selected","");
			if ($(this).val() == "") $(this).attr("selected","selected"); 
		});
		$('#adult_equipment,#package_deals,#general_equipment').show();
	} else {
		$('#childrens_equipment,#adult_equipment,#package_deals,#general_equipment').hide();
		$('#package_deals select option,#adult_equipment select option').each( function(i) {
			$(this).attr("selected","");
			if ($(this).val() == "") $(this).attr("selected","selected"); 
		});
		$('#childrens_equipment,#general_equipment').show();
	}
	update_skier_products()
}

update_skier_products = function() {
	total = 0;
	$('.product-select').each( function (i) {
		if ($(this).val() != '')
	    	total += parseInt($(this).val().split('_')[1]);
//	    	alert(total)
   	});
   	$('#total_sub').text("AUD $"+total.toFixed(2));
   	$('#total_discount').text("AUD $"+(total/100*discount).toFixed(2));
   	$('#total_skier').text("AUD $"+(total-(total/100*discount)).toFixed(2));
}

confirm_delete = function() {
	if (confirm("Are you sure you want to delete this item?")) return true
	return false;
}

$(document).ready(function() {
	$('#brands').cycle({ 
	    fx: 'scrollDown' 
	});
	
	$("#subscription form label").toggle();
	
	if ($(".cm-input").length > 0)
	{
		$('.cm-input').each( function() {
			if ($(this).val() == '' || $(this).val() == $(this).attr("title")) {
				$(this).val($(this).attr("title"));
				$(this).addClass("form-light");
			}		
		});
		
		$(".cm-input").focus( function() {
			if ($(this).val() == $(this).attr("title")) {
				$(this).val('');
				$(this).removeClass("form-light");
			}
		});

		$(".cm-input").blur( function() {
			if ($(this).val() == "") {
				$(this).val($(this).attr("title"));
				$(this).addClass("form-light");
			}
		});
	}

	
});