/***************************
* website_title
****************************/
document.title="영어의 달인이 되는 특별한 학습비법";
//document.write("<script type='text/javascript' src='/common/js/alice/prototype.js'></script>");
//document.write("<script type='text/javascript' src='/common/js/utils.js'></script>");
/******************************************************************************/
/* popup
/******************************************************************************/
/* window_open 스크롤이 없을 때 */
function popWin(url, target, intwidth,intheight) {
	window.open(url, target , "width="+intwidth+",height="+intheight+",resizable=0,scrollbars=0");
}

/* window_open 스크롤이 있을 때 */
function popWinS(url, target, intwidth,intheight) {
	window.open(url, target , "width="+intwidth+",height="+intheight+",resizable=0,scrollbars=1");
}

/* window_close */
function popClose() {
	window.close();
}



/******************************************************************************/
/* flash
/******************************************************************************/

function flashImg (fName) {
	getUrlChangeCode();
    var g ="";
    var fSize ="";
	var bannerMenuCode = "";
    switch (fName) {
    	case "mainNavi"		 		: fSize = "width=976px height=110px" ; break;
    	case "mainVisualOut" 		: fSize = "width=976px height=310px" ; break;
    	case "mainVisualIn"	 		: fSize = "width=962px height=189px" ; break;
    	case "studyInfoMain"		: fSize = "width=760px height=683px" ; break;
    	case "easyVocaIntroduce" 	: fSize = "width=760px height=570px" ; break;
    	case "easyVocaService"    	: fSize = "width=284px height=169px" ; break;
    	case "banService"	 		: fSize = "width=476px height=90px" ; break;
    	case "banEvent" 	 		: fSize = "width=190px height=116px" ; break;
        case "mainBanner"	 		: fSize = "width=185px height=150px" ; break;
        case "subBanEvent"	 		: fSize = "width=185px height=116px" ; break;
        case "studyInfoMain"	 	: fSize = "width=760px height=683px" ; break;
        case "easyVocaIntroduce" 	: fSize = "width=760px height=570px" ; break;
        case "autoDown"	     		: fSize = "width=94px height=90px" ; break;
        case "Button"          		: fSize = "width=91px height=23px" ; break;
        case "downLoadBtn"         	: fSize = "width=207px height=40px" ; break;
        case "layerDownLoadBt"     	: fSize = "width=136px height=23px" ; break;
    }

	/* sub Event Menu code*/
	if(fName=='subBanEvent'){
		bannerMenuCode = getUrlChangeCode();
	}

	g+="	<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 ";
	g+="    codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 ";
	g+="    " + fSize + " id=" + fName + " align=middle>";
	g+="		<param name=allowScriptAccess value=middle>";
	g+="		<param name=movie value=/front/common/swf/" + fName + ".swf?dep1Code=" + dep1Code + "&dep2Code=" + dep2Code + "&BANNER_MENU_CODE=" + bannerMenuCode +">";
	g+="		<param name=quality value=high>";
	g+="		<param name=wmode value=transparent>";
	g+="		<embed src=/front/common/swf/" + fName + ".swf?dep1Code=" + dep1Code + "&dep2Code=" + dep2Code + "&BANNER_MENU_CODE=" + bannerMenuCode ;
	g+="         quality=high pluginspage=http://www.macromedia.com/go/getflashplayer ";
	g+="		 type=application/x-shockwave-flash wmode=transparent " + fSize + "></embed>";
	g+="	</object>";

    document.write(g);
}

function flashStarPollImg() {
	var g ="";
	var fSize ="";
	fSize = "width=82px height=27px";
	g+="	<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 ";
	g+="    codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 ";
	g+="    " + fSize + " id=starPoll align=middle>";
	g+="		<param name=allowScriptAccess value=middle>";
	g+="		<param name=movie value=/front/common/swf/starPoll.swf>";
	g+="		<param name=quality value=high>";
	g+="		<param name=wmode value=transparent>";
	g+="		<embed src=/front/common/swf/starPoll.swf ";
	g+="         quality=high pluginspage=http://www.macromedia.com/go/getflashplayer ";
	g+="		 type=application/x-shockwave-flash wmode=transparent " + fSize + "></embed>";
	g+="	</object>";
	return g;
}

/* subMenu code*/
function getUrlChangeCode(){
	var docURI = document.URL;
	var urlCode = 0;

	if (docURI.indexOf("/join/") > 0) {
    	urlCode = 4;
	} else if(docURI.indexOf("/level/") > 0){
		urlCode = 5;
	} else if (docURI.indexOf("/study/") > 0) {
    	urlCode = 6;
	} else if (docURI.indexOf("/theme/") > 0) {
    	urlCode = 7;
	} else if (docURI.indexOf("/enote/") > 0) {
    	urlCode = 8;
	} else if (docURI.indexOf("/support/") > 0) {
    	urlCode = 9;
	} else if (docURI.indexOf("/voca/") > 0) {
    	urlCode = 10;
	} else if (docURI.indexOf("/my/") > 0) {
    	urlCode = 11;
    } else if (docURI.indexOf("/account/") > 0) {
    	urlCode = 12;
    } else if (docURI.indexOf("/join/") > 0) {
    	urlCode = 13;
    } else if (docURI.indexOf("/global/studyAfterList.do") > 0) {
    	urlCode = 14;
    } else if (docURI.indexOf("/info/") > 0) {
    	urlCode = 15;
    } else if (docURI.indexOf("/customer/") > 0) {
    	urlCode = 16;
    } else if (docURI.indexOf("/global/attoMediaInfo.do") > 0) {
    	urlCode = 17;
    } else if (docURI.indexOf("/global/") > 0) {
    	urlCode = 18;
    }
    return urlCode;
}


function isLoginCheck(){
/*
	JLoginProcess.isLoginCheck(function(res){
		if(!res){
			alert('다른 컴퓨터에서 접속 하였습니다. 로그아웃 페이지로 이동합니다.');
			location.href = '/join/logout.do';
		}
		setTimeout("isLoginCheck()", 600000);
	});
*/	
}


/* autoVoca popup layer gloval variable*/
var popupAutoVocaSimpleOrder = null;
var popupAutoVocaOrderLayer = null;
var popupAutoVocaChipOrderLayer = null;
var popupVocaChipOrderOkLayer = null;
var popupAutoVocaLimitLayer = null;
var popupAutoPrimiumTicketLayer = null;
var popupAutoVocaSetupLayer = null;
var popupAutoVocaExecuteLayer = null;
var popupAirSetupLayer = null;
/* autoVoca popup layer gloval variable*/

/******************************************************************************/
/* studyInfoLayer
/******************************************************************************/
function studyInfo(viewCode){
	if ( viewCode == "viewOn" ){
		document.getElementById("studyInfoLayer").style.display = "block";
	} else if ( viewCode == "viewOff" ) {
		document.getElementById("studyInfoLayer").style.display = "none";
	}

}

function flash(url,w,h,id,xml){ 
var flashStr=
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="'+id+'" align="middle">'+
'<param name="allowScriptAccess" value="sameDomain" />'+
'<param name="allowFullScreen" value="false" />'+
'<param name="movie" value="'+url+'" />'+
'<param name="flashvars" value="'+xml+'" />'+
'<param name="quality" value="high" />'+
'<param name="wmode" value="transparent" />'+
'<embed wmode="transparent" src="'+url+'"  flashvars="'+xml+'" quality="high" width="'+w+'" height="'+h+'" id="'+id+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
'</object>';
 document.write(flashStr);
}
function b2b_startPremiumStudyV2(formname, taking_seq, studySeq, phaseSeq,studyPhasesSeq,studyStatus , curLevelPosition, curLevelDetailPosition, studyName,mother_lang_code, meaning_lang_code){
	var date = new Date();
	var form = $(formname);
	form.taking_seq.value = taking_seq;
	form.studySeq.value = studySeq;
	form.studyPhasesSeq.value = studyPhasesSeq;
	form.phaseSeq.value = phaseSeq;
	form.studyStatus.value = studyStatus;
	form.studyName.value = studyName;
	form.mother_lang_code.value = mother_lang_code;
	form.meaning_lang_code.value = meaning_lang_code;
	form.action="/corestudy/lectureViewV2.jsp";
	
	if( curLevelPosition  ){
		form.curLevelPosition.value = curLevelPosition;
		form.curLevelDetailPosition.value = curLevelDetailPosition;
	}
	
	window.open('', 'premiumStudy', 'width=980,height=580');
	form.target = "premiumStudy";
	form.submit();
}
function b2b_startReviewStudyV2(formname, taking_seq, studySeq, phase, studyPhasesSeq,studyName,reviewType,mother_lang_code, meaning_lang_code){

	
	var form = $(formname);
	form.taking_seq.value = taking_seq;
	form.studySeq.value = studySeq;
	form.phase.value = phase;
	form.studyPhasesSeq.value = studyPhasesSeq; 
	form.studyName.value = studyName;
	form.reviewType.value = reviewType;
	form.mother_lang_code.value = mother_lang_code;
	form.meaning_lang_code.value = meaning_lang_code;
	form.action="/b2b/front/corestudy/reviewLectureViewV2.jsp";

	window.open('', 'reviewStudy', 'width=980,height=580');
	form.target = "reviewStudy";
	form.submit();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
