
// Tab (yb)
function initImgEffect(ImgEls,SelImg) {

 MenuImg = document.getElementById(ImgEls).getElementsByTagName("img");
 MenuImgLen = MenuImg.length;

 for (i=0; i<MenuImgLen; i++) {
  MenuImg.item(i).onmouseover = menuOver;
  MenuImg.item(i).onmouseout = menuOut;
  MenuImg.item(i).src=MenuImg.item(i).src.replace("_on.gif", ".gif");
  MenuImg.item(i).src=MenuImg.item(i).src.replace("_on.png", ".png");
  MenuImg.item(i).src=MenuImg.item(i).src.replace("_on.jpg", ".jpg");
  if (i == SelImg) {
   MenuImg.item(i).onmouseover();
   MenuImg.item(i).onmouseover = null;
   MenuImg.item(i).onmouseout = null;
  }
 }
}

function initImgEffectOut(ImgEls,SelImg) {

	MenuImg = document.getElementById(ImgEls).getElementsByTagName("img");
	MenuImgLen = MenuImg.length;

	for (i=0; i<MenuImgLen; i++) {
		MenuImg.item(i).onmouseout = menuOut;
		if (i == SelImg) {
			MenuImg.item(i).onmouseover();
			MenuImg.item(i).onmouseover = null;
			MenuImg.item(i).onmouseout = null;
		}
	}
}

function divImgOn2(start, end, select, id){
	for( i = start ; i <= end ; i++ ){
		img = document.getElementById( id + i );
		img.src = img.src.replace("_on.gif", ".gif");
		img.src = img.src.replace("_on.png", ".png");
		img.src = img.src.replace("_on.jpg", ".jpg");
	}
	img = document.getElementById( id + select );
	img.src = img.src.replace(".gif", "_on.gif");
	img.src = img.src.replace(".png", "_on.png");
	img.src = img.src.replace(".jpg", "_on.jpg");
}

// Quick (yb)
function Floating(FloatingObj,MarginY,Percentage,setTime) {
this.FloatingObj = FloatingObj;
this.MarginY = (MarginY) ? MarginY : 0;
this.Percentage = (Percentage) ? Percentage : 20;
this.setTime = (setTime) ? setTime : 10;
this.FloatingObj.style.position = "absolute";
this.Body = null;
this.setTimeOut = null;
this.Run();
}

Floating.prototype.Run = function () {
if ((document.documentElement.scrollLeft + document.documentElement.scrollTop) > (document.body.scrollLeft + document.body.scrollTop)) {
this.Body = document.documentElement;
} else {
this.Body = document.body;
}

var This = this;
var FloatingObjLeft = (this.FloatingObj.style.left) ? parseInt(this.FloatingObj.style.left,10) : this.FloatingObj.offsetLeft;
var FloatingObjTop = (this.FloatingObj.style.top) ? parseInt(this.FloatingObj.style.top,10) : this.FloatingObj.offsetTop;
var DocTop = this.Body.scrollTop + this.MarginY;

var MoveY = Math.abs(FloatingObjTop - DocTop);
MoveY = Math.ceil(MoveY / this.Percentage);


if (FloatingObjTop < DocTop) {
this.FloatingObj.style.top = FloatingObjTop + MoveY + "px";
} else {
this.FloatingObj.style.top = FloatingObjTop - MoveY + "px";
}

window.clearTimeout(this.setTimeOut);
this.setTimeOut = window.setTimeout(function () { This.Run(); },this.setTime);
}

// Font (yb)
var chFont = new Array('0.85em','1em','1.2em','1.4em','1.6em');
var chFont = new Array('60%', '70%','75%','80%','90%','100%');
var dfFont = 2;

function changeFsize(fs)
{
	//var obj = document.getElementById('content');
	var fsize = dfFont;

	if(fs == 'flarge')
		fsize += 1;
	else
		fsize -= 1;

	if(fsize < 0) {
		alert('더 이상 작아지지 않습니다.');
		fsize = 0;
	}
	if(fsize > 5) {
		alert('더 이상 커지지 않습니다.');
		fsize = 5;
	}

	dfFont = fsize;
	//obj.style.fontSize = chFont[fsize];
	document.body.style.fontSize = chFont[fsize]; // 전체변경
}

