// jQuery - Setting file

$(function() {
	$('a.lightbox').lightBox();
});

$(document).ready(function() {
	$(".close img[@src$=png]").pngfix();
});

$(document).ready( function () {
	$('a[@href^="http"]').not('[@href^="http://maps.google.co.jp"]').click(function(){
		window.open(this.href, '');
		return false;
	});
});

function initRollOverImages() {
	var image_cache = new Object();
	$("#gNavi 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);

function initRollOverImages2() {
	var image_cache = new Object();
	$(".rollover a img").not(".active").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(initRollOverImages2);



$(document).ready(function(){
	$('[@rel*="shadowbox"]').each(function() {
		var options = {
			resizeLgImages:     false,
			displayNav:         true,
			handleUnsupported:  'remove',
			keysClose:          ['c', 27] // c or esc
		};
		Shadowbox.init(options);
	});
});

