function recalc_price() {
	
  price = 0;
  
  //check which level
  level = $("#training_level").val();
    
  if (level == 0) { //no level - nothing to do
    return;
  }
  
  //check which activity
  activity = $("#training_activity").val();  
  
  var training_location = '';
  var training_location_bronze = '';
  
   if(activity == 3 && level == 3 ) {
		 if($('#location_field').css('display') == 'none')  {
			training_location = ''; 
			$('#location_field').show();
		 }		
	 	else
	    	training_location = $("#training_location").val(); 
			
		if($('#location_field_bronze').css('display') == 'block') {
		 	$("#training_location_bronze").val($("#training_location_bronze option:first").val());  
	 	}
	    $('#location_field_bronze').css({'display':'none'});
	 
   } else if (activity == 3 && level == 1) {
	   
	    if($('#location_field_bronze').css('display') == 'none')  {
			training_location_bronze = ''; 
			$('#location_field_bronze').show();
		 }		
	 	else
	    	training_location_bronze = $("#training_location_bronze").val(); 
			
		if($('#location_field').css('display') == 'block') {
		 	$("#training_location").val($("#training_location option:first").val());  
	 	}
		$('#location_field').css({'display':'none'});
   }
   
   else { 
   
   	 if($('#location_field').css('display') == 'block') {
		 $("#training_location").val($("#training_location option:first").val());  
	 }
	 
	 if($('#location_field_bronze').css('display') == 'block') {
		 $("#training_location_bronze").val($("#training_location_bronze option:first").val());  
	 }
	
 	  $('#location_field').css({'display':'none'});
	  $('#location_field_bronze').css({'display':'none'});
	
  }  /**/
  
  //check equipment
  itms = new Array();
  //PACK = 0
  //TENT = 1
  //SLEEPING BAG = 2
  //SLEEPING MAT = 3
  //COOKER = 4
  //POTS = 5
  //GAS = 6
  
  if ($("#pack_on:checked").length == 1) itms[0] = 1;
  if ($("#tent_on:checked").length == 1) itms[1] = 1;
  if ($("#sleeping_bag_on:checked").length == 1) itms[2] = 1;
  if ($("#sleeping_mat_on:checked").length == 1) itms[3] = 1;
  if ($("#cooker_on:checked").length == 1) itms[4] = 1;
  if ($("#pots_on:checked").length == 1) itms[5] = 1;
  if ($("#gas_on:checked").length == 1) itms[6] = 1;
  
  if (activity == 1) {
    price = 235;  //change from 215
  } else if (activity == 2) {
    if (level == 1) price = 175;  //change from 165
    if (level == 2) price = 225;  //change from 195
    if (level == 3) price = 235;  //change from 225
  } else if (activity == 3) {
    
	if (level == 1) {
		price = 205;
		if(training_location_bronze == 1) price = 175; // 175 for Auckland Area
		if(training_location_bronze == 2) price = 205; // 205 for Coromandel Area
	}		
    if (level == 2) price = 245;   //change from 225
    if (level == 3) {
		price = 350;
		if(training_location == 1) price = 350;
		if(training_location == 2) price = 400;
	}
  };
  
  if(activity == 3 && level == 1) 
 	 $("#programme_info").html(level+"|"+activity+"|"+training_location_bronze);
  else
  	 $("#programme_info").html(level+"|"+activity+"|"+training_location);
	
  subtot = price.toFixed(2);
  $("#programme_subtotal").html("$"+subtot);
  $("#programme_subtotal_s").html("$"+subtot);
   
  price = 0;
  $("#tent_na").hide();
  $("#sleeping_mat_na").hide();
  $("#cooker_na").hide();
  $("#gas_na").hide();
  if ( (level == 3) && (activity == 1)) {
    $("#tent_na").show();
  } else if ( (level ==1) && (activity == 3) && (training_location_bronze == 2) ) {
    $("#tent_na").show();
    $("#sleeping_mat_na").show();
    $("#cooker_na").show();
    $("#gas_na").show();
  }  
  
  bought = '';
	priceb4 = price;
  if (itms[0]) {
    if (activity == 1) { 
      price = price + 5;
    } else if (activity == 2) {
      if (level == 1) price = price + 5;
      if (level == 2) price = price + 10;
      if (level == 3) price = price + 10;
    } else if (activity == 3) {
	  if (level == 1 && training_location_bronze == 1) price = price + 5;
	  if (level == 1 && training_location_bronze == 2)  price = price + 10;
     // if (level == 1) price = price + 10;
      if (level == 2) price = price + 10;
      if (level == 3) price = price + 15;
    };
  }
	if (priceb4 != price) {
	  bought = bought + 'pack:'+(price-priceb4)+'|';
	};  

	priceb4 = price;
  if (itms[1]) {
    if (activity == 1) { 
      if (level == 1) price = price + 15;
      if (level == 2) price = price + 15;
    } else if (activity == 2) {
      if (level == 1) price = price + 15;
      if (level == 2) price = price + 20;
      if (level == 3) price = price + 20;
    } else if (activity == 3) {
      
	  if (level == 1 && training_location_bronze == 1) price = price + 15;
	  
	  if (level == 2) price = price + 20;
      if (level == 3) price = price + 25;
    };
  }  
	if (priceb4 != price) {
	  bought = bought + 'tent:'+(price-priceb4)+'|';
	};  
	
	priceb4 = price;
  if (itms[2]) {
    if (activity == 1) { 
      price = price + 10;
    } else if (activity == 2) {
      price = price + 10;
    } else if (activity == 3) {
      if (level == 1) price = price + 10;
      if (level == 2) price = price + 10;
      if (level == 3) price = price + 15;
    };
  }  
	if (priceb4 != price) {
	  bought = bought + 'sleeping bag:'+(price-priceb4)+'|';
	};  
	
	priceb4 = price;
  if (itms[3]) {
    if (activity == 1) { 
      price = price + 1;
    } else if (activity == 2) {
      if (level == 1) price = price + 1;
      if (level == 2) price = price + 2;
      if (level == 3) price = price + 2;
    } else if (activity == 3) {
	  
	  if (level == 1 && training_location_bronze == 1) price = price + 1;
		
      if (level == 2) price = price + 2;
      if (level == 3) price = price + 3;
    };
  }  
	if (priceb4 != price) {
	  bought = bought + 'sleeping mat:'+(price-priceb4)+'|';
	};  
	
	priceb4 = price;
  if (itms[4]) {
    if (activity == 1) { 
      price = price + 2;
    } else if (activity == 2) {
      if (level == 1) price = price + 2;
      if (level == 2) price = price + 4;
      if (level == 3) price = price + 4;
    } else if (activity == 3) {
	  if (level == 1 && training_location_bronze == 1) price = price + 2;
      if (level == 2) price = price + 4;
      if (level == 3) price = price + 4;
    };
  }  
	if (priceb4 != price) {
	  bought = bought + 'cooker:'+(price-priceb4)+'|';
	};  
	
	priceb4 = price;
  if (itms[5]) {
    if (activity == 1) { 
      price = price + 5;
    } else if (activity == 2) {
      if (level == 1) price = price + 5;
      if (level == 2) price = price + 6;
      if (level == 3) price = price + 6;
    } else if (activity == 3) {
      if (level == 1) price = price + 5;
	  if (level == 2) price = price + 6;
      if (level == 3) price = price + 6;
    };
  }  
	if (priceb4 != price) {
	  bought = bought + 'pots:'+(price-priceb4)+'|';
	};  
	
	priceb4 = price;
  if (itms[6]) {
    if (activity == 1) { 
      price = price + 8;
    } else if (activity == 2) {
      price = price + 8;      
    } else if (activity == 3) {
	  if (level == 1 && training_location_bronze == 1) price = price + 8;	
      if (level == 2) price = price + 8;
      if (level == 3) price = price + 8;
    };
  }  
  
  if (priceb4 != price) {
	  bought = bought + 'gas:'+(price-priceb4)+'|';
	};  
	
  $("#cart_contents").html(bought);
  cartsubtot = price.toFixed(2);
  $("#cart_subtotal").html("$"+cartsubtot);
  $("#cart_subtotal_s").html("$"+cartsubtot);
  
  var joinpps = '';
  
  if ($("#joinpps").val() == 1) {	 
    joinpps = 10;
  } else {   
    joinpps = 0;
  }
  
  p = joinpps.toFixed(2);
  
  $("#joinpps_subtotal_s").html("$"+p);
  
  price = parseFloat(cartsubtot) + parseFloat(subtot) + parseFloat(joinpps);

  p = price.toFixed(2);
  $("#totalprice").html("$"+p); 
  
}
