<!--
// ÀÌ¼º±Ç JavaScript ¸ðÀ½ ( °øÅëÇÔ¼ö )

// ÇÑ±Û¸¸ ÀÔ·Â °¡´É 
// ¿¹ : <input type="text" name="post" onKeyPress="OnlyHangul()">
function OnlyHangul() { 
    if ( (event.keyCode < 12592) || (event.keyCode > 12687) ) 
    event.returnValue = false 
} 

// ¼ýÀÚ¸¸ ÀÔ·Â °¡´É 
// ¿¹ : <input type="text" name="post" onKeyPress="OnlyNum()">
function OnlyNum() {
	if ( (event.keyCode<48)||(event.keyCode>57) )
	event.returnValue = false
}


// ÀÌ¹ÌÁö ·Ñ¿À¹ö 
// ¿¹ :  <img src="/images/test_off.gif" name="test" onmouseover="EImgChg('on')" onmouseout="EImgChg('off')">
function EImgChg(flag)
{
	source=event.srcElement;
	if (source.name == "")
	{ return false;  }

	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";  }
}

// Layer º¸ÀÌ°Ô È¤Àº °¨Ãß°Ô ÇÑ´Ù
// ¿¹ : <a href="JavaScript:LayerSH('testLayer','show')">º¸ÀÓ</a> <a href="JavaScript:LayerSH('testLayer','hide')">¾Èº¸ÀÓ</a> , testLayer : Layer Name		
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';
	}
}	

// ÀÌ¹ÌÁö ÆË¾÷À¸·Î ¶ç¿ì±â
// ¿¹ : <a href="JavaScript:PopImg('test','../images/test_off.gif',900,500)">¸µÅ©</a>
function PopImg(winname, url, width, height) {
	var win = window.open(url,winname,"left=0, top=0, toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + width +",height=" + height + ";");
	win.focus();		
}
	
// ÆäÀÌÁö ÆË¾÷À¸·Î ¶ç¿ì±â
// ¿¹ : <a href="JavaScript:PopWindow('test','../images/test_off.gif',0,0,900,500)">¸µÅ©</a>
function PopWindow(winname, url, left, top, width, height) {
	var sFeatures = "left=" + left + ", top=" + top + ", width=" + width +",height=" + height + ", toolbar=0,menubar=0,scrollbars=yes,resizable=no";
	var win = window.open(url, winname, sFeatures);
	win.focus();		
}

// ¼ýÀÚ¸¸ µé¾î°¡ ÀÖ´ÂÁö ÇÊµå °Ë»ç
// ¿¹ : var Item = isNumber(document.form.ItemPrice.value);
//		if ( Item == false )
//		{
//			alert("¼ýÀÚ¿ÜÀÇ ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
//			document.form.ItemPrice.focus();
//			return;
//		}
function isNumber(intNum) {
	for (i = 0; i < intNum.length; i++) {
		if (intNum.charCodeAt(i) < 48 || intNum.charCodeAt(i) > 57) {
			return false;
		}
	}
	return true;
}

// checkOK º¯¼ö¿¡ ÀÖ´Â ±ÛÀÚ¸¸ Çã¿ëµÇ°í ³ª¸ÓÁö´Â Çã¿ë¾ÈµÊ
// ¿¹ : var Item = isCheckOK(document.form.ItemPrice.value);
//		if ( Item == false )
//		{
//			alert("Çã¿ëµÇÁö ¾Ê´Â ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
//			document.form.ItemPrice.focus();
//			return;
//		}
function isCheckOK(val) {
	var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
	for (i = 0;  i < val.length;  i++) {
		ch = val.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
			if (j == checkOK.length) {
				return false;
				break;
			}
	}
	return true;
}

// ¼ýÀÚ,ÇÑ±Û,¿µ¹®¼Ò´ë¹®ÀÚ¸¸ ÀÔ·Â °¡´É ( Æ¯¼ö¹®ÀÚ Á¦¿Ü )
// ¿¹ : var Item = isCheckOK1(document.form.ItemPrice.value);
//		if ( Item == false )
//		{
//			alert("Çã¿ëµÇÁö ¾Ê´Â ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
//			document.form.ItemPrice.focus();
//			return;
//		}
function isCheckOK1(strVal) {
	var intTempIdx;
	var strTemp;

	for (intTempIdx = 0; intTempIdx < strVal.length; intTempIdx++) {
		if ((strVal.charCodeAt(intTempIdx) < 127 && strVal.charCodeAt(intTempIdx) > 122)
			|| (strVal.charCodeAt(intTempIdx) < 48 && strVal.charCodeAt(intTempIdx) > 31)
			|| (strVal.charCodeAt(intTempIdx) < 65 && strVal.charCodeAt(intTempIdx) > 57)
			|| (strVal.charCodeAt(intTempIdx) < 97 && strVal.charCodeAt(intTempIdx) > 90)
			|| (strVal.charCodeAt(i) == 12288)){
			return false;
		}
	}

	if (strVal.length != intTempIdx)
		return false;
	else
		return true;
}

// °ø¹éÀÌ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö Ã¼Å© ( ¾øÀ¸¸é true , ÀÖÀ¸¸é false )
// ¿¹ : var Item = isSpace(document.form.ItemName);
//		if ( Item == false )
//		{
//			alert("°ø¹éÀÌ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
//			document.form.ItemName.focus();
//			return;
//		}
function isSpace(strObj) { 

	var strValue = strObj.value;
	var intCode = 0;

	for (i = 0; i < strValue.length; i++) {
		var intCode = strValue.charCodeAt(i);
		var retChar = strValue.substr(i,1).toUpperCase();
		intCode = parseInt(intCode);
		if (retChar == " " )	return false;
	}
	return true;
}

// 3ÀÚ¸® ¸¶´Ù ÄÞ¸¶ Âï´Â ±â´É ( Money ¸¦ Ç¥½ÃÇÒ °æ¿ì )
// ¿¹ : var Item = fCurrency(document.form.ItemPrice.value);
//=======================================================================
function fCurrency(strVal) {
	var valLen = strVal.length;
	var comNo= 0;
	var fLen = 0;
	var fIdx = 0;
	var rtn = 0;
	
	if (valLen > 3)
	{
		comNo = parseInt(valLen / 3);
		fLen = valLen - (comNo * 3);
		
		rtn = strVal.substring(0, fLen);
		
		for (var i = 0; i < comNo; i++)
		{
			fIdx = fLen + (i * 3);
			rtn += "," + strVal.substring(fIdx, fIdx + 3);
		}
	}
	else
		rtn = strVal;
	
	return rtn;
}

// Ä¿¼­ ¸ð¾çÀÌ ¼ÕÀ¸·Î º¯ÇÏ´Â ÇÔ¼ö ( style="cursor:hand" ¿Í °°Àº ±â´É )
// ¿¹ : CursorHand(document.form.id);
function CursorHand(obj) {
	obj.style.cursor = "hand";
}

// Ã¼Å©¹Ú½º ¸®½ºÆ® ¸ðµÎ ¼±ÅÃ
//¿¹ : Ã¼Å©¹Ú½º ÀÌ¸§Àº list_check·Î ÇÑ´Ù.
var blnCheck = false 
function SelectAll()
{
    var list_size = document.all.list_check.length;
    if (list_size==null) list_size = 0;
	if (list_size != 0){
    	if (!blnCheck) {
        	for(i=0; i<list_size; i++) {
            	document.all.list_check[i].checked=true
        	}
        	blnCheck = true
    	}
    else {
        for(i=0; i<list_size; i++) {
            document.all.list_check[i].checked=false
		}
        blnCheck = false
    }
   }
	else{
    	if (!blnCheck) {
            document.all.list_check.checked=true
        	blnCheck = true
    	}
		else {
            document.all.list_check.checked=false
        	blnCheck = false
    	}
	}
}

// ÀÌ¹ÌÁö ·Ñ¿À¹ö Ã³¸®¿ë 
// µðÀÚÀÌ³Ê°¡ µå¸²À§¹ö »ç¿ëÇÒ¶§ ·Ñ¿À¹ö ±¸ÇöÇÒ·Á°í ¸¹ÀÌ »ç¿ë
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_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_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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function category_view()
{
			targetURL = "catalogue/catalogue.html";
			PopWindow('test',targetURL,0,0,1014,480);	
}
//-->
