/* cookie */
function _cookieInsert(name, value, expirehours) 
{
	var today = new Date();
	today.setTime(today.getTime() + (60*60*1000*expirehours));
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}

function _cookieRead(name) {
	var label = name + "=" ;
	var labelLen = label.length ;
	var cLen = document.cookie.length
	var i = 0
	while (i < cLen){
		var j = i + labelLen
		if (document.cookie.substring(i,j) == label) {
			var cEnd = document.cookie.indexOf(";",j)
			if (cEnd == -1){ cEnd = document.cookie.length }
			return unescape(document.cookie.substring(j,cEnd))
		}
		i++
	}//end of while
	return ""
}

function _cookieDelete(name) 
{
	var today = new Date();

	today.setTime(today.getTime() - 1);
	var value = getCookie(name);
	if(value != "")
		document.cookie = name + "=" + value + "; path=/; expires=" + today.toGMTString();
}

/* popup */
function _popupCookie(cookieName, url, winName, winOption) {
	var ck = _cookieRead(cookieName);

	if ( ck == '1' ) return;
		window.open(url, winName, winOption);
}

function _popup(url, winName, winOption) {
	if(winOption == '')
	winOption = "";

	window.open(url, winName, winOption);
}

// 새 창
function newBrowserOpen(src)
{
	var wWidth  = screen.width - 50;
	var wHeight = screen.height - 50;

	var wx = (screen.width - wWidth) / 2;
	var wy = (screen.height - wHeight) / 2;

	suffix = "toolbar=yes,menubar=yes,location=yes,status=yes,titlebar=yes,scrollbars=yes,resizable=yes,directories=yes";
	suffix = "width=" + wWidth + ",height=" + wHeight + ",top=" + wy + ",left=" + wx + "," + suffix;
	window.open(src, '', suffix);
}
