/* ready
----------------------------------------------- */
$(function() {

	// blocklink
	$(".linkbox").bind("click", blocklink);
	$(".list_entry dd").bind("click", blocklink);
	$(".search_service dd").bind("click", blocklink);

	// pageup
	$("#pgup a").bind("click", pageup);

	// jiritsustart
	$("#jiritsustart").bind("click", jiritsustart);

	// load
	$(window).bind("load", load);

});

/* load
----------------------------------------------- */
function load () {

	$(window).unbind("load");
	
	// smartRollover
	smartRollover();

}

/* smartRollover
----------------------------------------------- */
function smartRollover() {
	$("img").each(function() {
		if ($(this).attr("src").match("_off.")) {
			$(this).hover(imageRollOver, imageRollOut);
		}
	});
}
function imageRollOver() {
	$(this).attr("src", $(this).attr("src").replace("_off.", "_on."));
}
function imageRollOut() {
	$(this).attr("src", $(this).attr("src").replace("_on.", "_off."));
}

/* blocklink
----------------------------------------------- */
function blocklink() {
	var url = $("a", this).attr("href");
	window.location.href = url;
	return false;
}

/* jiritsustart
----------------------------------------------- */
function jiritsustart() {
	var w = window.open(this.href, 'jiritsu', 'top=100, left=100, width=1024, height=768, menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes');
	w.focus();
	return false;
}

/* page up
----------------------------------------------- */
function pageup() {
	$("html, body").animate({ scrollTop:0 }, 250);
	return false;
}

