function cur(obj){
	if(obj.parentNode.parentNode.getElementsByTagName('ul').length>0){
	for(var i=0; i<obj.parentNode.parentNode.getElementsByTagName('ul').length; i++){
		obj.parentNode.parentNode.getElementsByTagName('ul')[i].style.display='none';
	}
	}
	if(obj.parentNode.getElementsByTagName('ul').length>0){
		obj.parentNode.getElementsByTagName('ul')[0].style.display='block';
	}
}

/************* ÇÁ¸°Æ® ÇÏ±â ±â´É  ******************/
function viewPop(url)
{
	var screen_width    = screen.availWidth;
    var screen_height   = screen.availHeight;
    //var pop_width           = 1000;
    var pop_width           = 1020;
    var pop_height      = 630;
    var top                 = (screen_height - pop_height) / 2; 
    var left                    = (screen_width - pop_width) / 2;   
    var param = "scrollbars=yes, resizable=yes, width=" + pop_width + ", height=" + pop_height + ", top=" + top + ", left=" + left;            
    var win = window.open(url, "_viewpopup_", param); 
}

function viewPop2(url)
{
	var screen_width    = screen.availWidth;
    var screen_height   = screen.availHeight;
    var pop_width           = 600;
    var pop_height      = 500;
    var top                 = (screen_height - pop_height) / 2; 
    var left                    = (screen_width - pop_width) / 2;   
    var param = "scrollbars=yes, width=" + pop_width + ", height=" + pop_height + ", top=" + top + ", left=" + left;            
    var win = window.open(url, "_viewpopup2_", param); 
}

function totalSearchPop()
{
    var form = document.total_search_form;
    if(! form.query.value)
    {
        //alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
        //return;
    }
	var screen_width    = screen.availWidth;
    var screen_height   = screen.availHeight;
    var pop_width           = 1020;
    var pop_height      = 630;
    var top                 = (screen_height - pop_height) / 2; 
    var left                    = (screen_width - pop_width) / 2;   
    var param = "scrollbars=yes, resizable=yes, width=" + pop_width + ", height=" + pop_height + ", top=" + top + ", left=" + left;    
    
    var win = window.open("about:blank", "_viewpopup_", param); 
    form.submit();
	win.focus();
}

function toggleCartoon(num)
{
    var target = "cartoon" + num;
	for(var i=1; i<=4; i++)	
    {
	    var a = "cartoon" + i;
		if (document.getElementById(a) != null)
		{
		    document.getElementById(a).style.display='none';				
		}
    }
    document.getElementById(target).style.display='block';
    document.getElementById(target).style.paddingLeft='30px';
}

/**
* bool String::trim(void)
* ÇØ´ç ½ºÆ®¸µÀÇ ¾ÕµÚ °ø¹éÀ» Á¦°Å ÇÑ´Ù
*/
String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

function removeAnchor(content) 
{
    var tmp = content;

    tmp = tmp.replace(/<[aA](.*?)>/gi,""); //<a href¿¡ Æ÷ÇÔµÊ ¸ðµç ³»¿ë Á¦°Å 
    tmp = tmp.replace(/<(\/)?[aA]>/gi,""); //</a>ÅÂ±× Á¦°Å 

    tmp = tmp.replace(/<form(.*?)>/gi,"");    // form ÅÂ±× Á¦°Å
    tmp = tmp.replace(/<(\/)?form>/gi,"");

    tmp = tmp.replace(/<FORM(.*?)>/gi,"");  // form ÅÂ±× Á¦°Å
    tmp = tmp.replace(/<(\/)?FORM>/gi,"");

	tmp = tmp.replace(/<html(.*?)>/gi,"");  // form ÅÂ±× Á¦°Å
    tmp = tmp.replace(/<(\/)?html>/gi,"");

	tmp = tmp.replace(/<body(.*?)>/gi,"");  // form ÅÂ±× Á¦°Å
    tmp = tmp.replace(/<(\/)?body>/gi,"");
    
    return tmp;
}


function printContentHTML()
{    
    var screen_width    = screen.availWidth;    
    var screen_height   = screen.availHeight;    
    var pop_width           = 756;   
    var pop_height      = 600;    
    var top                 = (screen_height - pop_height) / 2;     
    var left                    = (screen_width - pop_width) / 2;
    
    var param = "scrollbars=yes, width=" + pop_width + ", height=" + pop_height + ", top=" + top + ", left=" + left;                
    var win = window.open("/home/common/print_main.jsp", "_printhtml_", param);        
	win.focus();
}

function printSearchHTML()
{    
    var screen_width    = screen.availWidth;    
    var screen_height   = screen.availHeight;    
    var pop_width           = 756;   
    var pop_height      = 600;    
    var top                 = (screen_height - pop_height) / 2;     
    var left                    = (screen_width - pop_width) / 2;    
    var param = "scrollbars=yes, width=" + pop_width + ", height=" + pop_height + ", top=" + top + ", left=" + left;                
    var win = window.open("/home/common/print_search.jsp", "_printhtml_", param); 
	win.focus();
}

function printSearchHTML2()
{    
    var screen_width    = screen.availWidth;    
    var screen_height   = screen.availHeight;    
    var pop_width           = 756;   
    var pop_height      = 600;    
    var top                 = (screen_height - pop_height) / 2;     
    var left                    = (screen_width - pop_width) / 2;    
    var param = "scrollbars=yes, width=" + pop_width + ", height=" + pop_height + ", top=" + top + ", left=" + left;                
    var win = window.open("/home/common/print_search2.jsp", "_printhtml_", param); 
	win.focus();
}
/* ÆË¾÷ */

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}

function checkExt(obj)
{
	var ext = "";
	if(obj.value.trim().length > 0)
    {
        var extArray = new Array("hwp", "xls", "ppt", "doc", "jpg", "gif", "png", "txt");
        ext =  obj.value.substr(document.insFrm.file_name.value.lastIndexOf(".") + 1);	    
        for(k = 0; k < extArray.length; k++)
        {
            if(ext.toLowerCase().indexOf(extArray[k]) > -1)
            {				
                return true;				
				break;
            }
        }
		alert("ÇØ´ç È®ÀåÀÚ(" + ext + ")ÀÇ ÆÄÀÏÀº µî·ÏÇÒ ¼ö ¾ø½À´Ï´Ù");
		return false;
    }
	return true;
}