$(document).ready(function() {
	
	$(".checklist .checkbox-select").click(
		function(event) {
			event.preventDefault();
			$(this).parent().addClass("selected");
			$(this).parent().find(":checkbox").attr("checked","checked");

			var var1 = parseFloat($(this).parent().parent().parent().find(".uk").html());
			var1 += parseFloat($(this).parent().find(".ec").val());

			$(this).parent().parent().parent().find(".uk").html(var1);
		}
	);
			
	$(".checklist .checkbox-deselect").click(
		function(event) {
			event.preventDefault();
			$(this).parent().removeClass("selected");
			$(this).parent().find(":checkbox").removeAttr("checked");

			var var1 = parseFloat($(this).parent().parent().parent().find(".uk").html());
			var1 -= parseFloat($(this).parent().find(".ec").val());

			$(this).parent().parent().parent().find(".uk").html(var1);
		}
	);

	$(".radiolist .radio-select").click(
		function(event) {
			event.preventDefault();
			var $boxes = $(this).parent().parent().children();
			$boxes.removeClass("selected");
			$(this).parent().addClass("selected");
			$(this).parent().find(":radio").attr("checked","checked");
		}
	);

	$(".radiolist .radio-deselect").click(
		function(event) {
			event.preventDefault();
			$(this).parent().removeClass("selected");
			$(this).parent().find(":radio").removeAttr("checked");
		}
	);



 function filterPath(string) {
  return string
    .replace(/^\//,'')
    .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
    .replace(/\/$/,'');
  }
  var locationPath = filterPath(location.pathname);
  $('a[href*=#]').each(function() {
    var thisPath = filterPath(this.pathname) || locationPath;
    if (  locationPath == thisPath
    && (location.hostname == this.hostname || !this.hostname)
    && this.hash.replace(/#/,'') ) {
      var $target = $(this.hash), target = this.hash;
      if (target) {
        var targetOffset = $target.offset().top;
        $(this).click(function(event) {
          event.preventDefault();
          $('html, body').animate({scrollTop: targetOffset}, 800, function() {
            location.hash = target;
          });
        });
      }
    }
  });


			
});
 