var region_mode, upjik_mode;

function getOffsetTop(obj) { return obj ? obj.offsetTop + getOffsetTop(obj.offsetParent) : 0; }
function getOffsetLeft(obj) { return obj ? obj.offsetLeft + getOffsetLeft(obj.offsetParent) : 0; }

function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showLayer(id) {
	$(id).style.display = "block";
	return true;
}

function hideLayer(id) {
	$(id).style.display = "none";
	return true;
}

function runPrint() {
    if(!confirm('ÀÎ¼âÇÏ½Ã°Ú½À´Ï±î?')) return;
    window.print();
}

function toggleLayer(id) {
	try {
    	var obj = $(id);
    	obj.style.display = (obj.style.display == "none") ? "block" : "none";
	} catch (e) {
	}
	return true;
}

//Æû»óÅÂ Åä±Û
function toggleForm(oid, mode) {
    var obj = $(oid);
    
    if(mode == 'on') {
        obj.disabled = false;
        obj.style.background = '#ffffff';
    }else{
        obj.disabled = true;
        obj.value = '';
        obj.style.background = '#e1e1e1';    
    }
}

//iframe »çÀÌÁî ÀÚµ¿Á¶Àý
function iframe_calcHeight(FrameName) {
    if(document.all) {
        var the_height = frames[FrameName].document.body.scrollHeight;
    } else {
        var the_height= $(FrameName).contentWindow.document.body.offsetHeight;
    }
    $(FrameName).height=the_height;
}

//ÅÇ º¯°æ¿ë ÇÔ¼ö
function chz_tabHover(tabObjName, count, hoverObj) {
    for (i=0; i<count; i++) {
        tab = $(tabObjName+'_'+i);
        bodyObj = $(tabObjName+'_body_'+i);
        if (hoverObj == i) {
            setHover(tab,"hover");
            setDisplay(bodyObj,"block");
        }else{
            setHover(tab,"none");
            setDisplay(bodyObj,"none");
        }
    }
}

function setHover(Hoverobj, flag) {
    if (typeof(Hoverobj) == 'string')
        Hoverobj = $(Hoverobj);

    if (!flag) {
        var strClassName = Hoverobj.className;
        if (strClassName.match("hover"))
            Hoverobj.className = strClassName.replace("hover", "");
        else
            Hoverobj.className = strClassName + " hover";
    }else{
        var strClassName = Hoverobj.className.replace("hover", "");
        if (flag == "hover")
            Hoverobj.className = strClassName + " hover";
        else
            Hoverobj.className = strClassName.replace("hover", "");
    }
}

function setDisplay(Disobj, flag) {
    if (typeof(Disobj) == "string") Disobj = $(Disobj);
    if (!flag) {
        if (Disobj.style.display == "block") Disobj.style.display = "none";
        else Disobj.style.display = "block";
    }else{
        if (flag == "block") Disobj.style.display = "block";
        else Disobj.style.display = "none";
    }
}
function setDisplay_2(Disobj, flag,e) {
	var evt = e || window.event;
	if(event.stopPropagation){
		evt.stopPropagation(); 
	}else {
		if (typeof(Disobj) == "string") Disobj = $(Disobj);
		if (!flag) {
			if (Disobj.style.display == "block") Disobj.style.display = "none";
			else Disobj.style.display = "block";
		}else{
			if (flag == "block") Disobj.style.display = "block";
			else Disobj.style.display = "none";
		}
	}
}

function rolloverClass(obj, type) {
    agent = navigator.userAgent.toLowerCase();
    if (!Prototype.Browser.Opera) {
        if (type == 'over') {
            if (obj.tagName == 'TR') {
                for (i=0; i<obj.cells.length; i++) {
                    obj.cells[i].className += ' rollover-class';
                }
            } else {
                extraClass = obj.className;
                obj.className = obj.className.replace(/(active|inactive)/ig, 'rollover');
            }
        } else {
            if (obj.tagName == 'TR') {
                for (i=0; i<obj.cells.length; i++) {
                    obj.cells[i].className = obj.cells[i].className.replace(/( )*rollover\-class/ig, '');
                }
            } else {
                obj.className = extraClass;
                extraClass = '';
            }
        }
    }
}

//ÄíÅ°¼³Á¤
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 "";
}

/* ÆË¾÷ */

//urlº¯°æ
function goURL(url, mode, close) {
    if(!mode) var mode = 1;
    if(mode==1) location.href = url;
    else if(mode==3) window.open(url,null);
    else window.opener.location.href = url;
    if(close==1) closeW();        
}

//ÆË¾÷ ¶ç¿ì±â
function POP_win(strURL,strwname,strWidth,strHeight,strOps,strTop,strLeft) {
    if(!strOps) strOps = "resizable=no,menubar=no,scrollbars=no";

    if(strTop)
        var strTop1 = ",top="+strTop;
    else
        var strTop1 = ",top=200";
    
    if(strLeft)
        var strLeft1 = ",left="+strLeft;
    else
        var strLeft1 = ",left=200";
        
    var t = window.open(strURL,strwname,'width='+strWidth+',height='+strHeight+strTop1+strLeft1+','+strOps);
    t.focus();
}

//¿ìÆí¹øÈ£ Ã£±â
function srchZIP(zip1, zip2, addr1, addr2) {
    POP_win('/utility/search_postzip.php?zip1='+zip1+'&zip2='+zip2+'&addr1='+addr1+'&addr2='+addr2, null, 468, 250, 'scrollbars=yes');    
}

//Ã¤¿ëÁ¤º¸ ¿Â¶óÀÎÀÔ»çÁö¿ø
function appOnline(idx) {
    if(!idx) {
        alert('ÀÔ»çÁö¿øÇÒ Ã¤¿ëÁ¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/recruit/appOnline.php?idx='+idx,'appEmail',566,620,'scrollbars=yes');
}
//°áÁ¦À§Ä¡ ÀÚ¼¼È÷º¸±â
function productPreview(url) {
    POP_win(url, null, 560,630,'scrollbars=no,resizable=no',100,100);
}

//Ã¤¿ëÁ¤º¸ ÀÌ¸ÞÀÏÀÔ»çÁö¿ø
function appEmail(idx) {
    if(!idx) {
        alert('ÀÔ»çÁö¿øÇÒ Ã¤¿ëÁ¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/recruit/appEmail.php?idx='+idx,'appEmail',566,600,'scrollbars=yes');
}

//Ã¤¿ëÁ¤º¸ ¸ÞÀÎÆË¾÷
function EMP_popview(idx, mode) {
	if(!idx) {
		alert('¿­¶÷ÇÏ½Ç Ã¤¿ë°ø°í°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù');
		return false;
	}
	POP_win('/recruit/recruit_popview.php?idx='+idx+'&mode='+mode,'EMPpopview',786,700,'scrollbars=yes',10,10);
	//window.open('/recruit/recruit_popview2.php?idx='+idx+'&mode='+mode,'EMPpopview','width=786,height=700,left=10,top=10,scrollbars=yes');
}
//Ã¤¿ëÁ¤º¸ ½ºÅ©·¦
function scrapRecruit(idx) {
    if(!idx) {
        alert('½ºÅ©·¦ÇÒ Ã¤¿ëÁ¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/recruit/recruit_scrap.php?popup=1&idx='+idx,'scrap',400,200);
}
//Áö¿øÀÚÇöÈ²Åë°è
function EMP_statistics(idx, mode) {
    if(!idx) {
        alert('Åë°è¸¦ º¼ Ã¤¿ëÁ¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/recruit/recruit_statistics.php?idx='+idx+'&mode='+mode,'statistics',565,650,'scrollbars=yes');
}

//±â¾÷È¸¿ø ·Î°íµî·Ï/¼öÁ¤
function uploadLOGO(wmode, mmode, amode, a2, a3) {
    if(!wmode) {
        alert('¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.');
        return false;
    }
    POP_win('/utility/upload_logoC.php?mmode='+mmode+'&wmode='+wmode+'&amode='+amode+'&amode2='+a2+'&amode3='+a3,'popup',400,300);
}

//±â¾÷È¸¿ø Æ÷ÅäÁ¤º¸µî·Ï/¼öÁ¤
function uploadPhotoC(ID, wmode, mmode, idx, amode, auid) {
    if(!wmode) {
        alert('¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.');
        return false;
    }
    POP_win('/utility/upload_photoC.php?ID='+ID+'&mmode='+mmode+'&wmode='+wmode+'&idx='+idx+'&amode='+amode+'&auid='+auid,'upload',400,320);
}

//°ü½É±â¾÷µî·Ï
function InterestComp(Cid) {
    if(!Cid) {
        alert('°ü½É±â¾÷À¸·Î µî·ÏÇÒ ±â¾÷ÀÌ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/recruit/recruit_interest.php?Cid='+Cid,'interest',400,250);
}

//Á÷Á¾¼±ÅÃ
function selectJik() {
    POP_win('/utility/selectJikjong.php','Jikjong',666,600,'scrollbars=yes');
}

//Å°¿öµå¼±ÅÃ
function selectKeywordC() {
    var J = $F('jikjong'); 
    var K = $F('keyword');
    
    if(!J) {
        alert('¸ÕÀú ¸ðÁýºÐ¾ß¸¦ ¼±ÅÃÇØÁÖ¼Å¾ß ÇÕ´Ï´Ù.');
        selectJik();
        return false;
    }       
    POP_win('/utility/search_keyword.php?jikjong='+J+'&keyword='+K,'Jikjong',666,600,'scrollbars=yes');
}

//±³À°Á¤º¸¼öÁ¤¿äÃ»
function edu_reqUpdate(mode, idx) {
    if(!idx) {
        alert('¼öÁ¤¿äÃ»ÇÒ Á¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/utility/edu_reqUpdate.php?mode='+mode+'&idx='+idx,'popup',400,430);
}

//±³À°Á¤º¸ ½ºÅ©·¦
function edu_scrap(mode, idx) {
    if(!idx) {
        alert('½ºÅ©·¦ÇÒ ±³À°Á¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/edu/edu_scrap.php?mode='+mode+'&idx='+idx,'popup',400,190);
}

//±³À°°úÁ¤ ¿Â¶óÀÎ»ó´ã
function edu_counsel(u_id, idx) {
    if(!idx) {
        alert('¿Â¶óÀÎ»ó´ãÇÒ ±³À°Á¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/utility/edu_counsel.php?uid='+u_id+'&idx='+idx,'popup',400,490);
}

//ÀÎÀçÁ¤º¸ ½ºÅ©·¦
function resume_scrap(idx) {
    if(!idx) {
        alert('½ºÅ©·¦ÇÒ Á¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/resume/resume_scrap.php?idx='+idx,'popup',400,280);
}

//¸éÁ¢Á¦ÀÇ(ÀÌ¸ÞÀÏ)
function resume_call(idx, mode) {
    if(!idx || !mode) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/resume/resume_call'+mode+'.php?idx='+idx,'popup',566,500,'scrollbars=yes');      
}

//Æ÷Æú ÆË¾÷Ã¢
function resume_port(idx) {
    if(!idx) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/resume/resume_portView.php?idx='+idx,'portfolio',700,700,'scrollbars=yes',100,50);
}
//Æ÷Æú ÆË¾÷Ã¢ - Æ¼¼ÅÃ÷°ø¸ðÀü °ü·Ã
function resume_port_wc(idx) {
    if(!idx) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/resume/resume_portView_wc.php?idx='+idx,'portfolio',700,700,'scrollbars=yes',100,50);
}
function resume_port_wc1(idx) {
    if(!idx) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/resume/resume_portView_wc_sylee.php?idx='+idx,'portfolio',700,700,'scrollbars=yes',100,50);
}

// Æ÷Æ®Æú¸®¿ÀºÏ open
function open_portBook(idx,id) {
	var left_pos = (document.body.clientWidth-934) / 2;
	var top_pos = (document.body.clientHeight-611) / 2 + 50;
    if(!idx) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    window.open('/portfolio/portfoliobook.html?p_id='+id+'&p_idx='+idx,'portfolio','width=934,height=611,top='+top_pos+',left='+left_pos);
}


//»çÁø µî·Ï/¼öÁ¤
function uploadPHOTO(wmode, mmode, amode, amode2) {
    if(!wmode) {
        alert('¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.');
        return false;
    }
    POP_win('/utility/upload_photoP.php?mmode='+mmode+'&wmode='+wmode+'&amode='+amode+'&amode2='+amode2,'popup',400,320);
}
//ÇÐ±³¸íÀÔ·Â
function searchUniv(idx) {
    if(!idx) {
        alert('Àß¸øµÈ Á¢±ÙÀÔ´Ï´Ù.');
        return false;
    }
    POP_win('/utility/searchUniv.php?idx='+idx,'popup',400,240);
}
//º¸À¯±â¼úÀÔ·Â
function searchSkill(idx) {
    if(!idx) {
        alert('Àß¸øµÈ Á¢±ÙÀÔ´Ï´Ù.');
        return false;
    }
    POP_win('/utility/searchSkill.php?idx='+idx,'popup',400,240);
}
//±â¾÷¸íÀÔ·Â(¿¬ºÀÁ¤º¸)
function searchSalaryCOM(idx) {
    if(!idx) {
        alert('Àß¸øµÈ Á¢±ÙÀÔ´Ï´Ù.');
        return false;
    }
    POP_win('/utility/searchSalary_COM.php?idx='+idx,'popup',500,240);
}
//ÀÌ·Â¼­ ÀÛ¼º°¡ÀÌµå
function resume_guide() {
    POP_win('/utility/resume_guide.html','popup',666,600,'scrollbars=yes');
}
//ÀÌ·Â¼­ÀÎ¼â ÆË¾÷
function resume_print(idx) {
    if(!idx) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/resume/resume_print_view.php?idx='+idx,'print',706,700,'scrollbars=yes',10,10);
}
//2010-02-02 ADD [JAESOOO]
//ÀÌ·Â¼­ DOC ´Ù¿î·Îµå ÀÓ½Ã¿ë
function resume_doc_down(idx) {
    if(!idx) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
	location = "/member_p/resume_download.php?idx=" +idx;
}

//°ø°íÀÎ¼â ÆË¾÷
function recruit_print(idx) {
    if(!idx) {
        alert('µ¥ÀÌÅ¸°¡ Á¤»óÀûÀ¸·Î ³Ñ¾î¿ÀÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/recruit/recruit_print_view.php?idx='+idx,'print',806,700,'scrollbars=yes',10,10);
}
/* ÆË¾÷ ³¡ */

//ÀÌ¸ÞÀÏ º¸³»±â-½ºÆÔº¸È£Â÷¿ø
function s_mail(strID, strDomain, title) {
	url = 'mail' + 'to:' + strID + '@' + strDomain;
	if(title) url += '?subject='+title;
    location.href = url; 
}

//·Î±×ÀÎÃ¼Å©
function chkLOGIN() {
    if(!l_frm.u_id.value) {
        alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
        l_frm.u_id.focus();
        return false;
    }
    if(!l_frm.u_pass.value) {
        alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
        l_frm.u_pass.focus();
        return false;
    }
}

function handleEnter (field, event, frm) {
    // ºê¶ó¿ìÀú Á¾·ù¿Í ¹öÀü¸¶´Ù Å°º¸µå ÀÌº¥Æ® Ä¸ÃÄÇÏ´Â ¹æ½ÄÀÌ ´Ù¸£´Ù
    var keyCode = event.keyCode ? event.keyCode :
    event.which ? event.which : event.charCode;

    // ¿£ÅÍÅ°(13)ÀÌ¸é
    if (keyCode == 13) {
         l_frm.submit();
    }
}

function chkTopsearch() {
    var f = $('TopsearchFrm');
    if(!f.q.value) {
        alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
        f.q.focus();
        return false;
    }
    
    if(f.q.value.length < 2) {
        alert('°Ë»ö¾î´Â 2ÀÚÀÌ»ó ÀÔ·ÂÇØÁÖ¼¼¿ä.');
        f.q.focus();
        return false;
    }
    location.href = '/search/search.php?page_w=1&q='+f.q.value;
    return false;    
}

function chkTopsearch1() { // °Ë»ö¹Ù ÀÌº¥Æ® ¸µÅ© ½ºÅ©¸³Æ®
    var f = $('TopsearchFrm');
    if(!f.q.value) {
        alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
        f.q.focus();
        return false;
    }
    
    if(f.q.value.length < 2) {
        alert('°Ë»ö¾î´Â 2ÀÚÀÌ»ó ÀÔ·ÂÇØÁÖ¼¼¿ä.');
        f.q.focus();
        return false;
    }
	if(f.q.value == "[±¹ºñÃë¾÷±³À°] À¥ºñÁÖ¾óµðÀÚÀÎ/À¥Ç¥ÁØÆÛºí¸®½Ì") {
		f.action = "http://hrd.designerjob.co.kr/hrd_02.html";
		return true;
	}

    location.href = '/search/search.php?page_w=1&q='+f.q.value;
    return false;    
}

function only_num(e) {
	//ÇÔ¼ö ¼öÁ¤ 2009.12.30. ÀÌ¼º¿ë
    //e.value = e.value.replace(/[^0-9]/g,'');
	var val = String(e.value); 
	e.value = val.replace(/[^0-9]/g,'');
}

function only_float_num(e) {
    e.value = e.value.replace(/^(-?)([0-9]*)(\.?)([^0-9]*)([0-9]*)([^0-9]*)/,'$2$3$5');
}

function only_float_num1(e) {
    e.value = e.value.replace(/^(-?)([0-9]*)(\.?)([^0-9]*)([0-9]*)([^0-9]*)/,'$1$2$3$5');
}
//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
}

//ÀÌ¸ÞÀÏÁÖ¼Ò Ã¼Å©
function chkEmail(e) {
    var checkStr = /(\S+)@(\S+)\.(\S+)/;
    
      if (!checkStr.test(emailStr))
         return false;
     
      return true;
}

//ÀÎ±â°Ë»ö¾î°ü·Ã
function show_popular_scroll_all(popular_scroll_all) {
    var m1 = $("popular_scroll_all1");
    var m2 = $("popular_scroll_all2");

    m1.style.display = "block";
    m2.style.display = "none";

    switch(popular_scroll_all) {
        case 1:
            m1.style.display = "";
            break;
        case 2:
            m2.style.display = "";
            break;
    }
}

//·Î±×ÀÎÃ¢ º¸¾ÈÁ¢¼Ó Åä±Û
function toggleSSL() {
    var obj = $('ssl_check');

    if(obj.checked == true)
        l_frm.action = 'https://www.designerjob.co.kr/login/login_check.php';
    else
        l_frm.action = '/login/login_check.php';
}

//·Î°í ¹Ì¸®º¸±â
function fileUploadPreview(objfile, previewWrap) {
    if(!/(\.gif|\.jp[e]?g|\.png)$/i.test(objfile.value)) {
        alert("ÀÌ¹ÌÁö Çü½ÄÀÇ ÆÄÀÏÀ» ¼±ÅÃÇÏ½Ê½Ã¿À");
        return;
    }
    
    // ie 7 ±¸ºÐ
    if (window.navigator.userAgent.indexOf("MSIE 7") != -1) { //ie7
        previewWrap.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='file://" + String(objfile.value) +"', sizingMethod='scale')";
    } else {    //ie7 ÀÌ ¾Æ´Ô
       previewWrap.innerHTML = "";
        var W = previewWrap.offsetWidth;
        var H = previewWrap.offsetHeight;
        var tmpImage = document.createElement( 'img' );
        previewWrap.appendChild(tmpImage);

        tmpImage.onerror = function () {
            //alert("ÀÌ¹ÌÁö ¹Ì¸®º¸±â »ý¼ºÁß ¿À·ù¹ß»ý.");
            return previewWrap.update('');
        }
        
        tmpImage.onload = function () {
            if (this.width > W) {
                this.height = 42;
                this.width = W;
            }
            if (this.height > H) {
                this.width = 105;
                this.height = H;
            }
        }
        if (window.navigator.userAgent.indexOf("Firefox/3") != -1) {    // firefox3 ÀÌ¸é
            var picData = objfile.files.item(0).getAsDataURL();
            tmpImage.src = 'data:' + picData;
            tmpImage.writeAttribute("title", "ImageSize: "+ objfile.files.item(0).fileSize +" byte");
        } else {
            tmpImage.src = "file://" + objfile.value;
        }
    }    
}

//Ã¢´Ý±â
function closeW() {
    window.self.close();
}

//Á¤È¸¿ø ¿ä±¸
function reqClassP() {
    if(!confirm("µðÀÚÀÌ³ÊÀâ Á¤È¸¿ø ½ÅÃ»ÈÄ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\nÁ¤È¸¿ø ½ÅÃ»ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?")) return;
    else goURL('/pay/p_member1.php', 1, 2);
}

//·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿
function reqLogin(r_url, msg, mode, mode2) {
    if(!r_url) var r_url = current_url;
    if(!msg) var msg = '·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù.';
    if(!mode) var mode = 1;
    if(!mode2) var mode2 = 1;
    if(mode==1) {
        alert(msg);
        if(mode2==2) {
            window.opener.location.href = '/login/login.php?return_url='+r_url;
            closeW();
        }else
            location.href='/login/login.php?return_url='+r_url;
    }else{
        if(confirm(msg))
            location.href='/login/login.php?return_url='+r_url;
    }
}

//Ã¤¿ë¸ñ·Ï ¿ä¾àÁ¤º¸ º¸±â
var old_summary;
function showSummary(id) {
    var obj = $(id);
    
    if(old_summary != obj) {
        if(old_summary)
            old_summary.style.display='none';
        obj.style.display='block';
        old_summary = obj;
    }else{
        obj.style.display='none';
        old_summary = '';
    }
}

//Ã¤¿ë ±Ù¹«ÇüÅÂ Ã¼Å©
function chkworkType(handle) {
    var w_type = frm.work_type;
    var chkcnt=0;
    
    if(w_type[0].checked == true) {
        if(handle.checked == true) {
            for(var i=1;i<w_type.length;i++)
                if(w_type[i].checked == true) chkcnt++;
                
            if(chkcnt>0) {
                alert('¹«°üÀÌ ¼±ÅÃµÇ¾î ÀÖÀ¸¸é ´Ù¸¥ ±Ù¹«ÇüÅÂ¸¦ ¼±ÅÃÇÏ½Ç ¼ö ¾ø½À´Ï´Ù');
                handle.checked = false;
            }
        }
    }else{
        if(handle.checked == true) {
            for(var i=1;i<w_type.length;i++)
                if(w_type[i].checked == true) chkcnt++;
            if(chkcnt>3) {
                alert('±Ù¹«ÇüÅÂ´Â µ¿½Ã¿¡ 3°³±îÁö¸¸ ¼±ÅÃÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
                handle.checked = false;
            }            
        }
    }
}

function chkworkType2(handle) {
    var chkcnt=0;
    
    for(var y=0;y<frm.elements.length;y++) {
        if(frm.elements[y].name == "work_type[]" && frm.elements[y].type=="checkbox" && frm.elements[y].checked == true && frm.elements[y].value != 0)
            chkcnt++;
    }    
    
    for(var i=0;i<frm.elements.length;i++) {
        var target = frm.elements[i];
        
        if(target.name == 'work_type[]' && target.type=='checkbox') {

            if(target.value == 0 && target.checked == true) {
                if(handle.checked == true && handle.value != 0) {
                    alert('¹«°üÀÌ ¼±ÅÃµÇ¾î ÀÖÀ¸¸é ´Ù¸¥ ±Ù¹«ÇüÅÂ¸¦ ¼±ÅÃÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
                    handle.checked = false;
                }
            }else{
                if(handle.checked == true) {
                    if(chkcnt>3) {
                        alert('±Ù¹«ÇüÅÂ´Â µ¿½Ã¿¡ 3°³±îÁö¸¸ ¼±ÅÃÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
                        handle.checked = false;
                    }
                }
            }

        }
    }
}

//Á¶»çºÙÀÌ±â
String.prototype.hasFinalConsonant = function(str) {
    str = this != window ? this : str;
    var strTemp = str.substr(str.length-1);
    return ((strTemp.charCodeAt(0)-16)%28!=0);
}

function josa(str,tail) {
    return (str.hasFinalConsonant()) ? tail.substring(0,1) : tail.substring(1,2);
}

//Ã¼Å©¹Ú½º Áßº¹Ã¼Å© È®ÀÎ
function chk_cBox(cnt, name, obj, Handle, f) {
    if(!f) var t_form = frm;
    else var t_form = $(f);
    var chkcnt = 0;
    for(var y=0;y<t_form.elements.length;y++) {
        if(t_form.elements[y].name == obj && t_form.elements[y].type=="checkbox" && t_form.elements[y].checked == true)
            chkcnt++;
    }
    if(chkcnt > cnt) {
        var msg = josa(name,'Àº´Â')
        alert(name+msg+' µ¿½Ã¿¡ '+cnt+'°³ÀÌ»ó ¼±ÅÃÇÏ½Ç ¼ö ¾ø½À´Ï´Ù');
        if(Handle) Handle.checked = false;
    }
    return chkcnt;
}

//Á¤·Ä¹æ½Äº¯°æ
function chzSORT() {
    $('listForm').submit();
}

//ÀüÃ¼ ¼±ÅÃ
function all_checked(sw, f, vname) {
    if(!vname) var vname = 'g_num[]';
    if(!f) var t_form = frm;
    else var t_form = $(f);
    for(var i=0; i<t_form.length; i++) {
        if(t_form.elements[i].name == vname) {
            t_form.elements[i].checked = sw;
        }
    }
}

//±Ý¾× ÇÑ±Ûº¯È¯
function Convert_priceKR(f, idx, type){
    var tmp_f = f.value;
    if(type==2) tmp_f = tmp_f * 10000;
    var joewon = Math.floor(tmp_f / 1000000000000);
    var eokwon = Math.floor(tmp_f / 100000000);
    var manwon = Math.floor(tmp_f / 10000);
    var onewon = tmp_f % 10000;
    var len = tmp_f.length;
    if (manwon == 0 && eokwon == 0 && joewon == 0) {
        if (len == 0)
            $('show_amount'+idx).update('');
        else
            $('show_amount'+idx).update(onewon+"¿ø");
    }
    else if (eokwon == 0 && joewon == 0) {
        if(onewon == '0') onewon = '';
        $('show_amount'+idx).update(manwon+"¸¸"+onewon+"¿ø");
    }
    else if (joewon == 0) {
        manwon = manwon % 10000;
        man_won = manwon + "¸¸";
        if(manwon == '0') man_won = '';
        if(onewon == '0') onewon = '';
        $('show_amount'+idx).update(eokwon + "¾ï" + man_won + onewon + "¿ø");
    }
    else {
        manwon = manwon % 10000;
        eokwon = eokwon % 10000;
        man_won = manwon + "¸¸";
        eok_won = eokwon + "¾ï";
        if(eokwon == '0') eok_won = '';
        if(manwon == '0') man_won = '';
        if(onewon == '0') onewon = '';
        $('show_amount'+idx).update(joewon + "Á¶" + eok_won + man_won + onewon + "¿ø");
    }
}

//Æ÷Æ®Æú¸®¿À °£·«¸ñ·Ï ÆäÀÌÁö ÀüÈ¯
function portviewList_move(mode) {
    if(mode=='p' && portCurrent==0) {
        alert('ÇöÀç ÆäÀÌÁö°¡ Ã¹¹øÂ° ÆäÀÌÁöÀÔ´Ï´Ù.');
        return false;       
    }else if(mode=='n' && portCurrent==portTotal) {
        alert('ÇöÀç ÆäÀÌÁö°¡ ¸¶Áö¸· ÆäÀÌÁöÀÔ´Ï´Ù.');
        return false;       
    }
    hideLayer('portList_'+portCurrent);
    if(mode=='p')
        portCurrent--;
    else
        portCurrent++;    
    showLayer('portList_'+portCurrent);    
}

//IE¿ë ÇÃ·¡½¬
function flashPlayer(name, sizex, sizey, value, mode) {
    //if(!mode) mode = 'transparent';
    if(!mode) mode = 'opaque';
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + sizex + '" height="' + sizey + '">');
    document.write('<param name="movie" value="' + name + '">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="menu" value="false">');
    document.write('<param name="wmode" value="'+mode+'">');
    document.write('<PARAM NAME="FlashVars" VALUE="' + value + '">');
    document.write('<embed src="' + name + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + sizex + '" height="' + sizey + '"');
    document.write('FlashVars="' + value + '"></embed>');
    document.write('</object>');
}

//ÅõÇ¥
function Vote_Go(num) {
    if(!num) {
        alert('¼±ÅÃÇÏ½Å ¼³¹®ÀÌ ¾ø½À´Ï´Ù.');
        return;
    }
    if(!$('vote_form').vote_sel.value) {
        alert('Ç×¸ñÀ» ¼±ÅÃÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
        return;
    }
    if($('vote_form').option_data.value) {
        if(!$('vote_form').option_sel.value) {
            alert('Ãß°¡Ç×¸ñÀ» ¼±ÅÃÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
            return;
        }
    }
    location.href = '/guide/?sub_page=vote.html&num='+num+'&vote_data='+$('vote_form').vote_sel.value+'&option_data='+$('vote_form').option_sel.value;
}
function Vote_Result(num) {
    if(!num) {
        alert('¼±ÅÃÇÏ½Å ¼³¹®ÀÌ ¾ø½À´Ï´Ù.');
        return;
    }else{
        location.href = '/guide/?sub_page=vote.html&num='+num;
    }
}

/*ÀÎ±â°Ë»ö¾î2*/
function keyword_layer() {
    clearTimeout(kstime);
    clearTimeout(phtime);
    kstime = phtime = null;
    ph.style.display = "block";
    ph.style.top = getOffsetTop(sl);
}
function keyword_layer_on() {
    clearTimeout(phtime);
    clearTimeout(kstime);
    kstime = phtime = null;
}
function keyword_layer_out() {
    phtime = setTimeout("keyword_scroll()", 100);
}

/*°Ô½ÃÆÇ*/
function boardCommentDEL(pidx, num, bid) {
    if(!num || !pidx || !bid) {
        alert('»èÁ¦ÇÒ ´ñ±ÛÀÌ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù');
        return;
    }else{
        if(confirm("ÇØ´ç ´ñ±ÛÀ» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
            location.href = '/guide/comment_delete.php?pIdx='+pidx+'&idx='+num+'&bid='+bid;
    }
}

function voteCommentDEL(pidx, num) {
    if(!num || !pidx) {
        alert('»èÁ¦ÇÒ ´ñ±ÛÀÌ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù');
        return;
    }else{
        if(confirm("ÇØ´ç ´ñ±ÛÀ» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
            location.href = '/guide/vote_comment_delete.php?pIdx='+pidx+'&idx='+num;
    }
}

//°Ô½Ã±Û »èÁ¦
function boardDEL(n, bid) {
    if(!n || !bid) {
        alert('»èÁ¦ÇÒ ±ÛÀÌ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù');
        return;
    }else{
        if(confirm("ÇØ´ç ±ÛÀ» Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
            location.href = '/guide/board_delete.php?idx='+n+'&bId='+bid;
    }
}

//°ø¸ðÀü½ÃÇà»ç
function CONTESTchzfrm(stype) {
    if(stype == 'Contest' && (frm.Etype1.value || frm.Etype2.value)) {
        alert('°ø¸ðÀü°ú Àü½Ã/Çà»ç¸¦ µ¿½Ã¿¡ °Ë»öÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
        frm.Etype1.value = '';
        frm.Etype2.value = '';    
    }else if(stype == 'Exhb' && (frm.Ctype1.value || frm.Ctype2.value)) {
        alert('°ø¸ðÀü°ú Àü½Ã/Çà»ç¸¦ µ¿½Ã¿¡ °Ë»öÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
        frm.Ctype1.value = '';
        frm.Ctype2.value = '';    
    }
}

function CONTEST_chkForm() {
    if(!frm.Etype1.value && !frm.Etype2.value && !frm.Ctype1.value && !frm.Ctype2.value) {
        alert('°ø¸ðÀü ¶Ç´Â Àü½Ã/Çà»çÀÇ ºÐ¾ß,ºÐ·ù µÑÁß ÇÏ³ª´Â ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
        return false;
    }

    if(frm.Ctype1.value || frm.Ctype2.value) {
        frm.action = './contest_list.php';
    }else{
        frm.action = './exhb_list.php';
    }
}

//Àü½Ã,Çà»ç »èÁ¦
function CONTESTdel(pidx) {
    if(!pidx) {
        alert('»èÁ¦ÇÒ Á¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù');
        return;
    }else{
        if(confirm("ÇØ´ç Á¤º¸¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
            location.href = '/contest/exhb_delete.php?pIdx='+pidx;
    }
}
//°ø¸ð/Àü½Ã/Çà»çÁ¤º¸ ½ºÅ©·¦
function scrapContest(idx, mode) {
    if(!idx) {
        alert('½ºÅ©·¦ÇÒ Á¤º¸°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }
    POP_win('/contest/contest_scrap.php?popup=1&idx='+idx+'&mode='+mode,'scrap',400,200);
}

//¸ñ·Ï°¡±â¹öÆ° backÇÏ°Å³ª ¸ñ·Ï¸ÞÀÎÀ¸·Î °¡°Å³ª (2009.12.9 ÀÌ¼º¿ë)
function moveBackList(gourl) {
	if(window.history.length > 0){
		history.go(-1);
		return false;
	}else {
		location.href = gourl;
		return false;
	}
}

//ÀÌ¹ÌÁö ½º¿Ò 2010.1.8. S.Y.LEE
function imgswap(id,img_src){
	id.src = img_src;
}

// Æ÷Æ®Æú¸®¿À ºÏ ¿ÀÇÂ 2010.07.21. S.Y.LEE
function popMybook(p_id,open){
	var left_pos = (document.body.clientWidth-934) / 2;
	var top_pos = (document.body.clientHeight-611) / 2 + 50;
	try{ 
		var pop =				window.open('http://www.designerjob.co.kr/mybook/'+p_id,'portfoliobook','width=934,height=611,top='+top_pos+',left='+left_pos); 
			
		if (pop == null) location.href="http://www.designerjob.co.kr/portfolio/no_pop.html?p_id="+p_id;
		else {
			if(open=='on') location.href="http://www.designerjob.co.kr";
		}
	
	}catch(e){ 
	  alert("ÆË¾÷Â÷´ÜÀ» ÇØÁöÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù."); 
	}
}