// 이미지 마우스 롤오버 롤아웃
function imageOver(imgs) {
	imgs.src = imgs.src.replace("off.gif", "on.gif");
}
function imageOut(imgs) {
	imgs.src = imgs.src.replace("on.gif", "off.gif");
}

// 팝업
function openPop(str, name, w, h, chk) {
	window.open (str, name, "width="+w+",height="+h+",scrollbars="+chk+"");
}

// 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 '';
}

// cafe 폰트 칼라 변경 
function colorchk(name) {
	document.getElementById("changeColor").style.background = name.style.background;
	document.changeSkin.color.value = name.style.background;
}

// 동영상 불러오기 
function Media(url,vol,w,h) {
	document.write("<OBJECT id='myMedia' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' width="+ w + " height="+ h + ">"+
	"<param name='filename' value="+url+" >"+
	"<param name='ShowControls' value='0'>"+
	"<param name='AutoRewind' value=1>"+
	"<param name='PlayCount' value='-1'>"+
	"<param name='Balance' value=0>"+
	"<param name='AutoStart' value='True'>"+
	"<param name='DisplaySize' value='4'>"+
	"<param name='EnablePositionControls' value='1'>"+
	"<param name='EnableContextMenu' value='1'>"+
	"<param name='Volume' value="+vol+">"+
	"</object>"
	)
}

// 플래시 로딩
function flashMovie(fid,src,wid,hei,fvs,wmd) {
  this.fPrint = '';
  this.Id = document.getElementById(fid);
  this.Src = src;
  if(wid == 0){
    this.Width = '100%';
  }
  else{
    this.Width = wid;
  }
  if(hei == 0){
    this.Height = '100%';
  }
  else{
    this.Height = hei;
  }
  this.FlashVars = (fvs != undefined)? fvs :'';
  this.Wmod = (wmd != undefined)? wmd :'';
  if(isObject(Id)) {
    fPrint = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
    fPrint += ' width="'+Width+'"';
    fPrint += ' height="'+Height+'">';
    fPrint += '<param name="allowScriptAccess" value="always">';
    fPrint += '<param name="movie" value="'+Src+'">';
    fPrint += '<param name="menu" value="false" />';
    fPrint += '<param name="quality" value="high">';
    fPrint += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : '';
    fPrint += (Wmod != null) ? '<param name="wmode" value="'+Wmod+'">' : '';
    fPrint += '<embed';
    fPrint += fPrint + ' src="'+Src+'"';
    fPrint += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : '';
    fPrint += (Wmod != null) ? ' wmode="'+Wmod+'"' : '';
    fPrint += ' quality="high"';
    fPrint += ' allowScriptAccess="always"';
    fPrint += ' pluginspage="http://www.macromedia.com/go/getflashplayer"';
    fPrint += ' type="application/x-shockwave-flash"';
    fPrint += ' width="'+Width+'"';
    fPrint += ' height="'+Height+'"';
    fPrint += '></embed>';
    fPrint += '</object>';
    Id.innerHTML = fPrint;
  }
}

// select
function showSelect01()
{
	var select  = document.getElementById("globalSite");
	
	if(select.style.display == "none")
	{
		select.style.display = "block";
	}
	else
	{
		select.style.display = "none";
	}
}

function showSelect02()
{
	var select  = document.getElementById("familySite");
	
	if(select.style.display == "none")
	{
		select.style.display = "block";
	}
	else
	{
		select.style.display = "none";
	}
}

// history tab
function showPathMap(idx)
{
	var imageOnSrc = new Array
	(
  	"../../images/company/history_2008_on.gif"
  	,"../../images/company/history_2007_on.gif"
	,"../../images/company/history_2006_on.gif"
	,"../../images/company/history_2005_on.gif"
	,"../../images/company/history_2004_on.gif"
	,"../../images/company/history_2003_on.gif"
	,"../../images/company/history_2002_on.gif"
	,"../../images/company/history_2001_on.gif"
	,"../../images/company/history_2000_on.gif"
  );
  
  var imageOffSrc = new Array
	(
  	"../../images/company/history_2008_off.gif"
  	,"../../images/company/history_2007_off.gif"
	,"../../images/company/history_2006_off.gif"
	,"../../images/company/history_2005_off.gif"
	,"../../images/company/history_2004_off.gif"
	,"../../images/company/history_2003_off.gif"
	,"../../images/company/history_2002_off.gif"
	,"../../images/company/history_2001_off.gif"
	,"../../images/company/history_2000_off.gif"
  );

	onObj=new Array();
	
  for(var i=0;i<imageOnSrc.length;i++){
   onObj[i]=new Image();
   onObj[i].src=imageOnSrc[i];
  }
  
  offObj=new Array();
  
  for(var i=0;i<imageOffSrc.length;i++){
   offObj[i]=new Image();
   offObj[i].src=imageOffSrc[i];
  }

	for(var i=0; i<imageOnSrc.length; i++)
	{
		if(i == idx)
		{
			document.getElementById("tab0"+idx).style.display = "block";					
			oldImg = eval("document.images.i"+idx);
			oldImg.src = onObj[i].src;
		} 
		else
		{
			document.getElementById("tab0"+i).style.display = "none";	
			oldImg = eval("document.images.i"+i);
			oldImg.src = offObj[i].src;
		}		
	}	
}