// JavaScript Document
var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

/********************************************************************************************************/
/*ÄíÅ° ¼³Á¤ Äí¸® ÀÌ¸§, °ª, ±â°£(ÀÏÂ÷)·Î ÄíÅ°¸¦ ¼³Á¤ÇÑ´Ù.*/
function setCookie( name, value, expiredays )
{
	 var todayDate = new Date();
	 todayDate.setDate( todayDate.getDate() + expiredays );
	 document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

/*ÄíÅ° ³»¿ëÀ» °¡Áö°í ¿Â´Ù. ¾øÀ» °æ¿ì ""¸¦ ¹ÝÈ¯ÇÑ´Ù.*/
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 "";
}
/********************************************************************************************************/


/********************************************************************************************************/
/* ÅÇ°Ô½ÃÆÇ Çü½ÄÀÇ ½ºÅ©¸³Æ® */
function BlockMenu(total_count, menu_name) {
	for(i=1;i<=total_count;i++){
		thiMenu = eval("document.all." + menu_name+digit2(i) + ".style");
	 	thiMenu.display = "none"
	}
}

/* ÇöÀç ¼±ÅÃµÈ ¸Þ´º ¹øÈ£, ÃÑ ¸Þ´º, ¼ýÀÚ¸¦ Á¦¿ÜÇÑ ¸Þ´ºÀÌ¸§*/
function toggleMenu(current_no, total_count, menu_name) {
	 BlockMenu(total_count, menu_name);
	 thiMenu = eval("document.all." + menu_name+digit2(current_no) + ".style");
	 thiMenu.display = "block"
}
/********************************************************************************************************/


/********************************************************************************************************/
function scroll(x, y){
	document.body.scrollTop=x
	document.body.scrollLeft=y
}


// ºÎµå·´°Ô ¿Ã¶ó°¡´Â Top ¹öÆ°(ÀÚ¹Ù½ºÅ©¸³Æ®).js
function back_top(){
	y = document.body.scrollLeft;
	x = document.body.scrollTop;
	step = 11;  // ¼ýÀÚ°¡ Å¬¼ö·Ï...ºü¸§
	//alert(x)
	while ((x != 0) || (y != 0)) {
		scroll (x, y);
		x -= step;
		y -= step;
		if (x < 0) x = 0;
		if (y < 0) y = 0;
	} 
	scroll (0, 0);
}
/********************************************************************************************************/



/*********************************************************************************************/
// ÇØ´ç·¹ÀÌ¾î°¡ ½ºÅ©·Ñ¿¡ µû¶ó ÀÌµ¿ÇÏ°Ô ÇÑ´Ù.
//div1=new getRef('divMenu',100)
//div2=new getRef('info',10)
//setInterval("div1.moving()", 5);
//setInterval("div2.moving()", 16);
function superObj(){
	this.moving=moveRightEdge;
}

function moveRightEdge()
{
	var divID
	if (isDOM) divID=document.getElementById(this.id1);
	if (isIE4) divID=document.all[this.id1];
	if (isNS4) divID=document.layers[this.id1];
	var isNS = navigator.appName == "Netscape";
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
	if (isNS4)
	{
		yMenuFrom   = divID.top;
		yMenuTo     = windows.pageYOffset + 20;
	}
	else if (isDOM)
	{
		yMenuFrom   = parseInt (divID.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + this.initPos;  //ÃÊ±â ½ÃÀÛ À§Ä¡
	}

	if (yMenuFrom != yMenuTo)
	{
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
		divID.top += yOffset;
		else if (isDOM)
			divID.style.top = parseInt (divID.style.top, 10) + yOffset;
	}
}

function getRef(id1,initPos)
{
	this.id1=id1
	this.initPos=initPos
}
getRef.prototype=new superObj;


function fitImage(img){
	if(img.width>700){
		img.width=700
	}
}
function openFullSize(img){
	nameImg=window.open(img.src,'img','')
}

var preColor
//¸àÆ® »ö º¯È­
function inTx(tName){
	 if (document.all) {
          var frmname=tName
          styleobj=eval("document.all."+frmname+".style")
		  preColor=styleobj.color
          styleobj.color="#CE737C"
    }

}
// ¸¶¿ì½º ¾Æ¿ô
function outTx(tName){
	 if (document.all) {
          var frmname=tName
          styleobj=eval("document.all."+frmname+".style")
          styleobj.color=preColor
    }

}
/*********************************************************************************************/