//<![CDATA[
var FSC = function( argId ) {
	if ( window == this || !this.initialize ) {
		return new FSC( argId );
	}
	return this.initialize( argId );
};
FSC.c = {
	TARGETNAME		: ''				,
	STYLENAME		: 'font-size'		,
	REPLACEID		: '#fontSizeChange'	,
	FONTINDEX		: 2					,
	FONTSIZE		: new Array(
					'xx-small'			,
					'x-small'			,
					'small'				,
					'medium'			,
					'large'		)		,
	DUMMY_END		: 2					
};
FSC.p = {
	gWindow			: null				,
	DUMMY_END		: 2					
};
FSC.prototype.initialize = function( argId ) {
	FSC.c.TARGETNAME	= argId;
	this.gElement		= document.getElementById( argId );
	return this;
};
FSC.prototype.clickFontSizeS = function() {
	var fontIndex = FSC.c.FONTINDEX;
	if( $.cookie( FSC.c.STYLENAME ) != null ) {
		fontIndex = parseInt( $.cookie( FSC.c.STYLENAME ) ) - 1;
		if ( fontIndex >= 0 ) {
			$( FSC.c.TARGETNAME ).css( FSC.c.STYLENAME , FSC.c.FONTSIZE[ fontIndex ] );
			$.cookie( FSC.c.STYLENAME , fontIndex , { expires: 90 } );
		} else {
		}
	} else {
		var fontIndex = FSC.c.FONTINDEX;
		$.cookie( FSC.c.STYLENAME , fontIndex , { expires: 90 } );
		$( FSC.c.TARGETNAME ).css( FSC.c.STYLENAME , FSC.c.FONTSIZE[ fontIndex ] );
	}
	this.renderButton();
};
FSC.prototype.clickFontSizeD = function() {
	$.cookie( FSC.c.STYLENAME , FSC.c.FONTINDEX , { expires: 90 } );
	$( FSC.c.TARGETNAME ).css( FSC.c.STYLENAME , FSC.c.FONTSIZE[ FSC.c.FONTINDEX ] );
	this.renderButton();
};
FSC.prototype.clickFontSizeL = function() {
	var fontIndex = FSC.c.FONTINDEX;
	if( $.cookie( FSC.c.STYLENAME ) != null ) {
		fontIndex = parseInt( $.cookie( FSC.c.STYLENAME ) ) + 1;
		if ( fontIndex < FSC.c.FONTSIZE.length ) {
			$( FSC.c.TARGETNAME ).css( FSC.c.STYLENAME , FSC.c.FONTSIZE[ fontIndex ] );
			$.cookie( FSC.c.STYLENAME , fontIndex , { expires: 90 } );
		} else {
		}
	} else {
		var fontIndex = FSC.c.FONTINDEX;
		$.cookie( FSC.c.STYLENAME , fontIndex , { expires: 90 } );
		$( FSC.c.TARGETNAME ).css( FSC.c.STYLENAME , FSC.c.FONTSIZE[ fontIndex ] );
	}
	this.renderButton();
};
FSC.prototype.openWindow = function( argUrl , argWidth , argHeight ) {
	if ( window.gWindow ) {
		FSC.p.gWindow.close();
	}
	FSC.p.gWindow = window.open( argUrl , 'win' , 'width=' + argWidth + ',height=' + argHeight + ',status=no,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no' );
};
FSC.prototype.renderButton = function() {
	var html = '';
	switch ( parseInt( $.cookie( FSC.c.STYLENAME ) ) ) {
		case 0:
		case 1:
			html+= '<li><img src="/common/images/header_fontsize-title.gif" width="82" height="10" alt="文字の大きさ変更" title="文字の大きさ変更" /></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeS();return false;" title="文字を縮小する"><img src="/common/images/header_fontsize-s_ov.gif" alt="小" title="小" width="24" height="25" /></a></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeD();return false;" title="文字を標準にする"><img src="/common/images/header_fontsize-m.gif" alt="中" title="中" width="24" height="25" class="imgover" /></a></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeL();return false;" title="文字を拡大する"><img src="/common/images/header_fontsize-b.gif" alt="大" title="大" width="24" height="25" class="imgover" /></a></li>';
			break;
		case 2:
			html+= '<li><img src="/common/images/header_fontsize-title.gif" width="82" height="10" alt="文字の大きさ変更" title="文字の大きさ変更" /></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeS();return false;" title="文字を縮小する"><img src="/common/images/header_fontsize-s.gif" alt="小" title="小" width="24" height="25" class="imgover" /></a></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeD();return false;" title="文字を標準にする"><img src="/common/images/header_fontsize-m_ov.gif" alt="中" title="中" width="24" height="25" /></a></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeL();return false;" title="文字を拡大する"><img src="/common/images/header_fontsize-b.gif" alt="大" title="大" width="24" height="25" class="imgover" /></a></li>';
			break;
		case 3:
		case 4:
			html+= '<li><img src="/common/images/header_fontsize-title.gif" width="82" height="10" alt="文字の大きさ変更" title="文字の大きさ変更" /></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeS();return false;" title="文字を縮小する"><img src="/common/images/header_fontsize-s.gif" alt="小" title="小" width="24" height="25" class="imgover" /></a></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeD();return false;" title="文字を標準にする"><img src="/common/images/header_fontsize-m.gif" alt="中" title="中" width="24" height="25" class="imgover" /></a></li>';
			html+= '<li><a href="#" onclick="FSC.prototype.clickFontSizeL();return false;" title="文字を拡大する"><img src="/common/images/header_fontsize-b_ov.gif" alt="大" title="大" width="24" height="25" /></a></li>';
			break;
		default:
	}
	$( FSC.c.REPLACEID ).html( html );
	initRollovers();
};
FSC.prototype.start = function() {
	var fontIndex = FSC.c.FONTINDEX;
	if( $.cookie( FSC.c.STYLENAME ) == null ) {
		$.cookie( FSC.c.STYLENAME , fontIndex , { expires: 90 } );
	} else {
	}
	fontIndex = parseInt( $.cookie( FSC.c.STYLENAME ) );
	$( FSC.c.TARGETNAME ).css( FSC.c.STYLENAME , FSC.c.FONTSIZE[ fontIndex ] );
	this.renderButton();
};
//]]>
