// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// *******AJAX CONTENT SELECTOR TABS *******
// by Anton Levchenko (http://anton.levchenko.ca)
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
 
 $(document).ready(function() { 
  var currentlyLoaded = "";
  $(".buttons li a").click(function(){ 
    // capture the url to load from the href 
	var myUrl = $(this).attr("href") + " #flights-form";
    // slide up the div to hide the swap 
    $("#flights-form").fadeOut(function() { 
      // load the content with AJAX
	  $('#load').remove(); 
   $('#formcontainer').append('<div id="load" style="height: 170px; padding-top: 70px; text-align: center;"><img src="http://gofly.ca/uploads/images/ajax-loader.gif"/></div>');  
 $('#load').fadeIn('normal');  
      $("#formcontainer").load(myUrl, function() { 
        // once the content is load, fade in
		$('#load').remove();
		readyup();
        $("#flights-form").fadeIn(); 
      }); 
    }); 
    return false; 
  }); 

});

$(function(){
  $(".buttons a").click(function(){
    $(this).parent().addClass('gray'). // <li>
      siblings().removeClass('gray');
	$('h1').contents().replaceWith($(this).attr("title"));
  });
});
