//-----------------------------------------------------------------------------------
// ÇÃ·¡½Ã Å×µÎ¸®¾øÀÌ º¸ÀÌ´Â ÀÚ¹Ù½ºÅ©¸³Æ®
//-----------------------------------------------------------------------------------

function playflash(file,width,height,bgcolor,quality,name){
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+name+'">');
        document.write('<param name="movie" value="'+file+'" />');
        document.write('<param name="quality" value="'+quality+'" />');
        document.write('<param name="wmode" value="transparent" />');
        document.write('<param name="bgcolor" value="'+bgcolor+'" />');
        document.write('<embed src="'+file+'" quality="'+quality+'" wmode="transparent" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>')
}

function embedFlash(id, url, width, height, bgcolor, quality, altText, flashVars, wmode) {
	if (!flashVars) flashVars = '';
	if (!wmode) wmode = 'window';
	if (!altText) altText = document.getElementById('altText').innerHTML;

	var str = '' +
	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="' + width + '" height="' + height + '" id="' + id + '">' +
		'<param name="movie" value="' + url + '" />' +
		'<param name="wmode" value="' + wmode + '" />' +
		'<param name="FlashVars" value="' + flashVars + '" />' +
		'<param name="quality" value="' + quality + '" />' +
		'<param name="bgcolor" value="' + bgcolor + '" />' +
		'<!--[if !IE]>-->' +
		'<object type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '" name="' + id + '">' +
			'<param name="wmode" value="' + wmode + '" />' +
			'<param name="FlashVars" value="' + flashVars + '" />' +
		'<!--<![endif]-->' +
			'<div class="alt-content alt-' + id + '">' + altText + '</div>' +
		'<!--[if !IE]>-->' +
		'</object>' +
		'<!--<![endif]-->' +
	'</object>';
	document.write(str);
}


//-----------------------------------------------------------------------------------
// ¸ÞÀÎÆäÀÌÁö ·Ñ¿À¹ö ÀÚ¹Ù½ºÅ©¸³Æ®_1
//-----------------------------------------------------------------------------------
bbsclicknum2 = 1;
imgarray2 = new Array();
imgarray_r2 = new Array();
for(i=1; i<4; i++){
    imgarray2[i-1] = new Image();
    imgarray2[i-1].src = "/images/main_data_tab_"+i+"_off.gif";
    imgarray_r2[i-1] = new Image();
    imgarray_r2[i-1].src = "/images/main_data_tab_"+i+"_on.gif";
}

function bbsOver2(num){

	if(bbsclicknum2 != num){
		try{
			var cnt2 = 0;
			var noticea2 = document.getElementById("noticea");
			cnt2++;
			eval("document.getElementById('ndiv_"+num+"').style.display = '';");
			cnt2++;
			eval("document.getElementById('ndiv_"+bbsclicknum2+"').style.display = 'none';");
			cnt2++;
			eval("document.getElementById('fourthbox_tab_img"+(num)+"').src = '"+imgarray_r2[num-1].src+"'");
			cnt2++;
			eval("document.getElementById('fourthbox_tab_img"+(bbsclicknum2)+"').src = '"+imgarray2[bbsclicknum2-1].src+"'");
			cnt2++;
        bbsclicknum2 = num;
		}catch(e){ alert(e.message+":"+cnt2); }
    }
    return;
}


//-----------------------------------------------------------------------------------
// ¸ÞÀÎÆäÀÌÁö ·Ñ¿À¹ö ÀÚ¹Ù½ºÅ©¸³Æ®_2
//-----------------------------------------------------------------------------------

			function topOn(tabid,a) {
        var ID = document.getElementById(tabid,a);

				for (i=1;i<=10;i++) {
					if(i<10){inn="0"+i;} else {inn=""+i;}
					topMenu = document.getElementById("top"+tabid+"m"+i);
					topContent = document.getElementById("top"+tabid+"c"+i);
					if (topMenu) { //°´Ã¼°¡Á¸ÀçÇÏ¸é
						if (topMenu.tagName=="IMG") { topMenu.src = topMenu.src.replace("on0" + i + ".gif", "off0" + i + ".gif");} //ÀÌ¹ÌÁöÀÏ¶§
						if (topMenu.tagName=="A") { topMenu.className=""; } //¾ÞÄ¿ÀÏ¶§
					}
					if (topContent) { topContent.style.display="none"; }
				}

				if(a<10){ann="0"+a;} else {ann=""+a;}
				topMenu = document.getElementById("top"+tabid+"m"+a);
				topContent = document.getElementById("top"+tabid+"c"+a);
				//alert(topMenu.tagName);
				if (topMenu) { //°´Ã¼°¡Á¸ÀçÇÏ¸é
					if (topMenu.tagName=="IMG") { topMenu.src = topMenu.src.replace("off0" + a + ".gif", "on0" + a + ".gif"); } //ÀÌ¹ÌÁöÀÏ¶§
					if (topMenu.tagName=="A") { topMenu.className="on"; } //¾ÞÄ¿ÀÏ¶§
				}
				if (topContent) { topContent.style.display="block"; }
				topMore = document.getElementById("top"+tabid+"more");
				}

//-----------------------------------------------------------------------------------
// ¼­ºêÆäÀÌÁö ¿ÞÂÊ ¸Þ´º ·Ñ¿À¹ö ÀÚ¹Ù½ºÅ©¸³Æ®
//-----------------------------------------------------------------------------------

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_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_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];}
}


// Familysite
function show_con(idName)	{
	var obj = document.getElementById(idName);
	obj.style.top = "-64px";
}

function hide_con(idName)	{
	var obj = document.getElementById(idName);
	obj.style.top = "-9000px";
}


//-----------------------------------------------------------------------------------
// »õÃ¢¶ç¿ì´Â ¼Ò½º
//-----------------------------------------------------------------------------------
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}


//-----------------------------------------------------------------------------------
// È­¸éÈ®´ëÃà¼Ò
//-----------------------------------------------------------------------------------
//È­¸é È®´ë Ãà¼Ò ½ÃÀÛ IE Àü¿ë//

var nowZoom = 100; // ÇöÀçºñÀ² 
var maxZoom = 500; // ÃÖ´ëºñÀ²(500À¸·ÎÇÏ¸é 5¹è Ä¿Áø´Ù) 
var minZoom = 80; // ÃÖ¼ÒºñÀ² 

//È­¸é Å°¿î´Ù. 
function zoomIn() 
{ 
    if (nowZoom < maxZoom) 
    { 
        nowZoom += 10; //25%¾¿ Ä¿Áø´Ù. 
    } 
    else 
    { 
        return; 
    } 
    document.body.style.zoom = nowZoom + "%"; 
} 


//È­¸é ÁÙÀÎ´Ù. 
function zoomOut() 
{ 
    if (nowZoom > minZoom) 
    { 
        nowZoom -= 10; //25%¾¿ ÀÛ¾ÆÁø´Ù. 
    } 
    else 
    { 
        return; 
    } 
    document.body.style.zoom = nowZoom + "%"; 
} 

//È­¸é ¿ø·¡´ë·Î 
function zoomDefault() 
{ 
    nowZoom = 100; 
    document.body.style.zoom = nowZoom + "%"; 
} 



/*****************************************************************/
//ÄíÅ°°ª ÀÐ±â
/*****************************************************************/

function ReadCookie( str )
{
  var key = str + "=";
  var key_len = key.length;
  var cookie_len = document.cookie.length;

  var i = 0;
  while ( i <= cookie_len ){
    var j = i + key_len;
    if ( document.cookie.substring( i, j ) == key ){
		var cookie_end = document.cookie.indexOf( ";", j );
		if ( cookie_end == -1 )
			cookie_end = document.cookie.length;
		return unescape( document.cookie.substring( j, cookie_end ) );
    }
    i = document.cookie.indexOf( " ", i ) + 1;

    if ( i == 0 )  break;
  }
  return "";
}

/*****************************************************************/
//ÄíÅ°°ª ¾²±â
/*****************************************************************/
function setCookie( key, value, term ){
	var expire = new Date();
	expire.setDate( expire.getDate() + term );
	document.cookie = key + "=" + escape( value ) + "; path=/; expires=" + expire.toGMTString() + ";";
}


/*****************************************************************/
/*Init()*/
/*****************************************************************/
function f_FontInit(){

	if ( ReadCookie("zoomVal").length == 0 ){
		setCookie("zoomVal", "100%", 7);
	}else currZoom = ReadCookie("zoomVal")+"%";		//È­¸éÅ©±â
	zoomInOut("");

	f_setFace();

}

/*********************************************************/
//È­¸éÈ®´ë
/*********************************************************/

function zoomInOut(how){
var sValue;

	if(ReadCookie("zoomVal") != null && ReadCookie("zoomVal") != "" && ReadCookie("zoomVal") != "NaN"){
		if( FrameLength == 2  ){
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = ReadCookie("zoomVal")+"%";
		}else{
			document.getElementById("wrap").style.zoom = ReadCookie("zoomVal")+"%";
		}
		currZoom=ReadCookie("zoomVal");
	}else{
		if( FrameLength == 2 ){
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = "100%";
		}else{
			document.getElementById("wrap").style.zoom = "100%";
		}
		currZoom = "100%";
	}

	if ( ((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
		return;
	}

	if (how == "in") {
		if( FrameLength == 2 )
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = parseInt(eval(FrameMainName +"document.getElementById('wrap')").style.zoom)+zoomRate+"%";
		else
			document.getElementById("wrap").style.zoom = parseInt(document.getElementById("wrap").style.zoom)+zoomRate+"%";
	}else if( how == "out" ){
		if( FrameLength == 2 )
			eval(FrameMainName +"document.getElementById('wrap')").style.zoom = parseInt(eval(FrameMainName +"document.getElementById('wrap')").style.zoom)-zoomRate+"%";
		else
			document.getElementById("wrap").style.zoom = parseInt(document.getElementById("wrap").style.zoom)-zoomRate+"%";
	}

	if( FrameLength == 2 ){
			sValue = parseInt(eval(FrameMainName +"document.getElementById('wrap')").style.zoom);
	}else{
			sValue = parseInt(document.getElementById("wrap").style.zoom);
	}
 setCookie("zoomVal", sValue, 1);
}

/*********************************************************/
//Object À¯/¹«
/*********************************************************/
function NetlightObjectType(netlight){
	if(netlight.object){
		return true;
	}else{
		return false;
	}
}


//-----------------------------------------------------------------------------------
// °Ë»ö¹Ú½º
//-----------------------------------------------------------------------------------
function fsearchbox_submit(f)
{
	if (f.stx.value == '')
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		f.stx.select();
		f.stx.focus();
		return;
	}

	f.action = "/gboard/bbs/search.php";
	f.submit();
}

function sFocus(vari) {
	(vari).style.border='1px solid #356daf';
	(vari).style.background='#fff none';
	(vari).style.letterSpacing='normal';
}
function sBlur(vari) {
	(vari).style.border='1px solid #CACACA';
}


//-----------------------------------------------------------------------------------
// top_menu
//-----------------------------------------------------------------------------------
function initNavigation(seq) {
	nav = document.getElementById("topmenu");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;

	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace("_on.gif", ".gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						nav.current = null;
					}
				}
			}, 500);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);

		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_on.gif", ".gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", "_on.gif");
				if (this.submenu)
					this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}

//¸ÞÀÎÇÁ¸°Æ®
function contentPrint(){
	window.open("/n_print2.html", "printPage", "scrollbars=yes width=730 height=620");
}



//-----------------------------------------------------------------------------------
// Å¬¸¯°æ°íÃ¢
//-----------------------------------------------------------------------------------

function drawAlert () {
alert ("ÁØºñÁßÀÔ´Ï´Ù.");
}
