// JavaScript Document

/*
Thanks to SIMPLE * SIMPLE
http://www.simplexsimple.com/archives/2006/09/post.html
2009/03/26
*/

function GotoTop() {
var x1 = x2 = x3 = 0;
var y1 = y2 = y3 = 0;
if (document.documentElement) {
x1 = document.documentElement.scrollLeft || 0;
y1 = document.documentElement.scrollTop || 0;
}
if (document.body) {
x2 = document.body.scrollLeft || 0;
y2 = document.body.scrollTop || 0;
}
x3 = window.scrollX || 0;
y3 = window.scrollY || 0;
var x = Math.max(x1, Math.max(x2, x3));
var y = Math.max(y1, Math.max(y2, y3));
window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
if (x > 0 || y > 0) {
window.setTimeout("GotoTop()", 25);
}
}

// 全て選択
function all_check(obAll) {
	for (var i = 0; i < document.item_entry_form.length; i++) {
		if (document.item_entry_form[i].type == "checkbox") {
			document.item_entry_form[i].checked = obAll.checked;
		}
	}
}

// 全て選択以外のチェックボックスの処理
function other_check(obCh) {
	if (obCh.checked == false) {
		document.item_entry_form.allinfo.checked = false;
		return;
	}
	
	for (var i = 0; i < document.item_entry_form.length; i++) {
		// チェックボックスなら
		if (document.item_entry_form[i].type == "checkbox") {
			// 全て選択以外のチェックボックスに選択されていないものがあったら
			if (document.item_entry_form[i].checked == false && document.item_entry_form[i].name != "ch_all") {
				return;
			}
		}
	}
	// 全て選択をチェックする
	document.item_entry_form.allinfo.checked = true;
}

