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_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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function Toggle(item) { // ¸Þ´º Å¬¸¯½Ã Åä±Û
	obj=document.getElementById(item);
	plusicon=document.getElementById("plusicon_"+item);
	visible=(obj.style.display!="none")

	if (visible) {
		plusicon.src="/images/i_plus.gif";
		obj.style.display="none";
	} else {
		plusicon.src="/images/i_minus.gif";	
		obj.style.display="block";
	}
}

// ¸Þ´º ±³Ã¼ ½ºÅ©¸³Æ® ½ÃÀÛ
function show_img(img_int) {
	for(var i = 1 ; i < 6 ; i++)
	{	
		if(String(i) == img_int)
		{
			document.all['mn_' + String(i)].style.display = 'block';
		}
		else
		{
			document.all['mn_' + String(i)].style.display = 'none';
		}
	}
}
// ¸Þ´º ±³Ã¼ ½ºÅ©¸³Æ® Á¾·á

function Expand() { // ¸Þ´º ÀüºÎ ¿­±â
divs=document.getElementsByTagName("DIV");
for (i=0;i<divs.length;i++) {
divs[i].style.display="block";
key=document.getElementById("x_" + divs[i].id);
key.innerHTML="<img src='img/textfolder.gif' border='0'>";
}
}

function Collapse() { // ¸Þ´º ÀüºÎ ´Ý±â
divs=document.getElementsByTagName("DIV");
for (i=0;i<divs.length;i++) {
divs[i].style.display="none";
key=document.getElementById("x_" + divs[i].id);
key.innerHTML="<img src='img/folder.gif' border='0'>";
}
}

var topmenuPX = 75;
var tid;

function mouseOV(arg){
	arg.style.display='block';
	//if(topmenuPX <= 110){
	//	tid = setInterval("checkTop()", 100); 
	//}
	//else{
	//	clearInterval(tid);
	//}
}

function checkTop(){
	topmenuPX = topmenuPX + 10;
	if(topmenuPX > 110){
		lnb_sub.style.top = 110;
	}
	else{		
		lnb_sub.style.top = topmenuPX;
	}
}

function mouseOT(arg){
	arg.style.display = "none";
//	topmenu.style.top = 70;
}

/*
= ·¹ÇÁÆ® ¸Þ´º ÀÌµ¿ =
Á¢±Ù±ÝÁö ¸Þ½ÃÁö°¡ ¾øÀ» °æ¿ì 
	ÇöÀç À§Ä¡°¡ »êÃâÆäÀÌÁöÀÏ °æ¿ì¿¡´Â º¸Çè Á¤º¸¸¦ ¼¼ÆÃÇÏ°í Æû ¼­ºê¹Ô
	¾Æ´Ñ °æ¿ì¿¡´Â »êÃâÆäÀÌÁö·Î ÀÌµ¿
Á¢±Ù±ÝÁö ¸Þ½ÃÁö°¡ ÀÖÀ» °æ¿ì ¸Þ½ÃÁö ¶ç¿ò
*/
function changeGoods(arg1, arg2){
	if(arg1 == ""){													// »êÃâÆäÀÌÁö·Î ¸µÅ©
		if(window.location.href.indexOf("goodsmall/goods_view.") > 0){			// ÇöÀç À§Ä¡°¡ »êÃâ»óÇ°ÆäÀÌÁöÀÏ°æ¿ì Æû°ª¼¼ÆÃ
			if(arg2 == "090713"){
				document.frmLeftInfo.txtPname.value = document.frm.txtPname.value;
				document.frmLeftInfo.txtPcode.value = document.frm.txtPcode.value;
				document.frmLeftInfo.txtJobCd.value = document.frm.txtJobCd.value;
				document.frmLeftInfo.txtJobName.value = document.frm.txtJobName.value;
				document.frmLeftInfo.lstJobGeub.value = document.frm.lstJobGeub.value;
				document.frmLeftInfo.txtJobPosition.value = document.frm.txtJobPosition.value;

				document.frmLeftInfo.action = "/goodsmall/goods_view_exp.asp?goodsCode="+arg2;
				document.frmLeftInfo.submit();	
			}
			else{
				document.frmLeftInfo.txtInfoKname.value = document.frm.txtInfoKname.value;
				document.frmLeftInfo.txtInfoKcode01.value = document.frm.txtInfoKcode01.value;
				document.frmLeftInfo.lstRelation.value = document.frm.lstRelation.value;
				document.frmLeftInfo.txtPname.value = document.frm.txtPname.value;
				document.frmLeftInfo.txtPcode.value = document.frm.txtPcode.value;
				document.frmLeftInfo.txtJobCd.value = document.frm.txtJobCd.value;
				document.frmLeftInfo.txtJobName.value = document.frm.txtJobName.value;
				document.frmLeftInfo.lstJobGeub.value = document.frm.lstJobGeub.value;
				document.frmLeftInfo.txtJobPosition.value = document.frm.txtJobPosition.value;
				if(document.getElementById("lstJongDrive")){
					document.frmLeftInfo.lstJongDrive.value = document.frm.lstJongDrive.value;
				}

				document.frmLeftInfo.action = "/goodsmall/goods_view.asp?goodsCode="+arg2;
				document.frmLeftInfo.submit();	
			}
		}
		else{														// ±× ¿Ü À§Ä¡ÀÏ °æ¿ì »êÃâ»óÇ°ÆäÀÌÁö·Î ¸µÅ©
			if(arg2 == "090713"){
				location.href="/goodsmall/goods_view_exp.asp?goodsCode="+arg2;
			}
			else{
				location.href="/goodsmall/goods_view.asp?goodsCode="+arg2;
			}
		}
	}	
	else{															// Á¢±Ù±ÝÁö ÆË¾÷
		alert(arg1);
	}
}

function isFieldBlank(theField){
	if (theField.value.length == 0)
		return true;
	else
		return false;
}

function login_si(obj){
	var message = " ";

	if (obj.MEBR_IDFC.value == "¾ÆÀÌµð" || isFieldBlank(obj.MEBR_IDFC)){
		message =  message + "¾ÆÀÌµð"
		foundError = true;
		alert(message+"¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		obj.MEBR_IDFC.focus();
		return(false);
	}

	if (obj.MEBR_PASW.value == "ºñ¹Ð¹øÈ£" || isFieldBlank(obj.MEBR_PASW)){
		message =  message + "ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä"
		foundError = true;
		alert(message);
		obj.MEBR_PASW.focus();
		return(false);
	}

	obj.action = "/member/login_ok.asp";
	obj.submit();
}

function onEnterSubmit(obj){ 
	var keyCode = window.event.keyCode; 
	if(keyCode==13) login_si(obj); 
} 

function setCookie (name, value, expires) {
	document.cookie = name + "=" + escape (value) +
    "; path=/; expires=" + expires.toGMTString();
}

function getCookie(Name) {
	var search = Name + "="
	if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é
		  offset += search.length
		  // set index of beginning of value
		  end = document.cookie.indexOf(";", offset)
		  // ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤
		  if (end == -1)
			end = document.cookie.length
		  return unescape(document.cookie.substring(offset, end))
		}
	}
	return "";
}

function saveid(form) {
	var expdate = new Date();
	// ±âº»ÀûÀ¸·Î 30ÀÏµ¿¾È ±â¾ïÇÏ°Ô ÇÔ. ÀÏ¼ö¸¦ Á¶ÀýÇÏ·Á¸é * 30¿¡¼­ ¼ýÀÚ¸¦ Á¶ÀýÇÏ¸é µÊ
	if (form.checksaveid.checked)
		expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30ÀÏ
	else
		expdate.setTime(expdate.getTime() - 1); // ÄíÅ° »èÁ¦Á¶°Ç

	setCookie("saveid", form.MEBR_IDFC.value, expdate);
}

function getid(form) {
	form.checksaveid.checked = ((form.MEBR_IDFC.value = getCookie("saveid")) != "");
}

/*ÇÃ·¡½Ã È£Ãâ ½ºÅ©¸³Æ® */

function __ws__(id)
{
document.write(id.text); id.id="";
}


function flashWrite(url,w,h,id,bg,vars){
// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö)
 // ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='wmode' value='transparent' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' menu='false' quality='high' wmode='transparent' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);

}

function set_center(width,height,type){
	nWidth = width;
	nHeight = height;
	nLeft = (window.screen.width - nWidth)/2;
	nTop = (window.screen.height - nHeight)/2;
	sF = "";
	if(type=="1") sF += "toolbar=no,location=no,menubar=no,status=no,directories=no,resizable=no,scrollbars=no";
	else sF += ",location=no,menubar=no,status=no,directories=no,resizable=no,scrollbars=yes";
	sF += ",left=" + nLeft;
	sF += ",top=" + nTop;
	sF += ",width=" + nWidth;
	sF += ",height=" + nHeight;
	return sF;
}

function allSearch(){
	if(document.getElementById("all_search_text").value == ""){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		return false;
	}
	document.getElementById("all_search_form").submit();
}


/* ÇöÀç À§Ä¡ °¡Áö°í ·Î ±× ÀÎÇÏ·¯ Go */
function go_login(){
	if(confirm("·Î±×ÀÎ ÈÄ ÀÌ¿ë°¡´ÉÇÕ´Ï´Ù. \n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?") == true){
		document.all.login_go.action="/member/login.asp";
		document.all.login_go.submit();
	}
	else{
	}
}

function MM_openBrWindowbn(theURL,winName,features) {
	theURL = theURL + "?branch_search=" + document.form1.branch_search.value;
	window.open(theURL,winName,features);
}
