// jQuery - Setting file

$(document).ready( function () {
	$('a[@href^="http"]').not('a[@href*="jinsei-c.com"]').click(function(){
		window.open(this.href, '');
		return false;
	});

	$('a[@href*=".wvx"]').click(function(){
		window.open(this.href, '');
		return false;
	});

	$('#kohroTable a, #infoTable a, #busYearEvent a').click(function(){
		window.open(this.href, '');
		return false;
	});

	$('a[@rel*="shadowbox"]').each(function() {
		var options = {
			resizeLgImages:     false,
			displayNav:         true,
			handleUnsupported:  'remove',
			keysClose:          ['c', 27] // c or esc
		};
		Shadowbox.init(options);
	});

});


function initRollOverImages() {
	var image_cache = new Object();
	$('#gNavi a img, #openMovie a img').not('[@src*="_on."]').each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; }
		);
	});
}
$(document).ready(initRollOverImages);
