function getCookies(name)
{
	var pcookie = document.cookie.split("; ");
	for (var i=0; i < pcookie.length; i++)
	{
		var values = pcookie[i].split("=");
		if (name == values[0])
			return unescape(values[1]);
	}
	return null;
}

function checkLogin()
{
	if(!getCookies('SMSESSION') || getCookies('SMSESSION') == "LOGGEDOFF" || !getCookies('SM_USER') || getCookies('SM_USER') != getCookies('cs_id'))
	{
		return false;
	}
	else 
	{
		return true;
	}
}

function showScrab()
{
	var win;
	var width = 423;
	var height = 462;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	
	if (checkLogin() == false)
	{
		alert('±â»ç ½ºÅ©·¦ ±â´ÉÀº ·Î±×ÀÎ ÈÄ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
		return;
	}

	win = window.open("/service/scrab_pop.html", "_blank", "left=" + left + ", top=" + top + ", width=" + width + ", height=" + height + ", status=0, menubar=0, location=0, scrollbars=0");

	while (win.document.readyState != 'complete')
	{
		window.setTimeout(function() { ; }, 30);
	}
}