
function topMenuChange(id) {
	var imgName;
	var re;
	for(i=1 ; i<6 ; i++) {
		imgName = "../img/menu/top/globalM0"+i+".gif";
		re = "deth1_"+i+"";
		document.getElementById(re).src = imgName;
		document.getElementById("deth2_"+i).style.display="none";
	}
	
	if (id > 0)
	{
		imgName = "../img/menu/top/globalM0"+id+"on.gif";
		document.getElementById("deth1_"+id+"").src = imgName;
		if(document.getElementById("deth2_"+id)){
			document.getElementById("deth2_"+id).style.display="block";
		}
	}
}

function topSubMenuImg(objName, y) {
	if (y > -1)
	{
		var object = document.getElementById(objName);
		var aObject = object.getElementsByTagName("img");
		var imgUrl = aObject[y].src;
		pathpoint = imgUrl.lastIndexOf('.');
		var newImgUrl = imgUrl.substring(0,pathpoint)+"on.gif";
		aObject[y].src= newImgUrl;
		aObject[y].setAttribute("SelectYn","Y");
	}
}

function objectGetSelect(obj) {
	if (obj.getAttribute("SelectYn") == null)
	{
		return false;
	}
	return true;
}

/*********************************************************************************************************
 flash
**********************************************************************************************************/

function flash(src,width,height,tr){
    object = '';
    object += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="param" width="'+width+'" height="'+height+'">';
    object += '<param name="movie" value="'+src+'">';
    object += '<param name="wmode" Value="Transparent">';
    object += '<embed src="'+src+'" quality="high" ';   
    object += ' wmode="Transparent" ';
    object += ' bgcolor="#ffffff" menu="false" width="'+width+'" height="'+height+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
    object += '</object>';
    document.write(object);
}
/*********************************************************************************************************
flash
**********************************************************************************************************/

// png24 ie6 ÆÐÄ¡
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 overAction( tab_img ){
	if( tab_img.src.indexOf("_o") == -1 ){
		tab_img.data = tab_img.src;
		tab_img.src = tab_img.src.replace( ".gif" , "_o.gif" );
	}else{
		tab_img.data = tab_img.src;
	}
}

function outAction( tab_img ){
	tab_img.src = tab_img.data;
}

// ·¹ÀÌ¾î show & hide
function show_tab(obj, n, v) //show_layer(id)
{
	for (var i=1; i<=n; i++)
	{
		if (i == v) {
			document.getElementById(obj+i).style.display='';
			}
		else {
			document.getElementById(obj+i).style.display='none';
			}
	}
}

// ÇÏ´Ü ÆÐ¹Ð¸® »çÀÌÆ®
function fnGoFamilySite(value) {
	if (value != "") {
		window.open(value, 'family', '');
	}
}

//faq
function initToggle(tabContainer) {
	triggers = tabContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).onclick = function () {
			if (tabContainer.current == this) {
				this.targetEl.style.display = "none";
				tabContainer.current = null;
			} else {
				if (tabContainer.current) {
					tabContainer.current.targetEl.style.display = "none";
				}
				this.targetEl.style.display = "block";
				tabContainer.current = this;
			}
			return false;
		}
	}
}
