$(function(){
	$('#fontSizeSwitcher a[rel=style]').set_style_switch();
	$('#gNav a img').rollover();
	$('#fNav li:first-child').css('background','none');
	$('#lowerBox dl').tile();
	$('#fontSizeSwitcher a').click(function(){
		$('#lowerBox dl').tile();
	});
	$('#fNav li:first-child').css('margin','0');
	$('#fNav li:first-child').css('padding','0');
	$('.pagetop a').click(function() {
		$('body,html').animate({
			scrollTop: 0
		}, 500);
		return false;
	});
	$('a[href$=".pdf"]:not(#backno a)').addClass('pdf');
	$('a[href$=".zip"]:not(#backno a)').addClass('zip');
});



//set_style_switch
(function(a){a.fn.set_style_switch=function(){var b=this;a("link[title]").each(function(){this.disabled=true});_change_style=function(c){a("link[title]").each(function(){this.disabled=(this.title!=c)});b.each(function(){var e=(/#([^???]*)/.exec(this.href)[1]);if(e==c&&a("img",this).length){var d=a("img",this)[0];d.src=d.src.replace(/_o(\.[a-z]+)$/,"_h$1");a(d).unbind()}else{if(a("img",this).length){var d=a("img",this)[0];d.src=d.src.replace(/_h(\.[a-z]+)$/,"_o$1");a(d).unbind()}}})};if(a.cookie("style")){_change_style(a.cookie("style"))}return this.click(function(){var c=(/#([^???]*)/.exec(this.href)[1]);_change_style(c);a.cookie("style",c);this.blur();return false})}})(jQuery);

//cookie
jQuery.cookie=function(a,g,j){var d={days:360,path:"/"};if(j){jQuery.extend(d,j)}var e=g?"set":"get";if(e=="get"){a=a+"=";var h=document.cookie.split("; ");for(var f=0;f<h.length;f++){if(h[f].indexOf(a)==0){return h[f].substring(a.length,h[f].length)}}return null}else{if(e=="set"){var c=new Date();c.setTime(c.getTime()+(d.days*24*60*60*1000));var b="; expires="+c.toGMTString();document.cookie=a+"="+g+b+"; path="+d.path}}};



/**
 * Flatten height same as the highest element for each row.
 *
 * Copyright (c) 2011 Hayato Takenaka
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * @author: Hayato Takenaka (http://urin.take-uma.net)
 * @version: 0.0.2
**/
;(function($) {
	$.fn.tile = function(columns) {
		var tiles, max, c, h, last = this.length - 1, s;
		if(!columns) columns = this.length;
		this.each(function() {
			s = this.style;
			if(s.removeProperty) s.removeProperty("height");
			if(s.removeAttribute) s.removeAttribute("height");
		});
		return this.each(function(i) {
			c = i % columns;
			if(c == 0) tiles = [];
			tiles[c] = $(this);
			h = tiles[c].height();
			if(c == 0 || h > max) max = h;
			if(i == last || c == columns - 1)
				$.each(tiles, function() { this.height(max); });
		});
	};
})(jQuery);


