// These first two functions should probably be re-written with JQuery but I cba xD

function mouseOver(n) {
  var name = 'menuLink' + n;
  document.getElementsByName(name)[0].src = "images/icons/pint_empty_icon.jpg";
}

function mouseOut(n) {
  var name = 'menuLink' + n;
  document.getElementsByName(name)[0].src = "images/icons/pint_full_icon.jpg";
}

function loadContent(url) {
	$('#content #ajax').empty().append("<div id='loading'><img src='images/icons/load_bottle.gif' alt='Loading...' /></div>");
  setTimeout(function() {$('#content #ajax').load(url);}, 1000);
  /* // FadeIn the Imperial College logo each page
  $('#content #image_head').hide();
  $('#content #ajax').empty().append("<div id='loading'><img src='images/icons/load_bottle.gif' alt='Loading...' /></div>");
 		setTimeout(function() {
  		$('#content #ajax').load(url, function() {
  			$('#content #image_head').fadeIn('slow');
  		});
  	}, 750);
  */
}

function loadGallery(file) {
	var path = 'slideshows/' + file;
	// Don't even think about fading this in, it doesn't work.
	$('#gallery').load('slideshow.html', function() {
		$.getScript('scripts/slideshow.js', function() {
			setTimeout(function() {
				$('#loading').empty();
				start_jcarousel(path);
			}, 2000);
		});
	});
}

$(document).ready(function() {
  loadContent('home.html');
});

