jQuery.preloadImages = function(){
	for(var i = 0; i<arguments.length; i++){
		jQuery("<img>").attr("src", arguments[i]);
	}
};

$.preloadImages("image/keyHoverRb.gif", "image/keyHoverRt.gif");

$(function(){
	$('div.section div.clearfix')
		.each(function(){
			$(this)
				.append('<span class="rt"></span><span class="rb"></span>')
				.find('a.key')
					.mousedown(function(){$(this).parent().removeClass('hover')})
					.hover(
						function(){$(this).parent().addClass('hover')},
						function(){$(this).parent().removeClass('hover')}
					)
					.append('<span class="rt"></span><span class="rb"></span>')
				.end();
		});
	$('a.skp').each(function(){
		uri = $(this).attr('href');
		$(this).parent()
			.mousedown(function(){
					$(this)
						.removeClass('hover')
						.addClass('active')
					.end();
					//window.open(uri,"blank","");
					return false;
			})
			.mouseup(function(){
					$(this)
						.removeClass('active')
						.addClass('hover')
						.css('cursor','pointer')
					.end();
			})
			.hover(
				function(){
					$(this)
						.removeClass('active')
						.addClass('hover')
						.css('cursor','pointer')
				},
				function(){
					$(this).removeClass('hover')
				}
			)
		.end();
	})
	.mousedown(function(){
		$(this).parent().addClass('active');
	})
	.end();
	
});
