
try {
	oCrypt.AntiPopupBlock(location.hostname);
	oCrypt.AntiActiveContents();
} catch (e) { }

function onLogin(url, launch) {
	if (eLABEL.EL_TYPE == 1 && !USE_CRYPT_PLUGIN && location.protocol != "https:") {
		location.replace("https://"+location.host+location.pathname);
		return;
	}
	if (!oCrypt) {
		goGuidance();
		return;
	}
	var SchoolCode = oCrypt.GetSchoolCode();
	if (/*USE_CRYPT_PLUGIN && */SchoolCode == "") {
		goGuidance();
		return;
	}

	var bZai = -1;
	try { bZai = oCrypt.IsZaiUser(); }
	catch( e ) {
		goGuidance();
		return;
	}
	if (bZai != 0) {
		goGuidance();
		return;
	}

	if (typeof(IsAllowedTeacherLogin) != "undefined" && !IsAllowedTeacherLogin()) {
		alert("権限がありません。");
		location.replace('/');
		return;
	}

	if (!USE_CRYPT_PLUGIN || launch%10) {
		var g_cr = new TCrypt( oCrypt, url );
		g_cr.param["schoolCode"] = SchoolCode;
		g_cr.param["zaitaku"] = bZai;
		g_cr.param["launch"] = launch;
		g_cr.SendCrypt();
	}
	else {
		try {
			oCrypt.LaunchIE("http://"+location.host+url+"?launch="+(launch+1));
		}
		catch( e ) {
			goGuidance();
			return;
		}
	}
}

