function setValue(input_name,input_value) {
	if(!(fn = document.getElementById(input_name))) {
		name = document.getElementsByName(input_name);
		fn = name[0];
	}

	if(fn!=null && input_value != '') {
		if(fn.type=='radio') {
			count = count = document.getElementsByName(input_name).length;
			for(i=0;i<count;i++) {
				if(document.getElementsByName(input_name)[i].value==input_value) {
				  document.getElementsByName(input_name)[i].checked=true;
				}
			}
		} else {
			switch (fn.type) {
				case 'checkbox' :
				if(fn.value==input_value) {
					fn.checked = true;
				}
				break;
				case 'select-one' :
					fn.value = input_value;
					if(fn.value=='') {
						fn.options[0].selected = true;
					}
					break;
				case 'text' :
				case 'textarea' :
					fn.value = input_value;
					break;
				default :
			}
		}
	} 
} 


//ÆË¾÷Ã¢ ¶ç¿ö¼­ ÀÛ¾÷Ã³¸®. À§Ä¡ÁöÁ¤¾ÈÇÏ¸é µðÆúÆ®¼³Á¤.
function popup_work(targeturl, arg, pos, cloaseflag)// url, ÀÎÀÚ, Ã¢Å©±â¹×À§Ä¡, ¶ç¿îÃ¢ ÀÚµ¿Á¾·á¿©ºÎ
{
	var url = targeturl + '?' + arg + '&closeflag=' + cloaseflag;

	var left_p = (screen.width - 300)/2;
	var top_p  = (screen.height - 160)/2;

	if(pos=='')
		pos = 'width=300,height=160,top='+top_p+',left='+left_p;

	window.open(url,'',pos);
}

// popup_workÀÇ ¾÷±×·¹ÀÌµå¹öÀü.
function popup_open(popupname, targeturl, pval, pop_w, pop_h, left_p, top_p, etcoption, cloaseflag)
{
	var url, left_p, top_p, pos, args, openwin;
	
	// url»ý¼º
	url = targeturl + '?' + pval + '&closeflag=' + cloaseflag;

	// ÆË¾÷Ã¢ Å©±â,À§Ä¡ »ý¼º
	if(left_p=='-1')
		left_p	= (screen.width - pop_w)/2;

	if(top_p=='-1')
		top_p	= (screen.height - pop_h)/2;

	pos_wid		= ",left="+left_p+",top="+top_p+",width="+pop_w+",height="+pop_h;

	// Ã¢±âÅ¸¿É¼Ç
	args	= pos_wid + "," + etcoption;

	// ¿ÀÇÂÃ¢.
	openwin = window.open(url, popupname, args);
}



// °Ë»ö(»ó´Ü ¸Þ´ºÂÊ)
function SearchCate()
{

	if ( document.searchq.s_guingujik.value=="1" )
	{	
    	document.searchq.action="/board.php";
        document.searchq.submit();
        return true;
	}

	if ( document.searchq.s_guingujik.value=="2" )
	{	
		document.searchq.action="/empboard.php";
		document.searchq.submit();
		return true;
	}

}

// ÅëÇÕ°Ë»ö(»ó´Ü ¸Þ´ºÂÊ)
function SearchTotal()
{
	if ( document.searchq.s_searchcate.value=="ALL" )			// ÅëÇÕ°Ë»ö
	{	
    	document.searchq.action="/search_result.php";
	}
	else if ( document.searchq.s_searchcate.value=="GUIN" )	// ±¸ÀÎ°Ë»ö
	{	
    	document.searchq.action="/board.php";
	}
	else if ( document.searchq.s_searchcate.value=="GUJIK" )	// ±¸Á÷°Ë»ö
	{	
    	document.searchq.action="/empboard.php";
	}
	document.searchq.submit();
	return;
}

// ·Î±×ÀÎ°ü·Ã
function del_member()
{
	if( confirm("Å»ÅðÇÏ½Ã°Ú½À´Ï±î?") == true )
	{
		location.href="/users_zone/log_out_del.php?load=del";
	}
}

// ·Î±×ÀÎ°ü·Ã
function login_chk()
{
	var frm = window.document.loginform;
	var floginid = frm.loginid;
	var floginpw = frm.loginpw;

	if(floginid.value =='') 
	{ 
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");  
		floginid.focus(); 
		return; 
	}
	if(floginpw.value=='') 
	{ 
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä."); 
		floginpw.focus(); 
		return; 
	}
	if(floginpw.value.length < 4 ) 
	{ 
		alert("ºñ¹Ð¹øÈ£´Â 4ÀÚÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä."); 
		floginpw.focus(); 
		return; 
	}

	frm.submit();
}
	
function chk_enter(frm) 
{
	if(event.keyCode == 13) { 
       frm.submit();
    } 
}

// ·Î±×ÀÎ°ü·Ã
function Login_Check(url)	// 
{
	var frm = window.document.loginform;
	var floginid = frm.loginid;
	var floginpw = frm.loginpw;

	if(floginid.value =='') 
	{ 
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");  
		floginid.focus(); 
		return false; 
	}
	if(floginpw.value=='') 
	{ 
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä."); 
		floginpw.focus(); 
		return false; 
	}
	if(floginpw.value.length < 4 ) 
	{ 
		alert("ºñ¹Ð¹øÈ£´Â 4ÀÚÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä."); 
		floginpw.focus(); 
		return false; 
	}


	frm.action = url+"/users_zone/login_ok.php";

	return true;
}

function Check_Enter(frm) 
{
	if(event.keyCode == 13) { 
       //frm.submit();
	   Login_Check();
    } 
}

// ±¸ÀÎ Å°¿öµå °Ë»ö
function KewordSearch()
{
	if(document.kewordsearch.s_keyword.value=="")
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÁÖ¼¼¿ä"); 
		document.kewordsearch.s_keyword.focus();
		return false; 
	}

	document.kewordsearch.action="/board.php";
//	window.document.search_r.submit();
	return true;
}


function OnChangeSelect(elm, frm, target)
{
	var tmp = eval("document."+frm+"."+target);

	tmp.value = elm.options[elm.selectedIndex].text;
}



// °Ë»ö¼¾ÅÍ(°¢ ¸Þ´º ¸ÞÀÎÈ­¸é)
function SearchCenter()
{
	document.searchcenter.action="../board.php";
	document.searchcenter.submit();
}


//3ÀÚ¸®¸¶´Ù ÄÞ¸¶Âï±â
function commaSplitAndAllowDot(val) 
{
	if(val=='' || val==null || val=='NaN')
		return '0';

    var txtNumber = '' + val;
    if (isNaN(txtNumber) ) 
	{
        val = val.substring(0, val.length-1 );
        return val;
    }
    else 
	{
        var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
        var arrNumber = txtNumber.split('.');
        arrNumber[0] += '.';

        do {
            arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
        } while (rxSplit.test(arrNumber[0]));
        
        if (arrNumber.length > 1)
            return arrNumber.join('');
        else 
            return arrNumber[0].split('.')[0];
   }
}


function numOnly(obj,isCash){ 
    //»ç¿ë¿¹ : <input type="text" name="text" onKeyUp="javascript:numOnly(this,true);"> 
    //¼¼ÀÚ¸® ÄÞ¸¶ »ç¿ë½Ã true , ¼ýÀÚ¸¸ ÀÔ·Â ½Ã false 
    if (event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39) return; 
    var returnValue = ""; 
    for (var i = 0; i < obj.value.length; i++){ 
        if (obj.value.charAt(i) >= "0" && obj.value.charAt(i) <= "9"){ 
            returnValue += obj.value.charAt(i); 
        }else{ 
            returnValue += ""; 
        } 
    } 

    if (isCash){ 
        obj.value = cashReturn(returnValue); 
        return; 
    } 
    obj.focus(); 
    obj.value = returnValue; 
} 


function cashReturn(numValue){ 
    //numOnlyÇÔ¼ö¿¡ ¸¶Áö¸· ÆÄ¶ó¹ÌÅÍ¸¦ true·Î ÁÖ°í numOnly¸¦ ºÎ¸¥´Ù. 
    var cashReturn = ""; 
    for (var i = numValue.length-1; i >= 0; i--){ 
        cashReturn = numValue.charAt(i) + cashReturn; 
        if (i != 0 && i%3 == numValue.length%3) cashReturn = "," + cashReturn; 
    } 
    return cashReturn; 
}


//ÀÌ¸áÁÖ¼ÒÇ¥½Ã
function linkEM(id, domain) 
{
	var em='';
	if(id!='' & domain!='')
		em      = id + "@" + domain;

	document.writeln(em);
}

//Å¬¸¯½Ã ·¹ÀÌ¾îÆË¾÷¸Þ´º
var select_obj;
function PopupLayer(name,status) 
{ 
	var obj=document.all[name];
	var _tmpx,_tmpy, marginx, marginy;
	_tmpx = event.clientX + parseInt(obj.offsetWidth);
	_tmpy = event.clientY + parseInt(obj.offsetHeight);
	_marginx = document.body.clientWidth - _tmpx;
	_marginy = document.body.clientHeight - _tmpy ;
	if(_marginx < 0)
		_tmpx = event.clientX + document.body.scrollLeft + _marginx ;
	else
		_tmpx = event.clientX + document.body.scrollLeft ;

	if(_marginy < 0)
		_tmpy = event.clientY + document.body.scrollTop + _marginy +20;
	else
		_tmpy = event.clientY + document.body.scrollTop ;
	
	obj.style.posLeft=_tmpx-13;
	obj.style.posTop=_tmpy-12;
	if(status=='visible') 
	{
		if(select_obj) 
		{
			select_obj.style.visibility='hidden';
			select_obj=null;
		}
		select_obj=obj;
	}
	else
	{
		select_obj=null;
	}
	obj.style.visibility=status; 
}



/** 
* string String::cut(int len)
* ±ÛÀÚ¸¦ ¾Õ¿¡¼­ºÎÅÍ ¿øÇÏ´Â ¹ÙÀÌÆ®¸¸Å­ Àß¶ó ¸®ÅÏÇÕ´Ï´Ù.
* ÇÑ±ÛÀÇ °æ¿ì 2¹ÙÀÌÆ®·Î °è»êÇÏ¸ç, ±ÛÀÚ Áß°£¿¡¼­ Àß¸®Áö ¾Ê½À´Ï´Ù.
*/
String.prototype.cut = function(len) {
		var str = this;
		var l = 0;
		for (var i=0; i<str.length; i++) {
				l += (str.charCodeAt(i) > 128) ? 2 : 1;
				if (l > len) return str.substring(0,i) + "...";
		}
		return str;
}

/** 
* bool String::bytes(void)
* ÇØ´ç½ºÆ®¸µÀÇ ¹ÙÀÌÆ®´ÜÀ§ ±æÀÌ¸¦ ¸®ÅÏÇÕ´Ï´Ù. (±âÁ¸ÀÇ length ¼Ó¼ºÀº 2¹ÙÀÌÆ® ¹®ÀÚ¸¦ ÇÑ±ÛÀÚ·Î °£ÁÖÇÕ´Ï´Ù)
*/
String.prototype.bytes = function() {
		var str = this;
		var l = 0;
		for (var i=0; i<str.length; i++) l += (str.charCodeAt(i) > 128) ? 2 : 1;
		return l;
}

/* -- »ç¿ë¿¹--
aaa = "µ¿aÇØb¹°c°ú ¹éµÎ»êÀÌ";
alert(aaa.cut(15));

// ¶Ç´Â

bbb = "³Ê¹«±ä³»¿ë³Ê¹«±ä³»¿ë³Ê¹«±ä³»¿ë";

alert("length: " + bbb.length + "\nbytes(): " + bbb.bytes());

//ÀÀ¿ë

if (bbb.bytes() > 20) {
		alert("³»¿ëÀÌ ³Ê¹« ±é´Ï´Ù");
} else {
		// Ã³¸®
}     
*/






// ChangeValue¿Í °ÅÀÇ°°À½. Áö¿ªÄÚµå¹è¿­Àº 1ºÎÅÍ½ÃÀÛ, ´ëÇÐ,ÀüÃ¶Àº 0ºÎÅÍ½ÃÀÛÇÏ¹Ç·Î ChangeArea¿Í °°ÀÌ¸ø¾¸.
// ¼¼ºÎÁö¿ª
function ChangeArea(adkindof,formname, idx, sel, selCode, selflag)	
{
	var elmMain, emlSub;
	var frm		= eval("document." + formname);	
	var difm, difp;
	
	if(formname=='regform')
	{
		elmMain	= eval("frm.sido"  + sel);	// sel Àº ±Ù¹«Áö¿ªÀÌ ¸ÖÆ¼ÀÏ¶§ »ç¿ë
		emlSub	= eval("frm.gugun" + sel);	// ´ÙÁß¼±ÅÃÀÏ¶§ 
	}
	else
	{
		elmMain	= frm.s_sido;
		emlSub	= frm.s_gugun;
	}

	subName	= guName;
	subCode	= guName;

	// ÃÊ±âÈ­
	SelectOptionClear(emlSub);
	emlSub.selectedIndex=0;

	if(adkindof=='900' || adkindof=='950' || adkindof=='999')	
	{
		difm = -1;
		difp = 1;	// ±¸±º¿¡¼­ 'ÀüÃ¼'¸¦ ¾Èº¸¿©ÁÜ.
	}
	else
	{
		difm = 0;
		difp = 0;
	}

	idx++;

	if(idx>0)
	{
		for(j=0; j<subName[idx].length+difm; j++) 
		{     
			emlSub.options[j] = new Option(subName[idx][j+difp],subCode[idx][j+difp]);
			if (emlSub.options[j].value==selCode)
			{
				emlSub.options[j].selected=true;
	     	}
		}     
		
		emlSub.length	= subName[idx].length+difm;
	}
	else
	{	
		emlSub.options[0]=new Option("¼±¡¡ÅÃ","0");
		emlSub.length=1;		
	}
}


// option clear
function SelectOptionClear(frm)
{ 
    for (i=(frm.length-1) ; i>0 ; i--)
	{ 
		frm.options[i] = null; 
	} 
}

// Á÷Á¾,Áö¿ª ¼¼ºÎ°Ë»ö¿¡¼­ »ç¿ë
function CheckCount(frm) 
{	
	var i =0;
	var ncnt = 0;			// ¼±ÅÃµÈ °¹¼ö
	//var frm = document.searchcenter;

	while (i < frm.elements.length)
	{
		if (frm.elements[i].type=='checkbox') 
		{
			if (frm.elements[i].checked)
			{
				if (ncnt > 2)
				{
					alert('3°³±îÁö ¼±ÅÃ °¡´ÉÇÕ´Ï´Ù.');
					frm.elements[i].checked = false;
				}
				else
					ncnt += 1;
			}
		}
		i++;

		frm.checkcount.value	= ncnt;	 			// Ä«¿îÆ®
	}
}

// Á÷Á¾ ¼¼ºÎ°Ë»ö¿¡¼­ »ç¿ë
function JobtypeChange(frm) 
{	
	frm.submit();
}

function isValidFormat(input,format) {
	if (input.value.search(format) != -1) {
		return true; //file://¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
	}
	return false;
}
/**
* ÀÔ·Â°ªÀÌ ÀÌ¸ÞÀÏ Çü½ÄÀÎÁö Ã¼Å©
* ex) if (!isValidEmail(form.email)) {
*         alert("¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.");
*     }
*/
function isValidEmail(input) {
	//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
	var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
	return isValidFormat(input,format);
}

CheckboxFlag=false;
function CheckToggle(ElementName)
{
    var EleSize=ElementName.length;
    var i=0;

    if(!CheckboxFlag){
        if(!EleSize){
            ElementName.checked=true;
        }else{
            for(i;EleSize>i;++i){
                ElementName[i].checked=true;
            }
        }
        CheckboxFlag=true;
    }else{
        if(!EleSize){
            ElementName.checked=false;
        }else{
            for(i;EleSize>i;++i){
                ElementName[i].checked=false;
            }
        }
        CheckboxFlag=false;
    }
}

// ±¸ÀÎ,±¸Á÷±¤°í ¼öÁ¤
function AdEdit(mode, loginid, arg, level)
{
	var form = document.regform;
	var actfile;
	if(mode=="gujik")	actfile= "/empedit.php";
	else				actfile= "/edit.php";

	if(loginid=='' && level!='0')
	{
		if( form.adpassword.value == '' ) { alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä."); return; }
	}
	form.action = actfile+"?"+arg;
	form.submit();
}

// ±¸ÀÎ,±¸Á÷±¤°í »èÁ¦
function AdDelete(mode, loginid, arg, level)
{
	var form = document.regform;
	var actfile;
	if(mode=="gujik")	actfile= "/empdelete.php";
	else				actfile= "/delete.php";

	if(loginid=='' && level!='0')
	{
		if( form.adpassword.value == '' ) { alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä."); return; }
	}
	if( confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?") == true )
	{
		form.action = actfile+"?"+arg;
		form.submit();
	}
	else
	{
		return;
	}
}

function OpenFlash(Url,Width,Height){                 
  document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + Width + "\" height=\"" + Height + "\">"); 
  document.writeln("<param name=\"movie\" value=\"" + Url + "\">"); 
  document.writeln("<param name=\"quality\" value=\"high\" />");     
  document.writeln("<param name=\"wmode\" value=\"transparent\">"); 
  document.writeln("<embed src=\"" + Url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + Width + "\"  height=\"" + Height + "\">"); 
  document.writeln("</object>");     
} 

function SetFocus()
{
	document.srhform.s_keyword.focus();
}


/*
function doBlink() {		// ±ÛÀÚ±ôºýÀÓ
	var blink = document.all.tags("BLINK") // ÅÂ±×(³×½ºÄÉÀÌÇÁ°è¿­Àº ±âº»À¸·Î µÊ. ie¿¡¼­´Â ¾ÈµÇ¼­ ÀÚ½º·Î ÇØ°á)
	for (var i=0; i < blink.length; i++) 
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
	} 

function startBlink() { 
	if (document.all) 
		setInterval("doBlink()",750) // ÀÛÀº¼ýÀÚ -> »¡¶óÁü
	} 

window.onload = startBlink; 
*/



//¹ÝÂ¦ÀÓ¸¸ »ç¿ë½Ã
color_basic=new Array;

color_basic[0]='#C4A7FD';
color_basic[1]='#9002DA';
color_basic[2]='#60A9FC';
color_basic[3]='#024B9D';

color_basic[4]='#FA80B4';
color_basic[5]='#FE016C';
color_basic[6]='#5CF840';
color_basic[7]='#157803';

//º¸¶ó Çü±¤Ææ»ç¿ë½Ã ¹ÝÂ¦ÀÓ
color_purple=new Array;
color_purple[0]='#60E9FE';
color_purple[1]='#FDCBE3';
color_purple[2]='#27FD18';
color_purple[3]='#F5FE06';

//ÃÊ·Ï Çü±¤Ææ»ç¿ë½Ã ¹ÝÂ¦ÀÓ
color_green=new Array;
color_green[0]='#60E9FE';
color_green[1]='#FDCBE3';
color_green[2]='#27FD18';
color_green[3]='#F5FE06';

var cnt_basic=0;
var cnt_purple=0;

function ColorChange(COUNTBLINK_BASIC, COUNTBLINK_PURPLE, COUNTBLINK_GREEN)	// ¹ÝÂ¦ÀÓ, º¸¶óÇü±¤+¹ÝÂ¦ÀÓ,  ³ì»öÇü±¤+¹ÝÂ¦ÀÓ
{
	var len_bas = color_basic.length;
	var len_pur = color_purple.length;

	if(COUNTBLINK_BASIC > 0){
		for (i=0; i<COUNTBLINK_BASIC; i++ )	{	
			spanid = eval("document.getElementById('blkbasic"+ i +"')");
			spanid.style.color=color_basic[cnt_basic];
		}
	}

	if(COUNTBLINK_PURPLE > 0){
		for (i=0; i<COUNTBLINK_PURPLE; i++ )	{	
			spanid = eval("document.getElementById('blkpurple"+ i +"')");
			spanid.style.color=color_purple[cnt_purple];
		}
	}

	if(COUNTBLINK_GREEN > 0){
		for (i=0; i<COUNTBLINK_GREEN; i++ )	{	
			spanid = eval("document.getElementById('blkgreen"+ i +"')");
			spanid.style.color=color_green[cnt_purple];
		}
	}

	cnt_basic++;
	cnt_purple++;

	if(len_bas < cnt_basic)
		cnt_basic=0;

	if(len_pur < cnt_purple)
		cnt_purple=0;

	
	if(cnt_basic%4==0)
		itime = 800;		
	else
		itime = 100;	

	
	refunc = eval(setTimeout("ColorChange("+COUNTBLINK_BASIC+","+COUNTBLINK_PURPLE+","+COUNTBLINK_GREEN+")", itime));
}



// ¾Æ·¡ÇÔ¼ö´Â ÇöÀç»ç¿ë¾ÈÇÔ. ÃßÈÄ »ç¿ëµÉ °¡´É¼º...
// ÀÌ¹ÌÁöÀÇ Å©±â¿¡ µû¶ó »õÃ¢ÀÇ Å©±â°¡ º¯°æµË´Ï´Ù. ==>get php½ºÄð	»ç¿ëÀº onclick='image_window(this)' ÇÏ¸éµÊ.
function image_window(img)
{
	var w = img.width;
	var h = img.height;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/3;
	alert(w+','+h);
	if (w >= screen.width) {
		winl = 0;
		h = (parseInt)(w * (h / w));
	}

	if (h >= screen.height) {
		wint = 0;
		w = (parseInt)(h * (w / h));
	}

	var js_url = "<script language='JavaScript1.2'> \n";
		js_url += "<!-- \n";
		js_url += "var ie=document.all; \n";
		js_url += "var nn6=document.getElementById&&!document.all; \n";
		js_url += "var isdrag=false; \n";
		js_url += "var x,y; \n";
		js_url += "var dobj; \n";
		js_url += "function movemouse(e) \n";
		js_url += "{ \n";
		js_url += "  if (isdrag) \n";
		js_url += "  { \n";
		js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n";
		js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n";
		js_url += "    return false; \n";
		js_url += "  } \n";
		js_url += "} \n";
		js_url += "function selectmouse(e) \n";
		js_url += "{ \n";
		js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n";
		js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n";
		js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n";
		js_url += "  { \n";
		js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n";
		js_url += "  } \n";
		js_url += "  if (fobj.className=='dragme') \n";
		js_url += "  { \n";
		js_url += "    isdrag = true; \n";
		js_url += "    dobj = fobj; \n";
		js_url += "    tx = parseInt(dobj.style.left+0); \n";
		js_url += "    ty = parseInt(dobj.style.top+0); \n";
		js_url += "    x = nn6 ? e.clientX : event.clientX; \n";
		js_url += "    y = nn6 ? e.clientY : event.clientY; \n";
		js_url += "    document.onmousemove=movemouse; \n";
		js_url += "    return false; \n";
		js_url += "  } \n";
		js_url += "} \n";
		js_url += "document.onmousedown=selectmouse; \n";
		js_url += "document.onmouseup=new Function('isdrag=false'); \n";
		js_url += "//--> \n";
		js_url += "</"+"script> \n";

	var settings;

	//if (g4_is_gecko) {
		settings  ='width='+(w+10)+',';
		settings +='height='+(h+10)+',';
	//} else {
	//	settings  ='width='+w+',';
	//	settings +='height='+h+',';
	//}
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars=no,';
	settings +='resizable=yes,';
	settings +='status=no';


	win=window.open("","image_window",settings);
	win.document.open();
	win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset=euc-kr'>\n");
	var size = "ÀÌ¹ÌÁö »çÀÌÁî : "+w+" x "+h;
	win.document.write ("<title>"+size+"</title> \n");
	if(w >= screen.width || h >= screen.height) {
		win.document.write (js_url);
		var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n ÀÌ¹ÌÁö »çÀÌÁî°¡ È­¸éº¸´Ù Å®´Ï´Ù. \n ¿ÞÂÊ ¹öÆ°À» Å¬¸¯ÇÑ ÈÄ ¸¶¿ì½º¸¦ ¿òÁ÷¿©¼­ º¸¼¼¿ä. \n\n ´õºí Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '";
	}
	else
		var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '";
	win.document.write ("<style>.dragme{position:relative;}</style> \n");
	win.document.write ("</head> \n\n");
	win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n");
	win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
	win.document.write ("</body></html>");
	win.document.close();

	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


CheckboxFlag=false;

function checkall(ElementName){

    var EleSize=ElementName.length;
    var i=0;

    if(!CheckboxFlag){
        if(!EleSize){
            ElementName.checked=true;
        }else{
            for(i;EleSize>i;++i){
                ElementName[i].checked=true;
            }
        }
        CheckboxFlag=true;
    }else{
        if(!EleSize){
            ElementName.checked=false;
        }else{
            for(i;EleSize>i;++i){
                ElementName[i].checked=false;
            }
        }
        CheckboxFlag=false;
    }
}


//Å¬¸³º¸µå¿¡ º¹»ç
function _copy(id) { 
	var txt=document.body.createTextRange(); 
	txt.moveToElementText(document.all(id)); 
	txt.select(); 
	txt.execCommand("copy"); 
	document.selection.empty(); 
} 

function trim( str ) {
    // Strip whitespace (or other characters) from the beginning and end of a string
    // 
    // +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_trim/
    // +       version: 801.3120
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: mdsjack (http://www.mdsjack.bo.it)
    // +   improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev)
    // *     example 1: trim('    Kevin van Zonneveld    ');
    // *     returns 1: 'Kevin van Zonneveld'

    return str.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g, '');
}

function explode( delimiter, string ) {
    // Split a string by string
    // 
    // +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_explode/
    // +       version: 802.107
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: kenneth
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: explode(' ', 'Kevin van Zonneveld');
    // *     returns 1: {0: 'Kevin', 1: 'van', 2: 'Zonneveld'}

    var emptyArray = { 0: '' };

    if ( arguments.length != 2
        || typeof arguments[0] == 'undefined'
        || typeof arguments[1] == 'undefined' )
    {
        return null;
    }

    if ( delimiter === ''
        || delimiter === false
        || delimiter === null )
    {
        return false;
    }

    if ( typeof delimiter == 'function'
        || typeof delimiter == 'object'
        || typeof string == 'function'
        || typeof string == 'object' )
    {
        return emptyArray;
    }

    if ( delimiter === true ) {
        delimiter = '1';
    }

    return string.toString().split ( delimiter.toString() );
}



// ÇÃ·¡½Ã¸¦ ÀÌ¿ëÇÑ Å¬¸³º¸µå º¹»ç ... phpschoolÃâÃ³ 
function copyClipboard(inElement, msgflag)	 
{ 
    if (inElement.createTextRange) 
    { 
        var range = inElement.createTextRange(); 
        if (range && BodyLoaded==1) 
            range.execCommand('Copy'); 
    } 
    else 
    { 
        var flashcopier = 'flashcopier'; 
        if(!document.getElementById(flashcopier)) 
        { 
            var divholder = document.createElement('div'); 
            divholder.id = flashcopier; 
            document.body.appendChild(divholder);                                                                                                                                    
        } 
        document.getElementById(flashcopier).innerHTML = ''; 
        var divinfo = '<embed src="/common_module/_clipboard_func.swf" FlashVars="clipboard='+encodeURIComponent(inElement.innerHTML)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>'; 
        document.getElementById(flashcopier).innerHTML = divinfo; 
    } 

	if(msgflag=='1')
		alert('º¹»çµÇ¾ú½À´Ï´Ù. ¿øÇÏ´Â°÷¿¡ ºÙ¿©³Ö±âÇÏ½Ã¸é µË´Ï´Ù.'); 
	else
		popup_open('msgwin', '/common_module/winmsg.php', '', 100, 100, -1, 20, '', '');	
} 


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 clean_jobtype_option_list(form) { 
    searchq.s_jobtype2.options.length=0; 
} 

function make_jobtype(form) { 
    clean_jobtype_option_list(form); 
    var funm_name="jobtype_option_for_"; 
    funm_name += searchq.s_jobtype1.value; 
    funm_name += "(form)"; 
    eval(funm_name); 
} 

function jobtype_option_for_(form) { 
    searchq.s_jobtype2.options[0] = new Option("ÀüÃ¼",""); 
	
} 

function jobtype_option_for_A(form) { //Çì¾î
    searchq.s_jobtype2.options[0] = new Option("ÀüÃ¼",""); 
	searchq.s_jobtype2.options[1] = new Option("½ºÅÇ","A1"); 
    searchq.s_jobtype2.options[2] = new Option("Áß»ó","A2");
	searchq.s_jobtype2.options[3] = new Option("µðÀÚÀÌ³Ê","A3");
	searchq.s_jobtype2.options[4] = new Option("½ºÆä¾Æ","A4");
} 

function jobtype_option_for_D(form) { //¸ÞÀÌÅ©¾÷
	searchq.s_jobtype2.options[0] = new Option("ÀüÃ¼",""); 
    searchq.s_jobtype2.options[1] = new Option("ÃÊº¸°ü¸®»ç","D1");  
	searchq.s_jobtype2.options[2] = new Option("°æ·Â°ü¸®»ç","D2");  
	searchq.s_jobtype2.options[3] = new Option("½ÇÀå±Þ°ü¸®»ç","D3");  
} 

function jobtype_option_for_G(form) { //ÇÇºÎ°ü¸®
	searchq.s_jobtype2.options[0] = new Option("ÀüÃ¼",""); 
	searchq.s_jobtype2.options[1] = new Option("ÃÊ±Þ¾ÆÆ¼½ºÆ®","G1");  
	searchq.s_jobtype2.options[2] = new Option("Áß±Þ¾ÆÆ¼½ºÆ®","G2");  
	searchq.s_jobtype2.options[3] = new Option("½ÇÀå±Þ¾ÆÆ¼½ºÆ®","G3");  
} 

function jobtype_option_for_F(form) {	//³×ÀÏ
	searchq.s_jobtype2.options[0] = new Option("ÀüÃ¼","");  
    searchq.s_jobtype2.options[1] = new Option("ÃÊ±Þ³×ÀÏ¸®½ºÆ®","F1");  
	searchq.s_jobtype2.options[2] = new Option("Áß±Þ³×ÀÏ¸®½ºÆ®","F2");  
	searchq.s_jobtype2.options[3] = new Option("½ÇÀå±Þ³×ÀÏ¸®½ºÆ®","F3");  
} 
                                    
function jobtype_option_for_Z(form) {	//±âÅ¸
	searchq.s_jobtype2.options[0] = new Option("ÀüÃ¼","");  
    searchq.s_jobtype2.options[1] = new Option("ÃÊºù¿øÀå","Z1");  
	searchq.s_jobtype2.options[2] = new Option("±³À°°­»ç","Z2");  
	searchq.s_jobtype2.options[3] = new Option("»ì·Õ¸Å´ÏÀú","Z3");  
	searchq.s_jobtype2.options[4] = new Option("ÅäÅ»½ºÅ¸ÀÏ¸®½ºÆ®/ÆÐ¼ÇµðÀÚÀÌ³Ê","Z4"); 
	searchq.s_jobtype2.options[5] = new Option("ºñ¸¸°ü¸®»ç","Z5"); 
	searchq.s_jobtype2.options[6] = new Option("µÎÇÇ°ü¸®»ç","Z6"); 
	searchq.s_jobtype2.options[7] = new Option("±âÅ¸","Z99"); 
} 
