document.write ('<script type="text/javascript" src="http://krn2011.ikeninc.jp/common/script/jquery.scrollTo.js"></script>');
document.write ('<script type="text/javascript" src="http://krn2011.ikeninc.jp/common/script/jquery.lightbox.js"></script>');


/* child
--------------------------------------------------------- */
$ (function () {

	if ($.browser.msie) {
		if ($.browser.version < 7) {
			$ (":first-child").addClass ("first-child");
			$ ("input").each (function () {
				$ (this).addClass ($ (this).attr ("type"));
			});
		}
		if ($.browser.version < 8) {
			$ (":last-child").addClass ("last-child");
		}
	}
});


/* lightbox
--------------------------------------------------------- */
$ (function() {
	$ ("ul.gallery a").lightBox();
	$ ("div.gallery-thumbnail a").lightBox();
});


/* rollover
--------------------------------------------------------- */
$ (function () {
	$ ("img.rollover").each (function () {
		$ ("<img />").attr ("src", this.src.replace (/\.([^.]+)$/, "_hover." + "$1"));
	});
	$ ("a:has(img.rollover)").hover (function () {
		$ ("img.rollover", this).each (function () {
			this.src = this.src.replace (/\.([^.]+)$/, "_hover." + "$1");
		});
	}, function () {
		$ ("img.rollover", this).each (function () {
			this.src = this.src.replace (/_hover\.([^.]+)$/, "." + "$1");
		});
	});
	$ ("input.rollover").each (function () {
		$ ("<img />").attr ("src", this.src.replace (/\.([^.]+)$/, "_hover." + "$1"));
		$ (this).hover (function () {
			this.src = this.src.replace (/\.([^.]+)$/, "_hover." + "$1");
		}, function () {
			this.src = this.src.replace (/_hover\.([^.]+)$/, "." + "$1");
		});
	});
});

/* scroll
--------------------------------------------------------- */
$ (function () {
	$ ("p#pagetop a").click (function (){
		$.scrollTo( 0, 400 );
		return false;
	});
});
