function openPopGallery(gal_id, img)
{
	var url = '/photo/_pop_gallery.php?gallery_id=' + gal_id + '&img=' + img;
	window.open(url, 'gallery_win', 'width=920,height=780');
}

function SetCookie(name, value, expire, path, domain, secure)
{
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	var strCookie = name + "=" + escape (value) + 
		((expires == null || !expires ) ? "" : 
			("; expires=" + expires.toGMTString())) + 
		((path == null) ? "" : ("; path=" + path)) + 
		((domain == null) ? "" : ("; domain=" + domain)) + 
		((secure == true) ? "; secure" : "");

	document.cookie = strCookie;
}

function getCookie( cookieName )
{
	var search = cookieName + "=";
	var cookie = document.cookie;

	if( cookie.length > 0 )
	{
		startIndex = cookie.indexOf( cookieName );
		if( startIndex != -1 )
		{
			startIndex += cookieName.length;
			endIndex = cookie.indexOf( ";", startIndex );
			if( endIndex == -1) endIndex = cookie.length;
			return unescape( cookie.substring( startIndex + 1, endIndex ) );
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}

function url_escape(strXmlUrl,SID) 
{
	var strReXmlUrl = "http://api.cyworld.com/openscrap/post/v1/?";
	strReXmlUrl +=  "sid=" + SID + "&";
	strReXmlUrl += "xu=" + encodeURIComponent(strXmlUrl);

	window.open(strReXmlUrl, "cyopenscrap","width=450,height=410");
}