function gSetting() {
// location
	$('#gnav li a').each(function() {
		var url = document.URL.split("/");
		crtdir     = url[3];
		crtdirPath = url[4];
		if(crtdir) {
			$('#gnav li a[href*='+ crtdir +']').not('#gnav .sub li a').parent().addClass('current');

		} else {
			$('#gnav li a[href*="/index.html"]').parent().addClass('current');

		}
	});

// box effect
	$('#gnav li.sub ul').hide();

	$('#gnav li.sub').hover(function(){
		$(this).addClass('active');
		$(this).children('ul').show();
	},function(){
		$(this).removeClass('active');
		$(this).children('ul').hide();
	});
	$('#gnav .current img').not('.current ul img').each(function() { this.src = this.src.replace(/(\.gif|\.jpg|\.png)/, "_crt"+'$1'); });

// rollover
	var aPreLoad = new Object();
	$('#header ul a img, img.imgover, .btn a img, .banner a img').not('[src*="_crt"], [src*="_ov"], .current>a img').each(function(i) {
		var tsrc = this.src;
		var ftype = this.src.lastIndexOf(".");
		var hsrc = this.src.substr(0, ftype) + "_ov" + this.src.substr(ftype, 4);
		aPreLoad[this.src] = new Image(); aPreLoad[this.src].src = hsrc;
		$(this).hover( function() { this.src = hsrc; }, function() { this.src = tsrc; });
	});

	$('a[rel="external"]').click(function(){ this.target = '_blank';});
}

$(function(){
// load
	$('#gnav').load('/common/inc/globalnav.txt', function(){ gSetting();});

// chart
	$('#chart table td .balloon').hide();
	$('#chart table td').wrapInner('<div class="block"></div>').hover(function(){
		$(this).find('.balloon').show();
	},function(){
		$(this).find('.balloon').hide();
	});

// noflash rotation img
	$('#mainVisual').innerfade({
		speed: 'slow',
		timeout: 6000,
		type: 'sequence',
		containerheight: '345px'
		// count: 2
	});

// etc
	$('.pageSpecial #content .section .btn a').bigTarget({ hoverClass: 'over', clickZone : 'div:eq(1)'});
	$('.linkblock').hover(function(){
		$(this).find('.btn a img').each(function() {
			this.src = this.src.replace('.jpg', '_ov.jpg');
		});
	},function(){
		$(this).find('.btn a img').each(function() {
			this.src = this.src.replace('_ov.jpg', '.jpg');
		});
	});
	$('#sitemap a[rel="external"]').append('<img src="/common/img/icon_newwin.gif" alt="別ウィンドウで移動します">').click(function(){
		this.target = "_blank";
	});

});


