// Block Skip

$(function(){
	$("#skip a").focus(function(){
		$(this).addClass("show");
	});
	$("#skip a").blur(function(){
		$(this).removeClass("show");
	});
});


// Change Font Size

$(document).ready(function() {
	var history = $.cookie("fsize");
	(!history)? $("body").addClass("font-s"):$("body").addClass(history);

	$("#font-size a").click(function() {
		var textSize = $(this).parent().attr("class");
		$("body").removeClass("font-s font-m font-l").addClass(textSize);
		$.cookie("fsize",textSize, { path: "/", expires: 7 });
		return false;
	});
});


// Roll Over

$(function() {
	var image_cache = new Object();
	$("img.rollover").each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; });
	});
})


// Scroll

$(function(){
	if(! $.browser.safari){
		$('.go-top').click(function(){
			$(this).blur();
			$('html,body').animate({ scrollTop: 0 },'fast');
			return false;
		});
	}
});


