//³ª¸¸ÀÇ ¿¹Áö¹ÌÀÎÃ£±â
//½ºÅÜ¿¡ ¸ÂÃç ÄíÅ°¿¡ °ªÀ» ÀúÀå
function myYeji_go(step)
{
	var maxStep = 5;

	if($("input:radio[name=answer]:checked").length == 0){
		alert("´ÙÀ½ ¹®Á¦·Î °¡½Ç·Á¸é ´äº¯À» ¸ÕÀú ¼±ÅÃÇÏ¼¼¿ä");
		return;
	}
	else
	{
		var ans = $("input:radio[name=answer]:checked").val();
		//¹®Á¦ ¼±ÅÃÀ» ¿Ã¹Ù¸£°Ô ÇßÀ» °æ¿ì
		//ÄíÅ°»ý¼º(À¥ÆäÀÌÁö Á¾·á½Ã Áï½Ã¸¸·á)
		setCookie(eval("'answer_"+(step-1)+"'"), ans, 1);

		if (step > maxStep)
		{
			parent.location.href = "/front/st/sub04_final.asp";
		}
		else
		{
			location.href = "f_"+(step)+".asp";
		}
		return;
	}
}

// ÀÌ¹ÌÁö src º¯°æ ÇÔ¼ö ##################################################
// EX) onmouseover, out ¾µ¶§ »ç¿ë
function imageChange(obj, isrc)
{
	$(obj).attr("src",isrc);
}

// ÇÃ·¡½Ã È£ÃâÇÔ¼ö ##################################################
function flashWrite(src, w, h, bg, wmode){
var str = src.split('.');
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'  width='"+w+"' height='"+h+"' id='"+str[0]+"' align='middle'>");
document.write("<param name='movie' value='"+src+"' />");
document.write("<param name='quality' value='high' />");
document.write("<param name='menu' value='false' />");
if(wmode == "yes"){
	document.write("<param name='wmode' value='transparent' />");
}
document.write("<embed src='"+src+"' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+str[0]+"' align='middle' wmode='transparent' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");
}

// ¿øº»ÀÌ¹ÌÁö º¸±â ##################################################
function openOrgImageView(path) {
	if (path.stripspace() == "") return;
	openPopup("/common/pop_orgImageView.asp?path="+encodeURI(path), "OrgImageView", 100, 100, "status=yes, resizable=yes");
}

// »óÇ°ÀÌ¹ÌÁö º¸±â ##################################################
function openZoomGoodsImg(guid, cate) {
	openPopup("/common/pop_zoom_goods.asp?guid="+guid+"&cate="+cate, "ZoomGoodsImg", 700, 546);
}

// ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿¼º Ã¼Å© ##################################################
function checkResNo(resNo1, resNo2) {
	var i;

	if (resNo1.value.stripspace() == "" || resNo2.value.stripspace() == "") return false;

	var total = 0;
	var key = new Array(2,3,4,5,6,7,8,9,2,3,4,5);
	var resNo = resNo1.value + resNo2.value;

	if (resNo.length == 13) {
		for (i=0; i<12; i++) {
			total = total + (eval(resNo.charAt(i)) * key[i]);
		}
		result = (11 - (total % 11)) % 10;

		if (eval(resNo.charAt(12)) != result) {
			alert ("À¯È¿ÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
			resNo1.value = "";
			resNo2.value = "";
			resNo1.focus();
			return false;
		}
		else {
			return true;
		}
	}
	else if (resNo1.value.stripspace().length != 6) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â 6ÀÚ¸®ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
		resNo1.value = "";
		resNo1.focus();
		return false;
	}
	else if (resNo2.value.stripspace().length != 7) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®´Â 7ÀÚ¸®ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
		resNo2.value = "";
		resNo2.focus();
		return false;
	}
}

// »ç¾÷ÀÚ¹øÈ£ À¯È¿¼º Ã¼Å© ##################################################
function checkBizNo(bizno1, bizno2, bizno3) {
	var i, ChkRule = "137137135";
	var step1, step2, step3, step4, step5, step6, step7;

	var strBizNo = bizno1.value + bizno2.value + bizno3.value; // »ç¾÷ÀÚ¹øÈ£ 10ÀÚ¸®

	step1 = 0; // ÃÊ±âÈ­

	for (i=0; i<7; i++) {
		step1 = step1 + (strBizNo.substring(i, i+1) *ChkRule.substring(i, i+1));
	}

	step2 = step1 % 10;
	step3 = (strBizNo.substring(7, 8) * ChkRule.substring(7, 8))% 10;
	step4 = strBizNo.substring(8, 9) * ChkRule.substring(8, 9);
	step5 = Math.round(step4 / 10 - 0.5);
	step6 = step4 - (step5 * 10);
	step7 = (10 - ((step2 + step3 + step5 + step6) % 10)) % 10;

	if (strBizNo.substring(9, 10) != step7) {
		alert ("À¯È¿ÇÑ »ç¾÷ÀÚ¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
		bizno1.value = "";
		bizno2.value = "";
		bizno3.value = "";
		bizno1.focus();
		return false;
	}
	else {
		return true;
	}
}

// ·Î±×ÀÎ ##################################################
function gotoLogin() {
	location.href = "/login.asp?redirect="+escape(document.URL);
}

// ·Î±×ÀÎ ##################################################
function e_gotoLogin(moveURL) {
	parent.location.href = "/login.asp?redirect="+escape(moveURL);
}

