function runLoads() {
	$('#schedule-content .current li').each(function() {
		divTime = $(this).data('time'); //Setup the time for the current div, doesn't work inside the nested each otherwise
		divCurrent = this;
		$.each(departLoad, function (time, data) { //Go through each item in the load JSON. Shitty but effective thanks to tiny json
			if (time == divTime) { //Check each item to see if the Div's time and the JSON time are the same
				//First up is to check for loads and setup loads
				if (typeof data['load'] != 'undefined' && data['load'] != '') {
					$(divCurrent).prepend('<div class="load-div"><div class="load-text">Current Load</div><div class="load-amount">' + data['load'] + '</div></div>');
				}
				//Then on to ETA
				if (typeof data['eta'] != 'undefined' && data['eta'] != '') {
					var now = new Date();
					var nowHours = now.getHours();
					var nowMinutes = now.getMinutes();
					nowHours = nowHours.toString();
					nowMinutes = nowMinutes.toString();
					nowTime = nowHours+nowMinutes;
					timeDifference = nowTime - data['eta'];
					if(timeDifference < 300) {
						prettyArrive = convertTime(data['eta']);
						$('.current [data-time="' + divTime + '"] .schedule-list-arrive').html('Arriving: ' + prettyArrive + '</p>');
					}
				}
				//Then on to current status
				if (typeof data['status'] != 'undefined' && data['status'] != '') {
					switch(data['status']) {
						case 'On Time':
							statusClass = 'ontime';
							break;
						default:
							statusClass = 'other';
					}
					
					$('.current [data-time="' + divTime + '"] .schedule-list-arrive').after('<p class="status ' + statusClass + '">Status: ' + data['status'] + '</p>');
				}
			}
		});
	});
}

function syncLoads(){
	$.getJSON('http://scrape.ferriesapp.ca/api/index.php?depart='+ depart +'&arrive=' + arrive + '&api=2&callback=?', function(result){
		//response data are now in the result variable
		departLoad = result;
		runLoads();
	});
}