var UserID = false;
var UserPWD = false;
function ch () {
if ( UserID ) return;
document.frmlogin.UserID.style.backgroundImage="";
//	UserID=true;
}

function ch2 () {
if ( UserPWD ) return;
document.frmlogin.UserPWD.style.backgroundImage="";
//	UserPWD=true;
}

function FuncUserIDUserPwdControllProc(stridx)
{
	var p;
	p = document.frmlogin;

	if(stridx == 1)
	{
		if(p.UserID.value == "")
			p.UserID.style.backgroundImage = "url('/Img/Common/login_userid.gif')";
	}
	else
	{
		if(p.UserPWD.value == "")
			p.UserPWD.style.backgroundImage = "url('/Img/Common/login_userpw.gif')";
	}
}


//###################### 
function FuncLogoutProc()
{
	var p;
	var strmode;

	p = document.frmlogin;
	strmode = p.strmode.value;

	location.href = "/Member/MemberLoginProc.asp?strmode=" + strmode
}

//################## 로그인 아이디 및 비번 체크 함수 #########################
function FuncMemberLoginProc()
{
	var p;
	p = document.frmlogin;
	if(p.UserID.value == "")
	{
		alert("아이디를 입력해 주시기 바랍니다.");
		p.UserID.focus();
		return false;
	}

	if(p.UserPWD.value == "")
	{
		alert("비밀번호를 입력해 주시기 바랍니다.");
		p.UserPWD.focus();
		return false;
	}
}
//#############################################################

//############# 시사 포커스 Open 창 함수 #########################
function FuncFocusOpen(strlink , strwidth , strhight)
{
	window.open(strlink , "linklink" , "width=" + strwidth + ",height=" + strhight + ",scrollbars=yes");
}
//######################################################

//############# 파일 다운 로드 함수 ########################
function FuncFileDownLoadProc(strFileName)
{ 
	//location.href = "/Admin/Common/FileDownLoad.asp?strFilePath=" + strFileName; 
	window.open(encodeURI("/Common/FileDownLoad.asp?strFilePath=" + strFileName), "asdf", "")  
}
//#################################################

//#################### 쪽지 Open 띄우기 Proc ##############################
function FuncUserMessageOpenProc()
{
	window.open("/Mypage/MyMessageReceiveList.asp", "Message", "width=700,height=500");
}
//#################################################################

//############ 전체 선택 및 전체 취소 하는 함수 #################
function CheckManage(fe,t)		// 전체선택 , 전체선택 취소
{ 
	if(fe.length) if(fe) for(var i=0; i<fe.length; i++) if(!fe[i].disabled) fe[i].checked = t.checked;
	if(!fe.length) fe.checked = t.checked;
}
//################################################

//################## 학습중인강의 Select 박스 이동하기 Proc #####################
function FuncCourseChoiceProc()
{
	var p;
	var StudentCode;
	var selectcnt;
	var CourseCode;
	var GroupCode;
	var ComCode;
	var CateCode1;
	var CateCode2;
	
	p = document.frmstudy;

	StudentCode = p.StudentCode.value
	if(StudentCode == "")
	{
		alert("학습중인 강의를 선택해 주시기 바랍니다.");
		return;
	}

	selectcnt = p.StudentCode.selectedIndex
	selectcnt = selectcnt - 1

	if(p.CourseCode.length == undefined)
	{
		CourseCode = p.CourseCode.value;
		GroupCode = p.GroupCode.value;
		ComCode = p.ComCode.value;
		CateCode1 = p.CateCode1.value;
		CateCode2 = p.CateCode2.value;
	}
	else
	{
		CourseCode = p.CourseCode[selectcnt].value;
		GroupCode = p.GroupCode[selectcnt].value;
		ComCode = p.ComCode[selectcnt].value;
		CateCode1 = p.CateCode1[selectcnt].value;
		CateCode2 = p.CateCode2[selectcnt].value;
	}

	//location.href = "/MyClass/MyClass.asp?CateCode1=800080100617&CateCnt=0&CourseCode=" + CourseCode + "&GroupCode=" + GroupCode + "&StudentCode=" + StudentCode + "&ComCode=" + ComCode;
	if(CateCode1 == 14)
	{
		
	location.href = "/MyClass/MyClassPMP.asp?CateCode1=700080100617&CateCnt=0&CourseCode=" + CourseCode + "&GroupCode=" + GroupCode + "&StudentCode=" + StudentCode + "&ComCode=" + ComCode;

	}
	
	else if(CateCode1 == 15) 

	{
	location.href = "/MyClass/MyClassPhone.asp?CateCode1=600080100617&CateCnt=0&CourseCode=" + CourseCode + "&GroupCode=" + GroupCode + "&StudentCode=" + StudentCode + "&ComCode=" + ComCode;
	}

	else if(CateCode2 == 120) 

	{
	location.href = "/MyClass/MyClassLive.asp?CateCode1=600080100617&CateCnt=0&CourseCode=" + CourseCode + "&GroupCode=" + GroupCode + "&StudentCode=" + StudentCode + "&ComCode=" + ComCode;
	}

	else

	{
		
	location.href = "/MyClass/MyClass.asp?CateCode1=800080100617&CateCnt=0&CourseCode=" + CourseCode + "&GroupCode=" + GroupCode + "&StudentCode=" + StudentCode + "&ComCode=" + ComCode;

	}

	
}

function FuncB2BCourseChoiceProc()
{
	var p;
	var StudentCode;
	var selectcnt;
	var CourseCode;
	var GroupCode;
	var ComCode;
	p = document.frmstudy;

	StudentCode = p.StudentCode.value;
	
	if(StudentCode == "")
	{
		alert("학습중인 강의를 선택해 주시기 바랍니다.");
		return;
	}

	selectcnt = p.StudentCode.selectedIndex;
	selectcnt = selectcnt - 1;

	if(p.CourseCode.length == undefined)
	{
		CourseCode = p.CourseCode.value;
		GroupCode = p.GroupCode.value;
		ComCode = p.ComCode.value;
	}
	else
	{
		CourseCode = p.CourseCode[selectcnt].value;
		GroupCode = p.GroupCode[selectcnt].value;
		ComCode = p.ComCode[selectcnt].value;
	}

	location.href = "/Esp/LectureRoom/Lectureroom.asp?CourseCode=" + CourseCode + "&GroupCode=" + GroupCode + "&StudentCode=" + StudentCode + "&ComCode=" + ComCode;
}
//##############################################################

//######################## 메인 Top의 과정 검색 Script Proc ##########################
function FuncMainCourseSearchProc(strcode)
{
	var p;
	var SearchString;

	p = document.frmcoursesearch;
	if(event.keyCode == 13 || strcode == 13)
	{
		if(p.SearchString.value == "")
		{
			alert("검색어를 입력해 주시기 바랍니다.");
			p.SearchString.focus();
			return false;
		}

		SearchString = p.SearchString.value;
		location.href = "/ClassInfo/ClassCourseSearch.asp?CateCode1=0121042617&CateCnt=1&SearchString=" + encodeURI(SearchString);
	}
}
//######################################################################

//########################## B2C Top 플래쉬 적용 Proc ###############################
function B2CMainTopFlashInsertProc(strTemp)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="920" height="135">')
	document.write('<param name="movie" value="' + strTemp + '">')
	document.write('<param name="quality" value="high">')
	document.write('<param name="wmode" value="transparent">')
	document.write('<embed src="/Img/Main/Main_img.swf" width="920" height="135" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object>')
	document.write('</object>')
}
//#########################################################################

//########################## B2C Top 메인 메뉴 링크 Proc ############################
function GotoMainMenuProc(strTemp)
{
	switch(strTemp)
	{
		case "Main":
			location.href = "/index.asp";
		break;
		case "Online":
			location.href = "/ClassInfo/ClassAllInfo.asp?CateCode1=12&CateCnt=1";
		break;
		case "Hakwon":
			location.href = "/ClassInfo/ClassList.asp?CateCode1=13&CateCode2=108&CateCnt=3";
		break;
		case "Mypage":
			location.href = "/Mypage/Mypage.asp?CateCode1=104217617&CateCnt=0";
		break;
		case "Pmp":
			location.href = "/ClassInfo/ClassAllInfo.asp?CateCode1=14&CateCnt=1";
		break;
		case "Info":
			location.href = "/Information/InformationMain.asp?CateCode1=1004617&CateCnt=0";
		break;
		case "Freezone":
			location.href = "/FreeZone/FreeZoneDefault.asp?CateCode1=12";
		break;
		case "Book":
			var newWin=window.open('http://book.chinasisa.com','','')
			//document.all["FamilySiteLink"].href = "http://www.japansisa.com/bookmall/index.asp"
		break;

}
}
//################################################################################


//######################## 강의 미리보기 Script ##############################################
function FuncCoursePreviewProc(CourseCode)
	{
		window.open("/ClassInfo/OpenCourseSample.asp?CourseCode=" + CourseCode, "SampleOpen", "width=200, height=200");
	}
//##################################################################################


//######################## 강의 미리보기 Script(창으로 열기) ##############################################
function FuncCoursePreviewProc2(CourseCode, WSize, HSize)
	{
	if(WSize==0 && HSize==0)
	//{var wView="channelmode=yes"}
	{var wView = "scrollbars=no, status=no,width="+(screen.width)+",height="+(screen.height)+";"}
	else	
	{var wView = "scrollbars=no, status=no,width="+WSize+",height="+HSize;}

	window.open("/ClassInfo/OpenCourseSample2.asp?CourseCode=" + CourseCode, "SampleOpen",wView);	
	}
//##################################################################################


//######################### 회원 학습 이력보기 Proc ############################################
function FuncMemberStudyingListProc(UserCode, ComCode)
{
	window.open("/Admin/MemberManager/MemberStudyList.asp?UserCode=" + UserCode + "&ComCode=" + ComCode, "MStudy", "width=800,height=600,scrollbars=yes");
}
//####################################################################################


//##################### 학습 결과 보기 Proc ###############################################333
function FuncCourseGradeProc(StudentCode, CourseCode, GroupCode, ComCode)
	{
		window.open("/Mypage/MypageCourseGrade.asp?StudentCode=" + StudentCode + "&CourseCode=" + CourseCode + "&GroupCode=" + GroupCode + "&ComCode=" + ComCode, "Grade", "width=710, height=530");
	}
//####################################################################################

//########################## 프리존 무료 동영상 오픈 Proc #########################################
function FuncFreezoneMovieOpenProc(strUrl, Width, Height)
{
	window.open(strUrl, "Open", "width=" + Width + ", height=" + Height);
}
//####################################################################################

//########################## 플래시관련 #########################################
function ieControl(id)
{
	document.write(id.innerHTML.replace("<!--","<").replace("-->",">")); id.id="";
}
//####################################################################################

//########################## 온라인사전 오픈 관련 #########################################
function MM_openDicWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//####################################################################################

//###################### 이벤트 쿠폰 발급 하기 Proc ##########################################
function FuncEventCouponInsertProc(CouponCode, StartDate, EndDate)
{
	window.open("/Mypage/MypageProc.asp?strmode=EventCouponInsert&CouponCode=" + CouponCode + "&StartDate=" + StartDate + "&EndDate=" + EndDate, "CouponInsert", "width=0,height=0");
}
//################################################################################


function flashActivate(fla_path, w, h)
{ 
	document.writeln("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+ w +"' height='"+ h +"' VIEWASTEXT>");
	document.writeln("	<param name='movie' value='"+ fla_path +"'>");
	document.writeln("	<param name='wmode' value='transparent'>");
	document.writeln("	<param name='quality' value='high'><param name='menu' value='false'>");
	document.writeln("	<embed src='"+ fla_path +"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ w +"' height='"+ h +"'></embed>");
	document.writeln("</object>");
}
