	var clicked=0;

	var randomnumber=Math.floor(Math.random()*4);
	randomnumber = randomnumber + 1;

	var t
	t=setTimeout("showbanner"+randomnumber+"()", 10);	

	$(function() {
		$("#homebtn1").click(function(){
			clearTimeout(t);
			clicked=1;
			showbanner1();
		});
		$("#homebtn2").click(function(){
			clearTimeout(t);
			clicked=1;
			showbanner2();
		});
		$("#homebtn3").click(function(){
			clearTimeout(t);
			clicked=1;
			showbanner3();
		});
		$("#homebtn4").click(function(){
			clearTimeout(t);
			clicked=1;
			showbanner4();
		});
	});
	
function showbanner1(){
			if (clicked==0)
			{
				t=setTimeout("showbanner2()", 5000);	
			}
			else
			{
				t=setTimeout("showbanner2()", 25000);
				clicked=0;
			}
			$("#banner2").css("z-index", 0);
			$("#banner3").css("z-index", 0);
			$("#banner4").css("z-index", 0);
			$("#banner1").css("z-index", 1);
			$("#banner1").fadeIn("slow");	
			$("#banner2").fadeOut("slow");
			$("#banner3").fadeOut("slow");
			$("#banner4").fadeOut("slow");
}; //end of function showbanner1
function showbanner2(){
			if (clicked==0)
			{
				t=setTimeout("showbanner3()", 5000);	
			}
			else
			{
				t=setTimeout("showbanner3()", 25000);
				clicked=0;
			}
			$("#banner1").css("z-index", 0);
			$("#banner3").css("z-index", 0);
			$("#banner4").css("z-index", 0);
			$("#banner2").css("z-index", 1);
			$("#banner2").fadeIn("slow");	
			$("#banner1").fadeOut("slow");
			$("#banner3").fadeOut("slow");
			$("#banner4").fadeOut("slow");
}; //end of function showbanner2
function showbanner3(){
			if (clicked==0)
			{
				t=setTimeout("showbanner4()", 5000);	
			}
			else
			{
				t=setTimeout("showbanner4()", 25000);
				clicked=0;
			}
			$("#banner2").css("z-index", 0);
			$("#banner1").css("z-index", 0);
			$("#banner4").css("z-index", 0);
			$("#banner3").css("z-index", 1);
			$("#banner3").fadeIn("slow");	
			$("#banner2").fadeOut("slow");
			$("#banner1").fadeOut("slow");
			$("#banner4").fadeOut("slow");
}; //end of function showbanner3
function showbanner4(){
			if (clicked==0)
			{
				t=setTimeout("showbanner1()", 5000);	
			}
			else
			{
				t=setTimeout("showbanner1()", 25000);
				clicked=0;
			}
			$("#banner2").css("z-index", 0);
			$("#banner3").css("z-index", 0);
			$("#banner1").css("z-index", 0);
			$("#banner4").css("z-index", 1);
			$("#banner4").fadeIn("slow");	
			$("#banner2").fadeOut("slow");
			$("#banner3").fadeOut("slow");
			$("#banner1").fadeOut("slow");
}; //end of function showbanner4

