﻿//.. swf

function swf(add, widthx, heighty){
	var add;
	var widthx;
	var heighty;

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+widthx+'" height="'+heighty+'"><param name=movie value="'+add+'"> <param name=quality value=high> <param name=menu value=false> <embed src="'+add+'" quality=high menu=false pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widthx+'" height="'+heighty+'"></embed></object>')
}

function swftrans(add, widthx, heighty){
	var add;
	var widthx;
	var heighty;

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+widthx+'" height="'+heighty+'"><param name=movie value="'+add+'"> <param name=quality value=high> <param name=menu value=false> <param name=wmode value=transparent> <embed src="'+add+'" quality=high menu=false wmode=transparent pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widthx+'" height="'+heighty+'"></embed></object>')
}

function flashLoad(url,w,h,id){
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id='"+id+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width="+w+" height="+h+"><param name='movie' value="+url+"><param name=quality value=high><param name=wmode value=transparent><param name='allowFullScreen' value='true' /><param name='allowScriptAccess' value='always' /><embed src="+url+" name='"+id+"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+w+" height="+h+" wmode=transparent></embed></object>");
}

//popup
function popup(page,name,x,y){
	opt = "toolbar=no,alwaysRaised=no,location=no,status=no,menubar=no,scrollbars=no,width="+x+",height="+y+",resizable=no,hotkey=no,dependent=no,screenX=0,screenY=0, top=0, left=0"
	window.open(page,name,opt)
	}
function popup2(page,name,x,y){
	opt = "toolbar=no,alwaysRaised=no,location=no,status=no,menubar=no,scrollbars=yes,width="+x+",height="+y+",resizable=no,hotkey=no,dependent=no,screenX=0,screenY=0, top=0, left=0"
	window.open(page,name,opt)
	}



/////상시메뉴, 탑버튼
function GoTop(){
	if (document.body.scrollTop == 0) {
		window.scrollTo(0,document.body.scrollHeight);
	} else {
		document.body.scrollTop(0,0);
	}
}

function GoTop_Call() {
	document.body.ondblclick = Top;	
}

// Banner Scroll 의 위한 Layer 생성
document.writeln("<div id='gotop' style='z-index:1;left:940px;top:600px;width:20px;height:48px;position:absolute;visibility:visible;'>");
document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
document.writeln("<tr><td><a href='#' onFocus='this.blur()'><img src='/images/top.gif' border='0'></a></td></tr>");
document.writeln("</table>");
document.writeln("</div>");



function _Floating(FloatingObj,MarginX,MarginY,Percentage,setTime) {
	this.FloatingObj = FloatingObj;
	this.MarginX = (MarginX) ? MarginX : 0;
	this.MarginY = (MarginY) ? MarginY : 0;
	this.Percentage = (Percentage) ? Percentage : 20;
	this.setTime = (setTime) ? setTime : 10;
	this.FloatingObj.style.position = "absolute";
	this.Body = null;
	this.setTimeOut = null;
	this.Run();
}

_Floating.prototype.Run = function () {

	if ((document.documentElement.scrollLeft + document.documentElement.scrollTop) > (document.body.scrollLeft + document.body.scrollTop)) {
		this.Body = document.documentElement;
	} else {
		this.Body = document.body;
	}

	var This = this;
	var FloatingObjLeft = (this.FloatingObj.style.left) ? parseInt(this.FloatingObj.style.left,10) : this.FloatingObj.offsetLeft;
	var FloatingObjTop = (this.FloatingObj.style.top) ? parseInt(this.FloatingObj.style.top,10) : this.FloatingObj.offsetTop;
	var DocLeft = this.Body.scrollLeft + this.MarginX;
	var DocTop = this.Body.scrollTop + this.MarginY;

	var MoveX = Math.abs(FloatingObjLeft - DocLeft);
	MoveX = Math.ceil(MoveX / this.Percentage);
	var MoveY = Math.abs(FloatingObjTop - DocTop);
	MoveY = Math.ceil(MoveY / this.Percentage);

	if (FloatingObjLeft < DocLeft) {
		this.FloatingObj.style.left = FloatingObjLeft + MoveX + "px";
	} else {
		this.FloatingObj.style.left = FloatingObjLeft - MoveX + "px";
	}

	if (FloatingObjTop < DocTop) {
		this.FloatingObj.style.top = FloatingObjTop + MoveY + "px";
	} else {
		this.FloatingObj.style.top = FloatingObjTop - MoveY + "px";
	}

	window.clearTimeout(this.setTimeOut);
	this.setTimeOut = window.setTimeout(function () { This.Run(); },this.setTime);
}



function OnLoad(){
    if ( top.frames.length )
    if ( bNetscape4plus ) {
            $('gotop').top = top.pageYOffset ;
            $('gotop').visibility = "visible";
    }
    else if ( bExplorer4plus ) {
            gotop.style.top = document.body.scrollTop ;
            gotop.style.visibility = "visible";
    }
	
	new _Floating($("gotop"),940,600,10,10); 

    return true;
}
OnLoad();