<!--//
function TMOver (st,col) { st.style.backgroundColor = 'f5f5f5'; }
function TMOut	(st) { st.style.backgroundColor = 'e9e9e9'; }
function smTMOver (st,col) { st.style.backgroundColor = 'f9f9f9'; }
function smTMOut	(st) { st.style.backgroundColor = 'f5f5f5'; }

function PopUP(URL,PopW, PopH) {
	if (URL == "/Login/") {
		alert("·Î±×ÀÎÀ» ÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
		fncCMAct('https://members.neungyule.com/pages/t_member/login.asp');
	} else {
	//	history.go(-1);
		var newWin = window.open(URL,"PopUP","scrollbars=yes,toolbar=no,resizable=no,menubar=no,fullscreen=no,width="+PopW+",height="+PopH);
	}
}
function PopUPScrollNO(URL,PopW, PopH) {
	var newWin = window.open(URL,"PopUP","scrollbars=no,toolbar=no,resizable=no,menubar=no,fullscreen=no,width="+PopW+",height="+PopH);
}

function PopUPScrollYES(URL,PopW, PopH) {
	var newWin = window.open(URL,"PopUP","scrollbars=yes,toolbar=no,resizable=no,menubar=no,fullscreen=no,width="+PopW+",height="+PopH);
}

function CheckLen(comp, maxLength){
	var temp;
	var bytes = 0;
	var limit_text='';
	var len = comp.value.length;
	
	for(i=0; i<len; i++){
		temp = comp.value.charAt(i);
		
		//escape codeÀÇ ±æÀÌ°¡ 4º¸´Ù Å©¸é ÇÑ±Û

		if(escape(temp).length > 4)
			bytes += 2;
		else
			bytes++;

		if (bytes<=maxLength)
			limit_text = limit_text+temp;
	}

	if(bytes>maxLength){
		alert("ÀÔ·ÂÇÑ ³»¿ëÀÇ ±æÀÌ´Â "+bytes+"byteÀÔ´Ï´Ù.\n\nÃÖ´ë "+maxLength+"byte±îÁö ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.\nÇÑ±ÛÀº 2byte¸¦ Â÷ÁöÇÕ´Ï´Ù.\n¿µ¹®Àº 1byte¸¦ Â÷ÁöÇÕ´Ï´Ù.");
		comp.value=limit_text;
		comp.focus();
		return;
	}	
}

function ImgMouse(objForm, imgName){	
	objForm.src=imgName;
}

function menuOver(itemName,iName) {
	for(i=1;i<=5;i++){					
		str = "Menu0"+i;								
		if (str != itemName){																		
			eval("document.all." + str + ".style.visibility='hidden'");			
			eval("document.topMU0"+i+"1.src='/images/main/ma_top_00"+i+"a.gif'");	
		}								
	}	 
	 eval("document.topMU0"+iName+"1.src='/images/main/ma_top_00"+iName+"b.gif'");
	 eval("document.all." + itemName + ".style.visibility='visible'");
}

function menuOut(itemName,iName) {
	for(i=1;i<=5;i++){					
		str = "Menu0"+i;								
		if (str != itemName){																		
			eval("document.all." + str + ".style.visibility='hidden'");		
			eval("document.topMU0"+i+"1.src='/images/main/ma_top_00"+i+"a.gif'");					  					
		}								
	}
	 eval("document.topMU0"+iName+"1.src='/images/main/ma_top_00"+iName+"b.gif'");
	 eval("document.all." + itemName + ".style.visibility='visible'");
}		 

/*
function menuOver2(itemName,iName) {
	for(i=1;i<=5;i++){					
		str = "Menu0"+i;								
		if (str != itemName){																		
			eval("document.all." + str + ".style.visibility='hidden'");			
			eval("document.topMU0"+i+"1.src='/WWW_Test/Images/ma_top_00"+i+"a.gif'");	
		}								
	}	 
	 eval("document.topMU0"+iName+"1.src='/WWW_Test/Images/ma_top_00"+iName+"b.gif'");
	 eval("document.all." + itemName + ".style.visibility='visible'");
}

function menuOut2(itemName,iName) {
	for(i=1;i<=5;i++){					
		str = "Menu0"+i;								
		if (str != itemName){																		
			eval("document.all." + str + ".style.visibility='hidden'");		
			eval("document.topMU0"+i+"1.src='/WWW_Test/Images/ma_top_00"+i+"a.gif'");					  					
		}								
	}
	 eval("document.topMU0"+iName+"1.src='/WWW_Test/Images/ma_top_00"+iName+"b.gif'");
	 eval("document.all." + itemName + ".style.visibility='visible'");
}		 
*/
function CalPre()
{        
        var tmpStr;
        tmpStr = document.OpinionForm.Opinion.value;
        cal_byte(tmpStr);
}

function cal_byte(aquery) 
{

        var tmpStr;
        var temp=0;
        var onechar;
        var tcount;
        tcount = 0;

        tmpStr = new String(aquery);
        temp = tmpStr.length;

        for (k=0;k<temp;k++)
        {
                onechar = tmpStr.charAt(k);
                if (escape(onechar) =='%0D') { } else if (escape(onechar).length > 4) { tcount += 2; } else { tcount++; }
        }

        //document.OpinionForm.remLen.value = tcount;
        document.all["StrLen"].innerHTML = tcount;
        if(tcount>60) {
                reserve = tcount-60;
                alert("³»¿ëÀº 60¹ÙÀÌÆ® ÀÌ»óÀº ÀÔ·Â ÇÏ½Ç¼ö ¾ø½À´Ï´Ù.rn ¾²½Å ³»¿ëÀº "+reserve+"¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.rn ÃÊ°úµÈ ºÎºÐÀº ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù."); 
                cutText();
        return;
        }        

}

function cutText()
{
        nets_check(document.OpinionForm.Opinion.value);
}

function nets_check(aquery)
{

        var tmpStr;
        var temp=0;
        var onechar;
        var tcount;
        tcount = 0;

        tmpStr = new String(aquery);
        temp = tmpStr.length;

        for(k=0;k<temp;k++)
        {
                onechar = tmpStr.charAt(k);

                if(escape(onechar).length > 4) {
                        tcount += 2;
                } else {
                        // ¿£ÅÍ°ªÀÌ µé¾î¿ÔÀ»¶§ °ª(rn)ÀÌ µÎ¹ø½ÇÇàµÇ´Âµ¥ Ã¹¹øÂ° °ª(n)ÀÌ µé¾î¿ÔÀ»¶§ tcount¸¦ Áõ°¡½ÃÅ°Áö ¾Ê´Â´Ù.
                        if(escape(onechar)=='%0A') {
                        } else {
                                tcount++;
                        }
                }

                if(tcount>60) {
                        tmpStr = tmpStr.substring(0,k);
                        break;
                }

        }
        document.OpinionForm.Opinion.value = tmpStr;
        cal_byte(tmpStr);

}

//Åä¸¶Åä º£ÀÌÁ÷ ¹«·á °­ÁÂ ±¸µ¿ ½ºÅ©¸³Æ®   2005-10-13  ÀåÀ±Á¤
function startLectureTB(capcode,display){
	viewerWindow = window.open('/lecturebasic/lecture_'+display+'.eng?course='+capcode,'LectureTB','width=1000, height=680, toolbar=0, location=0, menubar=0, status=0, scrollbars=0, resizable=0, top=0, left=0, fullscreen=no');
}

//Åä¸¶Åä º£ÀÌÁ÷ »ùÇÃ °­ÁÂ ±¸µ¿ ½ºÅ©¸³Æ®   2005-10-13  ÀåÀ±Á¤
function startLectureSample(display){
	viewerWindow = window.open('/lecturebasic/lecture_sample_'+display+'.eng','LectureTB','width=1000, height=680, toolbar=0, location=0, menubar=0, status=0, scrollbars=0, resizable=0, top=0, left=0, fullscreen=no');	
}

function fnc_buycompact(pdt_seq){
	var newwin = window.open('/purchase/toeic_settle.asp?seq=' + pdt_seq,'','width=450,height=480,top=0');
	newwin.focus();
}

function resultView(tid) {
	var receiptUrl = "https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid=" + tid  + "&noMethod=1";
	window.open(receiptUrl,"receipt","width=430,height=700, scrollbars=yes,resizable=yes,left=100,top=100");
}

function fnc_compactcalc() {
	if (document.calcForm.pdt_seq.value == '') {
		document.calcForm.pdt_seq.focus();
		alert('Test¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
		return;
	}

	if (document.calcForm.lc_cnt.value == '' || (document.calcForm.lc_cnt.value != parseInt(document.calcForm.lc_cnt.value)) ) {
		document.calcForm.lc_cnt.focus();
		alert('0-100±îÁöÀÇ ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.');
		return;
	}

	if (parseInt(document.calcForm.lc_cnt.value) > 100) {
		document.calcForm.lc_cnt.focus();
		alert('0-100±îÁöÀÇ ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.');
		return;
	}

	if (document.calcForm.rc_cnt.value == '' || (document.calcForm.rc_cnt.value != parseInt(document.calcForm.rc_cnt.value)) ) {
		document.calcForm.rc_cnt.focus();
		alert('0-100±îÁöÀÇ ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.');
		return;
	}

	if (parseInt(document.calcForm.rc_cnt.value) > 100) {
		document.calcForm.rc_cnt.focus();
		alert('0-100±îÁöÀÇ ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.');
		return;
	}

	document.calcForm.submit();
}

function compact_lecture(seq) {
	var newwin = window.open('/tomatoBookPds/compact_view.asp?seq=' + seq,'','width=' + screen.width + ' , height=' + screen.height);
	newwin.focus();
}
//-->