$(document).ready(function(){
	
	$("#themeTitle").removeClass("themeTitle");
	$("#themeTitle").addClass("themeTitleHome");		
	
	$(".galleryTeaser").jCarouselLite({
		visible:6,
		auto: 8000,
	    speed: 1000,
	    afterEnd: ShowRandomThemePicture
	}
	);
	$(".galleryTeaser").css("visibility","visible");
	ShowRandomThemePicture();
	
	$("#kanjiHapkido").mouseover(function(){
		$("#themePicture").addClass("themePictureHapkido");
	});
	
	$("#kanjiJudo").mouseover(function(){
		$("#themePicture").addClass("themePictureJudo");

	});

	$("#kanjiTaekwondo").mouseover(function(){
		$("#themePicture").addClass("themePictureTaekwondo");
	});
	
	$("#kanjiHapkido").click(function(){
		window.location.href = "Hapkido/Hapkido.html";
	});
	
	$("#kanjiJudo").click(function(){
		window.location.href = "Judo/Judo.html";
	});

	$("#kanjiTaekwondo").click(function(){
		window.location.href = "Taekwondo/Taekwondo.html";
	});

	
	
	$("#kanjiHapkido").mouseout(function(){
		$("#themePicture").removeClass("themePictureHapkido");
	});
	
	$("#kanjiJudo").mouseout(function(){
		$("#themePicture").removeClass("themePictureJudo");
	});

	$("#kanjiTaekwondo").mouseout(function(){
		$("#themePicture").removeClass("themePictureTaekwondo");
	});
});

function ShowRandomThemePicture(){
	if(! ($("#themePicture").hasClass('themePictureHapkido') || $("#themePicture").hasClass('themePictureTaekwondo') || $("#themePicture").hasClass('themePictureJudo')))
	{
		var randomnumber = Math.floor(Math.random()*7);
		$("#themePicture").removeAttr("class");
		$("#themePicture").addClass("themePicture" +  randomnumber);
	}
}