<!--

// Out put only YYYY-mm-dd of a full timestamp.
function date_only(timestamp)
{
	document.write(timestamp.substring(0, 10));
}

// Avoid links being too long.
function fix_links_length(link)
{
	if (35 < link.length)
	{
		document.write(link.substring(0, 30) + "...");
	}
	else
	{
		document.write(link);
	}
}

// Close the popup.
function close_popup()
{
	if (!get_cookie("dance_popup"))
	{
		// No existing for some odd reason, set it now.
		set_cookie("dance_popup", "0", 30, '/', '', '');
	}
	else if ("1" == get_cookie("dance_popup"))
	{
		// Set it to disable pop up.
		set_cookie("dance_popup", "0", 30, '/', '', '');
	}

	var popup = document.getElementById("popup");
	if (popup) { popup.style.display = "none"; }
}

// Show the popup.
function show_popup()
{
	if (!get_cookie("dance_popup"))
	{
		// Since no exsting pop up setting, just set it now.
		set_cookie("dance_popup", "1", 30, '/', '', '');
	}
	else if ("1" == get_cookie("dance_popup"))
	{
		// Show the pop up.
		var popup = document.getElementById("popup");
		if (popup)
		{
			popup.style.display = "block";
		}
	}
	else
	{
		close_popup();
	}
}

//-->

