(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

$(document).ready(function() {
	//Invoking the supersized function on the div with id - supersize. It is the div that contains the large background image
	$("div#supersize").supersize();
	$("#home_page ul#nav li:first-child").addClass("here");
	var prevLink = $("li.here").prev().children().attr("href");
	var nextLink = $("li.here").next().children().attr("href");
	var firstLink = $("ul#nav li:first-child").children().attr("href");
	var lastLink = $("li.last").children().attr("href");
	if (prevLink == null) {
		$("#prev_proj").attr("href", lastLink);
	}
	else {
		$("#prev_proj").attr("href", prevLink);
	};
	if (nextLink == null) {
		$("#next_proj").attr("href", firstLink);
	}
	else {
		$("#next_proj").attr("href", nextLink);
	};
});
