// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		if (thismenu.imgEl) {
			thismenu.onclick = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;
		thismenu.onfocus = tabMenuClick;

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		if (currentmenu) {
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace("tab on", "tab");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}
/* 19, 23, 29번째 줄의 onclick을 onmouseover로 고치면 마우스를 올렸을 때 이미지가 변경하도록 바꿀 수 있다. */

// Toggle
function toggleLayers(showIds, hideIds) {
	 for(var i in hideIds) {
	  document.getElementById(hideIds[i]).style.display = 'none';
	 }

	 for(var i in showIds) {
	  document.getElementById(showIds[i]).style.display = 'block';
	 }
}

	function img_change(img_name){

//		$("#showcase_img").fadeOut();
//		$("#showcase_img").fadeIn();
		showcase_img.src = '/images/showcase/' + img_name + '.jpg';

	}


	// 새창 띄우는 함수
	function openWindow(url,name,width,height,scroll)
	{
		var x = (window.screen.width - width) / 2;
		var y = (window.screen.height - height) / 2;

		if (!scroll)
		{
			scroll = "no";
		}

		window.open(url,name,'width=' + width + ',height=' + height + ',left=' + x + ',top=' + y + ',scrollbars=' + scroll);

	}

	// 새창 띄우는 함수
	function openModal(url,name,width,height)
	{
		var x = (window.screen.width - width) / 2;
		var y = (window.screen.height - height) / 2;

		window.showModalDialog(url,name,'dialogwidth=' + width + 'px; dialogheight=' + height + 'px;');

	}
