function chkImgFormat (el)
{
    var file = el.value;
    var allowSubmit = false;
    var extArray = new Array(".gif", ".jpg", ".png");

    extArray.join(" ");

    if (!file) return false;

    while (file.indexOf("\\") != -1)
        file = file.slice(file.indexOf("\\") + 1);

    var ext = file.slice(file.indexOf(".")).toLowerCase();

    for (var i = 0; i < extArray.length; i++) {
        if (extArray[i] == ext) {
            allowSubmit = true;
            break;
        }
    }

    if (allowSubmit) {
       return true;
    }
    else {
        alert("±×¸² »ðÀÔÀº GIF, JPG, PNG ÆÄÀÏ¸¸ °¡´ÉÇÕ´Ï´Ù. ´Ù½Ã ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        return false;
    }
} 

function activationActiveX(obj){ 
  document.write(obj); 
} 
 
/* »õÃ¢ */
function openwindow(url,intWidth,intHeight) { 
      window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",resizable=1,scrollbars=1");
}

function openwindow02(url,intWidth,intHeight) { 
      window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",resizable=0,scrollbars=0");
}


function openwindow_new(url,intWidth,intHeight) { 
      window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes") ;
      
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

 function WinPop(mypage,myname, w, h) { //v2.0

	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,status=0,scrollbars=0'
	popWin = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { popWin.window.focus(); }
}

function view_img(str,str1){
	 var thisMenu = eval("document.getElementById('img_" + str1 + "')")
	 
		 thisMenu.src ="/Pds/"+str1+"/"+str;

}

/* rollover */
var changedImg;

function EImgChg(flag)
{
	source=event.srcElement;
	if (source.name == "")
	{ return false;  }

	if(changedImg == source.name)
	return;


	else if (document.images && source.tagName=="IMG") {
		imgElement = source.name;  // ÀÌ¹ÌÁö name
		imgPath = source.src;   // ÀÌ¹ÌÁö src ¼Ó¼º°ª

		imgPathLen = imgPath.length;
		imgPathFlag = imgPath.lastIndexOf("/");
		imgName = imgPath.substring(0,imgPathFlag+1);

		document.images[imgElement].src =  imgName + imgElement + "_" + flag + ".gif";

	}
}

/* ·¹ÀÌ¾î */
	function LayerSH(LayerName,Status) {
	ns4 = (document.layers)?true:false
	ie4 = (document.all)?true:false
	
		if (ns4) {
			LayerN = document.layers[LayerName]
			if (Status == 'show') LayerN.visibility = 'show';
			if (Status == 'hide') LayerN.visibility = 'hidden';
		}	
		if (ie4) {
			LayerN = document.all[LayerName].style
			if (Status == 'show') LayerN.visibility = 'visible';
			if (Status == 'hide') LayerN.visibility = 'hidden';
		}
	}	
	
	
	
/* Å¬¸¯ÇßÀ»¶§ ÀÔ·ÂÆûÀÇ ±ÛÀÚ ¾ø¾îÁü */
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
        thefield.value = ""
} 	

/* Å¬¸¯½Ã Á¡¼± ¾È º¸ÀÌ°Ô  */
function allblur() {
for (i = 0; i < document.links.length; i++)
document.links[i].onfocus = document.links[i].blur;
}


	
/* ¾ÆÀÌÇÁ·¹ÀÓ ±æÀÌ ÀÚµ¿Á¶Àý */
	function initsize() { 
		livebar.resizeTo(livebar.document.body.scrollWidth, livebar.document.body.scrollHeight); 
	} 

// popup
function popsn(url,trgt,w,h) {
    window.open(url,trgt,'width='+w+',height='+h+',scrollbars=no,resizable=no,copyhistory=no,toolbar=no');
}
function popsy(url,trgt,w,h) {
    window.open(url,trgt,'width='+w+',height='+h+',scrollbars=yes,resizable=no,copyhistory=no,toolbar=no');
}

//°Ë»ö
function Search() {

	if (/[^\s]/g.test(document.top_search.search_word.value)==0) {

	  // alert("\n°Ë»ö´Ü¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä. ");
	//   document.top_search.search_word.focus();
	//   return false;
	}
 

}
// faq 
	var z=1

	function list(i){
		if(document.all["list"+i].style.display==""){
			document.all["list"+i].style.display="none"
		    z=1}

	    else{
	        document.all["list"+z].style.display="none";
            document.all["list"+i].style.display="";
	        z=i
	   }
	}

/* tab »ç¿ë½Ã ·¹ÀÌ¾î(ÅÇ Å¬¸¯ ³»¿ë º¸¿©ÁÖ±â - 2°³) */
		function menu2(index) {
			if (navigator.userAgent.indexOf("MSIE") != -1) {
				if (index == 1) {
					t1.style.display = "";
					t2.style.display = "none";			
				} 
				
				
			    else if (index == 2) {
					t1.style.display = "none";
					t2.style.display = "";									
			   }
			   					 	   

		}}		


		function menu21(index) {
			if (navigator.userAgent.indexOf("MSIE") != -1) {
				if (index == 3) {
					t3.style.display = "";
					t4.style.display = "none";			
				} 
				
				
			    else if (index == 4) {
					t3.style.display = "none";
					t4.style.display = "";									
			   }
			   					 	   

		}}

		function menu31(index) {
			if (navigator.userAgent.indexOf("MSIE") != -1) {
				if (index == 5) {
					t5.style.display = "";
					t6.style.display = "none";			
				} 
				
				
			    else if (index == 6) {
					t5.style.display = "none";
					t6.style.display = "";									
			   }
			   					 	   

		}}




	var isNN = (navigator.appName.indexOf("Netscape")!=-1);

	function autoTab(input,len, e) {
		var keyCode = (isNN) ? e.which : e.keyCode; 
		var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
		if(input.value.length >= len && !containsElement(filter,keyCode)) {
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
	}

	function containsElement(arr, ele) {
		var found = false, index = 0;
		while(!found && index < arr.length)
		if(arr[index] == ele)
			found = true;
		else
			index++;
		return found;
	}

	function getIndex(input) {
		var index = -1, i = 0, found = false;
		while (i < input.form.length && index == -1)
			if (input.form[i] == input)index = i;
			else i++;
			return index;
		}
		return true;
	}


	function resizeHeight(fr) {
		fr = typeof fr == 'string' ? document.getElementById(fr) : fr;
		fr.setExpression('height',livebar.document.body.scrollHeight);

	}

	// LineMap Ã¼Å©/Ãâ·Â ÇÔ¼ö - made by Yoon
	function check(path){

		var chk01 = ' > ';
		var chk02 = '>';

		var p0=1;
		var p1=0;

		var s0 = path;
		var s1;

		while(p0>0)
		{
			s0=s0.slice(p0+3,s0.length);
			p0=s0.indexOf(chk01);
			p1=p1+p0+3;
		}

		s1 = path.slice(0, p1+2);
		p0 = s0.indexOf(chk02);

		if (p0 >0)
		{
			s0 = s0.slice(p0+1,s0.length-4);
		}

		document.write(s1 + '<b>'+s0+'</b>');
	}
	
function getStyleObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function getObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId);
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId);
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function changeObjectVisibility(objectId, newVisibility) {
    // first get a reference to the cross-browser style object 
    // and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
		return false;
    }
}

function displayText(objectId, text){
	if (document.all) {
	document.all[objectId].innerHTML = text;
	}
	else
	{
	var obj = document.getElementById(objectId);
	obj.innerHTML = text;  
	}
}	
//Åä±Û¸Þ´º
function toggleMenu(currMenu) {
	
	if (document.getElementById) {
		thisMenu = eval("getObject('" + currMenu + "').style")
		if (thisMenu.display == "") {
			thisMenu.display = "none"
		}
		else {
			thisMenu.display = ""
		}
		return false;
	}
	else {
		return true;
	}
	
}

function toggleMenu__(currMenu,intMenu, intTotMenu) {
	if (document.getElementById) {
		for (i = 1; i <= intTotMenu; i++){

			thisMenu = eval("getObject('" + currMenu +i+ "').style")
			if (i == intMenu) {
				thisMenu.display = ""
			}
			else {
				thisMenu.display = "none"
			}
		}

		
	}
	else {
		return true
	}
}
 
function adjustImage(target_img)
{
	var newX, newY;
	var newHeight, newWidth;
	var newImg;

	var maxWidth = 700;
	var maxHeight = 700;

	newImg = new Image();
	newImg.src = target_img.src;
	imgw = newImg.width;
	imgh = newImg.height;

	if (imgw*1.2 >= imgh) {
		//return false;
	}

	if (imgw > maxWidth || imgh > maxHeight) {
		if(imgw > imgh) {
			if(imgw > maxWidth)
				newWidth = maxWidth;
			else
				newWidth = imgw;
			newHeight = Math.round((imgh*newWidth)/imgw);
		} else {
			if(imgh > maxHeight)
				newHeight = maxHeight;
			else
				newHeight = imgh;
			newWidth = Math.round((imgw*newHeight)/imgh);
		}
	} else {
		newWidth = imgw;
		newHeight = imgh;
	}

	newX = maxWidth/2 - newWidth/2;
	newY = maxHeight/2 - newHeight/2;

	target_img.onload = null;
	target_img.src = newImg.src;
	target_img.width = newWidth;
	target_img.height = newHeight;
}


function adjustbImage(target_img)
{
	var newX, newY;
	var newHeight, newWidth;
	var newImg;

	var maxWidth = 600;
	var maxHeight = 800;

	newImg = new Image();
	newImg.src = target_img.src;
	imgw = newImg.width;
	imgh = newImg.height;

	if (imgw*1.2 >= imgh) {
		return false;
	}

	if (imgw > maxWidth || imgh > maxHeight) {
		if(imgw > imgh) {
			if(imgw > maxWidth)
				newWidth = maxWidth;
			else
				newWidth = imgw;
			newHeight = Math.round((imgh*newWidth)/imgw);
		} else {
			if(imgh > maxHeight)
				newHeight = maxHeight;
			else
				newHeight = imgh;
			newWidth = Math.round((imgw*newHeight)/imgh);
		}
	} else {
		newWidth = imgw;
		newHeight = imgh;
	}

	newX = maxWidth/2 - newWidth/2;
	newY = maxHeight/2 - newHeight/2;

	target_img.onload = null;
	target_img.src = newImg.src;
	target_img.width = newWidth;
	target_img.height = newHeight;
}

//¢Ã##########  ±Ý¾×À» ,(ÄÞ¸¶)·Î Ãµ¿ø´ÜÀ§·Î ±¸ºÐ Ç¥½Ã ##########¢Ã


function setCurrency(obj)
{
 var str = obj.value;

 str = str.toString().replace(/\$|\,/g,'');
 if(isNaN(str)) Str = "0";

 cents = Math.floor((str*100+0.5)%100);
 str = Math.floor((str*100+0.5)/100).toString();

 if(cents < 10) cents = "0" + cents;

 for (var i = 0; i < Math.floor((str.length-(1+i))/3); i++)
  str = str.substring(0,str.length-(4*i+3))+','+str.substring(str.length-(4*i+3));

 obj.value = str;
 //return (str);
}

//¢Ã##########  ¼ýÀÚ±¸ºÐÀÚ ,(ÄÞ¸¶)¸¦ Á¦°ÅÇÏ´Â ÇÔ¼ö ##########¢Ã
function setUnCurrency(obj)
{
 var str = obj.value;
  str=str.split(",");
      str=str.join("");
     obj.value = eval¡¡(str);

}
 