function IsNumber(m_num)  //ÀÔ·Â°ªÀÌ ¼ýÀÚÀÎÁö °Ë»ç
{
	if (!IsEmpty(m_num))
	{
		for (j = 0; j < m_num.length; j++)
		{
			if (((m_num.substring(j, j+1) < "0") || (m_num.substring(j, j+1) > "9")))
			{
				return false;
			}
		}
	}
	else
	{
		return false;
	}
	return true;
}

function IsEmpty(m_str)  //ÀÔ·Â°ªÀÌ ºó°ªÀÎÁö °Ë»ç
{
	var LNum;

	LNum = m_str.length;

	for(i=0;i<LNum;i++)
	{
		m_str = m_str.replace(" ", "");
	}

	if (m_str == "")
	{
		return true;
	}
	else
	{
		return false;
	}
}
function search_go()
{
	if(IsEmpty(document.main_search.main_search_word.value)) { alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù."); document.main_search.main_search_word.value=""; document.main_search.main_search_word.focus(); return false;;}
	if(document.main_search.main_search_where.value=='guin')
	{
		location.href="/guin/index.html?sub_page=search_page.html&main_search_where="+document.main_search.main_search_where.value+"&main_search_word="+document.main_search.main_search_word.value;
		return false;
	}
	else if(document.main_search.main_search_where.value=='career')
	{
		location.href="/career/index.html?sub_page=search_page.html&main_search_where="+document.main_search.main_search_where.value+"&main_search_word="+document.main_search.main_search_word.value;
		return false;
	}
	else if(document.main_search.main_search_where.value=='gosi')
	{
		location.href="/gosi/index.html?sub_page=search_page.html&main_search_where="+document.main_search.main_search_where.value+"&main_search_word="+document.main_search.main_search_word.value;
		return false;
	}
	else if(document.main_search.main_search_where.value=='community')
	{
		location.href="/community/index.html?sub_page=search_page.html&main_search_where="+document.main_search.main_search_where.value+"&main_search_word="+document.main_search.main_search_word.value;
		return false;
	}
	else if(document.main_search.main_search_where.value=='guide')
	{
		location.href="/guide/index.html?sub_page=search_page.html&main_search_where="+document.main_search.main_search_where.value+"&main_search_word="+document.main_search.main_search_word.value;
		return false;
	}
	else
	{
		alert('°Ë»öÇÒ À§Ä¡¸¦ ¼±ÅÃÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
		return false;
	}
}

function open_coupon()
{
	window.open('/online_job.html','Coupon_Win','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes, left=200,top=100, width=720,height=430');
}

var c=false;
function ch ()
{
	if ( c ) return;
	document.main_search.main_search_word.style.backgroundImage="";
	c=true;
}
function search_10() {
	if(document.main_search.main_search_where.value == 'guin_1')
	{
		location.href="/guin/index.html?sub_page=search_main.html";
	}else if(document.main_search.main_search_where.value == 'career_1'){
		location.href="/career/index.html?sub_page=search_main.html";
	}

}

//±ÇÇÑ¿¡ µû¸¥ ¾È³»¹®±¸
function no_c_member(type,value)
{
	if(type == 'G')
	{
		if(value == 'guin')
		{
			if(confirm("±â¾÷È¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß Ã¤¿ë°ø°íµî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.\n\n±â¾÷È¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
			{
				window.location.href="./login/login.html?return_url=/c_member/index.html?sub_page=guin_reg.html";
			}
		}else if(value == 'edu')
		{
			if(confirm("±â¾÷È¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß ±³À°±â°üµî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.\n\n±â¾÷È¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
			{
				window.location.href="./login/login.html?return_url=/education/index.html?sub_page=education_write.html&gubun=edu2";
			}
		}else if(value == 'myG')
		{
			if(confirm("±â¾÷È¸¿ø Àü¿ë¸Þ´ºÀÔ´Ï´Ù.\n\n±â¾÷È¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
			{
				window.location.href="./login/login.html";
			}
		}
	}else if(type == 'C')
	{
		if(value == 'career')
		{
			if(confirm("°³ÀÎÈ¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß ÀÌ·Â¼­ µî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.\n\n°³ÀÎÈ¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
			{
				window.location.href="./login/login.html?return_url=/p_member/index.html?sub_page=career_reg.html";
			}
		}else if(value == 'port')
		{
			if(confirm("°³ÀÎÈ¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß Æ÷Æ®Æú¸®¿À µî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.\n\n°³ÀÎÈ¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
			{
				window.location.href="./login/login.html?return_url=/p_member/index.html?sub_page=portfolio.html";
			}
		}else if(value == 'myD')
		{

			if(confirm("°³ÀÎÈ¸¿ø Àü¿ë¸Þ´ºÀÔ´Ï´Ù.\n\n°³ÀÎÈ¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
			{
				window.location.href="./login/login.html";
			}
		}
	}else{
		if(confirm("Æ¼¿£Æ¼Àâ È¸¿ø ·Î±×ÀÎ ÈÄ °¡´ÉÇÕ´Ï´Ù."))
			{
				window.location.href="./login/login.html";
			}
	}
}

function no_c_member2(type,value)
{
    if(type == 'G')
    {
        if(value == 'guin')
        {
            if(confirm("±â¾÷È¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß Ã¤¿ë°ø°íµî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.\n\n±â¾÷È¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
            {
                window.location.href="/login/login.html?return_url=/c_member/index.html?sub_page=guin_reg.html";
            }
        }
    } else if(type == 'C') {
        if(value == 'career')
        {
            if(confirm("°³ÀÎÈ¸¿øÀ¸·Î ·Î±×ÀÎ ÇÏ¼Å¾ß ÀÌ·Â¼­ µî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.\n\n°³ÀÎÈ¸¿øÀ¸·Î ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?"))
            {
                window.location.href="/login/login.html?return_url=/p_member/index.html?sub_page=career_reg.html";
            }
        }
    }
}

function career_view(cash, career_num, member_gubun)
{
	if(!career_num)
	{
		alert('¿­¶÷ÇÏ½Ç ÀÌ·Â¼­¸¦ Á¤È®ÇÏ°Ô ¼±ÅÃÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
		return;
	}
	else
	{
		answer=window.confirm('º» Á¤º¸´Â [À¯·áÀÌ·Â¼­°Ë»ö¼­ºñ½º]¸¦ ±¸¸ÅÇÏ¼Å¾ß\n\nÀÌ¿ë°¡´ÉÇÕ´Ï´Ù. ±¸¸ÅÇÏ½Ã°Ú½À´Ï±î?')
		if (answer==false)
		{
			return;
		}
		else
		{
			if(member_gubun=='p_member')
			{
				window.location.href="/pay/index.html?sub_page=p_member_2.html";
			}
			else
			{
				window.location.href="/pay/index.html?sub_page=c_member_1.html";
			}
			return;
		}
	}
}

function career_view_new(member_p)
{
	if(confirm('[¾È³»] ¿µ¾î,ÀÏº»¾î,Áß±¹¾î ¾îÇÐºÐ¾ß Àü¹® ÀÌ·Â¼­DB ÃÖ´Ù º¸À¯ 1À§!            \n\n            ÀÌ·Â¼­ °Ë»ö °áÁ¦¸¦ ÇÏ½Ã°Ú½À´Ï±î?')){
		if(member_p =='p_member'){
			location.href = "/pay/?sub_page=p_member_2.html";
		}else{
			location.href = "/pay/?sub_page=c_member_1.html";
		}
	}
}

function go_login_career()
{
	if(confirm('º» ÀÎÀç Á¤º¸´Â [À¯·á °Ë»ö ¼­ºñ½º]ÀÔ´Ï´Ù.\n\nÈ¸¿ø °¡ÀÔÀ» ÇÏ½Ã°Ú½À´Ï±î?')){
		location.href='/login/login.html?Type=CO';
	}
}

function go_login_career_login()
{
	if(confirm('[¾È³»] ¿µ¾î,ÀÏº»¾î,Áß±¹¾î ¾îÇÐºÐ¾ß Àü¹® ÀÌ·Â¼­DB ÃÖ´Ù º¸À¯ 1À§!           \n\n          ±â¾÷È¸¿øÀ¸·Î °¡ÀÔÇÏ½Ã°Ú½À´Ï±î?')){
		location.href='/login/login.html?Type=CO';
	}
}

function go_login_page()
{
	window.location.href="/login/login.html";
}

function logout()
{
    answer=window.confirm('ÀÌ¿ëÇØ ÁÖ¼Å¼­ °¨»çÇÕ´Ï´Ù.\n·Î±×¾Æ¿ôÇÏ½Ã°Ú½À´Ï±î?')
    if (answer==false)
    {
        return;
    }else{
        location.href="/logout.php3";
    }
}

//ÀÌ¸ÞÀÏ º¸³»±â-½ºÆÔº¸È£Â÷¿ø
function s_mail(strID, strDomain)
{
    location.href = 'mail' + 'to:' + strID + '@' + strDomain;
}

//ÅÇÀÌ¸§,ÅÇid,ÃÑÅÇ°¹¼ö,ÅÇÅ¬·¡½º¸í,
function tabSwitch(tabName,tabIdx,tabCount,tabClassName,tabSelectedClassname)
{
    var tab;
    if(!tabClassName)tabClassName='tabstyle_01';
    if(!tabSelectedClassname)tabSelectedClassname='tab_selected';
    for(var i=0;i<=tabCount;i++)
    {
        tabObj=document.getElementById("tab_"+tabName+"_"+i);
        tabEntryObj=document.getElementById("tabEntry_"+tabName+"_"+i);
        if(i==tabIdx)
        {
            tabEntryObj.style.display="block";
            if(!tabObj.className.match(tabSelectedClassname))tabObj.className=tabClassName+" "+tabSelectedClassname;
        }else{
            tabEntryObj.style.display="none";
            if(tabObj.className.match(tabSelectedClassname))tabObj.className=tabClassName;
        }
    }
}

//ÅÇ º¯°æ¿ë ÇÔ¼ö
function chz_tabHover(tabObjName, count, hoverObj)
{
    for (i=0; i<count; i++)
    {
        tab = document.getElementById(tabObjName+'_'+i);
        body = document.getElementById(tabObjName+'_body_'+i);
        if (hoverObj == i)
        {
            setHover(tab,"hover");
            setDisplay(body,"block");
        }else{
            setHover(tab,"none");
            setDisplay(body,"none");
        }
    }
}

function setHover(obj, flag)
{
    if (typeof(obj) == 'string') obj = document.getElementById(obj);

    if (!flag)
    {
        var strClassName = obj.className;
        if (strClassName.match("hover")) obj.className = strClassName.replace("hover", "");
        else obj.className = strClassName + " hover";
    }else{
        var strClassName = obj.className.replace("hover", "");
        if (flag == "hover") obj.className = strClassName + " hover";
        else obj.className = strClassName.replace("hover", "");
    }
}

function setDisplay(obj, flag)
{
    if (typeof(obj) == "string") obj = document.getElementById(obj);

    if (!flag)
    {
        if (obj.style.display == "block") obj.style.display = "none";
        else obj.style.display = "block";
    }else{
        if (flag == "block") obj.style.display = "block";
        else obj.style.display = "none";
    }
}

function Lost_Id()
{
	window.open("/lost_id_pw/p_lost_id.html",null,"width=348,height=250,left=300,top=300,scrollbars=no,resizable=no");
	return false;
}

function Lost_Pw()
{
	window.open("/lost_id_pw/p_lost_pw.html",null,"width=348,height=300,left=300,top=300,scrollbars=no,resizable=no");
	return false;
}

//·Î±×ÀÎÆû °Ë»ç
function check_loginform()
{
    var login_form = document.getElementById("login_form");

    if(IsEmpty(login_form.id.value))
    {
        alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
        login_form.id.value='';
        login_form.id.focus();
        return false;
    }
    if(IsEmpty(login_form.passwd.value))
    {
        alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
        login_form.passwd.value="";
        login_form.passwd.focus();
        return false;
    }
}

function Show_nomail()
{
	window.open("/no_mail.html",'','toolbar=no,location=no,status=no,menubar=no,scrollbars=no, left=5,top=5, width=303,height=320')
}

function print_map()
{
	window.open("/company/print_map.html",null,"width=700,height=620,left=5,top=5,scrollbars=no,resizable=no");
	return;
}

function MM_popupMsg(msg)
{
	alert(msg);
	return;
}

function guin_reg()
{
	window.open('/c_member/guin_no_reg.html','guin_reg','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes, left=200,top=200, width=750,height=570');
	return;
}

//º¸¾È¼­¹ö ·Î°í ¸µÅ©
function ssl_popup(){
	window.open('http://www.trustlogo.com/ttb_searcher/trustlogo?v_querytype=W&v_shortname=SC2&v_search=www.linguajob.co.kr&x=6&y=5','new','menubar=no scrollbars=no width=450 height=500')
}

//ÄíÅ°¼³Á¤
function setCookie(name, value, expiredays)
{
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

//ÄíÅ°·Îµå
function getCookie(name)
{
    var nameOfCookie = name + "=";
    var x = 0;
    while ( x <= document.cookie.length )
    {
        var y = (x+nameOfCookie.length);
        if ( document.cookie.substring( x, y ) == nameOfCookie )
        {
            if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                endOfCookie = document.cookie.length;
            return unescape( document.cookie.substring( y, endOfCookie ) );
        }

        x = document.cookie.indexOf( " ", x ) + 1;

        if ( x == 0 )
            break;
     }
    return "";
}

//¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
function onlyNum(e)
{
    e.value = e.value.replace(/[^0-9]/g,"");
}

function guin_view(cash, guin_num, member_gubun)
{
	if(!guin_num)
	{
		alert('¿­¶÷ÇÏ½Ç Ã¤¿ë°ø°í¸¦ Á¤È®ÇÏ°Ô ¼±ÅÃÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
		return;
	}
	else
	{
		answer=window.confirm('º» Á¤º¸´Â [À¯·áÃ¤¿ë°Ë»ö¼­ºñ½º]¸¦ ±¸¸ÅÇÏ¼Å¾ß\n\nÀÌ¿ë°¡´ÉÇÕ´Ï´Ù. ±¸¸ÅÇÏ½Ã°Ú½À´Ï±î?')
		if (answer==false)
		{
			return;
		}
		else
		{
			if(member_gubun=='p_member')
			{
				window.location.href="/pay/index.html?sub_page=p_member_1.html";
			}
			else
			{
				window.location.href="/pay/index.html?sub_page=c_member_2.html";
			}
			return;
		}
	}
}

//3ÀÚ¸®¸¶´Ù ÄÞ¸¶³Ö±â
function plusComma(num)
{
    if (num < 0) { num *= -1; var minus = true}
    else var minus = false

    var dotPos = (num+"").split(".")
    var dotU = dotPos[0]
    var dotD = dotPos[1]
    var commaFlag = dotU.length%3

    if(commaFlag) {
        var out = dotU.substring(0, commaFlag)
        if (dotU.length > 3) out += ","
    }
    else var out = ""

    for (var i=commaFlag; i < dotU.length; i+=3) {
        out += dotU.substring(i, i+3)
        if( i < dotU.length-3) out += ","
    }

    if(minus) out = "-" + out
    if(dotD) return out + "." + dotD
    else return out
}
