var numLinkColours = 30;

function homeImgFadeIn() {
	$("#bg").addClass("bg_show").hide();  
	$(".bg_show").fadeIn(2000);
	};

function homeImgFadeOut() {
	$(".bg_show").fadeOut(200);
	};

function assignLinkColours() {
	var counter = 1;
	var className;
	$("li").each(function(){
		    className = "colour_" + counter;
		    $(this).addClass(className);
	 		if (counter >= numLinkColours ) {
				counter = 1
			} else {
				counter++ ;
			};
	      });
	};
	
function goToAnchor() {
  location.href = "#bottom";
}
		

// Delay Plugin for jQuery
// - http://www.evanbot.com
// - © 2008 Evan Byrne

jQuery.fn.delay = function(time,func){
	this.each(function(){
		setTimeout(func,time);
	});

	return this;
};

$(document).ready(function(){   
	

    // 
	// homeImgFadeIn();

 	// Add colours to links
 	assignLinkColours();
	goToAnchor();        
 	
 	$("#home a").click(function(){  
 		// Get the url of the link  
 		//var toLoad = $(this).attr('href');  
 	
 		// Do some stuff  
 		//homeImgFadeOut();
 		// Stop doing stuff  
 	
 		// Wait 700ms before loading the url  
 		//$(this).delay(300, function(){  
 		//	window.location = toLoad;  
 		//});  
 	
 		// Don't let the link do its natural thing  
 		//return false;  
 	});              
 
});                                




