
//flash
function flash_contents(file,width,height){
document.writeln("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='"+width+"' HEIGHT='"+height+"' id='contents' ALIGN=''>");
document.writeln("<PARAM NAME=allowScriptAccess VALUE=always />");
document.writeln("<PARAM NAME=movie VALUE='"+file+"' />");
document.writeln("<PARAM NAME=quality VALUE=high>");
document.writeln("<PARAM NAME=bgcolor VALUE=#FFFFFF>");
document.writeln("<PARAM NAME=wmode VALUE=transparent> ");
document.writeln("<PARAM NAME=base VALUE=.> ");
document.writeln("<embed base='.' src='"+file+"' quality='high' bgcolor='#FFFFFF' width='"+width+"' height='"+height+"' name='contents' align='middle' allowScriptAccess='always' swLiveConnect='true' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />");
document.writeln("</OBJECT>");
}

function flash_contents_index(file,width,height){
document.writeln("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='"+width+"' HEIGHT='"+height+"' id='contents' ALIGN=''>");
document.writeln("<PARAM NAME=movie VALUE='"+file+"' />");
document.writeln("<PARAM NAME=wmode VALUE=transparent> ");
document.writeln("</OBJECT>");
}

//faq_?버??
function chgTap(no){
	
	for(i=1;i<=5;i++){
		document.getElementById('tab0'+i).src = "/images/customer/faq_tab_0"+ i + ".gif"
		document.getElementById('tabCon0'+i).style.display = "none";
	}
		document.getElementById('tab0'+no).src = "/images/customer/faq_tab_0"+ no + "_on.gif"
		document.getElementById('tabCon0'+no).style.display = "block";

}

//faq
function showfaq(faq_num) {
	var tit = document.getElementById("faq_tit" + faq_num);
	var answer = document.getElementById("faq_txt" + faq_num);
	if (tit.className == "faqText")
	{
		tit.className = "faqText on";
		answer.style.display = "block";
	} else {
		tit.className = "faqText";
		answer.style.display = "none";
	}
}

function showfaq_02(faq_num) {
	var tit = document.getElementById("faq02_tit" + faq_num);
	var answer = document.getElementById("faq02_txt" + faq_num);
	if (tit.className == "faqText")
	{
		tit.className = "faqText on";
		answer.style.display = "block";
	} else {
		tit.className = "faqText";
		answer.style.display = "none";
	}
}

function showfaq_03(faq_num) {
	var tit = document.getElementById("faq03_tit" + faq_num);
	var answer = document.getElementById("faq03_txt" + faq_num);
	if (tit.className == "faqText")
	{
		tit.className = "faqText on";
		answer.style.display = "block";
	} else {
		tit.className = "faqText";
		answer.style.display = "none";
	}
}

function showfaq_04(faq_num) {
	var tit = document.getElementById("faq04_tit" + faq_num);
	var answer = document.getElementById("faq04_txt" + faq_num);
	if (tit.className == "faqText")
	{
		tit.className = "faqText on";
		answer.style.display = "block";
	} else {
		tit.className = "faqText";
		answer.style.display = "none";
	}
}

function showfaq_05(faq_num) {
	var tit = document.getElementById("faq05_tit" + faq_num);
	var answer = document.getElementById("faq05_txt" + faq_num);
	if (tit.className == "faqText")
	{
		tit.className = "faqText on";
		answer.style.display = "block";
	} else {
		tit.className = "faqText";
		answer.style.display = "none";
	}
}

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).length > 4) {
			tcount += 2;
		}
		else if (onechar!='\r') {
			tcount++;
		}
	}
	
	var a= tcount/2;
	document.form1.msg_len.value = a.toFixed(0);
	

	if(tcount>600) {
		reserve = tcount-600;
		chrhk = reserve/2;
		chrhk = chrhk.toFixed(0);
		alert("?용? 300글???내??성??주십?요\n?성?신 메세지??"+chrhk+"글??초과?었?니??\n초과??부분? ?동?로 ???니??"); 
		cutText();
		return;
	}	
	
	// 문장???? 지?을 경우, 로깅 ?덱????
	if(tcount < 2) {
		document.form1.index.value = "0";
	}

}
function cal_pre()
{
	var tmpStr;
	tmpStr = document.form1.content.value;
	cal_byte(tmpStr);
}

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 if(onechar!='\r') {
			tcount++;
		}
		if(tcount>600) {
			tmpStr = tmpStr.substring(0,k);
			break;
		}
	}
	document.form1.content.value = tmpStr;
	cal_byte(tmpStr);
}
function cutText()
{
	nets_check(document.form1.content.value);
}
document.writeln("");
