
function load_visits_list(start, trip_link, all_trips) {
	 
	if (all_trips == null){
	   all_trips = "no";
	 }
	 
	 if (trip_link == null){
	  trip_link = "";
	 }
	
	$.ajax({
	   type: "GET",
	   url: "http://www.miltonkeynesacademy.co.uk/cont_visits_list.php",
	   data: "start="+start+"&ajax_loaded=1&t_link="+trip_link+"&show_all="+all_trips,
	   cache: true,  
	   success: function(data){
			
			$("#blog_list_container").html(data);

	   },
	    error: function () {
	    $('#blog_list_container').empty(); // remove the loading image 
	    $('#blog_list_container').html('<div style="padding:50px 0 50px 0;" class="align-center red">The list could not be loaded. Please refresh the page and try again</div>');
	  } 
	});
	
	$("#blog_list_container").show();
}

function load_visits_images(start, trip_id, all_trips) {
	 
	if (all_trips == null){
	   all_strips = "no";
	 }
	
	$.ajax({
	   type: "GET",
	   url: "http://www.miltonkeynesacademy.co.uk/cont_visits_images.php",
	   data: "start="+start+"&ajax_loaded=1&t_id="+trip_id+"&upcoming_trips=0&show_all="+all_trips,
	   cache: true,  
	   success: function(data){
			
			$("#visits_images_container").html(data);

	   },
	    error: function () {
	    $('#visits_images_container').empty(); // remove the loading image 
	    $('#visits_images_container').html('<div style="padding:50px 0 50px 0;" class="align-center red">The images could not be loaded. Please refresh the page and try again</div>');
	  } 
	});
	
	$("#visits_images_container").show();
}

function load_upcoming_trips_list(start, trip_link, all_trips) {
	 
	if (all_trips == null){
	   all_trips = "no";
	 }
	 
	 if (trip_link == null){
	  trip_link = "";
	 }
	
	$.ajax({
	   type: "GET",
	   url: "http://www.miltonkeynesacademy.co.uk/cont_upcoming_trips_list.php",
	   data: "start="+start+"&ajax_loaded=1&t_link="+trip_link+"&upcoming_trips=1&show_all="+all_trips,
	   cache: true,  
	   success: function(data){
			
			$("#upcoming_trips_list_outter_container").html(data);

	   },
	    error: function () {
	    $('#upcoming_trips_list_outter_container').empty(); // remove the loading image 
	    $('#upcoming_trips_list_outter_container').html('<div style="padding:50px 0 50px 0;" class="align-center red">The list could not be loaded. Please refresh the page and try again</div>');
	  } 
	});
	
	$("#upcoming_trips_list_outter_container").show();
}

$(document).ready(function(){	

	//Comment/review toggle
	$('#commentbox').hide();
	
	$('a.comment').click(function() {
	        var id = $(this).attr('id');
	     $('#commentbox' + id).toggle(500);
	     return false;
	});
	
	$('#slider_main_bg').corner();
	
});

