document.write ("<script type='text/javascript' src='/common/script/jquery.lightbox.js'></script>");
document.write ("<script type='text/javascript' src='/common/script/jquery.scrollTo.js'></script>");
document.write ("<script type='text/javascript' src='/common/script/swfobject.js'></script>");


/* background
--------------------------------------------------------- */
$ (function () {
	$ ('body#index div#main h2').hover (function () {
			$(this).next().css("background-color","#262626");
		},
		function () {
			$(this).next().css("background-color","#1a1a1a");
	});
});

$ (function () {
	$ ('body#about.staff div#main ul.index-block li h3').hover (function () {
			$(this).next().css("background-color","#262626");
		},
		function () {
			$(this).next().css("background-color","#1a1a1a");
	});
});


/* child
--------------------------------------------------------- */
$ (function () {
	if ($.browser.msie) {
		$ ("body :last-child").addClass ("last-child");
		if ($.browser.version < 7) {
			$ (":first-child").addClass ("first-child");
			$ ("input").each (function () {
				$ (this).addClass ($ (this).attr ("type"));
			});
		}
	}
});


/* equal height
--------------------------------------------------------- */
$ (function () {
	for (var i = 1; $ (".equal-bottom-" + i).length; i++) {
		var block = $ (".equal-bottom-" + i);
		var height = 0;
		block.each (function () {
			height = Math.max ($ (this).offset ().top + $ (this).height (), height);
		});
		block.each (function () {
			$ (this).height (height - $ (this).offset ().top);
		});
	}
});


/* external
--------------------------------------------------------- */
$ (function () {
	$ (".external").attr ("target", "_blank");
});



/* indent
--------------------------------------------------------- */
$ (function () {
	$ ("span.marker").parent ().parent ().each (function () {
		var marker = $ (this).children ().children ("span.marker");
		var width = 0;
			marker.each (function () {
			width = Math.max (width, $ (this).css ("display", "inline").width () - parseInt ($ (this).css ("text-indent")));
		});
		var margin = (parseInt ($ (marker [0]).css ("margin-right")) + width) + "px";
		$ (this).css ("margin-left", margin);
		marker.width (width).css ("margin-left", "-" + margin);
	});
});


/* lightbox
--------------------------------------------------------- */
$ (function () {
	$('a[href$=".jpg"]').addClass("lightbox");
	$ ('.lightbox').lightBox();
});


/* margin
--------------------------------------------------------- */
$ (function () {
	$("h2 + p").css("margin-top", "-5px");
});


/* 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 () {
	$ ('div.pagetop-block a').click (function () {
		$.scrollTo( 0, 400 );
		return false;
	});
});

