var NUM = "0123456789";
  var SALPHA = "abcdefghijklmnopqrstuvwxyz";
  var ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"+SALPHA;
  var ERRORMSG = ""; 

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 confirmSave(checkbox)
{
  var isRemember;
  
  // 로그인 정보 저장한다고 선택할 경우
  if(checkbox.checked)
  {
    isRemember = confirm("이 PC에 로그인 정보를 저장하시겠습니까? \n\nPC방등의 공공장소에서는 개인정보가 유출될 수 있으니 주의해주십시오.");
    
    if(!isRemember)
      checkbox.checked = false;
  }
} 
 
// 쿠키값 가져오기
function getCookie(key)
{
  var cook = document.cookie + ";";
  var idx =  cook.indexOf(key, 0);
  var val = "";
 
  if(idx != -1)
  {
    cook = cook.substring(idx, cook.length);
    begin = cook.indexOf("=", 0) + 1;
    end = cook.indexOf(";", begin);
    val = unescape( cook.substring(begin, end) );
  }
 
  return val;
}
 
// 쿠키값 설정
function setCookie(name, value, expiredays)
{
  var today = new Date();
  today.setDate( today.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";"
}
 
// 쿠키에서 로그인 정보 가져오기
function getLogin()
{
 var frm = document.loginform;
 
 // userid 쿠키에서 id 값을 가져온다.
 var id = getCookie("userid");
 // 가져온 쿠키값이 있으면
 if(id != "")
 {
  frm.login_id.value = id;
  frm.saveid.checked = true;
 }
}
 
// 쿠키에 로그인 정보 저장
function saveLogin(id)
{
 if(id != "")
 {
  // userid 쿠키에 id 값을 30일간 저장
  setCookie("userid", id, 30);
 }else{
  // userid 쿠키 삭제
  setCookie("userid", id, -1);
 }
}



//======================================================================================
// Description	:	1000 -> 1,000 으로 변경함
// Writer       :   
// Parameter	:	number	/ 변경할 숫자
// Return Value	:	세자리마다 컴마가 찍힌 문자열
//======================================================================================
function FormatNumber(number)
{ 
        if (number < 0) { number *= -1; var minus = true; }
        else var minus = false;

        var dotPos = (number + "").split(".");
        var dotU = dotPos[0];
        var dotD = dotPos[1];
        var commaFlag = dotU.length % 3;

        if(commaFlag)
        {
                var out = dotU.substring(0, commaFlag);
                if (dotU.length > 3) out += ",";
        }
        else var out = "";

        for (var i=commaFlag; i < dotU.length; i+=3)
        {
                out += dotU.substring(i, i+3); 
                if( i < dotU.length-3) out += ",";
        }

        if(minus) out = "-" + out
			if(dotD) return out + "." + dotD;
			else return out;
}


function intcheck(oil)
{

  for(int01=0;int01<oil.value.length;int01++)
    {
     if ((oil.value.charAt(int01)<'0') || (oil.value.charAt(int01)>'9'))
	   {
	alert("숫자로만 입력하세요.");
	oil.value="";
	oil.focus();
    return;
   	   }
    }
}


function r_check(form) 
{
if (form.tbxviewname.value=="")
{alert("이름을 입력하세요.");
return false;}
return true;
}

function opi_check(form) 
{
if (form.opiname.value=="")
{alert("이름을 입력하세요.");
return false;}

if (form.opinion.value=="")
{alert("내용을 입력하세요.");
return false;}


return true;
}

function del_opi(s)
{
    if( confirm("정말 삭제하시겠습니까?")==false ) 
	{    }
	else{
       document.opidel_form.opi_seq.value=s;
       document.opidel_form.submit();
    }		
}

function ctrl_c() {
    var range, obj;

    if ( !document.all ) {
        alert("파이어폭스는 지원하지 않으니 복사해 주시길바랍니다.");
        return;
    }

    obj = document.getElementById('track_url');
    obj.select();

    range = obj.createTextRange();
    range.execCommand("Copy")

    alert("트랙백 주소가 복사되었습니다.");
    return;
}

function toggleLayer(id) {
	try {
	var obj = document.getElementById(id);
	obj.style.display = (obj.style.display == "none") ? "block" : "none";
	} catch (e) {
		
	}
	return true;
}


function del_view(s)
{
    if( confirm("정말 삭제하시겠습니까?")==false ) 
	{    }
	else{
 
       document.opidel_form.action="board_delete.asp";
       document.opidel_form.idx.value=s;
       document.opidel_form.submit();
    }		
}

function del_view2(s,url)
{
    if( confirm("정말 삭제하시겠습니까?")==false ) 
	{    }
	else{
 
       document.opidel_form.action=url;
       document.opidel_form.idx.value=s;
       document.opidel_form.submit();
    }		
}

function OpenView(strUrl) 
{ 
	var intWidth = 600; 
	var intHeight = 750; 

	var intTop = (window.screen.availHeight - intHeight) / 2; 
	var intLeft = (window.screen.availWidth - intWidth) / 2; 

	if(intLeft <0) intLeft = 0; 
	if(intTop <0) intTop = 0; 

	var result = window.open( 
		strUrl 
		, "ImageViewer" 
		, "top=" + intTop + ",left=" + intLeft + ",width=" + intWidth + ",height=" + intHeight + ",fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes" 
	) 

	result.focus(); 
} 


function intcheck(oil)
{

  for(int01=0;int01<oil.value.length;int01++)
    {
     if ((oil.value.charAt(int01)<'0') || (oil.value.charAt(int01)>'9'))
	   {
	alert("숫자로만 입력하세요.");
	oil.value="";
	oil.focus();
    return;
   	   }
    }
}


function contents_cp()
    {
        if (window.event)
        {
            window.event.returnValue = true;
            window.setTimeout('attach_kinref()', 25);
        }
    }

function attach_kinref()
    {
        if (window.clipboardData) // IE
        {
            // get data from clipboard
            var txt = window.clipboardData.getData('Text');

            // attach the source at the end of text
            txt = txt + '\r\n(출처 : \''+title_js_var+'\' - BCIC 인트라넷)\r\n';

            // set data to clibboard
            var result = window.clipboardData.setData('Text', txt);
        }
    }


function go_workdiary(id,tid)
{
location.href="workdiary.asp?work_id="+id+"&work_team="+tid;
}

function del_ubmopi(s)
{
    if( confirm("정말 삭제하시겠습니까?")==false ) 
	{    }
	else{
       document.opidel_form.opi_seq.value=s;
       document.opidel_form.submit();
    }		
}

function goUrl(url,opt)
{
if (url=="")
   {
  
   }
else
	{
      if (opt==0)
       {
	    location.href=url;
       }
      else
   	   {
        window.open (url,"win_t","")
       }
	}
}


function scaleFont(val) 
{ 
var content, lineHeight; 
content = document.getElementById("content");
if (val > 0) 
  { 
   if (fontSize <= 18) 
      {
	  fontSize = fontSize + val; 
	  lineHeight = fontSize+Math.round(1.1*fontSize);
	  content.style.fontSize = fontSize + "px"; 
	  }
   }
   else
   { 
    if (fontSize > 12)
	  {
	  fontSize = fontSize + val;
	  lineHeight = fontSize+Math.round(1.1*fontSize);
	  content.style.fontSize = fontSize + "px";
	  }
   }
//var mydate = new Date;
//mydate.setDate(mydate.getDate()+1000);
//setCookie("news_font_size", fontSize, mydate);
}
var fontSize = parseInt(getFontCookie());

function getFontCookie()
{ 
var cookie = getCookie("news_font_size");
if ( cookie == null ) return 16; 
if ( cookie.length ) return cookie; 
else return 16; 
} 


function GoPage(sURL)
{
	var sURLString, sGETString = "";
	var aGet, sTempString = "";
	var aGetTemp = new Array();
	var frm = document.gopage

	if (sURL.indexOf("?") > 0 ) {
		sURLString = sURL.substr(0,sURL.indexOf("?"));
		sTempString = sURL.substr(sURL.indexOf("?")+1);

		aGet = sTempString.split("&")
		for ( i = 0; i < aGet.length; i++ ) {
			var temp = aGet[i].split("=")
			aGetTemp[i] = new Array( temp[0], temp[1] );
		}
	} else {
		sURLString = sURL
	}
	for (var i=0;i<frm.elements.length;i++) {
		checkgetstring :
			for(var ii=0;ii < aGetTemp.length;ii++){
				if (document.gopage.elements[i].name == aGetTemp[ii][0] ){
					document.gopage.elements[i].value = aGetTemp[ii][1]
					aGetTemp.splice(ii,1)
					//delete aGetTemp[ii]
					break checkgetstring;
				}
			}
		if( i > 0 ) {
			sGETString = sGETString+"&"+document.gopage.elements[i].name+"="+document.gopage.elements[i].value;
		} else {
			sGETString = sGETString+document.gopage.elements[i].name+"="+document.gopage.elements[i].value;
		}
	}
	for( var i=0; i<aGetTemp.length; i++) {
		if (aGetTemp[i]){
			if (sGETString.length > 1) {
				sGETString = sGETString+"&"+aGetTemp[i][0]+"="+aGetTemp[i][1];
			} else {
				sGETString = sGETString+aGetTemp[i][0]+"="+aGetTemp[i][1];
			}
		}
	}
	//alert("URL:"+sURLString);
	//alert("Temp:"+sTempString);
	//alert("GET:"+sGETString);
	location.href= sURLString + "?" + sGETString

}

function fillaccount(f1, f2) {

  if (f1.value != '') {
      f2.value = f1.value;  
  }

}



// 원도우 창 오픈 (해상도에 따라 가운데로 열기)

function winOpenCenter (doc, wname, width, height) {

  var screenWidth  = window.screen.availWidth;
  var screenHeight = window.screen.availHeight;

  var intLeft = (screenWidth - width) / 2;
  var intTop  = (screenHeight - height) / 2

  window.open(doc, wname, 'scrollbars=no,resizable=no,top='+intTop+',left='+intLeft+',width='+width+',height='+height);

}


/*--------------------------------------------------------------------------*
  * boolean IsEmpty(str)
  * 문자열이 공백을 포함하여 빈문자열이면 True, 아니면 False
  *--------------------------------------------------------------------------*/
  function IsEmpty(str) {

	for (var i=0;i<str.length;i++) {
		if (str.substring(i,i+1) != " ") return false;  
	}   
	return true; 
  }


 /*--------------------------------------------------------------------------*
  * boolean IsSpcialString(str, spc)
  * 해당 문자가 포함되어 있는지 체크
  *--------------------------------------------------------------------------*/
  function IsSpcialString(str, chkstr) { 
	var flag = str.indexOf(chkstr);

	if (flag > -1) return true;              
	else  return false; 
  }



// 해당 문자가 있는지 체크

function chk_string(str, word) {
  var chk = str.indexOf(word);
  if (chk > -1) return true;              
  else  return false; 
}



// 자료가 영문,숫자로만 이루어 졌는지 체크

function IsAlphaNumeric(checkStr) {
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789";
  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 IsAlphaEmail(checkStr) {
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-0123456789";
  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 IsAlpha(checkStr) {
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
  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 IsAlphaHangul(checkStr) {
  
  for (i=0; i < checkStr.length; i++) {
	
	ch = checkStr.charAt(i);    
	if ( (ch >= '0' && ch <= '9') || !((ch >= 'a' && ch <='z') || (ch == '_') || (ch < 255) || (ch > 0) || (ch >= '가' && ch <= '힣')) ) {
	    return false;
		break;     
    }
  }
  
  return true;
}



// 자료가 숫자인지 체크

function checkDigit(tocheck) {
  var isnum = true;
  if ((tocheck ==null) || (tocheck == "")) {
       isnum = false;
       return isnum; 
  }

  for (var j= 0 ; j< tocheck.length; j++ ) {
       if ( ( tocheck.substring(j,j+1) != "0" ) &&
            ( tocheck.substring(j,j+1) != "1" ) &&
            ( tocheck.substring(j,j+1) != "2" ) &&
            ( tocheck.substring(j,j+1) != "3" ) &&
            ( tocheck.substring(j,j+1) != "4" ) &&
            ( tocheck.substring(j,j+1) != "5" ) &&
            ( tocheck.substring(j,j+1) != "6" ) &&
            ( tocheck.substring(j,j+1) != "7" ) &&
            ( tocheck.substring(j,j+1) != "8" ) &&
            ( tocheck.substring(j,j+1) != "9" ) ) {
            isnum = false; }  
   }
   return isnum; 
}


// 자료가 숫자인지 체크

function checkDigit_s(tocheck) {
  var isnum = true;
  if ((tocheck ==null) || (tocheck == "")) {
       isnum = false;
       return isnum; 
  }

  for (var j= 0 ; j< tocheck.length; j++ ) {
       if ( ( tocheck.substring(j,j+1) != "0" ) &&
            ( tocheck.substring(j,j+1) != "1" ) &&
            ( tocheck.substring(j,j+1) != "2" ) &&
            ( tocheck.substring(j,j+1) != "3" ) &&
            ( tocheck.substring(j,j+1) != "4" ) &&
            ( tocheck.substring(j,j+1) != "5" ) &&
            ( tocheck.substring(j,j+1) != "6" ) &&
            ( tocheck.substring(j,j+1) != "7" ) &&
            ( tocheck.substring(j,j+1) != "8" ) &&
			( tocheck.substring(j,j+1) != "9" ) &&
			( tocheck.substring(j,j+1) != "-" ) &&
            ( tocheck.substring(j,j+1) != "/" ) ) {
            isnum = false; }  
   }
   return isnum; 
}




// 자료가 숫자, 소수점 - 인지 체크

function checkDigit_point(tocheck) {
  var isnum = true;
  if ((tocheck ==null) || (tocheck == "")) {
       isnum = false;
       return isnum; 
  }

  for (var j= 0 ; j< tocheck.length; j++ ) {
       if ( ( tocheck.substring(j,j+1) != "0" ) &&
            ( tocheck.substring(j,j+1) != "1" ) &&
            ( tocheck.substring(j,j+1) != "2" ) &&
            ( tocheck.substring(j,j+1) != "3" ) &&
            ( tocheck.substring(j,j+1) != "4" ) &&
            ( tocheck.substring(j,j+1) != "5" ) &&
            ( tocheck.substring(j,j+1) != "6" ) &&
            ( tocheck.substring(j,j+1) != "7" ) &&
            ( tocheck.substring(j,j+1) != "8" ) &&
            ( tocheck.substring(j,j+1) != "9" ) &&
            ( tocheck.substring(j,j+1) != "-" ) &&
            ( tocheck.substring(j,j+1) != "." ) ) {
            isnum = false; }  
   }
   return isnum; 
}



 /*--------------------------------------------------------------------------*
  * int CheckRID (sRIDFirst, sRIDLast)
  * 주민등록번호가 유효한 형식이면 0, 앞자리가 잘못됐으면 -1, 뒷자리가 -2
  *--------------------------------------------------------------------------*/
  function CheckRID (sRIDFirst, sRIDLast) {

	  var i;
	  var chk = 0;
	  var nYear = sRIDFirst.substring(0,2);
	  var nMondth = sRIDFirst.substring(2,4);
	  var nDay = sRIDFirst.substring(4,6);
	  var nSex = sRIDLast.charAt(0);
	  
	  if (!IsNumber(sRIDFirst, NUM)) {
		  ERRORMSG = "주민등록번호 앞자리에 잘못된 문자가 있습니다.";
		  return -1;
	  }
	  
	  if ( sRIDFirst.length!=6 ||  nMondth<1 || nMondth>12 || nDay<1 || nDay>31) {
		  ERRORMSG = "주민등록번호 앞자리가 유효한 형식이 아닙니다.";
		  return -1;
	  }
	  
	  if (!IsNumber(sRIDLast, NUM)) {
		  ERRORMSG = "주민등록번호 뒷자리에 잘못된 문자가 있습니다.";
		  return -2;
	  }
	
      if ( sRIDLast.length!=7 || (nSex!=1 && nSex!=2 && nSex!=3 && nSex!=4) ) {
		  ERRORMSG = "주민등록번호 뒷자리가 유효한 형식이 아닙니다.";
		  return -2;
	  }
	
      for (i=0; i<6; i++) {
		  chk += ( (i+2) * parseInt( sRIDFirst.charAt(i) ));
      }
	
      for (i=6; i<12; i++) {
		  chk += ( (i%8+2) * parseInt( sRIDLast.charAt(i-6) ));
      }
	
      chk = 11 - (chk%11);
      chk %= 10;
	
      if (chk != parseInt( sRIDLast.charAt(6))) {
		  ERRORMSG = "유효하지 않은 주민등록번호입니다.";
          return -1;
      }
	  return 0;        	    	
  }


/*--------------------------------------------------------------------------*
  * void CheckBID (bid_first, bid_mid, bid_last)
  * 사업자 등록번호가 유효한 형식이면 True, 아니면 False 리턴
  *--------------------------------------------------------------------------*/
  function CheckBID (bid_first, bid_mid, bid_last) {
	  
	  var sName = "사업자등록번호";

      // 형식 체크
	  if (!IsNumber(bid_first, NUM)) {
		  ERRORMSG = sName + "에 잘못된 문자가 있습니다.";
		  return 1;
	  }
      if (!IsNumber(bid_mid, NUM)) {
		  ERRORMSG = sName + "에 잘못된 문자가 있습니다.";
		  return 2;
      }
      if (!IsNumber(bid_last, NUM)) {
		  ERRORMSG = sName + "에 잘못된 문자가 있습니다.";
		  return 3;
      }
	  
	  // 길이 체크
	  if ( !CheckLenEng(bid_first, sName, 3, 3, 1) ) {
		  return 1;
      }
      if ( !CheckLenEng(bid_mid, sName, 2, 2, 1) ) {
		  return 2;
      }
      if ( !CheckLenEng(bid_last, sName, 5, 5, 1) ) {
		  return 3;
      }

      var ls_epno = bid_first + bid_mid + bid_last;
	  var li_epno = new Array(10);
	  var sum = 0;

      var li_chkvalue = new Array(1,3,7,1,3,7,1,3,5);
                  
      for (i=0; i<10; i++) {
		  li_epno[i] = parseInt(ls_epno.charAt(i));
      }

      for (i=0; i<9; i++) {
		  sum += li_epno[i] * li_chkvalue[i];
      }
        
      sum = sum + parseInt(((li_epno[8] * 5) / 10));      
      li_y = sum % 10;

      if (li_y == 0) {
		  epno_chk = 0;
      } else {
		  epno_chk = 10 - li_y;    
      }
        
      if (epno_chk == li_epno[9]) {
		  return 0;
	  } else {
		  ERRORMSG = "유효하지 않은 사업자등록번호입니다.";          
		  return 1;
      }       
  } 


/*--------------------------------------------------------------------------*
  * boolean IsNumber(str)
  * 문자열이 숫자로만 이루어져 있으면 True, 아니면 False
  *--------------------------------------------------------------------------*/
  function IsNumber(str) {
    return IsOnlySpcialString(str, NUM);
  }

 /*--------------------------------------------------------------------------*
  * boolean IsOnlySpcialString(str, spc)
  * str 문자열이 spc 문자열로만 이루어져 있으면 True, 아니면 False
  *--------------------------------------------------------------------------*/
  function IsOnlySpcialString(str, spc) {
	var i;

	for(i=0; i<str.length; i++) {
		if (spc.indexOf(str.substring(i, i+1)) < 0) {
			return false;
      	}
	}
	return true;
  }


 /*--------------------------------------------------------------------------*
  * void openPageCenterS(url, wname, width, height)
  * 새창으로 가운데로 url 열기, 스크롤 허용
  * 호환 : Firefox(x)
  *--------------------------------------------------------------------------*/
  function openPageCenterS (url, wname, width, height) {
	  
	  var screenWidth  = screen.availwidth;
	  var screenHeight = screen.availheight;
	  
	  var intLeft = (screenWidth - width) / 2;
	  var intTop  = (screenHeight - height) / 2;

	  window.open(url, wname, 'scrollbars=yes,resizable=no,top='+intTop+',left='+intLeft+',width='+width+',height='+height);
  }


/*--------------------------------------------------------------------------*
  * show_submenu(id)
  * 상단 메인서브메뉴 보이기
  * 호환 : Firefox(x)
*--------------------------------------------------------------------------*/

var wx=0;


function show_submenu(id)
{
//alert(wx);

	if($("top_submenu"+id).style.display=="")
	{
		//$("top_submenu"+id).style.display="none";
		//z=1;
	}
	else
	{
		$("top_submenu"+wx).style.display="none";	
		$("top_submenu"+id).style.display=""; 	
		if (wx==0)
		{
		}
		else
		{hide_bigmenu(wx);}
		show_bigmenu(id);
		wx=id;
	}

}


function hide_submenu(id)
{
	if($("top_submenu"+id).style.display=="")
	{
		$("top_submenu"+id).style.display="none";	
	}
}

function show_bigmenu(id)
{
var thisimgsrc;
var arr_split;
var fname;

thisimgsrc=$("manubigtb"+id).src;
arr_split=thisimgsrc.split(".gif");
fname=arr_split[0];
$("manubigtb"+id).src= fname + "_on" + ".gif";
}

function hide_bigmenu(id)
{
var thisimgsrc;
var arr_split;
var fname;

//alert(id);

thisimgsrc=$("manubigtb"+id).src;
arr_split=thisimgsrc.split("_on.gif");
fname=arr_split[0];
$("manubigtb"+id).src= fname + ".gif";
}


function show_smallmenu(img, tail, ext)
{
var thisimgsrc=img.src;
//alert(thisimgsrc);
var arr_split=thisimgsrc.split("."+ext);
var fname=arr_split[0];
//var fext=arr_split[1];

img.src= fname + tail + ".png";

}


function hide_smallmenu(img, tail, ext)
{
var thisimgsrc=img.src;
var arr_split=thisimgsrc.split(tail+"."+ext);
var fname=arr_split[0];

img.src= fname + "."+ ext;
}


function show_toplinkbtn(id)
{
	if (id=="1")
	{
		$("toplink_1").style.display="";	
		$("toplink_2").style.display="none";	
	}
	else
	{
		$("toplink_2").style.display="";	
		$("toplink_1").style.display="none";	
	}

}

function hide_toplinkbtn(id)
{
	if (id=="1")
	{
		$("toplink_2").style.display="";	
		$("toplink_1").style.display="none";	
	}
	else
	{
		$("toplink_1").style.display="";	
		$("toplink_2").style.display="none";	
	}

}

function go_family(){

	if(document.siteForm.site_Url.value != ""){
		window.document.siteForm.target = "_blank"
		window.document.siteForm.action = document.siteForm.site_Url.value;
	}
	
}


/*** 팝업 레이어 팝업창 띄우기 ***/

function calLayer_show_popup (url, width, height,no,left,top) {
	
   var screenWidth  = screen.availwidth;
   var screenHeight = screen.availheight;
	
	if(left != "" && top != ""){
		var po_lef = parseInt(left);
		var po_top = parseInt(top);
	}
	else{
   var po_lef = (screenWidth - width) / 2;
   var po_top  = (screenHeight - height) / 2
	}


	w = parseInt(width);
	h = parseInt(height);

	var pixelBorder = 3;
	var titleHeight = 25;
	//w += pixelBorder * 2;
	h += pixelBorder * 2 + titleHeight;
	
	calhiddenselect('hidden');

	

	// 내용프레임
	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = parseInt(po_lef);
		top = parseInt(po_top);
		width = w;
		height = h - 7;
		backgroundColor = "#FFFFFF";
		border = "3px solid #DDDDDD";
		zIndex = "100";
	}
	obj.id = "popup_"+no;
	document.body.appendChild(obj);

	
	// 아이프레임
	var ifrm = document.createElement("iframe");
	with (ifrm.style){
		width = w+ "px";
		height = h - pixelBorder * 2 + "px";		
	}
	ifrm.frameBorder = 0;
	ifrm.marginwidth = 0;
	ifrm.marginheight = 0;
	ifrm.scrolling = "no";
	ifrm.src = url;   // 아이프레임 경로
	obj.appendChild(ifrm);


	x = (document.layers) ? loc.pageX : po_lef;
	y = (document.layers) ? loc.pageY : po_top;
	
	if (document.all) {
      document.getElementById("popup_"+no).style.pixelLeft = x;
      document.getElementById("popup_"+no).style.pixelTop = y;
  }
  else {
      document.getElementById("popup_"+no).style.left = x + "px";
      document.getElementById("popup_"+no).style.top =  y + "px";
			document.getElementById("popup_"+no).style.width = w + "px";
			document.getElementById("popup_"+no).style.height = h - 7 + "px";
  }
}


function calhiddenselect(mode) {
	var obj = document.getElementsByTagName('select');
	for (i=0;i<obj.length;i++){
		obj[i].style.visibility = mode;
	}
}

function calcloselayer_layer(no) {

	calhiddenselect('visible');

  var isb = chkBrowser();
	
	if (isb[0] == true) {
     parent.document.getElementById('popup_'+no).removeNode(true);
  }
  else {
     var obj1 = parent.document.getElementById('popup_'+no); 
	 obj1.parentNode.removeChild(obj1);
  }

}


// 브라우저 판정

function chkBrowser () { 

  var ua = navigator.userAgent;
  var isbrowser = new Array(9);


  for (i=0; i < 9; i++)  isbrowser[i] = false;

  if (document.all)                  isbrowser[0] = true;
  if (ua.indexOf("Netscape") != -1)  isbrowser[1] = true;
  if (ua.indexOf("Safari") != -1)    isbrowser[2] = true;
  if (ua.indexOf("Firefox") != -1)   isbrowser[3] = true;
  if (ua.indexOf("Konqueror") != -1) isbrowser[4] = true;
  if (ua.indexOf("Galeon") != -1)    isbrowser[5] = true;
  if (ua.indexOf("K-Meleon") != -1)  isbrowser[6] = true;
  if (ua.indexOf("Sylera") != -1)    isbrowser[7] = true;
  if (window.opera != undefined)     isbrowser[8] = true;
	

  if (isbrowser[0] == true) isbrowser[9] = new RegExp('MSIE ([0-9.]+)','gi').exec(ua)[1];
  else isbrowser[9] = "1";

  return isbrowser;

}


// 파일 다운로드

function file_down(gul_no, file_no) {

	if(gul_no == "" || file_no == "") return;


	location.href = "/bbs/bbs_download.asp?gul_no="+gul_no+"&file_no="+file_no;
	//location = "/bins/bbs/bbs_download.asp?gul_no="+gul_no+"&file_no="+file_no;
}


function hide_mainpop()
{
$("mainpopupZone").style.display="none";	

}


function setpopupclose() {
	setCookie('mainpopup', 'n', 1);
	//calcloselayer_layer(no);
	 hide_mainpop();
}
