function makeWindow(locationStr, winName) {
	optionStr = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,top=1,left=1,width=500,height=300";
	winObject = window.open(locationStr,winName, optionStr);
	winObject.opener.name = this.name;
}

function noteWindow(locationStr, winName) {
	optionStr = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,top=1,left=1,width=240,height=150";
	winObject = window.open(locationStr,winName, optionStr);
	winObject.opener.name = this.name;
}

function total_submit(){
	document.theForm.submit();
	return;
}

function isCompanyNumber(a, b, c) {
    var num = String(a) + String(b) + String(c);
    var strA = num.substr(0, 1);
    var strB = num.substr(1, 1);
    var strC = num.substr(2, 1);
    var strD = num.substr(3, 1);
    var strE = num.substr(4, 1);
    var strF = num.substr(5, 1);
    var strG = num.substr(6, 1);
    var strH = num.substr(7, 1);
    var strI = num.substr(8, 1);
    var strJ = num.substr(9, 1);
    var strK = strA * 1 + strB * 3 + strC * 7 + strD * 1 + strE * 3 + strF * 7 + strG * 1 + strH * 3;
    var strsum = eval(strK);
    var chkno = eval(strI * 5);
    if (chkno > 9) {
        chkno = strsum + Math.floor(chkno / 10) + Math.floor(chkno % 10) + parseInt(strJ,10);
    } else {
        chkno = strsum + chkno + parseInt(strJ,10);
    }

    if (chkno>99) {
        chkno = (chkno % 100) % 10;
        chkno = Math.floor(chkno);
    } else {
        if(chkno>9) {
            chkno = Math.floor(chkno % 10);
        }
    }
    if (chkno!=0) {
        return false;
    }
    return true;
}

function isCitizenNumber(varCitizenNumber1, varCitizenNumber2) {
	var varRegistration = String(varCitizenNumber1) + String(varCitizenNumber2);

	if(varRegistration.length != 13) {
		return false;
	}
	var intCheckSum = new Number;
	for(i=0; i < 8; i++) {
		intCheckSum = intCheckSum + varRegistration.charAt(i) * (i+2);
	}
	for(i=0; i < 4; i++) {
		intCheckSum = intCheckSum + varRegistration.charAt(i+8) * (i+2);
	}
	intCheckSum = intCheckSum % 11;
	if(intCheckSum == 0) {
		intCheckSum = 10;
	} else if(intCheckSum == 1) {
		intCheckSum = 11;
	} else {
		intCheckSum = intCheckSum;
	}
	intCheckSum = 11 - intCheckSum;
	if(intCheckSum != varRegistration.charAt(12)) {
		return false;
	}
	return true;
}

function isEmail(str) {
	var regExpEmail = /^.+\@.+\..+$/
	return regExpEmail.test(str);
}

function number_check(object) {
    if (event.keyCode!=8  &&
        event.keyCode!=9  &&
        event.keyCode!=13 &&
        event.keyCode!=16 &&
        event.keyCode!=17 &&
        event.keyCode!=18 &&
        event.keyCode!=19 &&
        event.keyCode!=20 &&
        event.keyCode!=21 &&
        event.keyCode!=229) {
        //alert (event.keyCode);
        if (event.keyCode<45 || event.keyCode>57) {
            if (event.keyCode<95 || event.keyCode>105) {
                alert ("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä");
                //event.returnValue=false;
                object.value="";
            }
        }
    }
}
//onKeyUp="number_check(this)"

function doBlink() {
    var blink = document.all.tags("BLINK");
    for (var i=0; i < blink.length; i++) {
        blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
    }
}
function startBlink() {
    if (document.all) {
        setInterval("doBlink()",400);
    }
}
//window.onload = startBlink;
//<blick>¾îÂ¼±¸ÀúÂ¼±¸</blink>

function Ltrim(str) {
    var lpatt = new RegExp( "^ *(.*)$" );
    var parse = str.match( lpatt );
    return parse[1];
}

function getCookie(name) {
    var found = false;
    var start, end;
    var i = 0;

    while (i <= document.cookie.length) {
        start = i;
        end = start + name.length;
        if (document.cookie.substring(start, end)==name) {
            found = true;
            break;
        }
        i++;
    }
    if (found == true) {
        start = end + 1;
        end = document.cookie.indexOf(";", start);
        if(end < start) {
            end = document.cookie.length;
        }
        return document.cookie.substring(start, end);
    } else {
        return "";
    }
}

function setCookie(name) {
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + 1 );
    document.cookie = name+"=O; path=/; expires="+todayDate.toGMTString()+";"
}

function send() {
    var error = "ok";
    if (error=="ok" && Ltrim(document.theForm.v_title.value)=="") {
        error = "ng";
        alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À");
    }
    if (error=="ok" && Ltrim(document.theForm.v_name.value)=="") {
        error = "ng";
        alert("¼º¸íÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À");
    }
    if (error=="ok" && document.theForm.v_email.value=="") {
        error = "ng";
        alert ("¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
    }
    if (error=="ok" && !isEmail(document.theForm.v_email.value)) {
        error = "ng";
        alert ("¸ÞÀÏÁÖ¼Ò°¡ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù");
    }
    if (error=="ok" && document.theForm.v_tel.value=="") {
        error = "ng";
        alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À");
    }
    if (error=="ok" && document.theForm.v_cont.value=="") {
        error = "ng";
        alert("¹®ÀÇÇÏ½Ç ³»¿ëÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À");
    }
    if (error=="ok") {
        document.theForm.submit();
    }
}


