var GetHistoryList = function(elm, url, vmPath){
	if(window == this || !this.init){
		return new GetHistoryList(elm, url, vmPath);
	}
	return this.init(elm, url, vmPath);
};

GetHistoryList.prototype.init = function( elm, url, vmPath){
	this.elm = elm;
	this.url = url;
	this.vmPath = vmPath;
};

GetHistoryList.prototype.load = function(){
	var elm = this.elm;
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: {
			"vmPath": this.vmPath
		},
		success: function(html){
			$('#' + elm).empty().append(html);
			EventHandler.bind('#' + elm);
		}
	});
};

function sendCheckBox(siryoFlg,contextPath){
	var address = "";
	var param = "";
	var checkBoxs = null;

	checkBoxs = document.validateForm.selectedGakkoCd;

	// パンフ
	if (siryoFlg == 1){
		for (var i = 0; i < checkBoxs.length; i++) {
			if (checkBoxs[i].checked){
				var panfuAriFlag = "#panfuAriFlag_"+checkBoxs[i].value;
				if( 0 == $(panfuAriFlag).val() ) {
					alert("パンフ請求不可校が含まれています");
					return;
				}
				param += "gakkoCd="+checkBoxs[i].value+"&";
			}
		}
		address = contextPath + "?seikyuShubetsu=0&shiryoShubetsu=01&pCd=TP0000000001&yuryoDispFlag=1&";

	// 願書
	}else if (siryoFlg == 2){
		for (var i = 0; i < checkBoxs.length; i++) {
			if (checkBoxs[i].checked){
				var ganshoAriFlag = "#ganshoAriFlag_"+checkBoxs[i].value;
				if ( 0 == $(ganshoAriFlag).val() ) {
					alert("願書請求不可校が含まれています");
					return;
				}
				param += "gakkoCd="+checkBoxs[i].value+"&";
			}
		}
		address = contextPath + "?seikyuShubetsu=0&shiryoShubetsu=02&pCd=TP0000000001&yuryoDispFlag=1&";
	}

	if (param == ""){
		alert("チェックがありません。");
	} else{
		param = param.slice(0,-1)
		location.href=address+param;
	}
}

// 資料情報表出時のファンクション(要件変更により不必要)
function sendCheckBoxBackUp(siryoFlg,contextPath){
	var address = "";
	var param = "";
	var checkBoxs = null;

	checkBoxs = document.validateForm.selectedGakkoCd;

	// パンフ
	if (siryoFlg == 1){
		for (var i = 0; i < checkBoxs.length; i++) {
			if (checkBoxs[i].checked){
				var panfuAriFlag = "#panfuAriFlag_"+checkBoxs[i].value;
				if( 0 == $(panfuAriFlag).val() ) {
					alert("パンフ請求不可校が含まれています");
					return;
				}
				param += "gakkoCd="+checkBoxs[i].value+"&";
			}
		}
		address = contextPath + "?seikyuShubetsu=0&shiryoShubetsu=01&pCd=TP0000000001&yuryoDispFlag=1&";

	// 願書
	}else if (siryoFlg == 2){
		for (var i = 0; i < checkBoxs.length; i++) {
			if (checkBoxs[i].checked){
				var ganshoAriFlag = "#ganshoAriFlag_"+checkBoxs[i].value;
				if ( 0 == $(ganshoAriFlag).val() ) {
					alert("願書請求不可校が含まれています");
					return;
				}
				param += "gakkoCd="+checkBoxs[i].value+"&";
			}
		}
		address = contextPath + "?seikyuShubetsu=0&shiryoShubetsu=02&pCd=TP0000000001&yuryoDispFlag=1&";
	}

	if (param == ""){
		alert("チェックがありません。");
	} else{
		param = param.slice(0,-1)
		location.href=address+param;
	}
}
