function doTopLogin() {
	location="/member/login.jsp?ref=" + encodeURIComponent(location.href);
}

// flash contents :: not use 
function flashInsert(id, vUrl, wid, hei, flashVars) {
	var viewObj = '' +
	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + wid + '" height="' + hei + '" id="' + id + '" align="middle">' +
	'<param name="allowScriptAccess" value="sameDomain" />' +
	'<param name="movie" value="' + vUrl + '" />' +
	'<param name="quality" value="high" />' +
	'<param name="wmode" value="transparent" />' +
	'<param name="FlashVars" value="' + flashVars + '" />' +
	'<embed src="' + vUrl + '" quality="high" wmode="transparent" FlashVars="'+flashVars+'" width="' + wid + '" height="' + hei + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />' +
	'</object>' ;
	document.write(viewObj);
	eval("window."+id+"=document.getElementById('"+id+"');");
}


// png24
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 '';
}


// target at strict mode
function externalLinks(){
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
		anchor.target = "_blank";
	}
}

try {
	document.observe("dom:loaded", function() {	
		externalLinks();
		qucikLink();	
	});
} catch (e) {}

/* constructor */
/* 인수는 (엘리먼트 id, 초기 top 값, (선택사항) bottom 마진) */
function floatedLayer(eleName, initialTop, bottomLimit) {

	if (!document.getElementById(eleName)) { return; }
	
	this.ele = document.getElementById(eleName);
	this.initialTop = initialTop;
	this.bottomLimit = (!bottomLimit)? 0 : bottomLimit;
	this.timer = null;
	this.moveLayer();
}

/* class property */
floatedLayer.INTERVAL = 10; /* 동작 간격: (단위: 밀리초(ms)) */
floatedLayer.DEGREE = 5; /* 움직임 정도: (단위: 퍼센트, 0 < 범위 <= 100) */


/* instance method */
floatedLayer.prototype.moveLayer = function () {

	var scrollHeight = 0;

	// 스크롤된 높이 계산 (참고: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow)
	if (document.body && document.body.scrollTop) {
		scrollHeight = document.body.scrollTop;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		scrollHeight = document.documentElement.scrollTop;
	}

	var top = (isNaN(parseInt(this.ele.style.top)))? this.initialTop : parseInt(this.ele.style.top);
	var exactHeight = scrollHeight + this.initialTop;

	var moveHeight = Math.ceil(Math.abs(top - exactHeight) * floatedLayer.DEGREE / 100);
	
	top = (top > exactHeight)? top - moveHeight : top + moveHeight;

	var documentHeight = document.body.offsetHeight;
	var eleHeight = this.ele.offsetHeight;

	if ((top + eleHeight) >= documentHeight - this.bottomLimit) {
		top = documentHeight - eleHeight - this.bottomLimit;
	}

	this.ele.style.top = top + "px";

	// setTimeout에서 인스턴스 메소드 사용 (참고: http://www.faqts.com/knowledge_base/view.phtml/aid/2311)
	var self = this;
	if (this.timer) {
		window.clearTimeout(this.timer);
	}
	this.timer = window.setTimeout(function () { self.moveLayer(); }, floatedLayer.INTERVAL);
}


function qucikLink() {
	var ele1Top = 216;
	if (document.getElementById("quick")) {
		new floatedLayer("quick", ele1Top, 80);
	}
}
