function reg_change(num,price,max_num,plus_added,price_light,plus_added_light){
if($("#loc_"+num).val()=="관내"){
$("#loc_det_"+num).empty();
$("#loc_det_"+num).append(''+
''+
''+
''+
''+
''+
''+
''+
''+
''+
''+
'');
}else{
$("#loc_det_"+num).empty();
$("#loc_det_"+num).append(''+
''+
''+
''+
'');
}
if($("input[name='light[]']:checked").val()=="n"){
var plus_price = 0;
$('select[id^="loc_"]').each(function(index){
if($(this).val()=="관외"){
plus_price += plus_added;
}
});
if($("#num_select").val()>max_num){
var ll = number_format($("#num_select").val()*price+plus_price);
$("#total_price_tag").text(ll+"원");
}else{
$("#total_price_tag").text(number_format(max_num*price+plus_price)+"원");
}
} else {
var plus_price = 0;
$('select[id^="loc_"]').each(function(index){
if($(this).val()=="관외"){
plus_price += plus_added_light;
}
});
if($("#num_select").val()>max_num){
var ll = number_format($("#num_select").val()*price_light+plus_price);
$("#total_price_tag").text(ll+"원");
}else{
$("#total_price_tag").text(number_format(max_num*price_light+plus_price)+"원");
}
}
}
function num_change(price,max_num,plus_added,price_light,plus_added_light,week){
if($("#num_select").val() > $("#reg_info tr").length ){
var alr = ($("#reg_info tr").length+1);
var add_num = $("#num_select").val() - $("#reg_info tr").length;
for( var mn = 0 ; mn < add_num ; mn ++ ) {
if(week=="관외"){
$("#reg_info tbody").append('
'+
'신청자'+alr+' | '+
''+
''+
''+
' | '+
'
');
}else{
$("#reg_info tbody").append(''+
'신청자'+alr+' | '+
''+
''+
''+
' | '+
'
');
}
alr++;
}
} else {
var alr = $("#reg_info tr").length;
var sub_num = $("#reg_info tr").length - $("#num_select").val();
for( var mn = 0 ; mn < sub_num ; mn ++ ) {
$("#reg_info tr").last().remove();
}
}
if($("input[name='light[]']:checked").val()=="n"){ // 사용 안할 때...
var plus_price = 0;
$('select[id^="loc_"]').each(function(index){
if($(this).val()=="관외"){
plus_price += plus_added;
}
});
if($("#num_select").val()>max_num){
var ll = number_format($("#num_select").val()*price+plus_price);
$("#total_price_tag").text(ll+"원");
} else {
$("#total_price_tag").text(number_format(max_num*price+plus_price)+"원");
}
} else { // 사용할 경우...
var plus_price = 0;
$('select[id^="loc_"]').each(function(index){
if($(this).val()=="관외"){
plus_price += plus_added_light;
}
});
if($("#num_select").val()>max_num){
var ll = number_format($("#num_select").val()*price_light+plus_price);
$("#total_price_tag").text(ll+"원");
} else {
$("#total_price_tag").text(number_format(max_num*price_light+plus_price)+"원");
}
}
}
function number_format( number ) {
var nArr = String(number).split('').join(',').split('');
for( var i=nArr.length-1, j=1; i>=0; i--, j++) if( j%6 != 0 && j%2 == 0) nArr[i] = '';
return nArr.join('');
}