/* 상단 컨텐츠 모음 */
function contView(n) {
	for(var j = 1; j < 2; j++) {
		var obj_ly = document.getElementById('cont'+j);

		if ( n == j ) {
				obj_ly.style.display = "block";
				document.getElementById('contClose').style.display = "block";
				document.getElementById('contOpen').style.display = "none";
				document.getElementById('bgControl').className = "top_png2"; //class 제어
		} else {
			obj_ly.style.display = "none";
			document.getElementById('contClose').style.display = "none";
			document.getElementById('contOpen').style.display = "block";
			document.getElementById('bgControl').className = "top_png"; //class 제어
		}
	}
}

/* 국문 메인 자동 닫힘 */
function autoClose(){
	document.getElementById('cont1').style.display = "none";
	document.getElementById('contClose').style.display = "none";
	document.getElementById('contOpen').style.display = "block";
	document.getElementById('bgControl').className = "top_png"; //class 제어
	clearInterval(autoTime);
}

function autoStart(){
	autoTime = setInterval('autoClose()', 2200);	
}

/* Expo2012 - Overview */
function open_text(){
	document.getElementById('openText').style.display = "block";
	document.getElementById('showbtn2').style.display = "block";
	document.getElementById('showbtn1').style.display = "none";
}
function close_text(){
	document.getElementById('openText').style.display = "none";
	document.getElementById('showbtn2').style.display = "none";
	document.getElementById('showbtn1').style.display = "block";
}

/* 이미지 확대보기 */
function pop_big_v(filename, filetitle){
	window.open("/include/html/pop_img_big.asp?imgname="+filename+"&poptitle="+filetitle, 'pop_big', 'width=398, height=630, scrollbars=no, status=no');
}
function pop_big_h(filename, filetitle){
	window.open("/include/html/pop_img_big.asp?imgname="+filename+"&poptitle="+filetitle, 'pop_big', 'width=598, height=430, scrollbars=no, status=no');
}

function kr_pop_big_v(filename, filetitle, imgheight){
	var en_filetitle = escape(filetitle); 
	window.open("/include/html/pop_img_big_kr.asp?imgname="+filename+"&poptitle="+en_filetitle, 'pop_big', 'width=398, height='+imgheight+', scrollbars=no, status=no');
}
function kr_pop_big_h(filename, filetitle, imgwidth){
	var en_filetitle = escape(filetitle); 
	window.open("/include/html/pop_img_big_kr.asp?imgname="+filename+"&poptitle="+en_filetitle, 'pop_big', 'width='+imgwidth+', height=430, scrollbars=no, status=no');
}
function pop_qna(popurlpath, imgwidth, imgheight, scrollbar){
	window.open(popurlpath, 'pop_qna', 'width='+imgwidth+', height='+imgheight+', scrollbars='+scrollbar+', status=no');
}
/*		var kr_pop_big_h = window.name;
	kr_pop_big_h.document.charset="euc-kr";
	kr_pop_big_h.document.poptitle="　";
*/
/*
kr_pop_big_v.document.charset="euc-kr" //이부분추가(특수문자나 한글 깨짐방지)
kr_pop_big_v.document.poptitle="　"; //이부분추가  ("　" 공백특수문자입니다. 복사해서 쓰세요)
kr_pop_big_h.document.charset="euc-kr" //이부분추가(특수문자나 한글 깨짐방지)
kr_pop_big_h.document.poptitle="　"; //이부분추가  ("　" 공백특수문자입니다. 복사해서 쓰세요)
*/

/* 기후환경관 Zone */
function zoneView(n) {
	for(var j = 1; j < 5; j++) {
		var obj_ly = document.getElementById('zone'+j);

		if ( n == j ) {
				obj_ly.style.display = "block";
		} else {
			obj_ly.style.display = "none";
		}
	}
}

/* 엑스포2012 참가국 현황 */
function nationView(n) {
	for(var j = 1; j < 8; j++) {
		var obj_ly = document.getElementById('nation'+j);
		var obj_over = document.getElementById('curNation'+j);

		if ( n == j ) {
				obj_ly.style.display = "block";
				obj_over.style.display = "block";
		} else {
			obj_ly.style.display = "none";
			obj_over.style.display = "none";
		}
	}
}

/* 남해안길라잡이 교통 플래시지도 */
function pageNum(number){
	var movie = window.document.navigation;
	movie.SetVariable("pageNum_k", number);
}

/* 국문 문의메일 Popup */
function pop_contact_kor(){
	window.open("/kor/popup/pop_contact.asp", 'pop_contact', 'width=350, height=420, scrollbars=no, status=no');	
}

/* 영문 Contact Popup */
function pop_contact_eng(){
	window.open("/eng/popup/pop_contact.asp", 'pop_contact', 'width=350, height=420, scrollbars=no, status=no');	
}

/* 일문 Contact Popup */
function pop_contact_jap(){
	window.open("/jap/popup/pop_contact.asp", 'pop_contact', 'width=350, height=420, scrollbars=no, status=no');	
}

/* 중문 Contact Popup */
function pop_contact_cha(){
	window.open("/cha/popup/pop_contact.asp", 'pop_contact', 'width=350, height=420, scrollbars=no, status=no');	
}

/* 프랑스어 Contact Popup */
function pop_contact_fra(){
	window.open("/fra/popup/pop_contact.asp", 'pop_contact', 'width=350, height=420, scrollbars=no, status=no');	
}

/* PNG24 */
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='about:blank;';
	return '';
}

//퀵메뉴 스크롤
var stmnLEFT = 0; // 왼쪽 여백 
var stmnGAP1 = 0; // 위쪽 여백
var stmnGAP2 = 340; // 스크롤시 브라우저 위쪽과 떨어지는 거리 
var stmnBASE = 0; // 스크롤 시작위치 
var stmnActivateSpeed = 10; 
var stmnScrollSpeed = 10; 
var stmnTimer;

function RefreshStaticMenu() { 
	var stmnStartPoint, stmnEndPoint; 
	stmnStartPoint = parseInt(document.getElementById('sidebar').style.top, 10); 
	stmnEndPoint = Math.max(document.documentElement.scrollTop, document.body.scrollTop) - stmnGAP2; 
	if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1; 
	if (stmnStartPoint != stmnEndPoint) { 
		stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 ); 
		document.getElementById('sidebar').style.top = parseInt(document.getElementById('sidebar').style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ) + 'px'; 
		stmnRefreshTimer = stmnScrollSpeed; 
	}
stmnTimer = setTimeout("RefreshStaticMenu();", stmnActivateSpeed); 
} 
function InitializeStaticMenu() {
	document.getElementById('sidebar').style.right = stmnLEFT + 'px'; 
	document.getElementById('sidebar').style.top = document.body.scrollTop + stmnBASE + 'px'; 
	RefreshStaticMenu();
}
