
/* ---------------------------------------------------------------- */
/* commonSetCookie                                                  */
/* ---------------------------------------------------------------- */
function commonSetCookie(cookieName, cookieValue)
{
        document.cookie = cookieName + "=" + cookieValue + "; expires=";
}

/* ---------------------------------------------------------------- */
/* commonGetCookie                                                  */
/* ---------------------------------------------------------------- */
function commonGetCookie(cookieName)
{
        var allCookie = document.cookie;
        var theValue;
        var start = allCookie.indexOf(cookieName+"=");
        if (start == -1)
			return "";
			
        var end = allCookie.indexOf(";", start);
        
        if (end == -1) 
			end = allCookie.length;
			
        var name_value = allCookie.substring(start, end);
        theValue = name_value.substring(cookieName.length+1, name_value.length);
        
        return theValue;
}

var showPopup = true;

/* ---------------------------------------------------------------- */
/* commonSetAutoStart                                               */
/* ---------------------------------------------------------------- */
function commonSetAutoStart()
{
	var updateCookie;
	if (cookieMusicAutoStart == "true")
		updateCookie = "false";
	else
		updateCookie = "true";
	commonSetCookie("cookieMusicAutoStart", updateCookie);
}

var blink_speed=1200;
var blink_on=0;

function commonBlink()
{
	for (b=1; b<20; b++)
	{
		obj = eval("window.blink" + b);
	
		if (obj == undefined)
			break;

		if (blink_on==0)
		{
			obj.style.color = obj.parentNode.style.color;
		}
		else
		{
			obj.style.color = "red";
		}
	}

	if (b != 1)
	{
		if (blink_on==0)
		{
			blink_on = 1;
			speed = blink_speed;
		}
		else
		{
			blink_on = 0;
			speed = blink_speed/2;
		}
		setTimeout("commonBlink();",speed);
	}
}
