

/* Publish */
function Publish(pubChkValue, pubKeyValue){ 
	var form = document.lstForm;
	form.pubChkValue.value = pubChkValue;
	form.pubKeyValue.value = pubKeyValue;
	form.action = "/etc/publish.jsp";
	form.submit();
}

/* »õ Ã¢ ¶ç¿ì±â */
function New_Window(url, width, height) {  
	var Win_Str = 'width=' + width + ',height=' + height + ', top=100,left=100,toolbar=0,scrollbars=1,resizable=yes'  
	farwindow = window.open('','_new',Win_Str);  
	if (farwindow != null) {  
		if (farwindow.opener == null) {  
			farwindow.opener = self;  
		}  
		farwindow.location.href = url;  
	}
}

function New_Open_Window(url, width, height) {  
	var Win_Str = 'width=' + width + ',height=' + height + ', top=100,left=100,toolbar=0,scrollbars=0,resizable=no'  
	farwindow = window.open('','_new',Win_Str);  
	if (farwindow != null) {  
		if (farwindow.opener == null) {  
			farwindow.opener = self;  
		}  
		farwindow.location.href = url;  
	}
}

function New_WindowOther(url, width, height) {  
	var Win_Str = 'width=' + width + ',height=' + height + ', top=100,left=100,toolbar=1,location=1,scrollbars=1,resizable=yes'  
	farwindow = window.open('','_new',Win_Str);  
	if (farwindow != null) {  
		if (farwindow.opener == null) {  
			farwindow.opener = self;  
		}  
		farwindow.location.href = url;  
	}
}

function New_WindowOrg(url, width, height) {  
	/* var Win_Str = 'width=' + width + ',height=' + height + ', top=100,left=100,toolbar=1,location=1,scrollbars=1,resizable=yes' */
	farwindow = window.open('','_new');  
	if (farwindow != null) {  
		if (farwindow.opener == null) {  
			farwindow.opener = self;  
		}  
		farwindow.location.href = url;  
	}
}

function print_Win(url){
	window.open(url,"bd_print","menubar=0,toolbar=0,location=0,directory=0,scrollbars=1,resizable=0,width=600,height=600,top=50, left=150");
}

function MM_swapImgRestore() { 
  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() { 
  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) { 
  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() { 
  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 IsNumeric(checkStr) {
	var checkOK = "0123456789";
	for (m = 0;  m < checkStr.length;  m++)
	{
		ch = checkStr.charAt(m);
		for (n = 0;  n < checkOK.length;  n++)
			if (ch == checkOK.charAt(n))
				break;
			if (n == checkOK.length)
			{
				return (false);
				break;
			}
	}
	return (true);
}

/* ¿µ.¼ýÀÚ Ã¼Å© */
function IsAlphaNumeric(checkStr)
{
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      return (false);
      break;
    }
  }
  return (true);
}
/* ÀÓ½Ã ÆË¾÷Ã¢ ÄíÅ°Á¦¾î(¿À´ÃÀº ÀÌ Ã¢À» ¿­Áö ¾ÊÀ½ Ã³¸®.) */
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 setChgImgSrc() {

	if(document.all != null && (size = document.all.length) > 1){
        for(i=0; i<size; i++){
            el = document.all.item(i);
            //alert(el.tagName);
            if(el.tagName == "IMG"){
                imgPath = el.src;
                //alert(imgPath);
                var idxEl = imgPath.indexOf("Imgview.jsp?path=");
                if(idxEl >= 0) { 
                    el.src = "http://cadet.sknetworks.com:4510"+imgPath.substring(idxEl+17); 
                }
            }
        }
    }
}
window.onload = setChgImgSrc;
