(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);
		//alert(cacheImage.src);
		}
	}


})(jQuery);


$(document).ready(function() {

	$('.hp_back').hover(
		function () {
			$('.hp_extras').stop(true, true).animate({'top': '228px', "opacity": .95}, 'fast');
		},
		function () {
			$('.hp_extras').stop(true, true).animate({'top': '320px', "opacity": .7}, 'fast');
		}
	);

	$('#kimori').mouseenter(function () {
		$(this).stop(true, true).animate({"opacity": 1}, 'fast');
	});

	$('#kimori').mouseleave(function () {
		$(this).stop(true, true).animate({"opacity": .6}, 'fast');
	});

	$('#samurai').mouseenter(function () {
		$(this).stop(true, true).animate({"opacity": 1}, 'fast');
	});

	$('#samurai').mouseleave(function () {
		$(this).stop(true, true).animate({"opacity": .6}, 'fast');
	});

	$('.header #top_nav li').mouseenter(function () {
		$(this).stop(true, true).animate({"opacity": 1}, 'fast');
	});

	$('.header #top_nav li').mouseleave(function () {
		$(this).stop(true, true).animate({"opacity": .6}, 'fast');
	});

	$('.link').mouseenter(function () {
		var sub_class_name = $(this).attr('id')+'_sub';
		//$('.subnav').hide();
	//	$('#'+sub_class_name).fadeIn(400);
		$('#'+sub_class_name).stop(true, true).fadeTo(400, .95, function() {
		});
	});
	
	$('.link').mouseleave(function (e) {
		var sub_class_name = $(this).attr('id')+'_sub';
		$('#'+sub_class_name).stop(true, true).fadeTo(400, 0, function() {
		});
		$('.subnav').hide();
	});
	
	$('.subnav').mouseenter(function (e) {
		//$('.subnav').hide();
		var class_name = $(this).attr('id');
		$('#'+class_name).show();
	});
	
	$('.subnav').mouseleave(function (e) {
		$(this).hide();
	});
	
	$(".scrollable").scrollable();

	$(".tooltip_me[title]").tooltip({ offset: [-10, 0], position: "bottom center", opacity: 0.7, effect: 'slide'});
});


