function mEmbed() {
	var emtype;
	var key = new Array();
	var value = new Array();

	for(i=0;i<mEmbed.arguments.length;i++) {
		data = mEmbed.arguments[i].split('=');
		key[i] = data[0].toLowerCase();
		value[i] = data[1].toLowerCase();
		// src 값 찾기...
		if (key[i] == 'src') {
			srcdata=value[i];
		}
	}

	// Start..
	contents = '';

	//classid, codebase, emtype
	if(/\.(swf)$/.test(srcdata)) { //flash
		classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
		codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c-ab#version=6,0,29,0';
		emtype="flash";
	} else if(/\.(wmv|wma|asf|avi|wav|asx|mpeg|mp3|midi|aiff|au|wpl|wm|wmx|wmd|wmz)$/.test(srcdata)){ //media
		classid = 'CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95';
		codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
		emtype="media";
	}

	if(classid && codebase && emtype) {
		contents += '<object ';
			contents += ' classid="' + classid + '"';
			contents += ' codebase="' + codebase + '"';

		// count 정의
		count = key.length;

		for(i=0;i<count;i++) {
			if(value[i]!='') {
				if(key[i]!='src') {
					contents += ' ' + key[i] + '="' + value[i] + '"';
				}
			}
		}
		contents += '>';

		// param 설정..
		for(i=0;i<count;i++) {
			if(value[i]!='') {
				if(emtype=='flash' && key[i]=='src') {
					contents += '<param name="movie" value="' + value[i] + '" />';
				} else  if(emtype=='media' && key[i]=='src') {
					contents += '<param name="filename" value="' + value[i] + '" />';
				} /*else  if(emtype=='title') {
					contents += '<param name="title" value="' + value[i] + '" />';
				} else*/ {
					contents += '<param name="' + key[i] + '" id="Prm'+i+'" value="' + value[i] + '" />';
				}
			}
		}

	//embed 설정..
	contents += '<embed';
	for(i=0;i<count;i++) {
		if(value[i]!='') {
			contents += ' ' + key[i] + '="' + value[i] + '"';
		}
	}

	if(emtype=='flash') {
		contents +=' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"'
	}

	contents += '>';
	contents += '</embed>';

	// End...
	contents += '</object>';
	}

    document.write(contents);
//return contents;
}
function setCookie( name, value, expiredays ){
	var today = new Date();
	today.setDate( today.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}

//사이트별팝업창 쿠키값 get 스크립트
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 "";
}

/*ActiveX 플래시 -2008. 09. 22 추가함*/

function setFlash(src, w, h, id, vars) {
	var Flash_html = "";
	Flash_html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="'+id+'" width="'+w+'" height="'+h+'">';
	Flash_html += '<param name="movie" value="'+src+'">';
	Flash_html += '<param name="quality" value="high">';
	Flash_html += '<param name="wmode" value="transparent">';
	Flash_html += '<param name="FlashVars" value='+vars+'>';
	Flash_html += '<param name="swliveconnect" value="true">';
	Flash_html += '<embed src="'+src+'" quality=high wmode="transparent" FlashVars='+vars+' width="'+w+'" height="'+h+'" swliveconnect="true" id="'+id+'" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	Flash_html += '</object>';
	document.write(Flash_html);
}
 
/*
	2008-08-18 좌측 플래쉬 메뉴 높이 문제 해결 스크립트.
*/
function onLeftMenuSize(idx){
	document.getElementById('Snb_Fla_Menu').style.height = idx;
	document.getElementById('leftMn').style.height = idx;
}



 //플래시 ActiveX 오브젝트
function  viewFlash(sURL, sName, sFeatures)
{

	 var FLASHCAB = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab";
	 var FLASHCID = "CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000";
	 var FLASHVER = "8,0,0,0";

	 var sFeature;
	 var sWidth  = "100%";
	 var sHeight  = "100%";
	 var pmBoolean = "false";
	 var sTempArray;
	 var sParamTag = "";
	 var sParamTag2 = "";

	sFeature = sFeatures.split(/\s*,\s*/);
	for (var i=0; i< sFeature.length ; i++)
	{
		sTempArray = sFeature[i].split(/\s*=\s*/);
		if (sTempArray[0].toLowerCase() == "width")
		{
			//넓이
			sWidth = sTempArray[1];
		}
		else if (sTempArray[0].toLowerCase() == "height")
		{
			//높이
			sHeight = sTempArray[1];
		}
		else
		{
			//기타 파라메터 처리
			if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true"){
				pmBoolean = "true";
			}else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false"){
				pmBoolean = "false";
			}else{
				pmBoolean = sTempArray[1];
			}
			sParamTag = "<PARAM NAME='"+sTempArray[0]+"' VALUE='" + pmBoolean + "'>\n"+sParamTag;
			sParamTag2 = " " + sTempArray[0] +"='"+pmBoolean +"' "+ sParamTag2;
		}
	}

	document.write("<OBJECT ID='"+sName+"' NAME='"+sName+"' CLASSID='"+FLASHCID+"' CODEBASE='"+FLASHCAB+"#version="+FLASHVER+"' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"'>");
	document.write("<PARAM NAME='movie' VALUE='" + sURL + "'>");
	document.write(sParamTag);
	document.write("<EMBED SRC='"+sURL+"' MENU='false' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' ID='"+sName+"' NAME='"+sName+"'"+ sParamTag2 +" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer' />")
	document.write("</OBJECT>");
}


//미디어 플레이어 오브젝트를 뿌려줍니다.
//미디어 플레이어 버전은 7~10 버전에 호환되는 오브젝트ID를 사용합니다.
function  viewMediaPlayer(sURL, sName, sFeatures)
{

	 var WMPCID = "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6";

	 var sFeature;
	 var sWidth  = "100%";
	 var sHeight  = "100%";
	 var pmBoolean;
	 var sTempArray;
	 var sParamTag = "";

	 sFeature = sFeatures.split(/\s*,\s*/);
	 for (var i=0; i< sFeature.length ; i++)
	 {
		sTempArray = sFeature[i].split(/\s*=\s*/);
		if (sTempArray[0].toLowerCase() == "width")
		{
			//넓이
			sWidth = sTempArray[1];
		}
		else if (sTempArray[0].toLowerCase() == "height")
		{
			//높이
			sHeight = sTempArray[1];
		}
		else
		{
			//기타 파라메터 처리
			if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true"){
				pmBoolean = "1";
			}else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false"){
				pmBoolean = "0";
			}else{
				pmBoolean = sTempArray[1];
			}
			sParamTag = "<PARAM NAME='"+sTempArray[0]+"' VALUE='" + pmBoolean + "'>\n"+sParamTag;
		}
	 }

	 document.write("<OBJECT ID='"+sName+"' NAME='"+sName+"' CLASSID='"+WMPCID+"' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' >");
     document.write("codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' ");
     document.write("standby='Loading Microsoft Windows Media Player components...' ");
	 document.write("<PARAM NAME='URL'VALUE='" + sURL + "'>");
	 document.write(sParamTag);
	 document.write("<EMBED type='application/x-mplayer2'  pluginspage= 'http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' SRC='"+sURL+"' MENU='false' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' ID='"+sName+"' NAME='"+sName+"'"+ " ></EMBED>")
	 document.write("</OBJECT>");
	 //alert(sParamTag);
}


function objMovie(filePath,width,height) {
var content ="";
content ="<OBJECT ID='MediaPlayer' align='middle' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' "+
         "codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' "+
         "standby='Loading Microsoft Windows Media Player components...' "+
         "type='application/x-oleobject' width='"+width+"' height='"+height+"' align='center'>"+
				"<param name='Filename' value='"+filePath+"'>\n"+
				"<param NAME='AudioStream' VALUE='-1'>\n"+
				"<param NAME='AutoSize' VALUE='0'>\n"+
				"<param NAME='AutoStart' VALUE='1'>\n"+
				"<param NAME='AutoPlay' VALUE='1'>\n"+
				"<param NAME='AutoRewind' VALUE='1'>\n"+
				"<param NAME='AnimationAtStart' VALUE='0'>\n"+
				"<param NAME='AllowScan' VALUE='-1'>\n"+
				"<param NAME='AllowChangeDisplaySize' VALUE='-1'>\n"+
				"<param NAME='AutoRewind' VALUE='1'>\n"+
				"<param NAME='Balance' VALUE='0'>\n"+
				"<param NAME='BaseURL' VALUE>\n"+
				"<param NAME='CaptioningID' VALUE>\n"+
				"<param NAME='ClickToPlay' VALUE='-1'>\n"+
				"<param NAME='CursorType' VALUE='0'>\n"+
				"<param NAME='CurrentPosition' VALUE='1'>\n"+
				"<param NAME='CurrentMarker' VALUE='-1'>\n"+
				"<param NAME='DisplayBackColor' VALUE='0'>\n"+
				"<param NAME='DisplayForeColor' VALUE='16777215'>\n"+
				"<param NAME='DisplaySize' VALUE='2'>\n"+	//<!-- 창 크기 -->
				"<param NAME='EnableContextMenu' VALUE='1'>\n"+ //<!--온른쪽클릭 제어-->
				"<param NAME='EnablePositionControls' VALUE='-1'>\n"+
				"<param NAME='EnableFullScreenControls' VALUE='0'>\n"+
				"<param NAME='EnableTracker' VALUE='-1'>\n"+
				"<param NAME='InvokeURLs' VALUE='-1'>\n"+
				"<param NAME='Language' VALUE='-1'>\n"+
				"<param NAME='Mute' VALUE='0'>\n"+
				"<param NAME='PreviewMode' VALUE='0'>\n"+
				"<param NAME='SAMILang' VALUE>\n"+
				"<param NAME='SAMIStyle' VALUE>\n"+
				"<param NAME='SAMIFileName' VALUE>\n"+
				"<param NAME='SelectionStart' VALUE='-1'>\n"+
				"<param NAME='SelectionEnd' VALUE='-1'>\n"+
				"<param NAME='SendOpenStateChangeEvents' VALUE='-1'>\n"+
				"<param NAME='SendWarningEvents' VALUE='-1'>\n"+
				"<param NAME='SendErrorEvents' VALUE='-1'>\n"+
				"<param NAME='SendKeyboardEvents' VALUE='0'>\n"+
				"<param NAME='SendMouseClickEvents' VALUE='1'>\n"+
				"<param NAME='SendMouseMoveEvents' VALUE='0'>\n"+
				"<param NAME='SendPlayStateChangeEvents' VALUE='-1'>\n"+
				"<param NAME='ShowCaptioning' VALUE='0'>\n"+
				"<param NAME='ShowControls' VALUE='0'>\n"+
				"<param NAME='ShowAudioControls' VALUE='0'>\n"+
				"<param NAME='ShowDisplay' VALUE='0'>\n"+  //<!-- 쇼, 클립, 만든이, 저작권 표시  -->
				"<param NAME='ShowGotoBar' VALUE='0'>\n"+  //<!-- 재생, 정지메뉴 밑의 '바' 없애기 -->
				"<param NAME='ShowTracker' VALUE='0'>\n"+
				"<param NAME='TransparentAtStart' VALUE='-1'>\n"+
				"<param NAME='VideoBorderWidth' VALUE='0'>\n"+
				"<param NAME='VideoBorderColor' VALUE='0'>\n"+
				"<param NAME='VideoBorder3D' VALUE='0'>\n"+
				"<param NAME='Volume' VALUE='-200'>\n"+
				"<param NAME='WindowlessVideo' VALUE='1'>\n"+ //<!-- 화면 재생 여부 -->
				"<EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'	src='"+filePath+"'	name='MediaPlayer' width='"+width+"' height='"+height+"' CONTROLLER=false  AutoStart=true>\n"+
				"</EMBED>\n"+
			"</object>";
			document.write(content);

			//				"<param NAME='ShowPositionControls' VALUE='-1'>\n"+
			//				"<param NAME='ShowStatusBar' VALUE='-1'>\n"+
	}

//////////////////////  default

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  with (document) if (getElementById && ((obj=getElementById(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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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_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];}}
}


var old = "";
function viewMenu(e)
{
	if(old != e)
	{
		if(old != "")
		{
			old.style.display = "none";
		}
		e.style.display = "block";
		old = e;
	}
	else
	{
		e.style.display = "none";
		old = "";
	}
}

var old_menu = '';
function menuclick( submenu) {
    if( old_menu != submenu ) {
    if( old_menu !='' ) {
        old_menu.style.display = 'none';
}
    submenu.style.display = 'block';
    old_menu = submenu;
    } else {
        submenu.style.display = 'none';
        old_menu = '';
    }
}

function viewMem(e)
{
	if(old != e)
	{
		if(old != "")
		{
			old.style.display = "none";
		}
		e.style.display = "block";
		old = e;
	}
	else
	{
		e.style.display = "none";
		old = "";
	}
}


function fn_01(url,w,h,tb,st,di,mb,sb,re)
{
 var position ="width="+w+",height="+h+",left=" + ((screen.width-w)/2) + ",top=" + ((screen.height-h)/2) + ",toolbar="+tb+",directories="+di+",status="+st+",menubar="+mb+",scrollbars="+sb+",resizable="+re+"";
 window.open( url, '', position);
}

function getWindow(url,w,h)
{
		var position = "width="+w+",height="+h+",left=100,top=100,toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0";
		window.open( url, '', position);
}

function changeBoardList(frm,val)
{
	frm.msg_ca_no.value = val;
	frm.submit();
}

function checkSearch(frm)
{
	if ( frm.search_opt.value=="" )
	{
			alert('검색 분류를 선택해주세요');
			frm.search_opt.focus();
			return false;
	}
	if ( frm.search_word.value.length < 2 )
	{
			alert('검색어는 2단어 이상 입력해주세요');
			frm.search_word.focus();
			return false;
	}

	if (frm.search_opt.value==1)
	{
		frm.action = '/06_about/page.htm?mnu_uid=1060'
		//frm.mnu_uid.value =487;
		frm.rst.value=frm.search_opt.value;
		frm.wo.value=frm.search_word.value;
		frm.submit();
	}else if(frm.search_opt.value==2){
		/*frm.kwd.value = frm.search_word.value;
		frm.action = '/search/search1.htm';
		frm.submit();*/
	}

}

function login_init() {
	  document.frmLogin.mem_id.focus();
}

// 로그인
function login()
{
	if(document.frmLogin.mem_id.value == "") {
		alert("[아이디]는  필수 입력 사항입니다.");
		document.frmLogin.mem_id.focus();
		return false;
	}

	if(document.frmLogin.mem_pass.value == "") {
		alert("[비밀번호]는 필수 입력 사항입니다");
		document.frmLogin.mem_pass.focus();
		return false;
	}
	return true;
}

// 문자열의 좌측 공백을 제거하는 함수
function LTrim( str )
{
	var i, result="", NonSpace=false;
	for ( i=0; i<str.length; i++ )
	{
		if ( str.charAt(i) != ' ' || NonSpace )
		{
			result = result + str.charAt(i);
			NonSpace = true;
		}
	}
	return result;
}

// 문자열의 우측 공백을 제거하는 함수
function RTrim( str )
{
	var i, result="", NonSpace=false;
	for ( i=str.length-1; i>=0; i-- )
	{
		if ( str.charAt(i) != ' ' || NonSpace )
		{
			result = str.charAt(i) + result;
			NonSpace = true;
		}
	}
	return result;
}

// 문자열의 양쪽 공백을 제거하는 함수
function Trim( str )
{
	var i, result;
	result = LTrim( str );
	result = RTrim( result );
	return result;
}

// 숫자관련 함수
function isNumber(fld)
{
	if (fld.value.length > 0)
	{
		for (i = 0; i < fld.value.length; i++)
		{
			var chr = fld.value.substr(i,1);
			if (chr < '0' || chr > '9')
				return false;
		}
		return true;
	}
	else
	{
		return false;
	}
}

function CopyClibboard(link)
{
	window.clipboardData.setData('Text', link);
	alert('RSS 주소가 복사되었습니다');
}

function findZipcodeOpen()
{
		MM_openBrWindow('/message/zip_search.asp?form=','','width=450,height=350,top=5,left=5')
}

function OWindowst2(url,w,h)
{
	window.open( url, "w_ssh", "toolbar=no,location=no,directories=no,status=no,menubar=no,width="+w+",height="+h+",resizable=no,scrollbars=no" );
}

function OWindowst3(url,w,h)
{
	window.open( url, "w_ssh", "toolbar=no,location=no,directories=no,status=no,menubar=no,width="+w+",height="+h+",resizable=no,scrollbars=yes" );
}

function changeWzWindow(wz_seq)
{
	if (wz_seq!="" )
		location.href="/newsletter/newsletter_sub01.jsp?wz_seq="+wz_seq;
}

function  checkSearchDate(frmObj)
{
		if ( frmObj.dt_start.value=="" || frmObj.dt_end.value=="" ){
			alert("검색일자를 입력해주세요");
			return false;
		}
}

//실명인증 Open 창
function fnPopup(enc_data){
	//한국신용평가정보 안심 실명확인 팝업페이지를 띄웁니다.
	window.open('', 'popup','width=410, height=590');

	document.frmRealName.target = "popup";
	document.frmRealName.action = "https://cert.namecheck.co.kr/certnc_input.asp"
	document.frmRealName.submit();
}

function fn_checkagree()
{
	var agree1 = document.frmAgree.agree1;
	var agree2 = document.frmAgree2.agree2;

	if (!agree1.checked)
	{
		alert("이용약관에 동의 하셔야 합니다.");
		agree1.focus();
		return;
	}
	else if(!agree2.checked)
	{
		alert("개인정보 수집 및 이용에 동의 하셔야 합니다.");
		agree2.focus();
		return;
	}
	else
	{
			fnPopup();
	}
}

function fn_checkagree2()
{
	var agree1 = document.frmAgree.agree1;

	if (!agree1.checked)
	{
		alert("이용약관에 동의 하셔야 합니다.");
		agree1.focus();
		return;
	}
	//else if(!agree2.checked)
	//{
		//alert("개인정보보호정책에 동의 하셔야 합니다.");
		//agree2.focus();
		//return;
	//}
	else
	{
			testAuth();
	}
}

function fnPopup2(){ fnPopup('') }


// 페이지 이동
function Login()
{
	location.href='/login/login.asp';
}

function Join()
{
	location.href='/join/join.asp';
}

function Logout()
{
	location.href='/message/member_logout_action.asp';
}

function Mypage()
{
	location.href='/mypage/mbr_modi.asp';
}

function changeList(ca)
{
	document.chList.msg_ca_no.value = ca;
	document.chList.submit();
}

function changeList_ON(ca)
{
	document.frmsearch.ca_selector.value = ca;
	document.frmsearch.submit();
}
function fn_chYear()
{
	document.frmsearch.submit();
}


var nowZoom = 100; // 현재비율
var maxZoom = 200; // 최대비율(500으로하면 5배 커진다)
var minZoom = 80; // 최소비율

//화면 키운다.
function zoomIn(){
	if (nowZoom < maxZoom){
		nowZoom += 20; //25%씩 커진다.
	}else{
		return;
	}
	document.body.style.zoom = nowZoom + "%";
}


//화면 줄인다.
function zoomOut(){
	if (nowZoom > minZoom){
		nowZoom -= 20; //25%씩 작아진다.
	}else{
		return;
	}
	document.body.style.zoom = nowZoom + "%";
}

//화면 원래대로
function zoomDefault(){
	nowZoom = 100;
	document.body.style.zoom = nowZoom + "%";
}

function printPage()
{
	window.print();
}

//글로벌 네비게이션(2Depth 메뉴그룹)에 대한 마우스 또는 키보드 반응(보임/숨김)설정
function menuD2block(id,id2,k) {
	/*for(num=1; num<=5; num++) {
		alert(num);
		//document.getElementById('D2MG'+num).style.display='none'; //D2MG1~D2MG4 까지 숨긴 다음
		//var top1 = document.getElementById("D1M"+num+"_S");
		//top1.src = "/images/main/m_0"+num+".gif";
	}
	var top1Menu = document.getElementById(id2);
	if (top1Menu){
		top1Menu.src = "/images/main/m_0"+k+"_ov.gif";
		document.getElementById(id).style.display='block'; //해당 ID만 보임
	}*/
}

function menuD2block_2() {
	for(num=1; num<=5; num++) {
		document.getElementById('D2MG'+num).style.display='none'; //D2MG1~D2MG4 까지 숨긴 다음
	}
}

//로컬 네비게이션(4Depth 메뉴그룹)에 대한 마우스 또는 키보드 반응(보임/숨김)설정
function menuD4MGblock(id,id2,num1) {
	var menuD3M = document.getElementById(id2);

	for(num=1; num<=11; num++) {
		if(document.getElementById('D4MG'+num)){
			document.getElementById('D4MG'+num).style.display='none'; //D4MG1~D4MG11 까지 숨긴 다음
		}
	}
	document.getElementById(id).style.display='block'; //해당 ID만 보임
	if (menuD3M) menuD3M.src = '/img/sub/ico_minus'+num1+'.jpg';
//	var ldiv = document.getElementById("left");
}

function menuD4MGblock2(id,id2,num) {
	//alert(id2);
	var menuD4M = document.getElementById(id);
	var menuD3M = document.getElementById(id2);

	if (menuD4M.style.display == 'none'){
		menuD4M.style.display = 'block';
		//$("\""+id+"\"").show("slow");
		menuD3M.src = '/img/sub/ico_minus'+num+'.jpg';
	}else{
		menuD4M.style.display = 'none';
		menuD3M.src = '/img/sub/ico_plus'+num+'.jpg';
	}
}

function menuD4MGblock3(id,id2,num) {

	var menuD3M = document.getElementById(id2);

	document.getElementById(id).style.display='block'; //해당 ID만 보임
	menuD3M.src = '/img/sub/ico_minus'+num+'.jpg';
}


function menuD4block2() {
	for(num=1; num<=11; num++) {
		if(document.getElementById('D4MG'+num)){
			document.getElementById('D4MG'+num).style.display='none'; //D4MG1~D4MG11 까지 숨김
		}
	}
}

function emailPage()
{
		window.open("/message/message_email_sender.php", '페이지메일','left=0,top=0,width=600,height=300,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes');
		return;
}

function errPage()
{
		window.open("/message/menu_errpage_request.php", '페이지오류','left=0,top=0,width=600,height=300,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes');
		return;
}

function showEbookPage(mnu_uid,msg_no,file_no)
{
		var url = "/message/message_ebook_window.php?mnu_uid="+mnu_uid+"&msg_no="+msg_no+"&file_no="+file_no;
		window.open(url, 'ebook','left=0,top=0,width=900,height=676,toolbar=no,menubar=no,status=yes,scrollbars=no,resizable=yes');
		return;
}

function fn_zipsearch(frmName,zip1,zip2,addr1,addr2,mnu_uid)
{
		var i_url = "/message/member_zipcode_search.php?fm="+frmName+"&zip1="+zip1+"&zip2="+zip2+"&addr1="+addr1+"&addr2="+addr2+"&mnu_uid="+mnu_uid;
		window.open(i_url,'openZipWindow','width=450,height=350,top=10,left=10,resizable=no,menubar=no,scrollbars=no');
		return;
}

function fn_zipsearch1(frmName,zip1,zip2,addr1,addr2,mnu_uid)
{
	if ( confirm("주소는 대구 수성구지역만 가능합니다.") )
	{
		var i_url = "/message/member_zipcode_search.php?fm="+frmName+"&zip1="+zip1+"&zip2="+zip2+"&addr1="+addr1+"&addr2="+addr2+"&mnu_uid="+mnu_uid;
		window.open(i_url,'openZipWindow','width=450,height=350,top=10,left=10,resizable=no,menubar=no,scrollbars=no');
		return;
	}
}

function fn_zipsearchedu(frmName,zip1,zip2,addr1,addr2,mnu_uid)
{
		if ( confirm("주소는 대구 수성구지역만 가능합니다.") )
		{
		var i_url = "/message/member_zipcode_search.php?fm="+frmName+"&zip1="+zip1+"&zip2="+zip2+"&addr1="+addr1+"&addr2="+addr2+"&mnu_uid="+mnu_uid;
			window.open(i_url,'openZipWindow','width=450,height=350,top=10,left=10,resizable=no,menubar=no,scrollbars=no');
			return;
		}

}

function fn_download(fileName)
{
	document.frmDocDownload.file_name.value = fileName;
	document.frmDocDownload.submit();
	return;
}

function fn_download1(fileName,pdir,pname)
{
	document.frmDocDownload.file_name.value = fileName;
	document.frmDocDownload.physical_name.value = pname;
	document.frmDocDownload.physical_dir.value = pdir;
	document.frmDocDownload.submit();
	return;
}

function showLayer(no,s)
{
	document.getElementById("event"+no).style.display= "block";
	for(i=1;i<=s;i++){
		if (no!=i) 	document.getElementById("event"+i).style.display = "none";
	}
}
function ShowPopupLayer(no,s)
{
		img_act(no,s);
		showLayer(no,s);
}


function setPosition(valueW, valueH)
{
	if(navigator.appVersion.indexOf("MSIE 7.0") > 0) {
		valueW = valueW;
		valueH = valueH + 21;
	} else {
		valueW = valueW;
		valueH = valueH - 1;
	}

	var height	= screen.height;
	var width	= screen.width;
	var leftpos = width / 2 - valueW / 2;
	var toppos	= height / 2 - valueH / 2;

	self.resizeTo(valueW, valueH);
	self.moveTo(leftpos, toppos);
	self.resizeTo(valueW, valueH);		// 이유없다 resize잘안되어서 한번더 call
}

     function toggleMenu(currMenu) {
     if (document.all) {
     thisMenu = eval("document.all." + currMenu + ".style")
     if (thisMenu.display == "block") {
     thisMenu.display = "none"
     }
     else {
     thisMenu.display = "block"
     }
     return false
     }
     else {
     return true
     }
     }


/////////////////////////////////////// 지도좌표 보기 ///////////////////////////////////////
var objMapWin;
var x;
var y;
var title;

function viewMap(x, y, title)
{
	if(x == 0 || y == 0) {alert("위치정보가 없습니다."); return;}

	this.x		= x;
	this.y		= y;
	this.title	= title;

	if(objMapWin == null || objMapWin.closed)
	{
		objMapWin = window.open("/travel/tvl_viewMap.php", "viewMap", "toolbar=no,locationbar=no");
	} else {
		nextAction();
	}
	objMapWin.focus();
}

function nextAction()
{
	objMapWin.goPosFlag(x, y, title);
}
/////////////////////////////////////// 지도좌표 보기 ///////////////////////////////////////

function viewImage(s) {
  window.open('/message/message_viewImage.php?src='+s, 'love_img', 'width=1,height=1,resize=no');
}

/*
따라댕기는 퀵메뉴...

ie랑 파폭까지는 된다...
*/
var _initTop = 0;
var _layerID = "";

function FlowBanner ( id, initTop )
{
//alert(navigator.appName);
 var ns = (navigator.appName.indexOf("Netscape") != -1);
 if (ns) initTop = initTop+"px";

 var layer = document.getElementById(id);
 layer.style.top = initTop;

 _layerID = id;
 _initTop = initTop;
 _FlowBanner ();
}

function _FlowBanner ()
{
 var layer = document.getElementById(_layerID);
 var ns = (navigator.appName.indexOf("Netscape") != -1);

 if (ns){
  num = (layer.style.top.length);
  var currentTop = layer.style.top.substring(0,(num-2));
  currentTop = parseInt(currentTop);

  _initTop = 88;

 }else{
  var currentTop = parseInt ( layer.style.top );
 }

 if (ns){
  var baseTop = parseInt ( document.documentElement.scrollTop );
 }else{
  var baseTop = parseInt ( document.documentElement.scrollTop );
 }

 var nextTop = baseTop + _initTop;
 var distance = ( nextTop - currentTop ) / 15;

 if ( distance > 10 )
  distance = 10;
 else if ( distance < -10 )
  distance = -10;
 if (ns){
  layer.style.top = currentTop + distance+"px";
 }else{
  layer.style.top = currentTop + distance;
 }


 setTimeout ( "_FlowBanner()", 3 );
}

function init ()
{
	FlowBanner ( "quick", 0 );
}

/* 각 대 메뉴별 현재 시각 표시 */
function init_clock() 
{
	setInterval("ClockSpaninit()", 1000);
}

function ClockSpaninit() 
{
	var tt = new Date();
	
	var tt_dm = tt.getMonth() + 1;
	var tt_dd = tt.getDate();
	var tt_dhour = tt.getHours();
	var tt_dmin = tt.getMinutes();
	var tt_dsec = tt.getSeconds();
	
	if (tt_dm < 10) {tt_dm = "0" + tt_dm;}
	if (tt_dd < 10) {tt_dd = "0" + tt_dd;}
	if (tt_dhour < 10) {tt_dhour = "0" + tt_dhour;}
	if (tt_dmin < 10) {tt_dmin = "0" + tt_dmin;}
	if (tt_dsec < 10) {tt_dsec = "0" + tt_dsec;}
	
	document.getElementById("ClockSpan").innerHTML = tt_dhour + ":" + tt_dmin;
}

//-->문자 byte체크
function nets_check(Obj,lsMax)
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	var utf_count;
	tcount = 0;
	utf_count=0;

	var aquery = Obj.value;

	tmpStr = new String(aquery);
	temp = tmpStr.length;

	for(k=0;k<temp;k++)
	{
		onechar = tmpStr.charAt(k);

		if(escape(onechar).length > 4)
		{
			tcount += 2;
			utf_count+=3;
			//utf_count+=2;
		}
		else if(onechar!='\r')
		{
			if ( onechar.charCodeAt() == 10 ){
				tcount += 2;
				utf_count+=2;
			}
			else
			{
				tcount++;
				utf_count++;
			}
		}
		//if(tcount>lsMax)
		if(utf_count>lsMax)
		{
			tmpStr = tmpStr.substring(0,k);
			break;
		}
	}
	Obj.focus();
	Obj.value = tmpStr;
}
//-->문자 byte체크 호출
var cmtMax = 400;
var cmtAlert='덧글은 영문 400자,한글 200자까지 가능합니다.';
function doTextByteCheck(Obj, VMax, ObjName)
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	var utf_count;
	tcount = 0;
	utf_count=0;

	var crnr_chk=0;
	var aquery = Obj.value;

	tmpStr = new String(aquery);
	temp = tmpStr.length;

	for (k=0;k<temp;k++)
	{
		onechar = tmpStr.charAt(k);
		//document.aa.b.value=escape(onechar);
		if ( k == 0 && onechar.charCodeAt() == 13 ) crnr_chk++;
		if ( k == 1 && onechar.charCodeAt() == 10 ) crnr_chk++;

		if ( crnr_chk == 2 )
		{
			alert("입력오류\r\n["+ObjName+"]의 첫라인을 공백으로 입력할 수 없습니다.");
			//Obj.value = "";
			return;
		}

		if (escape(onechar).length > 4)
		{
			tcount += 2;
			//utf_count +=2;
			utf_count +=3;
		}
		else if (onechar!='\r')
		{
			if ( onechar.charCodeAt() == 10 )
			{
				tcount += 2;
				utf_count +=2;
			}
			else
			{
				tcount++;
				utf_count ++;
			}
		}
	}

	//if(tcount>VMax)
	if(utf_count>VMax)
	{
		reserve = tcount-VMax;
		reserve = utf_count-VMax;
		alert(" "+ObjName+"은(는) "+VMax+"바이트 이상은 입력하실수 없습니다.\r\n 입력한 내용이 "+reserve+"바이트 초과되었습니다.\r\n 초과된 부분은 자동으로 삭제됩니다.");
		nets_check(Obj, VMax);
		return;
	}
}

function TabOver(box,onoff){
	if (onoff == "on"){
		box.style.backgroundImage = 'url(/img/common/Tab_off_2_bar_2.gif)';
		box.style.backgroundPosition='top right';
		box.style.backgroundRepeat='no-repeat';
	}else{
		box.style.backgroundImage = 'url(/img/common/Tab_off_2_bar2.gif)';
		box.style.backgroundPosition='top right';
		box.style.backgroundRepeat='no-repeat';
	}
}

function TabOver2(box,onoff){
	if (onoff == "on"){
		box.style.backgroundImage = 'url(/img/common/Tab_off_2_icon.gif)';
		box.style.backgroundPosition='bottom center';
		box.style.backgroundRepeat='no-repeat';
		box.style.color='#000';
	}else{
		box.style.backgroundImage = '';
	}
}

var g_css = 0;

function zoomFont(nSize) {
	var strCssName = "/css/css";

	if(nSize == 0) {
		g_css = nSize;
	} else {
		g_css += nSize;

		if(g_css > 3) {
			g_css = 3;
		}

		if(g_css < -3) {
			g_css = -3;
		}
	}

	strCssName += g_css + ".css";

	var oStyle = document.getElementById("idStyle");
	oStyle.href = strCssName;
}

//각 메뉴별 평가하기
function fn_menu_vote()
{
	var cat_pool_point = 99;
	var k = 5;

	for (i=0; i<=4; i++)
	{
		if(document.page_poll.cat_pool_point[i].checked == true){
			cat_pool_point = k;
		}
		k--;
	}

	if ( cat_pool_point == 99 )
	{
		alert("만족도는 선택하셔야 합니다.");
		document.page_poll.cat_pool_point[0].focus();
		return;
	}

	mnu_sa_text = document.page_poll.mnu_sa_text.value;
	document.page_poll.action = "/message/menu_poll_action.php?point="+cat_pool_point;
	document.page_poll.submit();
	document.page_poll.mnu_sa_text.value = " 여러분의 소중한 한마디를 부탁드립니다.";
	//pollFrame.location.href="/message/menu_poll_action.php?mnu_uid="+mnu_uid+"&point="+cat_pool_point+"&mnu_sa_text="+mnu_sa_text;
}
//페이지 수정
function popupOpen(url,vscrollbars,vtoolbar,vmenubar,vlocation,vwidth,vheight)
{
	var cntyn = '<?=$ck_cnt?>';
	if (cntyn==1)
		window.open(url,'win_popip','scrollbars='+vscrollbars+',toolbar='+vtoolbar+',menubar='+vmenubar+',location='+vlocation+',width='+vwidth+',height='+vheight+',location=no')
	else
		alert("해당메뉴 프로그램 페이지 입니다");
}


//설문조사 스크립트
function chkPatten(field,patten,name){
	var regNum =/^[0-9]+$/;
	var regPhone =/^[0-9]{2,3}[0-9]{3,4}[0-9]{4}$/;
	var regMail =/^[_a-zA-Z0-9-]+@[._a-zA-Z0-9-]+\.[a-zA-Z]+$/;
	var regDomain =/^[.a-zA-Z0-9-]+.[a-zA-Z]+$/;
	var regAlpha =/^[a-zA-Z]+$/;
	var regHost =/^[a-zA-Z-]+$/;
	var regHangul =/[가-힣]/;
	var regHangulEng =/[가-힣a-zA-Z]/;
	var regHangulOnly =/^[가-힣]*$/;
	var regId = /^[a-zA-Z]{1}[a-zA-Z0-9_-]{3,15}$/;
	var regPass = /^[a-zA-Z0-9_-]{4,15}$/;
	var regDate =/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;

	patten = eval(patten);
	if(!patten.test(field.value)){
		alert(name + "\n\n항목의 형식이 올바르지 않습니다.");
		field.focus();
		return false;
	}
	return true;
}

function openswf(swf) {
	//alert(swf);
	location.href="yesan_down.php?dat_uid="+swf;
}

function on_change(){
	//window.open('/04_open/yesan.htm?view_dep_uid='+document.frm.view_dep_uid.value, '_self');
	document.frm.submit();
}

//실렉트 박스 경로 이동(ex:관내주요기관...)
function goLinkUrl(Obj){
	var url = Obj.options[Obj.selectedIndex].value;
	if (url!="")
		window.open(url);
	else
		alert('사이트를 선택해주세요');
}

//구청장 동정 마우스 오버시
function GoFr(yy,mm,dd)
{
		location.href = "/mayor/03_schedule/page.htm?mnu_uid=1075&yy2="+yy+"&mm2="+mm+"&dd2="+dd;
}

//일반파일 다운받기
function file_down(mnu_uid, File_Name)
{
	parent.top.location.href="/inc/download.php?mnu_uid="+mnu_uid+"&File_Name="+File_Name;
}

function search() { //자동차 검사일조회 스크립트
	var text;
	text = document.car_search.year.value;
	window.open('/etc_program/car/car_userResult.htm?select='+text,'Win1','scrollbar=yes,resizable=no,copyhistory=no,top=200, left=200, width=400,height=150');
}

//레인에디터용 폼체크
function CheckForm(form) {
	/*form.raincontents.parse();
	if (form.raincontents.value == '') {
		alert('내용을 넣어 주십시오');
		return false;
	} else
		return true;*/
	return true;
}

//레인에디터용 환경설정 변수값
var rainGlobalConf = {
	uploadSCRIPT : '/RainEditor/codephp/upload_fileswf.php',
	downloadSCRIPT : '/RainEditor/codephp/download.php',
	uploadURL : '/RainEditor/uploads/',
	callbackURL : '/RainEditor/editor_callback.html',
	editorClassName : 'rainEditorContents',
	maxUploadSize : 1024*1024*100,
	useMediaPlayer : true,
	useImageEditor : true,
	toolbarSet : {},
	middlebarSet : {}
}

// 세로 중앙정렬
function verticalAlign(obj){
    result=(obj.offsetParent.offsetHeight - obj.offsetHeight)/2+"px";
    if(obj.readyState == "complete"){
        obj.style.marginTop="0";
        obj.style.marginTop=result;
    }else{
        return result;
    }
}

//max-width, max-height
function maxSize(obj,w,h){
    if(obj.readyState != "complete") return "auto";
    real_w=obj.offsetWidth;
    real_h=obj.offsetHeight;
    virt_w=obj.offsetWidth;
    virt_h=obj.offsetHeight;
    if(w>0 && virt_w>w){
        virt_w = w;
        virt_h = real_h * (virt_w/real_w);
    }
    if(h>0 && virt_h>h){
        virt_h = h;
        virt_w = real_w * (virt_h/real_h);
    }

    obj.style.width="0";
    obj.style.height="0";
    obj.style.width=virt_w+"px";
    obj.style.height=virt_h+"px";

}

//min-height
function min_height(obj,h){
    if(obj.readyState != "complete") return "auto";
    if(obj.offsetHeight<h){
        obj.style.height="0";
        obj.style.height=h+"px";
    }

}

//라디오,체크버튼 border 없애기
function input_nb(obj){
    obj.style.zIndex="1";
    if(obj.type.toLowerCase()=="radio" || obj.type.toLowerCase()=="image"

|| obj.type.toLowerCase()=="checkbox"){

        obj.style.border="0";

    }
}


/*========================================
js_rolling.js

#간단설명
<div><img /><img /></div>
라고 했을 경우 div안의 img를 위,오른쪽,아래,왼쪽으로 롤링 시킨다.




# 사용법
<script type="text/javascript" charset='utf-8' src="js_rolling.js"></script> 
//JS스크립트 로드

<div id='div1'><img /><img /><img /><img /><img /></div>
//처럼 구성후 div의 너비와 높이는 꼭 정해주기 바랍니다.
<div>
	<div>1<img />etc</div>
	<div>2</div>
	<div>3</div>
	<div>4</div>
</div>
이렇게 구성할 경우 방향은 위,아래로만 가능합니다


var roll = new js_rolling('rolling');
or
var roll = new js_rolling(document.getElementById('rolling'));
// id이름을 적던지, 직접 대상을 지목해서 롤링 클래스로 객체를 만듬

roll.set_direction(4); // 반향을 바꿈. 1: top, 2:right, 3:bottom 4:left 그외의 경우 동작안함
roll.move_gap = 1;	//움직이는 픽셀단위
roll.time_dealy = 10; //움직이는 타임딜레이
roll.time_dealy_pause = 5000;//하나의 대상이 새로 시작할 때 멈추는 시간, 0 이면 적용 안함
roll.start(); //롤링 동작

roll.move_up(); //위로 한번 롤링 (반향이 top,botton일때만 동작)
roll.move_right(); //오른쪽으로 한번 롤링(반향이 right,left일때만 동작)
roll.move_down(); //아래로 한번 롤링(반향이 top,botton일때만 동작)
roll.move_left(); //왼쪽으로 한번 롤링(반향이 right,left일때만 동작)

#주의
반향이 top,bottom일 경우 내부 태그는 block요소(div)로
반향이 left,right일 경우 내부태그는 inline요소(a,span)으로
해수세요.
FF에서 top,bottom의 경우 inline요소일 경우 offsetHeight를 잘못알아옵니다.


#사용제약
사용시 "공대여자는 예쁘다"를 나타내셔야합니다.

만든날 : 2007-06-07
수정일 : 2007-08-11
만든이 : mins01,mins,공대여자
홈페이지 : http://www.mins01.com 
NateOn&MSN : mins01(at)lycos.co.kr
========================================*/
var js_rolling = function(this_s){
	// 시간단위는 ms로 1000이 1초
	if(this_s.nodeType==1){
		this.this_s = this_s;
	}else{
		this.this_s = document.getElementById(this_s);
	}
	this.is_rolling = false;
	this.direction = 1; //1:top, 2:right, 3:bottom, 4:left (시계방향) // 1번과 4번만 됨
	this.children =	null;
	this.move_gap = 1;	//움직이는 픽셀단위
	this.time_dealy = 100; //움직이는 타임딜레이
	this.time_dealy_pause = 1000;//하나의 대상이 새로 시작할 때 멈추는 시간, 0 이면 적용 안함
	this.time_timer=null;
	this.time_timer_pause=null;
	this.mouseover=false;
	this.init();
	this.set_direction(this.direction);
}
js_rolling.prototype.init = function(){
	this.this_s.style.position='relative';
	this.this_s.style.overflow='hidden';
	var children = this.this_s.childNodes;
	for(var i=(children.length-1);0<=i;i--){
		if(children[i].nodeType==1){
			children[i].style.position='relative';
		}else{
			this.this_s.removeChild(children[i]);
		}
	}
	var this_s=this;
	this.this_s.onmouseover=function(){
		this_s.mouseover=true;
		if(!this_s.time_timer_pause){
			this_s.pause();
		}
	}
	this.this_s.onmouseout=function(){
		this_s.mouseover=false;
		if(!this_s.time_timer_pause){
			this_s.resume();
		}
	}	
}
js_rolling.prototype.set_direction = function(direction){
	this.direction=direction;
	if(this.direction==2 ||this.direction==4){
		this.this_s.style.whiteSpace='nowrap';
	}else{
		this.this_s.style.whiteSpace='normal';
	}
	var children = this.this_s.childNodes;
	for(var i=(children.length-1);0<=i;i--){
			if(this.direction==1){
				children[i].style.display='block';
			}else if(this.direction==2){
				children[i].style.textlign='right';
				children[i].style.display='inline';
			}else if(this.direction==3){
				children[i].style.display='block';
			}else if(this.direction==4){
				children[i].style.display='inline';
			}
	}
	this.init_element_children();	
}
js_rolling.prototype.init_element_children = function(){
	var children = this.this_s.childNodes;
	this.children = children;
	for(var i=(children.length-1);0<=i;i--){
			if(this.direction==1){
				children[i].style.top='0px';
			}else if(this.direction==2){
				children[i].style.left='-'+this.this_s.firstChild.offsetWidth+'px';
			}else if(this.direction==3){
				children[i].style.top='-'+this.this_s.firstChild.offsetHeight+'px';
			}else if(this.direction==4){
				children[i].style.left='0px';
			}
	}
}
js_rolling.prototype.act_move_up = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.top=(parseInt(child.style.top)-this.move_gap)+'px';
	}
	if((this.children[0].offsetHeight+parseInt(this.children[0].style.top))<=0){
		this.this_s.appendChild(this.children[0]);
		this.init_element_children();
		this.pause_act();		
	}
}
js_rolling.prototype.move_up = function(){
	if(this.direction!=1&&this.direction!=3){return false;}
	this.this_s.appendChild(this.children[0]);
	this.init_element_children();
	this.pause_act();	
}
js_rolling.prototype.act_move_down = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.top=(parseInt(child.style.top)+this.move_gap)+'px';
	}
	if(parseInt(this.children[0].style.top)>=0){
		this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();	
	}
}
js_rolling.prototype.move_down = function(){
	if(this.direction!=1&&this.direction!=3){return false;}	
	this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.act_move_left = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.left=(parseInt(child.style.left)-this.move_gap)+'px';
	}
	if((this.children[0].offsetWidth+parseInt(this.children[0].style.left))<=0){
		this.this_s.appendChild(this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();		
	}
}
js_rolling.prototype.move_left = function(){
	if(this.direction!=2&&this.direction!=4){return false;}		
	this.this_s.appendChild(this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();		
}
js_rolling.prototype.act_move_right = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.left=(parseInt(child.style.left)+this.move_gap)+'px';
	}
	
	if(parseInt(this.this_s.lastChild.style.left)>=0){
		this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();		
	}
}
js_rolling.prototype.move_right = function(){
	if(this.direction!=2&&this.direction!=4){return false;}			
	this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.start = function(){ //롤링 시작
	var this_s = this;
	this.stop();
	this.is_rolling = true;
	var act = function(){
		if(this_s.is_rolling){
			if(this_s.direction==1){this_s.act_move_up();}
			else if(this_s.direction==2){this_s.act_move_right();}
			else if(this_s.direction==3){this_s.act_move_down();}
			else if(this_s.direction==4){this_s.act_move_left();}
		}
	}
	this.time_timer = setInterval(act,this.time_dealy);
}
js_rolling.prototype.pause_act = function(){ //일시 동작
	if(this.time_dealy_pause){
		var this_s = this;
		var act = function(){this_s.resume();this_s.time_timer_pause=null;}
		if(this.time_timer_pause){clearTimeout(this.time_timer_pause);}
		this.time_timer_pause = setTimeout(act,this.time_dealy_pause);
		this.pause();
	}
}
js_rolling.prototype.pause = function(){ //일시 멈춤
	this.is_rolling = false;
}
js_rolling.prototype.resume = function(){ //일시 멈춤 해제
	if(!this.mouseover){
		this.is_rolling = true;
	}
}
js_rolling.prototype.stop = function(){ //롤링을 끝냄
	this.is_rolling = false;
	if(!this.time_timer){
		clearInterval(this.time_timer);
	}
	this.time_timer = null
}

function testAuth() {
wWidth = 360;
wHight = 120;

wX = (window.screen.width - wWidth) / 2;
wY = (window.screen.height - wHight) / 2;

// Request Page Call
var w = window.open("/G-PIN/Sample-AuthRequest.php", "gPinLoginWin", "directories=no,toolbar=no,left="+wX+",top="+wY+",width="+wWidth+",height="+wHight);
}

function OverFlowChange(id){
	var id = "#"+id;
	if ($(id).css("overflow") == "visible"){
		$(id).css("overflow","hidden");
	}else if($(id).css("overflow") == "hidden"){
		$(id).css("overflow","visible");
	}
}


function CoolFilter(form) {
	form.msg_content.parse();
	var Content = form.msg_content.value;
	if (form.msg_content.value == '') {
		alert('내용이 없습니다');
		return false;
	}else{
		$j.ajax({
			type: "POST",
			url: "/util/CoolFilter.php",
			data: "Content="+Content,
			success: function(msg){
				if(msg) {
					//alert(msg);
					$j("#dialog").dialog({bgiframe: true,height: 140,modal: true}).html(msg).css("display","block");
					return false;
				}else{
					form.submit();
				}
			}
		});
	}
}

function changeZindex(){
	$("#main_visual").css("z-index",2);
	$("#main_board").css("z-index",1);
}

function changeZindex2(){
	$("#main_visual").css("z-index",1);
	$("#main_board").css("z-index",2);
	location.href="#main_board";
}


function searchDetail(not_ancmt_mgt_no) {
	
	//var f = document.form1;
	//f.not_ancmt_mgt_no.value = not_ancmt_mgt_no ;
	//f.target = "_new";
	//f.action = "http://eminwon.dong.daegu.kr/emwp/gov/mogaha/ntis/web/ofr/action/OfrAction.do";	
	//f.method.value   = 'selectOfrNotAncmt'; //Action
	//f.methodnm.value = 'selectOfrNotAncmtRegst';
	//f.submit();
	location.href="/02_open/page.htm?mnu_uid=103&ancmt_mgt_no="+not_ancmt_mgt_no;
	return false;
}

function searchDetail_1(not_ancmt_mgt_no) {
	
	//var f = document.form1;
	//f.not_ancmt_mgt_no.value = not_ancmt_mgt_no ;
	//f.target = "_new";
	//f.action = "http://eminwon.dong.daegu.kr/emwp/gov/mogaha/ntis/web/ofr/action/OfrAction.do";	
	//f.method.value   = 'selectOfrNotAncmt'; //Action
	//f.methodnm.value = 'selectOfrNotAncmtRegst';
	//f.submit();
	location.href="/02_open/page.htm?mnu_uid=108&ancmt_mgt_no="+not_ancmt_mgt_no;
	return false;
}

function searchDetail_2(not_ancmt_mgt_no) {
	
	//var f = document.form1;
	//f.not_ancmt_mgt_no.value = not_ancmt_mgt_no ;
	//f.target = "_new";
	//f.action = "http://eminwon.dong.daegu.kr/emwp/gov/mogaha/ntis/web/ofr/action/OfrAction.do";	
	//f.method.value   = 'selectOfrNotAncmt'; //Action
	//f.methodnm.value = 'selectOfrNotAncmtRegst';
	//f.submit();	
	location.href="/02_open/page.htm?mnu_uid=105&ancmt_mgt_no="+not_ancmt_mgt_no;
	return false;
}


function convertDateStr( str ){
	str = str.replace(/-/gi, "."); 
	str = str.substring(2,10);
	document.write(str);
}


// ===== iframe 관련	===== //
// iframe auto resize
function resizeIFrame(ifrName) 
{ 

		var min_h = 400;

        var oIFrame = document.getElementById(ifrName);

        try {          
          
          var oDoc = oIFrame.contentDocument || oIFrame.contentWindow.document;        

          if (/MSIE/.test(navigator.userAgent)) {
            var frmHeight = oDoc.body.scrollHeight;
          } else {
            var s = oDoc.body.appendChild(document.createElement('DIV'))
            s.style.clear = 'both';

            var frmHeight = s.offsetTop;
            s.parentNode.removeChild(s);
          }
          
          if (frmHeight < min_h) frmHeight = min_h;

          oIFrame.style.height = frmHeight+"px";

		} catch (e) { }
}

var preTabID	= "tab_1";
function showhideTab(showID) {
	var subMn	= document.getElementById(showID);

	if(preTabID != showID) {
		if(preTabID != "") {
			document.getElementById(preTabID).style.display	= "none";
		}
		subMn.style.display	= "block";
		preTabID			= showID;
	}
	return false;
}
