function set_image_size(o, max) {
	var obj = new Image();
	obj.src = o.src;

	if (obj) {
		if (obj.width > max || obj.width == "undefined" || obj.width == null) {
			o.width = max;
		}
	}
}

function copyit(tag) { 
	window.clipboardData.setData('Text',tag);
}

function droplayer(o) {
	var obj = parent.document.getElementById(o);
	if (obj) { obj.style.display = "none"; }
}

function open_pop(url, objname, title, w, h, scroll) {
	var w = w;		// ÁÂ¿ì ÀÌ¹ÌÁö Å©±â
	var h = h;			// »óÇÏ ÀÌ¹ÌÁö Å©±â
	var html = "";
	var obj = document.getElementById(objname);
	var x, y;
	var moveareaWidth = w - 30;
	var scrolltext;

	if (document.body.clientWidth < w) { x = 0; 	}
	else { x = (document.body.clientWidth - w) / 2; }

	if (document.body.clientHeight < h) {
		y = 0;
	}
	else {
		if (document.body.clientHeight > 1200) {
			y = 300;
		}
		else {
			y = (document.body.clientHeight - h) / 2;
		}
	}

	if (scroll == 0)	{ scrolltext = "no"; 	}
	else { scrolltext = "auto"; }

	obj.style.width = (w + 12) + "px";
	obj.style.height = (h + 27) + "px";
	obj.style.position = "absolute";
	obj.style.left = x + "px";
	obj.style.top = y + "px";
	obj.style.display = "block";
	obj.style.zIndex = 100;

	html += "<div id='layerpopup'>";
	html += "<p class='layerT1'></p>";
	html += "<p style='width: " + moveareaWidth + "px'; class='layerT2 txtPX11DA'>" + title + "</p>";
	html += "<p class='layerT3'><img src='/images/layerPT3.gif' width='24' height='20' border='0' alt='´Ý±â' onClick='close_pop(\"" + objname + "\");' class='btn' /></p>";
	html += "<table width='" + (w + 12) + "' border='0'>";
	html += "<tr>";
	html += "<td width='5' background='/images/layerPC1.gif'></td>";
	html += "<td>";
	html += "<iframe id='layerpop' name='layerpop' src='" + url + "' width='" + (w + 2) + "' height='" + h + "' frameborder='0' marginheight='0' marginwidth='0' scrolling='" + scrolltext + "'></iframe>";
	html += "</td>";
	html += "<td width='5' background='/images/layerPC3.gif'></td>";
	html += "</tr>";
	html += "<tr>";
	html += "<td height='7' style='background: url(/images/layerPB1.gif) no-repeat 0 0;'></td>";
	html += "<td style='background: url(/images/layerPB2.gif) repeat-x 0 0;'></td>";
	html += "<td style='background: url(/images/layerPB3.gif) no-repeat 0 0;'></td>";
	html += "</tr>";
	html += "</table>";
	html += "</div>";

	obj.innerHTML = html;
}

function close_pop(obj) {
	var obj = document.getElementById(obj);
	obj.style.display = "none";
}

function flashhandler(obj){
	var objID = obj;

	switch (objID){
	case 'lostsaga' :
		location.href="/guide/infoIndex.asp";
		break;
	case 'community' :
		location.href="/community/comtyIndex.asp";
		break;
	case 'guild' :
		location.href="/guild/index.asp";
		break;
	case 'region' :
		location.href="/guild/guild_boardList.asp";
		break;
	case 'ranking' :
		location.href="/ranking/index.asp";
		break;
	case 'support' :
		location.href="/support/index.asp";
		break;
	case 'playgame' :
		sendit();
		break;
	default :
		top.location.replace("http://www.lostsaga.com/");
		break;
	}
}


function resize_iframe(o) {
	var obj = document.getElementById(o);
	var minheight = 90;

	if (obj.contentWindow.document.location.href == 'about:blank') {
		setTimeout("resize_iframe('" + o + "')", 500);
	}
	else {
		obj.style.height = obj.contentWindow.document.body.scrollHeight + "px";
	}
}



if (document.layers) {
	isNav = true;
}
else if (document.all) {
	isIE = true;
}


/*
ÃÊ±â Á¦ÀÛ¶§ »ç¿ëÇß´ø ÇÔ¼ö.
iframe ·Îµå ÈÄ ÇöÀç »ç¿ë ÇÔ¼ö¸¦ È£Ãâ ÇßÁö¸¸ FF¿¡¼­ iframe body ³ôÀÌ¸¦ Á¤»óÀûÀ¸·Î °¡Á®¿ÀÁö ¸øÇÏ¿© ¾Æ·¡ ÇÔ¼ö »ç¿ë.
ÇöÀç´Â À§ÀÇ ÇÔ¼ö°¡ ¿Ö Á¤»óÀûÀ¸·Î µ¿ÀåÇÏ´ÂÁö ¾Ë ¼ö ¾øÀ½.
function resize_iframe(n) {
	var obj = document.getElementById("ifrm" + n);
	var h;
	var minheight = 90;

	try {
		if (!document.all && obj.contentWindow.document.location.href == 'about:blank') {
			setTimeout("resize_iframe('" + n + "')", 10);
			return;
		}
		if (this.Location != obj.contentWindow.document.location.href) {
			h = obj.contentWindow.document.body.scrollHeight + 5;
			obj.style.height =  (h < minheight ? minheight : h) + 'px';
			this.Location = obj.contentWindow.document.location.href;
			setTimeout("resize_iframe('" + n + "')", 10);
		}
		else {
			obj.style.height = obj.contentWindow.document.body.scrollHeight;
		}
	}
	catch (e) {
		setTimeout("resize_iframe('" + n + "')", 10);
		return;
	}
}
*/





