$(function(){
	// rollover
	$('.imgover, #gNavi img').each(function(){
		this.osrc = $(this).attr('src');
		this.rollover = new Image();
		this.rollover.src = this.osrc.replace(/(\.gif|\.jpg|\.png)/, "_o$1");
	}).hover(function(){
		$(this).attr('src',this.rollover.src);
	},function(){
		$(this).attr('src',this.osrc);
	});
	
	// gnavi pulldown menu
	$('#gNavi dd > ul').droppy({speed: 1});
	$('#gNavi dd > ul ul').css("opacity", "0.9");
	
	// photo gallery
	$('.galleryArea a').lightBox();
	
	// pngfix
	$("img[src$=png],.iepngfix").pngfix();


	// switch font
	$('#utility > .fontsize').css("display", "inline");
	var currentFont = $.cookie('fontsize');
	if (currentFont == undefined || !currentFont) {
		currentFont = 'small';
	}
	$('body').addClass(currentFont);
	$('#fontSwitch a').click(function() {
		var font = this.hash.replace('#', '');
		var date = new Date();
		date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
		$.cookie('fontsize', font, {path: '/', expires: date});
		$('body').removeClass('small').removeClass('medium').removeClass('large').addClass(font);
		return false;
	});
	
});
