﻿/********************************
토킹클럽 로그인 
*********************************/
function TalkingLogin(id, pw){
    var strURL = "https://sso.talkingclub.co.kr:389/mfirst_login.asp?id="+ id +"&pw=" + encodeURIComponent(pw);
    //var clubWin = window.open(strURL, "talkingLogin","width=0,height=0,left=10000,top=10000");
//    if (clubWin){
//        clubWin.close();
//    }
}

/********************************
토킹클럽 로그아웃
*********************************/
function TalkingLogout(){
    var obj = document.getElementById("TalkingLog");
    var strURL = "https://sso.talkingclub.co.kr:389/mfirst_logout.asp";            
    //var clubWin = window.open(strURL, "talkingLogin","width=0,height=0,left=10000,top=10000");  
}

/********************************
중학영어 관리단 로그인 
*********************************/
function EBYadminLogin(id, pw)
{
    var obj = document.getElementById("adminLogin");
    var param = base64Encode("usrid=" + id + "&usrpwd=" + encodeURIComponent(pw));

    var strURL = "http://admin.m-first.com/CenterAdmin/User/LoginProc.aspx?param=" + param;
    
    obj.src = strURL; 
    
}

/********************************
중학영어 관리단 로그아웃
*********************************/
function EBYadminLogout()
{
    var obj = document.getElementById("adminLogin");
    var strURL = "http://admin.m-first.com/CenterAdmin/User/Logout.ashx";
    obj.src = strURL;
}

/********************************
중학영어 프론트 로그인
*********************************/
function EBYFrontLogin(id, pw) {
    var obj = document.getElementById("frontLogin");
    var param = base64Encode("usrid=" + id + "&usrpwd=" + encodeURIComponent(pw));
    var strURL = "http://www.m-first.com/Front/Main/LoginProc.aspx?param=" + param;
    obj.src = strURL;    
}

/********************************
중학영어 프론트 로그아웃
*********************************/
function EBYFrontLogOut() {
    var obj = document.getElementById("frontLogin");
    var strURL = "http://www.m-first.com/Front/Custom/Logout.ashx";
    obj.src = strURL;
}

function EFXAdminLoginOut(strParam, type) {
   strParam = base64Decode(strParam);
   if (type == "1")
       location.href = "http://admin.m-first.com/CenterAdmin/User/LoginUser.ashx?" + strParam;
   else
       location.href = "http://www.m-first.com/Front/Custom/LoginUser.ashx?" + strParam;   
//       parent.top.location.href = "http://admin.m-first.com/CenterAdmin/";

}

function getWebEncode(strURL,strParam)
{
	try {
	    strParam = base64Decode(strParam);
        if (!checkObject(strParam))
            strParam = "";
		var objXMLHttp=getXMLHttpObject();
		var strText = "";
		var strMethod=strParam.length>0?"POST":"GET";
		if (objXMLHttp)
		{
			objXMLHttp.open(strMethod, strURL, false);
			objXMLHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			objXMLHttp.setRequestHeader("Content-length", strParam.length); 
	//		objXMLHttp.setRequestHeader("Connection", "close"); 
			objXMLHttp.send(strParam);
			strText=objXMLHttp.responseText;
			strText=strText.trim();
		}		
		return strText+"";
	}
	catch(e)
	{
	}
	return false;
}
