/**
 * Description 	: À¯´ÏÅ©·Î QuickMenu
 */

function initQuickMenu(){
    var obj = document.getElementById("quickMenu");
    var bodyTable = document.getElementById('bodyTable');
    obj.style.top = bodyTable.offsetTop + 170;
	var bodyWidth = parseInt(bodyTable.width);
	
	if (bodyWidth > 900)
		obj.style.right = -40 + "px";
	else if(bodyWidth > 850)
		obj.style.right = -80 + "px";
	else
		obj.style.right = -55 + "px";
	moveQuickMenu();
}

function moveQuickMenu()
{
	var timer;
	var activeSpeed = 200; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
	var scrollSpeed = 10; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)
	var menuGap = 170;

	var stPoint, edPoint, refreshTimer;
	var quickMenu = document.getElementById('quickMenu');

	stPoint = parseInt(quickMenu.style.top);
	edPoint = document.body.scrollTop;
	if (edPoint < menuGap) edPoint = menuGap;

	refreshTimer = activeSpeed;

	if ( stPoint != edPoint ) {
		scrollAmount = Math.ceil( Math.abs( edPoint - stPoint ) / 15 );
		quickMenu.style.top = parseInt(quickMenu.style.top) + ( ( edPoint<stPoint ) ? -scrollAmount : scrollAmount );
		refreshTimer = scrollSpeed;
		}

	timer = setTimeout ("moveQuickMenu();", refreshTimer);
}

/* iframe heigth */
function iframeHeight(obj_id) {
	try {
		document.getElementById(obj_id).height = 100;
		var the_height = document.getElementById(obj_id).contentWindow.document.body.scrollHeight;
		if( the_height < 1000 ) the_height="1100";
		document.getElementById(obj_id).height = the_height;
	} catch(e) {}
}
