<?php 
error_reporting(0);
session_start();
$iatacode_fromcity 	 = $_SESSION['se_fromCity'] = $_GET['se_fromCity']; 
$iatacode_tocity 	 = $_SESSION['se_toCity'] = $_GET['se_toCity'];

$from_city 	 = $_SESSION['fromCity'] = $_GET['fromCity'];
$to_city 	 = $_SESSION['toCity'] = $_GET['toCity']; 

$searchdate  = $_SESSION['departure_date'] = $_GET['departure_date'];
$returnDate  = $_SESSION['return_date'] = $_GET['return_date'];
$adults      = $_SESSION['Adult']  = $_GET['Adult'];
$child       = $_SESSION['child']  = $_GET['child'];
$infants	 = $_SESSION['infant'] = $_GET['infant'];
$travelClass = $_SESSION['cabin']  = $_GET['cabin'];



?>
<?php include"search_results_header_engine.php"; ?>
<?php include"search_results_filter.php"; ?>
<div id="loader" class="center"></div>

<?php
require_once 'vendor/rmccue/requests/library/Requests.php';
Requests::register_autoloader();
$url = 'https://test.api.amadeus.com/v1/security/oauth2/token';
$auth_data = array(
'client_id' => 'KEUu3vZkAEYsCq8snJUzcUl3GPkThNrM',
'client_secret' => 'b4G93MTdvTF4Pot3',
'grant_type' => 'client_credentials'
);
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$requests_response = Requests::post($url, $headers, $auth_data);
$response_body = json_decode($requests_response->body, true);
$token = $response_body['access_token'];
$access_token = $token;
/*Search Flights Engine Starts Here*/
if(isset($access_token)){

if(isset($_GET['submit'])){
	
$departure   = $_GET['se_fromCity'];
$destination = $_GET['se_toCity'];
$searchdate  = $_GET['departure_date'];
$adults      = $_GET['Adult'];
$child       = $_GET['child'];
$infants	 = $_GET['infant'];
$travelClass = $_GET['cabin'];
$max = 10;

$timestamp     = strtotime($searchdate);
$depart_date   = date("Y-m-d", $timestamp);


$htpe = $_GET['hfTripType'];
if($htpe == '1'){
  $curl = curl_init();	
  curl_setopt_array($curl, array(
  CURLOPT_URL => "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=$departure&destinationLocationCode=$destination&departureDate=$depart_date&adults=$adults&children=$child&infants=$infants&travelClass=$travelClass&nonStop=false&currencyCode=USD&max=$max",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer $access_token"
  ),
));
}else{
  $htpe = $_GET['hfTripType'];
  if($htpe == '2'){
  $returnDate = $_GET['return_date'];
  $Returntimestamp     = strtotime($returnDate);
  $return_date   = date("Y-m-d", $Returntimestamp);
  
  $curl = curl_init();  
  curl_setopt_array($curl, array(
  CURLOPT_URL => "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=$departure&destinationLocationCode=$destination&departureDate=$depart_date&returnDate=$return_date&adults=$adults&children=$child&infants=$infants&travelClass=$travelClass&nonStop=false&currencyCode=USD&max=$max",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer $access_token"
  ),
));
}
}

$response = curl_exec($curl);
curl_close($curl);
$result = json_decode($response, true);
//echo "<pre>";
//print_r($result);die();

$count = $result['meta']['count'];

if($count == 0){
echo"
<div class='no-result-bx'>
	<div class='error-img'><img src='images/no-result-img.png'></div>
	<div class='error-cont'>
	<h2>Sorry! No Result Found</h2><br>
	<p>We have Searched more than million Flights Combination. We didn't find any Flights for Your Search.</p>
	<h5>Let Our Agents Help You Find The Best Flight Option!</h5>
	<h4>Call Now Toll Free</h4>
	<h1>+1-9999 888 777</h1>
	</div>
</div>";
}else{
foreach($result['data'] as $data){
	$dataId = $data['id'];
	$source = $data['source'];
	$leftSeats = $data['numberOfBookableSeats'];
	
	/*Flight Total Price Starts Here*/
	$priceCurrency = $data['price']['currency'];	
	$priceTotal = $data['price']['total'];
	$priceBase = $data['price']['base'];
	$priceGrandTotal = $data['price']['grandTotal'];
	$carrierCode = $data['itineraries'][0]['segments'][0]['carrierCode'];
	$countArry = count($data['itineraries'][0]['segments']);
	$travelClass = $data['travelerPricings'][0]['fareDetailsBySegment'][0]['class'];
	
	?>	
	<!--Single Result Starts Here-->
	<form action="flightPayment" method="get">
		<div class="flightDetailsBx" >
			<div class="flightLeft">
				<?php
				$counter 				= 0;
				$itinery_go 			= $data['itineraries'][0];
				$itinery_return 		= isset($data['itineraries'][1])?$data['itineraries'][1]:null;
				//foreach($data['itineraries'] as $itinery){
				$totalDuration = $data['itineraries'][0]['duration'];
				//$countSegment = count($itinery['segments'], 0); 	
				foreach($itinery_go['segments'] as $key => $itinerys){
					//$counts = $counter++;
					//$cc = count($counts);
													
					$departure = $itinerys['departure']['at'];
					$arrival   = $itinerys['arrival']['at'];
					$depTime   = date("H:i", strtotime($departure));
					$arrTime   = date("H:i", strtotime($arrival));
					
					$depDate   = date("Y-m-d", strtotime($departure));
					$arrDate   = date("Y-m-d", strtotime($arrival));
					
					$departDate 	= 	date("jM", strtotime($depDate));
					$arrvlDate 	= 	date("jM", strtotime($arrDate));
					
					
					
					//$time1 = $depTime;
					//$time2 = $arrTime;  
					list($hours, $minutes) = explode(':', $depTime);
					$startTimestamp = mktime($hours, $minutes);

					list($hours, $minutes) = explode(':', $arrTime);
					$endTimestamp = mktime($hours, $minutes);

					$seconds = $endTimestamp - $startTimestamp;
					if($seconds < 0) {
						$seconds+=60*60*24; 
					}
					$minutes = ($seconds / 60) % 60;
					$hours = round($seconds / (60 * 60));
					
					$depIata   = $itinerys['departure']['iataCode'];
					$arrIata   = $itinerys['arrival']['iataCode'];
					
					$CarrierCode  = $itinerys['carrierCode'];
					$aircraftCode = $itinerys['number'];
				
					?>
					<div class="flbx">
						<div class="flg-lft">
						<h5>
							DEPARTURE<span>-
							<?php echo "$CarrierCode $aircraftCode"; ?>
							</span>
						</h5>
						<div class="clearfix"></div>
				
						<img src="https://daisycon.io/images/airline/?width=60&height=25&color=&iata=<?php echo $carrierCode; ?>" style="padding-left:3px;padding-right:3px;border-radius:3px;border:1px solid #ddd"/>
						
						<h4><?php echo $depTime; ?> | <span id="depDate"><?php echo $departDate; ?></span></h4>
						
						<div class="clearfix"></div>
						<p>
							<?php
							$selectDepIata = "SELECT * FROM airport_list WHERE iatacode='$depIata'";
							$depIataQuery = mysqli_query($conn, $selectDepIata);
							$depIatas = mysqli_fetch_array($depIataQuery);
							$d_iata = $depIatas['iatacode'];
							$d_airport  = $depIatas['airport_name'];
							
							if($depIata == $d_iata){
								$depAirport = substr_replace($d_airport, "..", 34);
								echo"($depIata)$depAirport";
							}else{
								echo $depIata;
							}
							?>
						</p>
						
						</div>
						
						<div class="flg-cntr">
							<span>
							<?php
							if($minutes > 0){
							?>	
							<?php echo $hours; ?>h <?php echo $minutes; ?>m'
							<?php }else{ ?>
							<?php echo $hours?>hour'	
							<?php } ?>	
							&nbsp;&nbsp;&nbsp;<i class="fa fa-plane"></i>&nbsp;&nbsp;&nbsp;
							<strong>Non stop</strong>
							</span>
						</div>
						
						<div class="flg-rgt">
							<?php if($key==0){ ?>
								<span class="bagg"><i class="fa fa-briefcase"></i> Check-in baggage included!</span>
							<?php } ?>
							<div class="clearfix"></div>
							<br>
							<h4><?php echo $arrTime; ?> | <span id="arrDates"><?php echo $arrvlDate; ?></span></h4>
							<div class="clearfix"></div>
							<p>
								<?php
								$selectArrIata = "SELECT * FROM airport_list WHERE iatacode='$arrIata'";
								$arrIataQuery = mysqli_query($conn, $selectArrIata);
								$arrIatas   = mysqli_fetch_array($arrIataQuery);
								$a_iata    = $arrIatas['iatacode'];
								$a_airport = $arrIatas['airport_name'];
								
								if($arrIata == $a_iata){
									$arrAirport = substr_replace($a_airport, "..", 34);
									echo"($arrIata)$arrAirport";
								} else{
									echo $arrIata;
								}
								?>
							</p>
						</div>
					</div>
			
					<input type="hidden" name="carrier_Code[]" value="<?php echo $CarrierCode; ?><?php echo $aircraftCode; ?> " />
					<input type="hidden" name="airline_logo[]" value="https://daisycon.io/images/airline/?width=60&height=25&color=&iata=<?php echo $carrierCode; ?>" />
					<input type="hidden" name="dep_time[]" value="<?php echo $depTime; ?>" />
					<input type="hidden" name="arr_time[]" value="<?php echo $arrTime; ?>" />
					<input type="hidden" name="dep_date[]" value="<?php echo $depDate; ?>" />
					<input type="hidden" name="arr_date[]" value="<?php echo $arrDate; ?>" />
					<input type="hidden" name="dep_iata_city[]" value="(<?php echo $depIata; ?>)<?php echo $depAirport; ?> " />
					<input type="hidden" name="arr_iata_city[]" value="(<?php echo $arrIata; ?>)<?php echo $arrAirport; ?> " />
			        <input type="hidden" name="depIata[]" value="<?php echo $depIata; ?>" />
					<input type="hidden" name="arrIata[]" value="<?php echo $arrIata; ?>" />
					<?php
					if($minutes > 0){
					?>	
						<input type="hidden" name="trip_time[]" value="<?php echo $hours; ?>h <?php echo $minutes; ?>m'" />
					<?php } else{ ?>
						<input type="hidden" name="trip_time[]" value="<?php echo $hours; ?>hour'" />
					<?php } 
					
					foreach($result['dictionaries']['carriers'] as $key =>  $v3){
						if($key == $itinerys['carrierCode']){
					?>
						<input type="hidden" value="<?php echo $v3; ?>" name="airlineName[]" />
					<?php }
					} 
					?>								
					
			
			  
					<div style='width:100%;height:1px;margin:2px auto;background-color:#eee;'></div>
		<?php   } ?>
		<?php 
			// Return flight.
				foreach($itinery_return['segments'] as $key => $itinerys){
					//$counts = $counter++;
					//$cc = count($counts);
													
					$departure = $itinerys['departure']['at'];
					$arrival   = $itinerys['arrival']['at'];
					$depTime   = date("H:i", strtotime($departure));
					$arrTime   = date("H:i", strtotime($arrival));
					
					$depDate   = date("Y-m-d", strtotime($departure));
					$arrDate   = date("Y-m-d", strtotime($arrival));
					
					$departDate 	= 	date("jM", strtotime($depDate));
					$arrvlDate 	= 	date("jM", strtotime($arrDate));
					
					//$time1 = $depTime;
					//$time2 = $arrTime;  
					list($hours, $minutes) = explode(':', $depTime);
					$startTimestamp = mktime($hours, $minutes);

					list($hours, $minutes) = explode(':', $arrTime);
					$endTimestamp = mktime($hours, $minutes);

					$seconds = $endTimestamp - $startTimestamp;
					if($seconds < 0) {
						$seconds+=60*60*24; 
					}
					$minutes = ($seconds / 60) % 60;
					$hours = round($seconds / (60 * 60));
					
					$depIata   = $itinerys['departure']['iataCode'];
					$arrIata   = $itinerys['arrival']['iataCode'];
					
					$CarrierCode  = $itinerys['carrierCode'];
					$aircraftCode = $itinerys['aircraft']['code'];
				
					?>
					<div class="flbx">
						<div class="flg-lft">
						<h5>
							DEPARTURE<span>-
							<?php echo "$CarrierCode $aircraftCode"; ?>
							</span>
						</h5>
						<div class="clearfix"></div>
				
						<img src="https://daisycon.io/images/airline/?width=60&height=25&color=&iata=<?php echo $carrierCode; ?>" style="padding-left:3px;padding-right:3px;border-radius:3px;border:1px solid #ddd"/>
						
						<h4><?php echo $depTime; ?> | <span id="depDate"><?php echo $departDate; ?></span></h4>
						<div class="clearfix"></div>
						<p>
							<?php
							$selectDepIata = "SELECT * FROM airport_list WHERE iatacode='$depIata'";
							$depIataQuery = mysqli_query($conn, $selectDepIata);
							$depIatas = mysqli_fetch_array($depIataQuery);
							$d_iata = $depIatas['iatacode'];
							$d_airport  = $depIatas['airport_name'];
							
							if($depIata == $d_iata){
								$depAirport = substr_replace($d_airport, "..", 34);
								echo"($depIata)$depAirport";
							}else{
								echo $depIata;
							}
							?>
						</p>
						
						</div>
						
						<div class="flg-cntr">
							<span>
							<?php
							if($minutes > 0){
							?>	
							<?php echo $hours; ?>h <?php echo $minutes; ?>m'
							<?php }else{ ?>
							<?php echo $hours?>hour'	
							<?php } ?>	
							&nbsp;&nbsp;&nbsp;<i class="fa fa-plane"></i>&nbsp;&nbsp;&nbsp;
							<strong>Non stop</strong>
							</span>
						</div>
						
						<div class="flg-rgt">
							<?php if($key==0){ ?>
								<span class="bagg"><i class="fa fa-briefcase"></i> Check-in baggage included!</span>
							<?php } ?>
							<div class="clearfix"></div>
							<br>
							<h4><?php echo $arrTime; ?> | <span id="arrDates"><?php echo $arrvlDate; ?></span></h4>
							<div class="clearfix"></div>
							<p>
								<?php
								$selectArrIata = "SELECT * FROM airport_list WHERE iatacode='$arrIata'";
								$arrIataQuery = mysqli_query($conn, $selectArrIata);
								$arrIatas   = mysqli_fetch_array($arrIataQuery);
								$a_iata    = $arrIatas['iatacode'];
								$a_airport = $arrIatas['airport_name'];
								
								if($arrIata == $a_iata){
									$arrAirport = substr_replace($a_airport, "..", 34);
									echo"($arrIata)$arrAirport";
								} else{
									echo $arrIata;
								}
								?>
							</p>
						</div>
					</div>
			
					<input type="hidden" name="carrier_Code[]" value="<?php echo $CarrierCode; ?><?php echo $aircraftCode; ?> " />
					<input type="hidden" name="airline_logo[]" value="https://daisycon.io/images/airline/?width=60&height=25&color=&iata=<?php echo $carrierCode; ?>" />
					<input type="hidden" name="dep_time[]" value="<?php echo $depTime; ?>" />
					<input type="hidden" name="arr_time[]" value="<?php echo $arrTime; ?>" />
					<input type="hidden" name="dep_date[]" value="<?php echo $depDate; ?>" />
					<input type="hidden" name="arr_date[]" value="<?php echo $arrDate; ?>" />
					<input type="hidden" name="dep_iata_city[]" value="(<?php echo $depIata; ?>)<?php echo $depAirport; ?> " />
					<input type="hidden" name="arr_iata_city[]" value="(<?php echo $arrIata; ?>)<?php echo $arrAirport; ?> " />
					<input type="hidden" name="depIata[]" value="<?php echo $depIata; ?>" />
					<input type="hidden" name="arrIata[]" value="<?php echo $arrIata; ?>" />
			
					<?php
					if($minutes > 0){
					?>	
						<input type="hidden" name="trip_time[]" value="<?php echo $hours; ?>h <?php echo $minutes; ?>m'" />
					<?php } else{ ?>
						<input type="hidden" name="trip_time[]" value="<?php echo $hours; ?>hour'" />
					<?php } 
					foreach($result['dictionaries']['carriers'] as $key =>  $v3){
						if($key == $itinerys['carrierCode']){
					?>
						<input type="hidden" value="<?php echo $v3; ?>" name="airlineName[]" />
					<?php }
					} 
					?>								
					
					<div style='width:100%;height:1px;margin:2px auto;background-color:#eee;'></div>
					<?php   } ?>
				
					<?php
					
					$total_duration = substr($totalDuration,2); 
					?>
					<input type="hidden" name="totalDuration"  value="<?php echo $total_duration; ?>" />
					<input type="hidden" name="adults" value="<?php echo $adults; ?>" />
					<input type="hidden" name="childs" value="<?php echo $child; ?>" />
					<input type="hidden" name="infants" value="<?php echo $infants; ?>" />
					<input type="hidden" name="travel_class" value="<?php echo $travelClass; ?>" />
		
				<?php
			
				foreach($data['travelerPricings'] as $key => $adultPrice){
					if($adultPrice['travelerType'] == 'ADULT'){ 
						$adult_price = $adultPrice['price']['base'];
						echo"<input type='hidden' name='adultPrice[]' value='$adult_price' />";
					}
				}
				foreach($data['travelerPricings'] as $key => $childPrice){
					if($childPrice['travelerType'] == 'CHILD'){ 
						$child_price = $childPrice['price']['base'];
						echo"<input type='hidden' name='childPrice[]' value='$child_price' />";	
					}
				}
				foreach($data['travelerPricings'] as $key => $infantPrice){
					if($infantPrice['travelerType'] == 'HELD_INFANT'){ 
						$infant_price = $infantPrice['price']['base'];
						echo"<input type='hidden' name='infantPrice[]' value='$infant_price' />";
					}
				}
				?>	
								<?php 
								if(isset($_GET['hfTripType'])){
								$tripType = $_GET['hfTripType'];
								?>
								<input type="hidden" name="triptype" value="<?php echo $tripType; ?>" />
								<?php } ?>
		</div>
			<?php
								$fetchClass = "SELECT * FROM discounts_by_class WHERE class='$travelClass'";
								$classQuery = mysqli_query($conn, $fetchClass);
								$clas = mysqli_fetch_array($classQuery);
									
								$disclass = $clas['class'];	
								$discount = $clas['discount'];
								
								$basePrice      = "$priceBase";								
								$finalPrice      = "$priceGrandTotal";
								$percentage = "$discount";
								
								$afterDisBaseprice = round($basePrice * ((100 - $percentage) / 100), 2);
								$afterDiscountprice = round($finalPrice * ((100 - $percentage) / 100), 2);
								?>
								<div class="flightRight">
								<!--<span class="disnt"><?php //echo $discount; ?>% Discount (Class- <?php //echo $travelClass; ?>) </span>-->
								<div class="clearfix"></div>
								<span class="tcklft">Only <?php echo $leftSeats; ?> tickets left!</span>
								<div class="clearfix"></div>
								<h3>
								<span id="p1">
								<del>$<?php echo $priceGrandTotal; ?></del>
								</span>&nbsp; 
								<span id="p2">$</span><?php echo $afterDiscountprice; ?>
								</h3>
								<div class="clearfix"></div>
								<input type="hidden" name="price_base" value="<?php echo $afterDisBaseprice; ?>" />
								<input type="hidden" name="grand_total" value="<?php echo $afterDiscountprice; ?>" />
								<button id="selectBtn" type="submit" name="select">Select</button>
								</div>								
									</div>
										</form>
								<?php }}}} ?>
						
		<!--Single Results ends here-->
			<!--<div class="call_effect"><div class="call_eff"></div><a href="tel:+1-888-749-0002" onclick="openSlider();" class="call-now">Call Now</a></div>-->
					
					
                                
                        </div>
						<div class="right-section">
						<div class="price-section">
						<h3><img src="/images/price-icon.jpg" width="21" height="14" alt="" /> Offer Details</span></h3>
						<div class="pricing">
						<img src="images/offer2.jpg" width="100%" />  
						</div>
						</div>
						<br><br>
						<div class="price-section">
						<h3><img src="/images/price-icon.jpg" width="21" height="14" alt="" /> Offer Details</span></h3>
						<div class="pricing">
						<img src="images/offerss.jpg" width="100%" />  
						</div>
						</div>
						
                    </div>
                </div>
                <!-- Middle section End-->
                <!--Right Section start-->
				

            </div>
        </div>
    </div>
</div>

<div id="divSessionOut" class="SessionTimeOut">
    <div class="sessionbox">
        <div class="row">
            <div class="col-md-12">
                <div class="col-md-3"></div>
                <div class="col-md-6 session-exp nopadding">
                    <h2 class="session-head"> Session expired</h2>
                    <div class="session_content">
                        <h3 class="text-center t-color2"><i class="fa fa-clock-o"></i>Your Session has expired</h3><br />
                        <p class="text-center session-color">
                            Your preferred search session has expired. We regret the inconvenience caused
                        </p><br />
                        <div class="col-md-6 col-xs-6"><p class="session-2"><a href="index" class="search-button-01 se-05">Go to Home</a></p></div>
                        <div class="col-md-6 col-xs-6 pull-right"><p><a class="search-button-02" onclick="SearchAgain();" href="/flight/?sec1=DCA|MCO|2022-02-22&amp;sec2=MCO|DCA|2022-02-24&amp;sec3=&amp;sec4=&amp;adults=1&amp;child=0&amp;infants=0&amp;cabin=1&amp;airline=ALL&amp;siteid=6&amp;campain=1000&amp;currency=USD">Search Again</a></p></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="sliderWhole" onclick="openSlider();" style="position: fixed; top: 0px; left: 0px; height: 100%; width: 100%; z-index: 1048; background-color: rgba(0, 0, 0, 0.5); display: none;"></div>
<div class="call_slider" id="slider" style="background-color:#ddd; position: fixed; width:350px;  height: 100%; top: 0px; right: 0px; z-index: 1049;display:none;">
    <div class="slide_top">
        <span  onclick="openSlider();"><i class="fa fa-close"></i></span>
        <h3>Exclusive Phone Offer</h3>

    </div>
    <div class="slider_buttom">
        <div class="slider_call">
            <div class="slider_icon"><i class="fa fa-phone"></i><i class="fa fa-plane"></i></div>
            <h4>This deal is only available over the phone!</h4>
            <p>Call now to take advantage of this offer:</p>
            <h2>+1-888-749-0002</h2>
        </div>
    </div>
</div>

        <section class="footer-section1">
            <div class="search-footer-main-div1">
                <div class="container-fluid">
                    <div class="row">
                        <div class="container">
                            <div class="footer1-div">
                                <img class="img-responsive" src="/images/astra_masterdcard_gray.jpg" alt="">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <div class="clearfix"></div>
        <?php include"include/footer_panel.php"; ?>
		</div>
	
		<script>
		document.onreadystatechange = function() {
			if (document.readyState !== "complete") {
				document.querySelector(
				"body").style.visibility = "hidden";
				document.querySelector(
				"#loader").style.visibility = "visible";
			} else {
				document.querySelector(
				"#loader").style.display = "none";
				document.querySelector(
				"body").style.visibility = "visible";
			}
		};
		</script>
	
		<script type="text/javascript">
        var totPax=4;
        if ($(window).width() > 960) {
            $(window).scroll(function () {
                var scroll = $(window).scrollTop();

                if (scroll >= 310) {
                    $(".right-section").addClass("fixed-right");
                } else {
                    $(".right-section").removeClass("fixed-right");
                }
                if ($(window).scrollTop() + $(window).height() > ($(document).height() - 320)) {

                    $(".right-section").addClass("fixed-right2");
                } else {
                    $(".right-section").removeClass("fixed-right2");
                }
            });
        }
    </script>


    <script src="Scripts/autocomplete-jquery.min.js"></script>
	<script src="Scripts/iata_from_city.js"></script>
	<script src="Scripts/iata_to_city.js"></script>
    <script src="Scripts/jquery-1.10.2.min.js"></script>
	<script src="Scripts/jquery-ui.min.js"></script>
	<script src="Scripts/jquery.validate_New.min.js"></script>
	<script src="Scripts/bootstrap.min.js"></script>
	<script src="Scripts/script.js"></script>
	<script src="Scripts/moment-with-locales.js"></script>
	<script src="Scripts/bootstrap-datetimepicker.js"></script>
	<script src="Scripts/SearchEngine.js"></script>
	<script src="Scripts/jquery.custom-scrollbar.js"></script>
	<script src="Scripts/ng-infinite-scroll.js"></script>
    <script>
        $(document).ready(function () {
            $('ul li').click(function () {
                $('li').removeClass("active");
                $(this).addClass("active");
            });
            //setMultiCitySector();

            ChangeTripType(parseInt($('#hfTripType').val()));

        });

        function openSlider() {
            var options = { direction: 'right' };
            $("#sliderWhole").toggle();
            $("#slider").toggle('slide', options, 500);
        }
    </script>


    <script>
        $(document).ready(function () {
            $(".dropbtn").click(function () {
                $("#myDropdown").toggle();
            });
        });
        function ChangeNo(country) {
            if (country == "us") {
                $("#tollFreeNo").html('+1-888-749-0002');
                $("#ImgFlagTollFree").attr('src', '/images/us_flag.jpg');
            }
            else if (country == "ca") {
                $("#tollFreeNo").html('+1-888-749-0002');
                $("#ImgFlagTollFree").attr('src', '/images/ca_flag.jpg');
            }
            else if (country == "uk") {
                $("#tollFreeNo").html('+1-888-749-0002');
                $("#ImgFlagTollFree").attr('src', '/images/uk_flag.jpg');
            }
            $("#myDropdown").toggle();
        }
    </script>   
   
</body>
</html>
