function bodyReSize(chkSize){
	var Browser = {
		Version: function() {
			var version = 999; // we assume a sane browser
			if (navigator.appVersion.indexOf("MSIE") != -1)      // bah, IE again, lets downgrade version number
			version = parseFloat(navigator.appVersion.split("MSIE")[1]);
			return version;
			}
		}
		if(Browser.Version() > 6){
				try{
					jQuery(window).resize(function(){
							var width = jQuery("body").width();
							if(Number(width) < chkSize){
								jQuery("#wrap").attr("class", "wrap930");
							} else {
								jQuery("#wrap").attr("class", "wrap");
							}
					}).resize();
				} catch (e){
			}
		} else {
			jQuery("#wrap").attr("class", "wrap930");
		}
}

/* 2009.09.23 kjs Left Navi 디렉토리 tab 기능용 */
function oneDepth(id, num, index){
	var i;
	var obj;
	for (i=1;i<=index;i++)
	{
		if (num == i )
		{
			obj = document.getElementById((id+i));
			obj.className = "select";
		}else{
		obj = document.getElementById((id+i));
		obj.className = "";
		}
	}
}

/* 2009.09.23 kjs 이미지 롤오버 */

function tab_notice(id, num, index){
	var i;
	var obj;
	var notice;
	for (i=1;i<=index;i++ )
	{
		obj = document.getElementById((id+i));
		obj.src = obj.src.replace('on.gif', 'off.gif');
		notice = document.getElementById((id+i+"List"));
		notice.style.display = "none";
	}
	obj = document.getElementById((id+num));
	obj.src = obj.src.replace('off.gif', 'on.gif');
	notice = document.getElementById((id+num+"List"));
	notice.style.display = "block";
}

/* 2009-10-15 tootip PMH */
var tooltip=function(){
	var id = 'tt';
	var top = 3;
	var left = 3;
	var maxw = 300;
	var speed = 10;
	var timer = 20;
	var endalpha = 95;
	var alpha = 0;
	var tt,t,c,b,h;
	var ie = document.all ? true : false;
	return{
		show:function(v,w){
			if(tt == null){
				tt = document.createElement('div');
				tt.setAttribute('id',id);
				t = document.createElement('div');
				t.setAttribute('id',id + 'top');
				c = document.createElement('div');
				c.setAttribute('id',id + 'cont');
				b = document.createElement('div');
				b.setAttribute('id',id + 'bot');
				tt.appendChild(t);
				tt.appendChild(c);
				tt.appendChild(b);
				document.body.appendChild(tt);
				tt.style.opacity = 0;
				tt.style.filter = 'alpha(opacity=0)';
				document.onmousemove = this.pos;
			}
			tt.style.display = 'block';
			c.innerHTML = v;
			tt.style.width = w ? w + 'px' : 'auto';
			if(!w && ie){
				t.style.display = 'none';
				b.style.display = 'none';
				tt.style.width = tt.offsetWidth;
				t.style.display = 'block';
				b.style.display = 'block';
			}
			if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
			h = parseInt(tt.offsetHeight) + top;
			clearInterval(tt.timer);
			tt.timer = setInterval(function(){tooltip.fade(1)},timer);
		},
		pos:function(e){
			var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
			var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
			tt.style.top = (u - h) + 'px';
			tt.style.left = (l + left) + 'px';
		},
		fade:function(d){
			var a = alpha;
			if((a != endalpha && d == 1) || (a != 0 && d == -1)){
				var i = speed;
				if(endalpha - a < speed && d == 1){
					i = endalpha - a;
				}else if(alpha < speed && d == -1){
					i = a;
				}
				alpha = a + (i * d);
				tt.style.opacity = alpha * .01;
				tt.style.filter = 'alpha(opacity=' + alpha + ')';
			}else{
				clearInterval(tt.timer);
				if(d == -1){tt.style.display = 'none'}
			}
		},
		hide:function(){
			clearInterval(tt.timer);
			tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
		}
	};
}



/* 2009-11-02 kjs 팝업 레이어 */
/* 팝업 레이어 */
/* layer show/hide */
function layerShow(imgLayer) {
	document.getElementById(imgLayer).style.display = "block";
}
function layerHide(imgLayer) {
	document.getElementById(imgLayer).style.display = "none";
}

/* layer move */
function layerMove(imgLayer) {
	var layerObj = document.getElementById(imgLayer);
	if(document.getElementById("wrap")) {
		with (layerObj.style) {
			position = "absolute";
			left = 408 + "px";
			top = 489 + "px";
		}
	} else {
		with (layerObj.style) {
			position = "absolute";
			left = ((document.body.clientWidth/2)-(layerObj.offsetWidth/2)) + "px";
			top = ((document.body.clientHeight/2)-(layerObj.offsetHeight/2)) + "px";
		}
	}
}

function popupLayer2(imgLayer,dis) {
	if(dis == "show") {
		document.getElementById(imgLayer).style.visibility = "visible";
		layerMove(imgLayer);
		alpha.apply();

	} else if(dis == "hide") {
		document.getElementById(imgLayer).style.visibility = "hidden";
		alpha.clear();
	}
	return false;
}
/* 비활성화 레이어 */
// 알파레이어 온    : alpha.apply('색상','투명도')  [ 색상 및 투명도 미지정시 디폴트는 흰색에 50% 입니다 예) alpha.apply() ]
// 알파레이어 오프  : alpha.clear()
alpha = new Object;
alpha = {
	clear  : function() {
				alpha.create().style.display = "none"
				document.getElementsByTagName('HTML')[0].style.overflow = "";
			},
	apply  : function(co,op) {
				var Alpha = alpha.create()
				var alphacolor = co ? co : "#000"
				var opa = op ? op : "40"
				document.getElementsByTagName('HTML')[0].style.overflow = "";
				with (Alpha.style) {
					//width      = document.getElementById("allwrap").scrollWidth + "px";
					//height     = document.getElementById("allwrap").scrollHeight + "px";
					width      = document.body.scrollWidth + "px";
					height     = document.body.scrollHeight + "px";
					background = alphacolor;
					filter     = "alpha(opacity=" + opa + ")";
					opacity    = opa / 100;
					display    = "block";					
				}			
			},
	create : function() {
				if (!document.getElementById('alpha')) {
					var alphaDiv = document.createElement('div');
					alphaDiv.setAttribute('id', 'alpha');
					with(alphaDiv.style) {
						display  = "none";
						position = "absolute";
						top      = "0";
						left     = "0";
						zIndex   = "90";
					}
					document.body.appendChild(alphaDiv);
					window.onresize = alpha.resize;
				}
				return document.getElementById('alpha')
			},
	resize : function() {
				var Alpha = alpha.create()
				with (Alpha.style) {
					width      = document.body.scrollWidth + "px";
					height     = document.body.scrollHeight + "px";
				}
			}
}
function popupLayer(layerId,dis) {
	if(dis == "show") {
		layerShow(layerId);
		layerMove(layerId);
		alpha.apply();
	} else if(dis == "hide") {
		layerHide(layerId);
		alpha.clear();
	}
	return false;
}