<?php
//   include_once dirname(__FILE__) . '/elements/header.php';
   $SEARCH = $_SESSION[$controller->defaultStore]['search'];
   $months = __('months', true);
   $short_days = __('short_days', true);
   ksort($months);
   ksort($short_days);
   $week_start = isset($tpl['option_arr']['o_week_start']) && in_array((int) $tpl['option_arr']['o_week_start'], range(0,6)) ? (int) $tpl['option_arr']['o_week_start'] : 0;
   
   ?>
  
    <style>
        
        .pac-container {
            background-color: #fff;
            position: absolute!important;
            z-index: 1000;
            border-radius: 2px;
            border-top: 1px solid #d9d9d9;t
            font-family: Arial, sans-serif;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
            -moz-box-sizing: border-box;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            overflow: hidden;
            /*display:inline-block !important;*/
        }
        
        .pac-item{
            cursor: default;
            padding: 0 18px;
            text-overflow: ellipsis;
            white-space: normal;
            line-height: 20px;
            text-align: left;
            border: 1px solid #e6e6e6;
            font-size: 11px;
            color: gray;
            /*padding-top:20px !important;*/
        }
        .pac-item-query {
            font-size: 13px;
            padding-right: 3px;
            color: #000;
        }
        .pac-item-query:after {
            content:"\A";
            white-space: pre;
         }

        .pac-item:hover {
            background-color: #fafafa;
        }
        .pac-item-selected,
        .pac-item-selected:hover {
            background-color: #ebf2fe;
        }
        .pac-matched {
            font-weight: 700;
        }
        .pac-icon {
            width: 15px;
            height: 20px;
            margin-right: 7px;
            margin-top: 1px;
            display: inline-block;
            vertical-align: top;
            background-image: url(https://maps.gstatic.com/mapfiles/api-3/images/autocomplete-icons.png);
            background-size: 34px;
        }
        .pac-icon-marker {
            margin: 1px 0px -3px -15px;
        }
        .pac-item-selected .pac-icon-marker {
            background-position: 18px;
        }
        .pac-placeholder {
            color: gray
        }
        .pac-container{
            /*display:block !important;*/
        }
        .pac-logo{
            /*display:block !important;*/
        }
        
    </style>
    

<div class="pjTbs-head">
	<div class="row">
		<div class="col-sm-4 col-xs-8">
		
		</div>
		<div class="col-sm-8 col-xs-12 text-right pull-right">
			<div class="btn-group btnn">
				<?php
				if(!$controller->isFrontLogged())
				{
    				?>
      				<button type="button" class="btn btn-default pjCssLogin"><?php __('front_btn_login');?></button>
      				<?php
				}else{
				    ?>
      				<button type="button" class="btn btn-default pjTbsProfile"><?php __('front_btn_profile');?></button>
      				<button type="button" class="btn btn-default pjTbsReservations"><?php __('front_btn_reservations');?></button>
      				<button type="button" class="btn btn-default pjCssLogout"><?php __('front_btn_logout');?></button>
      				<?php
				}
      			?>
			</div>
			<?php if ((!isset($_GET['hide']) || (int) $_GET['hide'] === 0) && isset($tpl['locale_arr']) && is_array($tpl['locale_arr']) && count($tpl['locale_arr']) > 1) : ?>
    		<?php
    		$selected_title = null;
    		$selected_src = NULL;
    		foreach ($tpl['locale_arr'] as $locale)
    		{
    			if ($controller->getLocaleId() == $locale['id'])
    			{
    				$selected_title = $locale['language_iso'];
    				$lang_iso = explode("-", $selected_title);
    				if(isset($lang_iso[1]))
    				{
    					$selected_title = $lang_iso[1];
    				}
    				if (!empty($locale['flag']) && is_file(PJ_INSTALL_PATH . $locale['flag']))
    				{
    					$selected_src = PJ_INSTALL_URL . $locale['flag'];
    				} elseif (!empty($locale['file']) && is_file(PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'])) {
    					$selected_src = PJ_INSTALL_URL . PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'];
    				}
    				break;
    			}
    		}
    		?>
			<div class="btn-group pull-right pjTbsLangaugeSelector">
				<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					<img src="<?php echo $selected_src; ?>" alt="">
					<?php echo $selected_title; ?>
					<span class="caret"></span>
				</button>

				<ul class="dropdown-menu">
					<?php
					foreach ($tpl['locale_arr'] as $locale)
					{
						$selected_src = NULL;
						if (!empty($locale['flag']) && is_file(PJ_INSTALL_PATH . $locale['flag']))
						{
							$selected_src = PJ_INSTALL_URL . $locale['flag'];
						} elseif (!empty($locale['file']) && is_file(PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'])) {
							$selected_src = PJ_INSTALL_URL . PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'];
						}
						?>
						<li<?php echo $controller->getLocaleId() == $locale['id'] ? ' active' : NULL; ?>>
							<a href="#" class="pjTbsLocale" data-id="<?php echo $locale['id']; ?>" data-dir="<?php echo $locale['dir']; ?>">
								<img src="<?php echo $selected_src; ?>" alt="">
								<?php echo pjSanitize::html($locale['name']); ?>
							</a>
						</li>
						<?php
					}
					?>
				</ul>
			</div>
    		</div><!-- /.col-sm-4 -->
    		<?php endif;?>
		</div>
	</div><!-- /.row -->
</div><!-- /.pjTbs-head -->

<script language="javascript" type="text/javascript">
    function abc(){
        // var a=("The URL of this page is: " + window.location.href);
        // alert(a);
        // var element = document.getElementById('get_data');
        // var dataID = element.getAttribute('data-id');
        var type=document.getElementById('get_data').value;
        // alert(type);
        if(type == "1"){
            window.location = "http://localhost/varunsir/aziz/TaxiBooking";
        }
        else if(type == "2"){
            window.location = "http://localhost/varunsir/aziz/TaxiBooking/en";
        }
    }

</script>

    
<div class="pjTbs-body">
   <div class="tab-content">
      
        <div class="tabbable">
            
            <!-- Only required for left/right tabs -->
            <ul class="nav nav-tabs" id="myTab">
                <li class="list_color active"><a href="#tab1" data-toggle="tab" id="t_btn_1" onclick="tab_1()"><?php __('front_To_Airport');?></a></li>
                <li class="list_color"><a href="#tab2" data-toggle="tab" id="t_btn_2" onclick="tab_2()"><?php __('front_from_airport');?></a></li>
                <li class="list_color"><a href="#tab3" data-toggle="tab" id="t_btn_3" onclick="tab_3()"><?php __('front_returned');?></a></li>
            </ul>
        </div>
        <form id="pjTbsSearchForm_<?php echo $_GET['index'];?>" action="#" method="post" class="pjTbsSearchForm">
            <input type="hidden" name="tbs_search" value="1"/>
            <div id="pjTbsCalendarLocale" style="display: none;" data-months="<?php echo implode("_", $months);?>" data-days="<?php echo implode("_", $short_days);?>" data-fday="<?php echo $week_start;?>"></div>
            <input type="hidden" id="checked_type" name="check_type" value=" <?php echo isset($SEARCH['check_type']) ? pjSanitize::clean($SEARCH['check_type']) : NULL;?> " class="form-control pjTbsAddress">
            <input type="hidden" id="switched_button" name="switch_button" value="<?php echo isset($SEARCH['switch_button']) ? pjSanitize::clean($SEARCH['switch_button']) : NULL;?>" class="form-control pjTbsAddress">
         
            
                <div class="tab-pane active" id="tab1">
                    <!-- Zum Flughafen -->
                    <div class="pjTbs-box">
                        <div class="row">
                            <!----------------------------------------- TAB 1 ----------------------------------------------->
                            <h4 style="margin: -10px 0 0 15px; padding:2px 0 5px 0;" id="buchung">Buchung / Preisanfrage</h4>
                            <h4 style="margin: -10px 0 0 15px; padding:2px 0 5px 0; display:none;" id="booking">Booking / Price inquiry</h4>
                            
                            <div class="col-sm-6 col-xs-12" id="q1">
                                <label class="control-label" style="font-size:10px;"><?php __('front_pickup_address');?></label>
                                <div class="form-group">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                        </span>
                                        <input type="text" id="pickup_address1_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000)">    
                                        <span class="input-group-addon">
                                           <i class="fa fa-map-marker" id="testing" onclick="showPosition();" style="font-size:26px;color:red"></i>
                                        </span>
                                        <!--<span class="input-group-addon">-->
                                        <!--    <span class="glyphicon glyphicon-plus" onclick="ShowExtraPickup();" style="font-size:16px" aria-hidden="true"></span>-->
                                        <!--</span>-->
                                    </div>
                                    <div class="help-block with-errors">
                                        <ul class="list-unstyled"></ul>
                                    </div>
                                </div>
                                
                                <!--Zum Extra Pickup Points -->
                                <div class="row" id="extra_pickup_1" style="display:none;">
                                    <div class="col-md-12 col-sm-6 col-xs-12">
                                        <div class="form-group">
                                            <div class="input-group">
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                </span>
                                                <input type="text" id="pickup_address5_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-plus" onclick="plus_extra_pickup();" style="font-size:16px" aria-hidden="true"></span>
                                                </span>
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_1();" style="font-size:16px" aria-hidden="true"></span>
                                                </span>
                                            </div>
                                            <div class="help-block with-errors">
                                                <ul class="list-unstyled"></ul>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                </div>
                                
                                <div class="row" id="extra_pickup_2" style="display:none;">
                                    <div class="col-md-12 col-sm-6 col-xs-12">
                                        <div class="form-group">
                                            <div class="input-group">
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                </span>
                                                <input type="text" id="pickup_address6_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_2();" style="font-size:16px" aria-hidden="true"></span>
                                                </span>
                                            </div>
                                            <div class="help-block with-errors">
                                                <ul class="list-unstyled"></ul>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                </div>
                                
                                <!-- Zum Extra Pickup Points -->
                                
                                <label class="control-label" style="font-size:10px;"><?php __('front_dropoff_address');?></label>
                                <div class="form-group">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-plane" style="font-size:16px" aria-hidden="true"></span>
                                        </span>
            
                                        <select id="return_address1_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['return_address']) ? pjSanitize::clean($SEARCH['return_address']) : NULL;?>"  class="form-control pjTbsAddress" data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000);"> 
                                            <option value="Hugo-Eckener-Ring, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport - Terminal -1 </option>
                                            <option value="Terminal 2, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport – Terminal -2</option>
                                            <option value="The Squaire (Airrail, 60549 Frankfurt am Main">FRA - Frankfurt/Airport – Fernbahnhof - The Squaire</option>
                                            <option value="Am Hauptbahnhof, 60329 Frankfurt am Main">FFM – Frankfurt/Main -  Hauptbahnhof - HBF</option>
                                            <option value="Messe Frankfurt, Ludwig-Erhard-Anlage 1, 60327">FFM - Frankfurt/Main - Messe</option>
                                            <option value="Flughafen Frankfurt-Hahn">HHN - Hahn Airport</option>
                                        </select>
                                        
                                    </div>
                                    <div class="help-block with-errors">
                                        <ul class="list-unstyled"></ul>
                                    </div>
                                </div>
    
                                <script>
                                    // const input = document.getElementById("return_address1_<?php echo $_GET['index'];?>");
                                    //     input.addEventListener('click', () => {
                                    //         if (input.value) {
                                    //          input.value = "";
                                    //         }
                                    //     });
                                </script>
                            </div>
                            <!----------------------------------------- TAB 2 ----------------------------------------------->
                            <div class="tab-pane" id="tab2">
                                <div class="col-sm-6 col-xs-12" id="q2" style="display:none;">
                                    <label class="control-label" style="font-size:10px;"><?php __('front_pickup_address');?></label>
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-plane" style="font-size:16px" aria-hidden="true"></span>
                                            </span>
                                            <select id="return_address2_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['return_address']) ? pjSanitize::clean($SEARCH['return_address']) : NULL;?>" class="form-control pjTbsAddress" data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000);">    
                                                <option value="Hugo-Eckener-Ring, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport - Terminal -1 </option>
                                                <option value="Terminal 2, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport - Terminal -2</option>
                                                <option value="The Squaire (Airrail, 60549 Frankfurt am Main">FRA - Frankfurt/Airport - Fernbahnhof - The Squaire</option>
                                                <option value="Am Hauptbahnhof, 60329 Frankfurt am Main">FFM - Frankfurt/Main -  Hauptbahnhof - HBF</option>
                                                <option value="Messe Frankfurt, Ludwig-Erhard-Anlage 1, 60327">FFM - Frankfurt/Main - Messe</option>
                                                <option value="Flughafen Frankfurt-Hahn">HHN - Hahn Airport</option>
                                            </select>
                                            
                                            <!--<span class="input-group-addon">-->
                                            <!--    <span class="glyphicon glyphicon-plus" onclick="ShowExtraPickup_2();" style="font-size:16px" aria-hidden="true"></span>-->
                                            <!--</span>-->
                                        </div>
                                        <div class="help-block with-errors">
                                            <ul class="list-unstyled"></ul>
                                        </div>
                                    </div>
                                    
                                    <!-- Vom Extra Pickup Points -->
                                    <div class="row" id="extra_pickup_3" style="display:none;">
                                        <div class="col-md-12 col-sm-6 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="pickup_address7_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                    
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-plus" onclick="plus_extra_pickup_2();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_3();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                    </div>

                                    <div class="row" id="extra_pickup_4" style="display:none;">
                                        <div class="col-md-12 col-sm-6 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="pickup_address8_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                    
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_4();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                    </div>
                                    <!-- Vom Extra Pickup Points -->
                                    
                                    <label class="control-label" style="font-size:10px;"><?php __('front_dropoff_address');?></label>
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                            </span>
                                            <input type="text" id="pickup_address2_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000);"> 
                                            <span class="input-group-addon">
                                                <i class="fa fa-map-marker" onclick="showPosition();" style="font-size:26px;color:red"></i> 
                                            </span>
                                        </div>
                                        <div class="help-block with-errors">
                                            <ul class="list-unstyled"></ul>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!----------------------------------------- TAB 3 ----------------------------------------------->
                            <div class="tab-pane" id="tab3">
                                <input type="hidden" id="optioned_button" name="option_button" value="<?php echo isset($SEARCH['option_button']) ? pjSanitize::clean($SEARCH['option_button']) : NULL;?>" class="form-control pjTbsAddress">
         
                                <div class="col-sm-6 col-xs-12 active" id="q3" value="0" style="display:none;">
                                    <label class="control-label" style="font-size:10px;"><?php __('front_pickup_address');?></label>
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                            </span>
                                            <input type="text" id="pickup_address3_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress " data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000);">    
                                            <span class="input-group-addon">
                                                <i class="fa fa-map-marker" onclick="showPosition();" style="font-size:26px;color:red"></i>
                                            </span>
                                            <span class="input-group-addon">
                                                <i class="fa fa-refresh" id="t_btn_4" value="1" onclick="tab_4();" style="font-size:26px;color:red"></i>
                                            </span>
                                            <!--<span class="input-group-addon">-->
                                            <!--    <span class="glyphicon glyphicon-plus" onclick="ShowExtraPickup_3();" style="font-size:16px" aria-hidden="true"></span>-->
                                            <!--</span>-->
                                        </div>
                                        <div class="help-block with-errors">
                                            <ul class="list-unstyled"></ul>
                                        </div>
                                    </div>
                                    
                                    <!-- HIN Extra Pickup Points Part 1 -->
                                    <div class="row" id="extra_pickup_5" style="display:none;">
                                        <div class="col-md-12 col-sm-6 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="pickup_address9_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                    
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-plus" onclick="plus_extra_pickup_3();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_5();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                    </div>
                                    
                                    <div class="row" id="extra_pickup_6" style="display:none;">
                                        <div class="col-md-12 col-sm-6 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="pickup_address10_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                    
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_6();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                    </div>
                                    <!-- Hin Extra Pickup Points Part 1 -->
                                    
                                    <label class="control-label" style="font-size:10px;"><?php __('front_dropoff_address');?></label>
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-plane" style="font-size:16px" aria-hidden="true"></span>
                                            </span>
                                            <select id="return_address3_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['return_address']) ? pjSanitize::clean($SEARCH['return_address']) : NULL;?>" class="form-control pjTbsAddress" data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000);"> 
                                                <!--<option>Select Your Dropoff Address</option>-->
                                                <option value="Hugo-Eckener-Ring, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport - Terminal -1 </option>
                                                <option value="Terminal 2, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport - Terminal -2</option>
                                                <option value="The Squaire (Airrail, 60549 Frankfurt am Main">FRA - Frankfurt/Airport - Fernbahnhof - The Squaire</option>
                                                <option value="Am Hauptbahnhof, 60329 Frankfurt am Main">FFM - Frankfurt/Main -  Hauptbahnhof - HBF</option>
                                                <option value="Messe Frankfurt, Ludwig-Erhard-Anlage 1, 60327">FFM - Frankfurt/Main - Messe</option>
                                                <option value="Flughafen Frankfurt-Hahn">HHN - Hahn Airport</option>
                                            </select>
                                            
                                        </div>
                                        <div class="help-block with-errors">
                                            <ul class="list-unstyled"></ul>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="col-sm-6 col-xs-12 " id="q4" value="1" style="display:none;">
                                    <label class="control-label" style="font-size:10px;"><?php __('front_pickup_address');?></label>
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-plane" style="font-size:16px" aria-hidden="true"></span>
                                            </span>
                                            <select id="return_address4_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['return_address']) ? pjSanitize::clean($SEARCH['return_address']) : NULL;?>" class="form-control pjTbsAddress" data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000);"> 
                                                <!--<option>Select Your Dropoff Address</option>-->
                                                <option value="Hugo-Eckener-Ring, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport - Terminal -1 </option>
                                                <option value="Terminal 2, 60549 Frankfurt am Main, Germany">FRA - Frankfurt/Airport - Terminal -2</option>
                                                <option value="The Squaire (Airrail, 60549 Frankfurt am Main">FRA - Frankfurt/Airport - Fernbahnhof - The Squaire</option>
                                                <option value="Am Hauptbahnhof, 60329 Frankfurt am Main">FFM - Frankfurt/Main -  Hauptbahnhof - HBF</option>
                                                <option value="Messe Frankfurt, Ludwig-Erhard-Anlage 1, 60327">FFM - Frankfurt/Main - Messe</option>
                                                <option value="Flughafen Frankfurt-Hahn">HHN - Hahn Airport</option>
                                            </select>
                                            
                                            <!--<span class="input-group-addon">-->
                                            <!--    <span class="glyphicon glyphicon-plus" onclick="ShowExtraPickup_4();" style="font-size:16px" aria-hidden="true"></span>-->
                                            <!--</span>-->
                                            
                                        </div>
                                        <div class="help-block with-errors">
                                            <ul class="list-unstyled"></ul>
                                        </div>
                                    </div>
                                    
                                    <!-- Hin Extra Pickup Points Part 2 -->
                                    <div class="row" id="extra_pickup_7" style="display:none;">
                                        <div class="col-md-12 col-sm-6 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="pickup_address11_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                    
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-plus" onclick="plus_extra_pickup_4();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_7();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                    </div>
                                    
                                    <div class="row" id="extra_pickup_8" style="display:none;">
                                        <div class="col-md-12 col-sm-6 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="pickup_address12_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress" onchange="setTimeout(path_change, 3000)">    
                                                    
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-minus" onclick="removeExtraPickup_8();" style="font-size:16px" aria-hidden="true"></span>
                                                    </span>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-6 col-xs-6 col-md-6"></div>
                                    </div>
                                    <!-- Hin Extra Pickup Points Part 2 -->
                                    
                                    <label class="control-label" style="font-size:10px;"><?php __('front_dropoff_address');?></label>
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-map-marker" style="font-size:16px" aria-hidden="true"></span>
                                            </span>
                                            <input type="text" id="pickup_address4_<?php echo $_GET['index'];?>" name="" value="<?php echo isset($SEARCH['pickup_address']) ? pjSanitize::clean($SEARCH['pickup_address']) : NULL;?>" class="form-control pjTbsAddress " data-msg-required="<?php __('front_required_field');?>" required onchange="setTimeout(path_change, 3000);">    
                                            <span class="input-group-addon">
                                                <i class="fa fa-map-marker" onclick="showPosition();" style="font-size:26px;color:red"></i>
                                            </span>
                                            <span class="input-group-addon">
                                                <i class="fa fa-refresh"  onclick="tab_3();" style="font-size:26px;color:red"></i>
                                                
                                            </span>
                                        </div>
                                        <div class="help-block with-errors">
                                            <ul class="list-unstyled"></ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="col-sm-6 col-xs-12">
                                <label style="font-size:10px;"><?php __('front_passengers');?></label>
                                <div class="form-group">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                                        </span>
                                        <div class="btn-group pjTbs-spinner" role="group" aria-label="...">
                                            <button type="button" class="btn pjTbs-spinner pjTbs-spinner-down" onclick="path_change_minus_pass()">-</button>
                                            <input type="text" id="passengers" name="passengers" class="pjTbs-spinner-result digits" maxlength="3" value="<?php echo isset($SEARCH['passengers']) ? $SEARCH['passengers'] : 1;?>" data-msg-digits="<?php __('front_digits_validation');?>" onchange="path_change()">
                                            <button type="button" class="btn pjTbs-spinner pjTbs-spinner-up" onclick="path_change_plus_pass()">+</button>
                                        </div>
                                    </div>
                                    <div class="help-block with-errors">
                                        <ul class="list-unstyled"></ul>
                                    </div>
                                </div>
                            </div>
                            <!-- /. --><!-- /.col-sm-6 -->
                            <div class="col-sm-6 col-xs-12 luggage">
                                <label style="font-size:10px;"><?php __('front_pieces_of_luggage');?></label>
                                <div class="form-group">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>
                                        </span>
                                        <div class="btn-group pjTbs-spinner" role="group" aria-label="...">
                                            <button type="button" class="btn pjTbs-spinner pjTbs-spinner-down" onclick="path_change_minus_lug()">-</button>
                                            <input type="text" id="luggage" name="luggage" class="pjTbs-spinner-result digits"  value="<?php echo isset($SEARCH['luggage']) ? $SEARCH['luggage'] : 1;?>" data-msg-digits="<?php __('front_digits_validation');?>" onchange="path_change()" >
                                            <button type="button" class="btn pjTbs-spinner pjTbs-spinner-up" onclick="path_change_plus_lug()">+</button>
                                        </div>
                                    </div>
                                    <div class="help-block with-errors">
                                      <ul class="list-unstyled"></ul>
                                    </div>
                                </div>
                            </div>
                            <!-- /.col-sm-6 -->
                    
                            <!-- /.col-sm-6 -->
                            <div class="col-sm-6 col-xs-12">
                                <label class="control-label" style="font-size:10px;"><?php __('front_date_time');?></label>
                                <div class="row">
                                    <div class="col-md-6 col-sm-7 col-xs-12">
                                        <div class="form-group">
                                            <div class="input-group date-pick">
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
                                                </span>
                                                <input type="text" name="booking_date" value="<?php echo isset($SEARCH['booking_date']) ? $SEARCH['booking_date'] : NULL;?>" class="form-control required" readonly="readonly" data-msg-required="<?php __('front_required_field');?>"/>
                                            </div>
                                            <div class="help-block with-errors">
                                                <ul class="list-unstyled"></ul>
                                            </div>
                                        </div>
                                    <!-- /. -->
                                    </div>
                                   <!-- /.col-sm-6 -->
                                    <div class="col-md-6 col-sm-5 col-xs-12">
                                        <div class="form-group">
                                            <div class="input-group time-pick">
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-time" aria-hidden="true"></span>
                                                </span>
                                                <input type="text" name="booking_time" value="<?php echo isset($SEARCH['booking_time']) ? $SEARCH['booking_time'] : NULL;?>" class="form-control required" readonly data-msg-required="<?php __('front_required_field');?>"/>
                                            </div>
                                            <div class="help-block with-errors">
                                                <ul class="list-unstyled"></ul>
                                            </div>
                                        </div>
                                        <!-- /. -->
                                    </div>
                                    <!-- /.col-sm-6 -->
                                    <label class="control-label" style="font-size:10px; margin-left:16px;" id="show_label_div"><?php __('front_return_date');?></label>
                                    <div id="show_date_div" style="display:none;">
                                        <div class="col-md-6 col-sm-7 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group date-pick">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="c_return" name="c_return_date" value="<?php echo isset($SEARCH['c_return_date']) ? $SEARCH['c_return_date'] : NULL;?>" 
                                                    class="form-control required" readonly data-msg-required="<?php __('front_required_field');?>"/>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                        <!-- /. -->
                                        </div>
                                       <!-- /.col-sm-6 -->
                                        <div class="col-md-6 col-sm-5 col-xs-12">
                                            <div class="form-group">
                                                <div class="input-group time-pick">
                                                    <span class="input-group-addon">
                                                        <span class="glyphicon glyphicon-time" aria-hidden="true"></span>
                                                    </span>
                                                    <input type="text" id="c_time" name="c_return_time" value="<?php echo isset($SEARCH['c_return_time']) ? $SEARCH['c_return_time'] : NULL;?>" class="form-control required" readonly data-msg-required="<?php __('front_required_field');?>"/>
                                                </div>
                                                <div class="help-block with-errors">
                                                    <ul class="list-unstyled"></ul>
                                                </div>
                                            </div>
                                            <!-- /. -->
                                        </div>
                                        <!-- /.col-sm-6 -->
                                    </div>
                                </div>
                                <!-- /.row -->
                            </div>
                            <!-- /.col-sm-6 -->
                            <div class="col-sm-6 col-xs-6" id="d1">
                                <label class="control-label" style="font-size:10px;"><?php __('front_distance');?>:</label>
                                    <div class="pjTbs-distance">
                                        <input type="text" id="pjTbsDistanceFiled" name="distance" value="<?php echo isset($SEARCH['distance']) ? $SEARCH['distance'] : NULL;?>" class="required number" data-msg-required="Please fill the form first" data-msg-number="<?php __('front_number_validation');?>" readonly="readonly" style="background-color:white; height:37px"/> <b>Km</b>
                                    </div>
                                    <div class="help-block with-errors">
                                       <ul class="list-unstyled"></ul>
                                    </div>
                            </div>

                            <div class="col-sm-6 col-xs-12" id="show_empty_div"></div>
                     
                            <!-- Price Code Start Here -->
                            <?php
                                //Fetech Taxi-Fleet data from DB
                                $q="SELECT * FROM taxi_fleets";
                                $conn=mysqli_connect('localhost', 'ninja', 'ninja', 'aziz_taxi_booking_live');
                                $receive=mysqli_query($conn,$q);
                                while($row=mysqli_fetch_array($receive)) { 
                                   $taxi_fleet_ids[]=$row['id']; 
                                   $taxi_fleet_start_fee[]=$row['start_fee'];
                                   $taxi_fleet_fee_per_person[]=$row['fee_per_person'];
                                   $taxi_fleet_passengers[]=$row['passengers']; 
                                   $taxi_fleet_luggage[]=$row['luggage'];
                                }
                                //Fetech Taxi-Fleet data from DB end
        
                                //Fetch Taxi_price data from DB
                                $q1="SELECT * FROM taxi_prices";
                                $receive=mysqli_query($conn,$q1);
                                while($row=mysqli_fetch_array($receive)) { 
                                   $taxi_prices_id[]=$row['id']; 
                                   $taxi_prices_fleet_id[]=$row['fleet_id']; 
                                   $taxi_prices_start[]=$row['start'];
                                   $taxi_prices_end[]=$row['end'];
                                   $taxi_prices_price[]=$row['price'];
                                }
                                 //Fetch Taxi_price data from DB end
                                 
                                 //Fetch Taxi_price data from DB end
                                ob_start(); //initiates output buffering
                                echo __('front_returned');
                                $front_return_value = ob_get_clean(); //returns the contents of the buffer and turns off output buffering
                            ?>
                     
                            <script>
                                function path_change_minus_pass(){
                                    var passengers =  Number(document.getElementById("passengers").value);
                                    var luggage =  Number(document.getElementById("luggage").value);
                                    var passenger = passengers - 1;
                                    path_change(passenger , luggage);
                                }
                                function path_change_plus_pass(){
                                    var passengers =  Number(document.getElementById("passengers").value);
                                    var luggage =  Number(document.getElementById("luggage").value);
                                    var passenger = passengers + 1;
                                    path_change(passenger , luggage);
                                }
                                function path_change_minus_lug(){
                                    var passengers =  Number(document.getElementById("passengers").value);
                                    var luggages =  Number(document.getElementById("luggage").value);
                                    var luggage = luggages - 1 ;
                                    path_change(passengers , luggage);
                                }
                                function path_change_plus_lug(){
                                    var passengers =  Number(document.getElementById("passengers").value);
                                    var luggages =  Number(document.getElementById("luggage").value);
                                    var luggage = luggages + 1 ;
                                    path_change(passengers , luggage);
                                }
                                function path_change(a,b){
                                    
                                    $distance =  Number(document.getElementById("pjTbsDistanceFiled").value);
                                    if(!a == 0){
                                        $onchange_passenger= a;
                                    }else{
                                        $onchange_passenger= Number(document.getElementById("passengers").value);
                                    }
                                    if(!b == 0){
                                        $onchange_luggage= b;
                                    }else{
                                        $onchange_luggage= Number(document.getElementById("luggage").value);
                                    }
                                   
                                    //Fetech Taxi-Fleet data
                                    var taxi_fleet_ids = <?php echo json_encode($taxi_fleet_ids); ?>;
                                    var taxi_fleet_start_fee= <?php echo json_encode($taxi_fleet_start_fee); ?>;
                                    var taxi_fleet_fee_per_person= <?php echo json_encode($taxi_fleet_fee_per_person); ?>;
                                    var taxi_fleet_passengers =<?php echo json_encode($taxi_fleet_passengers); ?>;
                                    var taxi_fleet_luggage = <?php echo json_encode($taxi_fleet_luggage); ?>;
                                    //Fetech Taxi-Fleet data
                                    var total_taxi_fleet_ids = []; //Required ids(Passangers/Luggage)
                                    for(var i = 0; i <=taxi_fleet_luggage.length; i++){
                                        if(($onchange_passenger <= taxi_fleet_passengers[i]) && ($onchange_luggage <= taxi_fleet_luggage[i] )){
                                            total_taxi_fleet_ids.push(Number(taxi_fleet_ids[i])); //Required ids(Passangers/Luggage)
                                        }
                                    }
                                        //alert(total_taxi_fleet_ids);
                                        //Fetech Taxi-prices data
                                        var taxi_prices_id = <?php echo json_encode($taxi_prices_id); ?>;
                                        var taxi_prices_fleet_id = <?php echo json_encode($taxi_prices_fleet_id); ?>;
                                        var taxi_prices_start = <?php echo json_encode($taxi_prices_start); ?>;
                                        var taxi_prices_end   = <?php echo json_encode($taxi_prices_end); ?>;
                                        var taxi_prices_price = <?php echo json_encode($taxi_prices_price); ?>;
                                        //Fetech Taxi-prices data
                                        // var selected_ids = []; //Selected ids
                                        var selected_starts = []; //Selected Start
                                        var selected_ends = []; //Selected End
                                        var selected_prices = []; //Selected Prices
                                        for(var a = 0; a < total_taxi_fleet_ids.length; a++){
                                            $test = total_taxi_fleet_ids[a];
                                            for(var i = 0; i < taxi_prices_id.length; i++){
                                                if($test == taxi_prices_fleet_id[i]){
                                                    // selected_ids.push(Number(taxi_prices_id[i])); //Selected ids
                                                    selected_starts.push(Number(taxi_prices_start[i])); //Selected Start 
                                                    selected_ends.push(Number(taxi_prices_end[i])); //Selected End
                                                    selected_prices.push(Number(taxi_prices_price[i])); //Selected Prices
                                                }
                                            }
                                        }
                                                                              
                                        var filtered_prices = []; //Filtered Prices
                                        for(var i = 0; i < selected_starts.length; i++){
                                            if(($distance >selected_starts[i]) && ($distance<= selected_ends[i] )){
                                                filtered_prices.push(Number(selected_prices[i])); //Filtered Prices
                                            }
                                        }
                                        var type=document.getElementById('checked_type').value;
                                        var $front_return_value = <?php echo json_encode($front_return_value); ?>;
                                        if(type == $front_return_value){
                                            var minimum_price = Math.min.apply(null, filtered_prices);
                                            $total = minimum_price * $distance*2;
                                            document.getElementById('price').value=parseFloat($total).toFixed(2);
                                        }else {
                                            var minimum_price = Math.min.apply(null, filtered_prices);
                                            $total = minimum_price * $distance;
                                            document.getElementById('price').value=parseFloat($total).toFixed(2);
                                        }
                                }
                            </script>

                            
                     
                            <div class="col-sm-6 col-xs-6 prices">
                                <label class="control-label" style="font-size:10px;"><?php __('front_price');?>:</label>
                                <div class="pjTbs-distance">
                                    <?php $val= min($taxi_prices_price);?>
                                    <input type="text" id="price" name="price" value="" readonly="readonly" style="font-weight:bold; background-color:white;height:37px;"/> <b>€</b>
                                </div>
                                <div class="help-block with-errors">
                                    <ul class="list-unstyled"></ul>
                                </div>
                            </div>
                        </div>
                        <!-- /.row -->

                 
                        <div class="pjTbs-body-actions" style="margin-top:-20px">		
                            <input value="<?php __('front_btn_book_a_taxi');?>"  class="btn btn-primary" type="submit" onclick="hide_info()">
                        </div>
                        <div class="pjTbs-map" id="pjTbsMapCanvas"></div> 
                    </div> <!-- .pjTbs-box  -->
                </div><!-- /.tab1 -->
            
        </form> <!-- /.form -->
    </div> 
</div> <!-- /.pjTbs-body -->

<script language="javascript" type="text/javascript">

    pjQ.$( document ).ready(function() {
        setTimeout(get_type, 1000);     
        var check_price=document.getElementById('price').value;
        if(check_price == 'NaN'){
            document.getElementById('price').value = 0.00;
        }
        
        if( "http://localhost/varunsir/aziz/TaxiBooking/" == window.location.href){
            document.getElementById("buchung").style.display = 'block';
            document.getElementById("booking").style.display = 'none';
        }
        else if("http://localhost/varunsir/aziz/TaxiBooking/en/" == window.location.href){
            document.getElementById("buchung").style.display = 'none';
            document.getElementById("booking").style.display = 'block';
        }
    });
    
    // function get_type(){
    //     var a=document.getElementById("t_btn_1").value="<?php __('front_To_Airport');?>";
    //     var b=document.getElementById("t_btn_2").value="<?php __('front_from_airport');?>";
    //     var c=document.getElementById("t_btn_3").value="<?php __('front_returned');?>";
    //     var d=document.getElementById("t_btn_4").value="<?php __('front_returned');?>";
    //     var type=document.getElementById('checked_type').value;
    //     var optioned_button=document.getElementById('optioned_button').value;
        
    //     alert(type);
    //     alert(optioned_button);
    //     if(type == d && optioned_button == "1"){
    //         tab_4();
    //     }else if(type == c && optioned_button == "0"){
    //         tab_3();
    //     }else if(type == b){
    //         tab_2();
    //     }else{
    //         tab_1();
    //     }
    // }
    
    function get_type() {
        var a = document.getElementById("t_btn_1").value = "<?php echo __('front_To_Airport');?>";
        var b = document.getElementById("t_btn_2").value = "<?php echo __('front_from_airport');?>";
        var c = document.getElementById("t_btn_3").value = "<?php echo __('front_returned');?>";
        var d = document.getElementById("t_btn_4").value = "<?php echo __('front_returned');?>";
        var type = document.getElementById('checked_type').value.trim(); // Trim spaces if needed
        var optioned_button = document.getElementById('optioned_button').value.trim(); // Trim spaces if needed
    
        console.log(type, optioned_button); // Debug line, check values in the console
    
        if (type == d && optioned_button == "1") {
            tab_4();
        } else if (type == c && optioned_button == "0") {
            tab_3();
        } else if (type == b) {
            tab_2();
        } else {
            tab_1();
        }
    }


    function tab_1(){
         document.getElementById("q1").style.display = 'block';
         document.getElementById("q2").style.display = 'none';
         document.getElementById("q3").style.display = 'none';
         document.getElementById("q4").style.display = 'none';
         document.getElementById('show_date_div').style.display='none';
         document.getElementById('show_label_div').style.display='none';
         document.getElementById('show_empty_div').style.display='block';
         
    
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").required = true;
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").required = true;
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").required = false;
         
         // name changing
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").name = "pickup_address";
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").name = "return_address";
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").name = "";
         
         //  Extras Name Given
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
        
         // reset form
         document.getElementById("pjTbsSearchForm_<?php echo $_GET['index'];?>").reset();
         document.getElementById("checked_type").value="<?php __('front_To_Airport');?>";
         document.getElementById("switched_button").value="0";
         document.getElementById("c_return").value="0";
         document.getElementById("c_time").value="0";
         
         document.getElementById("t_btn_1").style.backgroundColor = "#ecbd1c";
         document.getElementById("t_btn_2").style.backgroundColor = "white";
         document.getElementById("t_btn_3").style.backgroundColor = "white";
         path_change();
        var distance =  Number(document.getElementById("pjTbsDistanceFiled").value);
        if(distance==0){
            var check_price=document.getElementById('price').value;
            if(check_price=='NaN'){
                document.getElementById('price').value=0.00;
            }
        }
        TaxiBooking.calcRoute();
        show_info();
        
        // TaxiBooking.calcRoute();
        // setTimeout(path_change, 2000);
        
    }
    
    function tab_2(){
         document.getElementById("q1").style.display = 'none';
         document.getElementById("q2").style.display = 'block';
         document.getElementById("q3").style.display = 'none';
         document.getElementById("q4").style.display = 'none';
         document.getElementById('show_date_div').style.display='none';
         document.getElementById('show_label_div').style.display='none';
         document.getElementById('show_empty_div').style.display='block';
         
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").required = true;
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").required = true;
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").required = false;
         // name changing
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").name = "pickup_address";
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").name = "return_address";
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").name = "";
         
         //  Extras Name Given
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";

         
         // reset form
         document.getElementById("pjTbsSearchForm_<?php echo $_GET['index'];?>").reset();
         document.getElementById("checked_type").value="<?php __('front_from_airport');?>";
         document.getElementById("switched_button").value="0";
         document.getElementById("c_return").value="0";
         document.getElementById("c_time").value="0";
         
         document.getElementById("t_btn_1").style.backgroundColor = "white";
         document.getElementById("t_btn_2").style.backgroundColor = "#ecbd1c";
         document.getElementById("t_btn_3").style.backgroundColor = "white";
         path_change();
         var distance =  Number(document.getElementById("pjTbsDistanceFiled").value);
         if(distance==0){
            var check_price=document.getElementById('price').value;
                if(check_price=='NaN'){
                    document.getElementById('price').value=0.00;
                }
            }
            TaxiBooking.calcRoute();
            show_info();
            
            // TaxiBooking.calcRoute();
            // setTimeout(path_change, 2000);
    }
    
    function tab_3(){
         document.getElementById("q1").style.display = 'none';
         document.getElementById("q2").style.display = 'none';
         document.getElementById("q3").style.display = 'block';
         document.getElementById("q4").style.display = 'none';
         document.getElementById('show_date_div').style.display='block';
         document.getElementById('show_label_div').style.display='block';
         document.getElementById('show_empty_div').style.display='none';
        
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").required = true;
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").required = true;
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").required = false;
         
         // name changing
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").name = "pickup_address";
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").name = "return_address";
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").name = "";
         
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";

         
         
         // reset form
         document.getElementById("pjTbsSearchForm_<?php echo $_GET['index'];?>").reset();
         document.getElementById("checked_type").value="<?php __('front_returned');?>";
         document.getElementById("switched_button").value="<?php __('front_switch_button_1');?>";
         document.getElementById("optioned_button").value="0";
         
        
        //  document.getElementById("hidden_button_1").value="switch_button_1";
        //  document.getElementById("hidden_button_2").value="0";
    
         document.getElementById("t_btn_1").style.backgroundColor = "white";
         document.getElementById("t_btn_2").style.backgroundColor = "white";
         document.getElementById("t_btn_3").style.backgroundColor = "#ecbd1c";
         path_change();
         var distance =  Number(document.getElementById("pjTbsDistanceFiled").value);
         if(distance == 0){
            var check_price=document.getElementById('price').value;
                if(check_price == 'NaN'){
                    document.getElementById('price').value=0.00;
                }
            }
            TaxiBooking.calcRoute();
            show_info();
        //     TaxiBooking.calcRoute();
        // setTimeout(path_change, 2000);
    }
    
    function tab_4(){
         
         document.getElementById("q1").style.display = 'none';
         document.getElementById("q2").style.display = 'none';
         document.getElementById("q3").style.display = 'none';
         document.getElementById("q4").style.display = 'block';
         document.getElementById('show_date_div').style.display='block';
         document.getElementById('show_label_div').style.display='block';
         document.getElementById('show_empty_div').style.display='none';
         
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").required = false;
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").required = true;
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").required = true;
         
         // name changing
         document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address1_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address2_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("return_address3_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").name = "pickup_address";
         document.getElementById("return_address4_<?php echo $_GET['index'];?>").name = "return_address";
         
        
        //  Extras Name
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        //  document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        //  document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
         // reset form
         document.getElementById("pjTbsSearchForm_<?php echo $_GET['index'];?>").reset();
         document.getElementById("checked_type").value="<?php __('front_returned');?>";
         document.getElementById("switched_button").value="<?php __('front_switch_button_2');?>";
         document.getElementById("optioned_button").value="1";
         
        //  document.getElementById("hidden_button_1").value="0";
        //  document.getElementById("hidden_button_2").value="switch_button_2";
         
         document.getElementById("t_btn_1").style.backgroundColor = "white";
         document.getElementById("t_btn_2").style.backgroundColor = "white";
         document.getElementById("t_btn_3").style.backgroundColor = "#ecbd1c";
         path_change();
         var distance =  Number(document.getElementById("pjTbsDistanceFiled").value);
         if(distance == 0){
            var check_price=document.getElementById('price').value;
                if(check_price == 'NaN'){
                    document.getElementById('price').value=0.00;
                }
            }
            TaxiBooking.calcRoute();
            show_info();
        // TaxiBooking.calcRoute();
        // setTimeout(path_change, 2000);
    }
      
    function hide_info(){
        document.getElementById("contain_data1").style.display = 'none';
    }
   
    function show_info(){
        document.getElementById("contain_data1").style.display = 'block';
    }
    
    // Zum Extra pickup points
    function ShowExtraPickup() {
        
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "waypoint_zum_1";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_1");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '57px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }
    
    function plus_extra_pickup() {
        
        // document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "waypoint_zum_1";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "waypoint_zum_2";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_2");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '112px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }

    function removeExtraPickup_1(){
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
        var extraPickup1 = document.getElementById("extra_pickup_1").style.display='none';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '0px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }

    function removeExtraPickup_2(){
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
        var extraPickup1 = document.getElementById("extra_pickup_2").style.display='none';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '57px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }
    // Zum Extra pickup points
    
    // Vom Extra pickup points
    
    function ShowExtraPickup_2() {
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "waypoint_vom_1";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_3");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '57px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }

    function plus_extra_pickup_2() {
        
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        // document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "waypoint_vom_1";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "waypoint_vom_2";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_4");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '112px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }

    function removeExtraPickup_3(){
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
        var extraPickup1 = document.getElementById("extra_pickup_3").style.display='none';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '0px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }

    function removeExtraPickup_4(){
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
        var extraPickup1 = document.getElementById("extra_pickup_4").style.display='none';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '57px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }

    // Vom Extra pickup points
    
     // Hin Un Zuruck part_1

    function ShowExtraPickup_3() {
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "waypoint_hin_1";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_5");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '57px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        var distance =  Number(document.getElementById("pjTbsDistanceFiled").value);
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }

    function plus_extra_pickup_3() {
        
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
        // document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "waypoint_hin_1";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "waypoint_hin_2";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
        document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_6");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '112px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }

    function removeExtraPickup_5(){
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
        var extraPickup1 = document.getElementById("extra_pickup_5").style.display='none';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '0px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }

    function removeExtraPickup_6(){
        
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
         
        var extraPickup1 = document.getElementById("extra_pickup_6").style.display='none';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '57px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }

    // Hin Un Zuruck part 1
     
    // Hin Un Zuruck part 2

    function ShowExtraPickup_4() {
        
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "waypoint_hin_3";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_7");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '57px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        var distance =  Number(document.getElementById("pjTbsDistanceFiled").value);
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }

    function plus_extra_pickup_4() {
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").name = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").name = "";
        //  document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").name = "waypoint_hin_3";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").name = "waypoint_hin_4";
         
         document.getElementById("pickup_address5_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address6_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address7_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address8_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address9_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address10_<?php echo $_GET['index'];?>").value = "";
         document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value = "";
        
        var extraPickup1 = document.getElementById("extra_pickup_8");
        var luggage = document.querySelector(".luggage");

        // Check if the screen width is less than a specified breakpoint (e.g., 767px for mobile)
        if (window.innerWidth <= 767) {
            // If extra_pickup_1 is hidden, remove padding-top for luggage class
            if (extraPickup1.style.display === 'block' || extraPickup1.style.display === '') {
                luggage.style.paddingTop = '0px';
            } else {
                // If extra_pickup_1 is displayed, remove padding-top for luggage class (for consistency)
                luggage.style.paddingTop = '0px';
            }
        } else {
            // For desktop view, set padding-top for luggage class to 57px
            luggage.style.paddingTop = '112px';
        }

        // Toggle the display of extra_pickup_1
        if (extraPickup1.style.display === 'none' || extraPickup1.style.display === '') {
            extraPickup1.style.display = 'block';
        } else {
            extraPickup1.style.display = 'none';
        }
        if(distance == 0){
            var check_price=document.getElementById('price').value;
            if(check_price == 'NaN'){
                document.getElementById('price').value=0.00;
            }
        }
    }

    function removeExtraPickup_7(){
        var extraPickup1 = document.getElementById("extra_pickup_7").style.display='none';
        document.getElementById("pickup_address11_<?php echo $_GET['index'];?>").value='';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '0px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }

    function removeExtraPickup_8(){
        var extraPickup1 = document.getElementById("extra_pickup_8").style.display='none';
        document.getElementById("pickup_address12_<?php echo $_GET['index'];?>").value='';
        var luggage = document.querySelector(".luggage");
        luggage.style.paddingTop = '57px';
        TaxiBooking.calcRoute();
        setTimeout(path_change, 2000);
    }
    
    // Hin Un Zuruck part 2
   
 </script>
<div id="result" style="display:none;"></div>

 <script>
    // Set up global variable
    var result;
    function showPosition() {
		// Store the element where the page displays the result
        result = document.getElementById("result");

        // If geolocation is available, try to get the visitor's position
        if(navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
            result.innerHTML = "Getting the position information...";
        } else {
            alert("Sorry, your browser does not support HTML5 geolocation.");
        }
    };
    
    // Define callback function for successful attempt
    function successCallback(position) {
		var lat= result.innerHTML = position.coords.latitude + ", " + position.coords.longitude;
       	// document.getElementById('lat').value=lat;
       	geocodeLatLng(lat);
    }
    
    // Define callback function for failed attempt
    function errorCallback(error) {
        if(error.code == 1) {
            result.innerHTML = "You've decided not to share your position, but it's OK. We won't ask you again.";
        } else if(error.code == 2) {
            result.innerHTML = "The network is down or the positioning service can't be reached.";
        } else if(error.code == 3) {
            result.innerHTML = "The attempt timed out before it could get the location data.";
        } else {
            result.innerHTML = "Geolocation failed due to unknown error.";
        }
    }
    
    function geocodeLatLng(lat) {
        var geocoder = new google.maps.Geocoder();
        var input = lat;
        const latlngStr = input.split(",", 2);
        const latlng = {
          lat: parseFloat(latlngStr[0]),
          lng: parseFloat(latlngStr[1]),
        };
        geocoder
          .geocode({ location: latlng })
          .then((response) => {
            if (response.results[0]) {
                var a=document.getElementById("t_btn_1").value="<?php __('front_To_Airport');?>";
                var b=document.getElementById("t_btn_2").value="<?php __('front_from_airport');?>";
                var c=document.getElementById("t_btn_3").value="<?php __('front_returned');?>";
                var d=document.getElementById("t_btn_4").value="<?php __('front_returned');?>";
                var optioned_button=document.getElementById('optioned_button').value;
                var type=document.getElementById('checked_type').value;
                
                if(type == d && optioned_button == "1"){
                    var convert_latlng=response.results[0].formatted_address;
                    var c=document.getElementById("pickup_address4_<?php echo $_GET['index'];?>").value=convert_latlng;
                    TaxiBooking.calcRoute();
                    setTimeout(path_change, 2000);
                }
                else if(type == c && optioned_button == "0"){
                    var convert_latlng=response.results[0].formatted_address;
                    var c=document.getElementById("pickup_address3_<?php echo $_GET['index'];?>").value=convert_latlng;
                    TaxiBooking.calcRoute();
                    setTimeout(path_change, 2000);
                } else if(type==b){
                    var convert_latlng=response.results[0].formatted_address;
                    var b=document.getElementById("pickup_address2_<?php echo $_GET['index'];?>").value=convert_latlng;
                    TaxiBooking.calcRoute();
                    setTimeout(path_change, 2000);
                }else{
                    var convert_latlng=response.results[0].formatted_address;
                    var a=document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").value=convert_latlng;
                    TaxiBooking.calcRoute();
                    setTimeout(path_change, 2000);
                    // alert(a);
                    // focusMethod();
                    // pjQ.$("#pickup_address1_<?php echo $_GET['index'];?>").trigger();
                    // TaxiBooking.bindSearch.call(a);
                    // TaxiBooking.calcRoute.call();
                    // setTimeout(test1, 1000);
                }
            } else {
              window.alert("No results found");
            }
          })
          .catch((e) => window.alert("Geocoder failed due to: " + e));
    }
    // focusMethod = function getFocus() {
    //   document.getElementById("pickup_address1_<?php echo $_GET['index'];?>").focus();
    // //   setTimeout(test1, 500);
    //   setTimeout(clickevent, 500);
    // }
    
    // $(document).keydown(function(event){
    //     if(event.keyCode == 13){                
    //       e.preventDefault();
    //       pjQ.$("#pickup_address1_<?php echo $_GET['index'];?>").trigger();
    //     }
    //       pjQ.$("#pickup_address1_<?php echo $_GET['index'];?>").submit();
    // });
    // function clickevent()
    // {    
       
    //     // let input = document.querySelector("input");
    //     // input.addEventListener('Keyup',(e)=> {
    //     //     if(e.Keycode === 13){
    //     //         alert('keypress triggered')
    //     //         e.target.value;
                
    //     //     }
    //     // })
    //     // var e = $.Event("keydown");
    //     // e.which = 13;
    //     // e.keyCode = 13;
    //     // $(document).trigger(e);
    //     e = jQuery.Event("keypress");
    //     e.which = 13 //choose the one you want
    //     pjQ.$("#pickup_address1_<?php echo $_GET['index'];?>").keypress(function(){
    //         alert('keypress triggered');
    //         e.target.value;
    //         TaxiBooking.calcRoute.call();
    //     }).trigger(e)
    // }
    
    // function test1(){
        
    //     var a=confirm("Press Enter to confirm your location");
        // alert('hello1');
        // var e = jQuery.Event("keypress");
        // e.which = 13; //enter keycode
        // e.keyCode = 13;
        // pjQ.$("#pickup_address1_<?php echo $_GET['index'];?>").trigger(e);
        // e = jQuery.Event("keypress");
        // e.which = 13 //choose the one you want
        // pjQ.$("#pickup_address1_<?php echo $_GET['index'];?>").keypress(function(){
        //     alert('keypress triggered')
        // }).trigger(e)
    // }
    
    // function test2(){
    //     alert('hello2');
    //     var e = jQuery.Event("keypress");
    //     e.which = 13; //enter keycode
    //     e.keyCode = 13;
    //     pjQ.$("#pickup_address1_<?php echo $_GET['index'];?>").trigger(e);
        
    // }
    
   
</script>