$(document).ready(function(){
	var remotePhoto = new Array();
	remotePhoto[0] = new Image; remotePhoto[0].src = "img/remote_kuro.jpg";
	remotePhoto[1] = new Image; remotePhoto[1].src = "img/remote_ao.jpg";
	remotePhoto[2] = new Image; remotePhoto[2].src = "img/remote_pink.jpg";
	
	// Wii Remote
	
	$("#remote_btnKuro").click(function(){
		refreshThumbs();
		$("#remote_btnKuro").attr("src", "img/remote_thumbKuro_ov.gif");
		if($("#remotePhoto").attr("src") != "img/remote_kuro.jpg"){
			$("#remotePhoto").fadeOut(
				100,
				function(){
					$("#remotePhoto").attr("src", "img/remote_kuro.jpg");
					$(this).fadeIn(200);
				}
			);
		}
		return false;
	});

	$("#remote_btnShiro").click(function(){
		refreshThumbs();
		$("#remote_btnShiro").attr("src", "img/remote_thumbShiro_ov.gif");
		if($("#remotePhoto").attr("src") != "img/remote_shiro.jpg"){
			$("#remotePhoto").fadeOut(
				100,
				function(){
					$("#remotePhoto").attr("src", "img/remote_shiro.jpg");
					$(this).fadeIn(200);
				}
			);
		}
		return false;
	});

	$("#remote_btnAo").click(function(){
		refreshThumbs();
		$("#remote_btnAo").attr("src", "img/remote_thumbAo_ov.gif");
		if($("#remotePhoto").attr("src") != "img/remote_ao.jpg"){
			$("#remotePhoto").fadeOut(
				100,
				function(){
					$("#remotePhoto").attr("src", "img/remote_ao.jpg");
					$(this).fadeIn(200);
				}
			);
		}
		return false;
	});

	$("#remote_btnPink").click(function(){
		refreshThumbs();
		$("#remote_btnPink").attr("src", "img/remote_thumbPink_ov.gif");
		if($("#remotePhoto").attr("src") != "img/remote_pink.jpg"){
			$("#remotePhoto").fadeOut(
				100,
				function(){
					$("#remotePhoto").attr("src", "img/remote_pink.jpg");
					$(this).fadeIn(200);
				}
			);
		}
		return false;
	});

});


function refreshThumbs(){
	$("#remote_btnShiro").attr("src", "img/remote_thumbShiro.gif");
	$("#remote_btnKuro").attr("src", "img/remote_thumbKuro.gif");
	$("#remote_btnAo").attr("src", "img/remote_thumbAo.gif");
	$("#remote_btnPink").attr("src", "img/remote_thumbPink.gif");
}