function bt(id,after) { 
eval(id+'.filters.blendTrans.stop();'); 
eval(id+'.filters.blendTrans.Apply();'); 
eval(id+'.src="'+after+'";'); 
eval(id+'.filters.blendTrans.Play();'); 
}

// 롤오버 이미지
function restore_img_src(name, nsdoc)
{
 var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
 if (name == '')
 return;
 if (img && img.altsrc) {
 img.src = img.altsrc;
 img.altsrc = null;
 }
}

function preload_img()
{
 var img_list = preload_img.arguments;
 if (document.preloadlist == null)
 document.preloadlist = new Array();
 var top = document.preloadlist.length;
 for (var i=0; i < img_list.length; i++) {
 document.preloadlist[top+i]  = new Image;
 document.preloadlist[top+i].src = img_list[i+1];
 }
}

function change_img_src(name, nsdoc, rpath, preload)
{
 var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
 if (name == '')
 return;
 if (img) {
 img.altsrc = img.src;
 img.src = rpath;
 }
}

// Flash 띄우기
function flashmovie(url,width,height)
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+width+"' height='"+height+"'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='allowFullScreen' value='false' />");
	document.write("<param name='movie' value='"+url+"' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='bgcolor' value='#ffffff' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<embed type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

/* OBJECT 통합생성 스크립트 */
function makeobject(type,path,w,h,id,vars,transparent,bg) {
	this.type = type; // flash, applet, movie
	this.path = path;
	this.w = w+"px";
	this.h = h+"px";
	this.id = id;
	this.vars = (vars) ? vars : '';
	this.trnasparent = (transparent) ? transparent : 'transparent';
	this.bg = (bg) ? bg : '#ffffff';
	this.gettag =
		function() {
			switch(this.type) {
				case 'flash' :
					this.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
					this.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
					this.tag = "<object classid='"+this.classid+"' codebase='"+this.codebase+"' id='"+this.id+"' width='"+this.w+"' height='"+this.h+"'>";
					this.tag += "<param name='movie' value='"+this.path+"' />";
					this.tag += "<param name='allowScriptAccess' value='always' />";
					if(this.vars) this.tag += "<param name='FlashVars' value='"+this.vars+"' />";
					if(this.trnasparent) this.tag += "<param name='wmode' value='"+this.trnasparent+"' />";
					this.tag += "<param name='menu' value='false' />";
					this.tag += "<param name='quality' value='high' />"
					this.tag += "<param name='bgcolor' value='"+this.bg+"' />";
					this.tag += "<param value='"+this.path+"'>";
					this.tag += "<param name='base' value='.'>";
					this.tag += "<embed src='"+this.path+"'";
					if(this.vars) this.tag += " FlashVars='"+this.vars+"'";
					if(this.trnasparent) this.tag += " wmode='"+this.trnasparent+"'";
					this.tag += " width='"+this.w+"'";
					this.tag += " height='"+this.h+"'";
					this.tag += " bgcolor='"+this.bg+"'";
					this.tag += " name='"+this.id+"'";
					this.tag += " menu='false'";
					this.tag += " base='.'";
					this.tag += " quality='high'";
					this.tag += " allowScriptAccess='always'";
					this.tag += " type='application/x-shockwave-flash'";
					this.tag += " pluginspage='http://www.macromedia.com/go/etflashplayer'";
					this.tag += " />";
					this.tag += "</object>";
					return this.tag;
					break;
				case 'media' :
					this.classid = 'clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95';
					this.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
					this.tag = "<object classid='"+this.classid+"' codebase='"+this.codebase+"' id='"+this.id+"' width='"+this.w+"' height='"+this.h+"'>";
					this.tag += "<param name='movie' value='"+this.path+"' />";
					this.tag += "<param name='allowScriptAccess' value='always' />";
					if(this.vars) this.tag += "<param name='FlashVars' value='"+this.vars+"' />";
					if(this.trnasparent) this.tag += "<param name='wmode' value='"+this.trnasparent+"' />";
					this.tag += "<param name='menu' value='false' />";
					this.tag += "<param name='quality' value='high' />"
					this.tag += "<param name='bgcolor' value='"+this.bg+"' />";
					this.tag += "<param value='"+this.path+"'>";
					this.tag += "<param name='base' value='.'>";
					this.tag += "<embed src='"+this.path+"'";
					if(this.vars) this.tag += " FlashVars='"+this.vars+"'";
					if(this.trnasparent) this.tag += " wmode='"+this.trnasparent+"'";
					this.tag += " width='"+this.w+"'";
					this.tag += " height='"+this.h+"'";
					this.tag += " bgcolor='"+this.bg+"'";
					this.tag += " name='"+this.id+"'";
					this.tag += " menu='false'";
					this.tag += " quality='high'";
					this.tag += " allowScriptAccess='always'";
					this.tag += " type='application/x-mplayer2";
					this.tag += " pluginspage='http://www.macromedia.com/go/etflashplayer'";
					this.tag += " />";
					this.tag += "</object>";
					return this.tag;
					break;
			}
		}
	this.writetag =
		function() {
			document.write(this.gettag());
			//Flash의 ExternalInterface가 Form Tag내에서 오류나는 버그를 해결하는 코드
			//eval("window." + this.id + " = document.getElementById('" + this.id + "');");
		}
}

// 쇼하이드 레이어
function changePage(pageNum,full,changeName)
{
	for (var i = 1; i <= full; i++) {
		if (pageNum == i) {
			document.all(changeName+i).style.display='';
		} else {
			document.all(changeName+i).style.display='none';
		}
	}
}

// 탑버튼
function heartBeat()
{
	diffY = document.body.scrollTop;
	if (diffY != lastScrollY) {
		percent = .2 * (diffY - lastScrollY);
		if (percent > 0) percent = Math.ceil(percent);
		else percent = Math.floor(percent);
		document.all.topbutton.style.pixelTop += percent;
		lastScrollY = lastScrollY + percent;
	}
}

function topbutton(){
document.write("<div id='topbutton' style='position:absolute; left:960px; top:280px; width:20px; height:185px; z-index:10;display:block;'>");
document.write("<img src='/images/bt_top_up.gif'><br>");
document.write("<a href='#' onfocus='this.blur()'><img src='/images/bt_top.gif'></a><br>");
document.write("<img src='/images/bt_top_down.gif'>");
document.write("</div>");

self.onError=null;
currentY = 0;
whichIt = null;
lastScrollY = 0;
minY = 150;
action = window.setInterval("heartBeat()",1);
}

function goTop(){
	location.href="#";
}

// 입력폼 배경
function clearbg(id) {
	document.getElementById(id).style.background="#f2f1f0";
}

// 팝업창 컨텐츠 내용에 맞게 resize 하기
function winresize() {
	window.resizeTo(document.body.scrollWidth,document.body.scrollHeight);
}

// E-mail 입력
function change_mail(form) {
	if(form.email_list.value != "self") {
		form.email2.style.display = "none";
		form.email2.value = form.email_list.value;
	} else {
		form.email2.value = "";
		form.email2.style.display = "inline";
	}
}
