var menuText2=new Array(" ±³È¸ ¾È³» "," ¿¹¹è ¾È³» ","±³À°°ú ÈÆ·Ã","¸ñÀå(°¡Á¤±³È¸)","»ç¿ªÀ§¿øÈ¸"," Ä¿¹Â´ÏÆ¼ ");
var menuText1=new Array(" <a class='special' href=http://www.sjkepc.org/www/about/church_template.php?page=history>±³È¸ ¾È³»</a> ","<a class='special' href=http://www.sjkepc.org/www/services/services_template.php?page=service_info>¿¹¹è ¾È³»</a> "," <a class='special' href=http://www.sjkepc.org/www/education/education_template.php?page=discipline>±³À°°ú ÈÆ·Ã</a> ","<a class='special' href=http://www.sjkepc.org/www/cell/cell_template.php?page=info>¸ñÀå(°¡Á¤±³È¸)</a>","<a class='special' href=http://www.sjkepc.org/www/mission/mission_template.php?page=mission>»ç¿ªÀ§¿øÈ¸</a> "," <a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board.php?bo_table=share'>Ä¿¹Â´ÏÆ¼</a> ");
var sub0=new Array("<a class='special' href=http://www.sjkepc.org/www/about/church_template.php?page=history>±³È¸ ¹ßÀÚÃë</a>","<a class='special' href=http://www.sjkepc.org/www/about/church_template.php?page=admin>±³È¸ ±â°ü</a>","<a class='special' href=http://www.sjkepc.org/www/about/church_template.php?page=schedule>±³È¸ Çà»ç ÀÏÁ¤</a>");

var sub1=new Array("<a class='special' href=http://www.sjkepc.org/www/services/services_template.php?page=service_sun>ÁÖÀÏ ¿¹¹è</a>","<a class='special' href=http://www.sjkepc.org/www/services/services_template.php?page=service_week>ÁÖÁß¿¹¹è ¹× ¸ðÀÓ</a>","<a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board.php?bo_table=home'>°¡Á· ¿¹¹è</a>");

var sub2=new Array("<a class='special' href='http://www.sjkepc.org/www/education/education_template_bible.php?page=bible_study_all'>¼º°æÇÐ±³</a>","<a class='special' href=http://www.sjkepc.org/www/education/education_template.php?page=korean>ÇÑ±¹ÇÐ±³</a>","<a class='special' href=http://www.sjkepc.org/www/education/education_template.php?page=baby>¿µÀ¯¾ÆºÎ</a>", "<a class='special' href=http://www.sjkepc.org/www/education/education_template.php?page=kinder>À¯Ä¡ºÎ&K-1</a>", "<a class='special' href=http://www.sjkepc.org/www/education/education_template.php?page=grade4-6>ÃÊµîºÎ</a>", "<a class='special' href=http://www.sjkepc.org/www/education/education_template.php?page=youth>Áß°íµîºÎ</a>");
var sub3=new Array("<a class='special' href=http://www.sjkepc.org/www/cell/cell_template.php?page=info>¸ñÀåÀÌ¶õ?</a>","<a class='special' href=http://www.sjkepc.org/www/cell/cell_template.php?page=intro>¸ñÀå¼Ò°³</a>","<a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board.php?bo_table=communityNews'>¸ñÀå¼Ò½Ä</a>");
var sub4=new Array("<a class='special' href=http://www.sjkepc.org/www/mission/mission_template.php?page=mission>¼±±³ À§¿øÈ¸</a>","<a class='special' href=http://www.sjkepc.org/www/mission/mission_template.php?page=gospel>Àüµµ À§¿øÈ¸</a>","<a class='special' href=http://www.sjkepc.org/www/mission/mission_template.php?page=regional>Áö¿ªºÀ»ç À§¿øÈ¸</a>","<a class='special' href=http://www.sjkepc.org/www/mission/mission_template.php?page=maint>°ü¸®À§¿øÈ¸</a>");
var sub5=new Array("<a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board.php?bo_table=share'>³ª´®¹æ</a>","<a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board.php?bo_table=flower'>²É²ÈÀÌ¹æ</a>","<a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board.php?bo_table=photo'>»çÁø.¾Ù¹ü</a>","<a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board.php?bo_table=library'>µµ¼­½Ç</a>","<a class='special' href='http://www.sjkepc.org/www/gnuboard4/bbs/board_counsel.php?bo_table=counseling'>»ó´ã½Ç</a>","<a class='special' href='http://www.sjkepc.org/www/community/community_template.php?page=choir'>Âù¾ç´ë</a>");

var menuW=90;
var menuH=25;
var containerW=menuW*menuText1.length;
var subContainerW=containerW+10;
var xLim=new Array(menuText1.length);
var xGap=menuW;
var menu2W=menuW*2;
var menu2H=menuH*2;
var x=0;
var z=0;
var yPos=-menuH;
var subCw=containerW-2;

if(document.getElementById)
{
	stdBrowser = true;
}
else
{
	stdBrowser = false;
}

function otherBack(idx){
	if(stdBrowser)
	{
        for(i=0;i<menuText1.length;i++){
				menuObj = document.getElementById("mnu" + i).style;
                menuObj.top = yPos + "px";
                for(j=0;j<eval("sub" + i + ".length");j++){
					subMenuObj = document.getElementById("subM" + i).style;
					subMenuObj.top=menuH + "px";
                }
        }
		
		moveDIV(idx, yPos, 0);
        moveSUB(idx, menuH, 0);
	}
}

function moveDIV(idx, pixelCheck, caller){
	menuObj = document.getElementById("mnu" + idx).style;
	var newTop = 0;
	if(caller == 0)
	{
		newTop = parseInt(menuObj.top) + 1;
		menuObj.top = newTop + "px";
		timer1=setTimeout("moveDIV(" + idx + ", " + newTop + ")",0.5);
	}
	else
	{	
		if(pixelCheck > yPos && parseInt(menuObj.top) < 0)
		{
				pixelCheck = parseInt(menuObj.top);
				if(pixelCheck != yPos)
				{
					newTop = parseInt(menuObj.top) + 1;
					menuObj.top = newTop + "px";
				}
				timer1=setTimeout("moveDIV(" + idx + ", " + pixelCheck + ")",0.5);
		}
		else if(pixelCheck == yPos)
		{
					menuObj.top=yPos + "px";
		}
		else
		{
				menuObj.top=0 + "px";
		}
	}
}

function moveSUB(idx, pixelCheck, caller){
	subMenuObj = document.getElementById("subM" + idx).style;
	var newTop = 0;
	if(caller == 0)
	{
		newTop = parseInt(subMenuObj.top) - 1;
		subMenuObj.top = newTop + "px";
		timer2=setTimeout("moveSUB(" + idx + ", " + newTop + ")",0.5);
	}
	else
	{
		if(pixelCheck < menuH && parseInt(subMenuObj.top) > 0)
		{
				pixelCheck = parseInt(subMenuObj.top);
				if(pixelCheck != menuH)
				{
					newTop = parseInt(subMenuObj.top) - 1;
					subMenuObj.top = newTop + "px";
				}
				timer2=setTimeout("moveSUB(" + idx + ", " + pixelCheck + ")",0.5);
		}
		else if(pixelCheck == menuH)
		{
				subMenuObj.top=menuH + "px";
		}
		else
		{
				subMenuObj.top=0 + "px";
		}
	}
}

document.write("<div id='container' align='right' style='position:relative;overflow:hidden;width:" + containerW + ";height:" + menuH + ";'>");
	for(i=0;i<menuText1.length;i++)
	{
			xPos=xGap*x;
			if(i==0)
			{
				document.write("<div id='mnu"+ i +"' class=mnu style='cursor:default;position:absolute;left:"+ xPos + ";top:"+ yPos +";z-index:"+ z +
				";width:" + menuW+ ";height:"+ menu2H + ";vertical-align:top;'><table width="  + menuW+ " cellspacing=0><tr><td align='center' width=" + menuW + " height=" + menuH + " background='/www/images/top_navi_left.jpg' style='color:white'>"+ 
				menuText1[i] +"</td></tr><tr><td align='center' onmouseover='otherBack("+ i +")' width=" + menuW + " height=" + menuH + " background='/www/images/top_navi_left_sub.jpg'>"+ menuText2[i] +"</td></tr></table></div>");
			}
			else if(i==menuText1.length-1)
			{
				document.write("<div id='mnu"+ i +"' class=mnu style='cursor:default;position:absolute;left:"+ xPos + ";top:"+ yPos +";z-index:"+ z +
				";width:" + menuW+ ";height:"+ menu2H + ";vertical-align:top;'><table width="  + menuW+ " cellspacing=0><tr><td align='center' width=" + menuW + " height=" + menuH + " background='/www/images/top_navi_right.jpg' style='color:white'>"+ 
				menuText1[i] +"</td></tr><tr><td align='center' onmouseover='otherBack("+ i +")' width=" + menuW + " height=" + menuH + " background='/www/images/top_navi_right_sub.jpg'>"+ menuText2[i] +"</td></tr></table></div>");
			}
			else
			{	
				document.write("<div id='mnu"+ i +"' class=mnu style='cursor:default;position:absolute;left:"+ xPos + ";top:"+ yPos +";z-index:"+ z +
				";width:" + menuW+ ";height:"+ menu2H + ";vertical-align:top;'><table width="  + menuW+ " cellspacing=0><tr><td align='center' width=" + menuW + " height=" + menuH + " background='/www/images/top_navi_middle.jpg' style='color:white'>"+ 
				menuText1[i] +"</td></tr><tr><td align='center' onmouseover='otherBack("+ i +")' width=" + menuW + " height=" + menuH + " background='/www/images/top_navi_middle_sub.jpg'>"+ menuText2[i] +"</td></tr></table></div>");
			}
			
			x++;
			z++;
	}
document.write("</div>");

document.write("<div id='sub_container' align='right' style='position:relative;width:"+ subContainerW + ";height:" + menuH + ";overflow:hidden;'>");
	for(i=0;i<menuText1.length;i++)
	{
			document.write("<div id='subM"+ i +"' style='position:absolute;left:0;top:"+ menuH + ";width:"+ subContainerW + ";height:" + menuH +";'>");
				document.write("<table background='/www/images/top_lower.jpg' width=" + subContainerW + " cellspacing=0 ><tr>");
					subCw = subContainerW / eval("sub"+i+".length");
					for(j=0;j<eval("sub" + i +".length");j++){
						if(j==0)
						{
							document.write("<td height='25' align='center' width='" + subCw + "'  style='color:white'>"+ eval("sub" + i + "[j]") +"</td>");
						}
						else
						{
							document.write("<td height='25' align='center' width='" + subCw + "'  style='border-left:1px solid #777;color:white'>"+ eval("sub" + i + "[j]") +"</td>");
						}
					}
				document.write("</tr></table>");
			document.write("</div>");
	}
document.write("</div>");
