// 백그라운드 이미지 로딩
try {document.exeCommand('BackgroundImageCashe', false, true);} catch (e) {}

// png 파일 투명 처리 
function setPng24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src='';
    return '';
}

// 이미지 오버 
function imageOver(imgs) {
	imgs.src = imgs.src.replace("off.gif", "on.gif");
}
function imageOut(imgs) {
	imgs.src = imgs.src.replace("on.gif", "off.gif");
}

// quick 스크롤
function initMoving(target, position, topLimit, btmLimit) {

	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	//obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}

//플래시 로딩
jQuery(document).ready(function() {
	var obj = document.getElementById('onFlash');
	if(obj) {
		
		obj.style.display = "block";
	}
});

jQuery(document).ready(function() {
	var weatherObj = document.getElementById('onFlash_01');
	if(weatherObj) {
		weatherObj.style.display = "block";
	}
});

//flash resize
window.onload = function() {
	var obj_sub_navi = document.getElementById('header');
	var w = (document.body.scrollWidth || document.documentElement.scrollWidth);

	if(w <= 1000) {
		obj_sub_navi.style.width = 1000 + "px";
	} else {
		obj_sub_navi.style.width = 100 + "%";
	}
}

window.onresize = function() {
	var obj_sub_navi = document.getElementById('header');
	var w = (document.body.scrollWidth || document.documentElement.scrollWidth);

	if(w <= 1000) {
		obj_sub_navi.style.width = 1000 + "px";
	} else {
		obj_sub_navi.style.width = 100 + "%";
	}
}

// 플래시 네비 높이 활성화
function resizeNavi(no) {
	var useObj = null;
	if(navigator.appName == "Microsoft Internet Explorer") {
		useObj = document.getElementById('subNaviEx');
		useObj.style.height = no + "px";
	} else {
		useObj = document.getElementById('subNavi');
		useObj.style.height = no + "px";
	}
}
