if ( typeof(webpath) == "undefined" || webpath == null )
	webpath = "/images";

document.write("<div id='loading_div' style='width:290px;height:95px;border:0;position:absolute;background:url("+webpath+"/loading/bg_loading_bar.gif);z-index:200;display:none;'></div>\n");
document.write("<iframe id='deactall_ifrm' style='left:0;top:0;filter:alpha(opacity=40);position:absolute;z-index:197;display:none;' frameborder='0'></iframe>");

// 화면 잠그기
function lockScreen() {
	repositeLoading(false);
	document.getElementById("loading_div").style.display = "block";
	document.getElementById("deactall_ifrm").style.display = "block";
}

// 화면 잠금 해제
function releaseScreen() {

	document.getElementById("loading_div").style.display = "none";
	document.getElementById("deactall_ifrm").style.display = "none";
}

// 로딩 메세지 위치 조정
function repositeLoading(checkDisplay) {
	var loading_div = document.getElementById("loading_div");

	if (!checkDisplay || loading_div.style.display!="none") {
		var width = parseInt(loading_div.style.width.match(/\d+/));
		var height = parseInt(loading_div.style.height.match(/\d+/));
		loading_div.style.left = document.body.scrollLeft+(document.body.clientWidth-width)/2;
		loading_div.style.top = document.body.scrollTop+(document.body.clientHeight-height)/2;
		
		var deactall_ifrm = document.getElementById("deactall_ifrm");
		deactall_ifrm.style.width = document.body.scrollWidth;
		deactall_ifrm.style.height = document.body.scrollHeight;
	}
}

window.onresize = function() {
	repositeLoading(true);
}

window.onscroll = function() {
	repositeLoading(true);
}
