if(!ist) { var ist = []; }
/* --------------------------------------------------
	IE BackgroundImageCache
-------------------------------------------------- */
try{
	document.execCommand("BackgroundImageCache", false, true);
}
catch(err){}

/* --------------------------------------------------
	LOAD FUNCTION
-------------------------------------------------- */
(function($){
$(function(){
	$("a.layerBox").colorbox({ opacity : 0.5, iframe : true, innerWidth : 760, innerHeight : 600, close : '<img src="/template/images/btnClose_btn_01.gif" alt="閉じる" width="94" height="25" class="imgover" />' });
	ist.putUtilElement('container');
	$('.imgover').imgHover({ suffix : '_o' });
	$('#globalNavMod img').imgHover({ suffix : '_o' }).imgStay({ bodyClass : 'gStay-', prefixClass : 'gNav-', suffixStay : '_o' });
	$('a.anchorScroll,.anLinkIco a').scrollFor();

	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
		$('div.frameT,div.frameB,div.frameM,div.aside-roundTitle', 'div.aside-roundFrame').each(function(){
			DD_belatedPNG.fixPng(this);
		});
	}

	$('#asideColumn div.asideSec:eq(0)').addClass('firstSec');
});

$(window).load(function(){
	ist.alignBoxes();
});
})($jq['1.4.1']);

/* --------------------------------------------------
	PUT UTILITY SWF
-------------------------------------------------- */
ist.putUtilElement = function(elemId){(function($){
	var _utilElement = document.createElement('div');
	_utilElement.id = 'utilElement';
	_utilElement.style.width = '1em';
	_utilElement.style.height = '1em';
	_utilElement.style.top = '0px';
	_utilElement.style.left = '0px';

	var _utilElementSwf = document.createElement('div');
	_utilElementSwf.id = 'utilElementSwf';
	_utilElement.appendChild(_utilElementSwf)

	if(navigator.userAgent.indexOf('MSIE') != -1){
		_utilElement.style.position = 'absolute';
		if(elemId) {
			document.getElementById(elemId).appendChild(_utilElement);
		} else {
			document.body.appendChild(_utilElement);
		}
		_utilElement.onresize = function(){ist.alignBoxes();};
	}else{
		_utilElement.style.position = 'fixed';
		if(elemId) {
			document.getElementById(elemId).appendChild(_utilElement);
		} else {
			document.body.appendChild(_utilElement);
		}
		swfobject.embedSWF(
			'/template/swf/util.swf',
			_utilElementSwf.id,
			'100%',
			'100%',
			'8',
			'',
			{},
			{ wmode : 'transparent', allowScriptAccess : 'always' },
			{},
			function(e){
				ist.utilSwf = e.ref;
			}
		);
	}
})($jq['1.4.1'])};

/* --------------------------------------------------
	ALIGN BOXES HEIGHT
-------------------------------------------------- */
ist.alignBoxesSetting = function(wrapStr, boxStr){(function($){
	$(wrapStr).each(function(){
		var maxHeight = 0;
		var alignBox = $(this).find(boxStr);
		if($.browser.msie && Number($.browser.version) < 7) { alignBox.height('auto'); }
		else { alignBox.css('min-height', 0); }

		setTimeout(function(){
			for(var i=0; i<alignBox.length; i++){
				maxHeight = Math.max(maxHeight, alignBox.eq(i).height());
			}
			if($.browser.msie && Number($.browser.version) < 7) { alignBox.height(maxHeight); }
			else { alignBox.css('min-height', maxHeight); }
		},1);
	});
})($jq['1.4.1'])};

ist.alignBoxes = function(){(function($){
	ist.alignBoxesSetting('div.alignBoxWrap', '.alignBoxTitle');
	ist.alignBoxesSetting('div.alignBoxWrap', 'div.alignBox');
})($jq['1.4.1'])};


/* --------------------------------------------------
	STYLE SWITCH
-------------------------------------------------- */
(function($){
	var cookiekey = 'ffhcFontSize';
	$(function() {
		$('#fsSwitch li').click(function(e) {
			var c = this.id;
			switchStylestyle(c);
			switchImgActiviity(c);
			this.blur();
			e.preventDefault();
		});
		var c = $.readCookie(cookiekey);
		if(!c){ c = 'fsSmall'; }
		switchStylestyle(c);
		switchImgActiviity(c);
	});
	function switchStylestyle(styleName) {
		$('link[rel*=style][title]').each(function(i, item) {
			this.disabled = true;
			if (this.getAttribute('title') == styleName) { this.disabled = false; }
		});
		$.createCookie(cookiekey, styleName, 365);
	}
	function switchImgActiviity(styleName) {
		$('#fsSwitch li').each(function(i, item){
			var _this = $(this);
			var _img = _this.find('img');


			if(this.id == styleName){
				_img.attr('src', _img.data('src_o')).addClass('active').unbind();
			} else if(_img.hasClass('active')) {
				_img.attr('src', _img.data('src')).removeClass('active').imgHover();
			}
		});
	}
})($jq['1.4.1']);

/* --------------------------------------------------
	SEARCH FORM STRING
-------------------------------------------------- */
(function($){
	$(function() {
		var _form = $('#searchText').val('サイト内検索');
		var _val = _form.val();
		$('#searchText').focus(function(){
			if(_form.val() == _val){
				_form.val('');
			}
		}).blur(function(){
			if(_form.val() == ''){
				_form.val(_val);
			}
		});

		$('#submitBtn').click(function(e){
			this.blur();
			if(_form.val() == _val){
				_form.val('');
			}
		});
	});
})($jq['1.4.1']);

/* --------------------------------------------------
	FORM Style
-------------------------------------------------- */
(function($){
	$(function() {
		$('input:text.formStyle,input:password.formStyle,textarea.formStyle').focus(function(){
			$(this).addClass('focus');
		}).blur(function(){
			$(this).removeClass('focus');
		});
	});
})($jq['1.4.1']);

/* --------------------------------------------------
	Expand Frame
-------------------------------------------------- */
(function($){
	var _hoverClass = 'hover';
	var _expandClass = 'expand';
	var _duration = 300;
	var _easing = 'easeOutQuart';
	var _frames;
	$(function() {
		_frames = $('div.expandFrame').each(function(index, item){
			var _this = $(this);
			var _title = _this.find('div.expandTitle').removeClass(_expandClass);
			var _panel = _this.find('div.expandPanel').css({ overflow : 'hidden', height : 1 });
			_title.hover(function(e){
				_title.addClass(_hoverClass);
			},
			function(){
				_title.removeClass(_hoverClass);
			}).click(function(e){
				var _flag = _title.hasClass(_expandClass);
				if(_flag) {
					_panel.animate({ height : 1 }, _duration, _easing, function(){
						_panel.css({ overflow : 'hidden' });
					});
					_title.removeClass(_expandClass);
				} else {
					var _h = _panel.find('div.frameContent').outerHeight(true);
					_panel.animate({ height : _h }, _duration, _easing, function(){
						_panel.css({ height : 'auto', overflow : 'auto' })
					});
					_title.addClass(_expandClass);
				}
			});
		});

		$('a.openExpand').click(function(e){
			_frames.find('div.expandTitle').addClass(_expandClass);
			_frames.find('div.expandPanel').css({ height : 'auto', overflow : 'auto' });
			e.preventDefault();
		});
		$('a.closeExpand').click(function(e){
			_frames.find('div.expandTitle').removeClass(_expandClass);
			_frames.find('div.expandPanel').css({ height : 1, overflow : 'hidden' });
			e.preventDefault();
		});
	});
})($jq['1.4.1']);