function validateLogin() {
	var f = document.loginForm;

	if (f.userid.value.search(/\S/) < 0 || f.userid.value == '아이디') {
		alert("아이디를 입력하세요");
		f.userid.focus();
		return false;
	}

	if (f.passwd.style.display == 'none') {
		f.passwd_1.style.display = 'none';
		f.passwd.style.display = 'block';

		alert("비밀번호를 입력하세요");
		f.passwd.focus();
		return false;
	}

	if (f.passwd.value.search(/\S/) < 0) {
		alert("비밀번호를 입력하세요");
		f.passwd.focus();
		return false;
	}

	var day = new Date();
	day.setMonth( day.getMonth()+ ( f.saveId.checked ? 1 : -1 ) )
	document.cookie = "login_saved=" + f.userid.value + "; path=/; expires=" + day.toGMTString() + ";"

	f.action = "http://eagle.ebslang.co.kr/ebs/fhz.AilSSOLoginSubmit.laf";
	f.submit();
}

function clear_logintext(type) {
	if (type == 'id') {
		if (document.all['userid'].value == '아이디')
			document.all['userid'].value = '';
	} else {
		document.all['passwd_1'].style.display = 'none';
		document.all['passwd'].style.display = 'block';
		document.all['passwd'].focus();
	}
}


function attendHistView(o) {
	var value = o.value;

	if (value != '') {

		var arr = value.split("|");
    if(arr[4]=="O"){
		  cmiShow(arr[0], arr[1], arr[2]); //stepid(스텝수강이력ID)

    } else {
      courseShow(arr[3],arr[2]); //쿠폰 무료사용
    }

		o.value = "";
		o.blur();
	}
}

function goFamilySite(o) {
	if (o.value != '') {
		//top.location.href = o.value;
    //window.open(o.value, '_blank', 'fullscreen=no,resizable=yes,menubar=yes,status=yes,toolbar=yes,titlebar=yes,location=yes,scrollbar=yes');
    window.open(o.value, '', '');
	}
}


function getSavedId(){
	var cookieValue = document.cookie+';';
	index1 = cookieValue.indexOf('login_saved', 0);

	if(index1 != -1){
		cookieValue = cookieValue.substring(index1, cookieValue.length);
		var index2 = cookieValue.indexOf('=', 0) + 1;
		var index3 = cookieValue.indexOf(';', index2);

		var userId = unescape(cookieValue.substring(index2, index3));

		if(userId != ''){
			if (document.loginForm) {
				document.loginForm.userid.value = userId;
				document.loginForm.saveId.checked = true;
			}
		}
	}
}

// 슬라이드
self.onError    = null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0;
lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;

var tmp1 = tmp2 = tmp3 = 0;

function heartBeat()
{
	tmp1 = document.body.clientHeight;

	tmp2 = document.body.clientHeight;

	if ( tmp1 != tmp2 )
	{
		tmp3 =  tmp2 - tmp1;
		tmp1 = tmp2;
		if ( tmp3 < 0 ) { }
	}

	if ( IE )
	{
		diffY = document.body.scrollTop;
		diffX = 0;
	}

	if ( NS )
	{
		diffY = self.pageYOffset;
		diffX = self.pageXOffset;
	}

	if ( diffY != lastScrollY )
	{
		percent = .1 * (diffY - lastScrollY);

		if ( percent > 0 )
			percent = Math.ceil(percent);
		else
			percent = Math.floor(percent);

		if ( IE )   document.all.Layer1.style.pixelTop += percent;
		if ( NS )   document.Layer1.top += percent;

		lastScrollY = lastScrollY + percent;
	}

	if ( diffX != lastScrollX )
	{
		percent = .1 * (diffX - lastScrollX);

		if ( percent > 0 )
			percent = Math.ceil(percent);
		else
			percent = Math.floor(percent);

		if ( IE )   document.all.Layer1.style.pixelLeft += percent;
		if ( NS )   document.Layer1.top += percent;

		lastScrollY = lastScrollY + percent;
	}
}
