function startupCookie(which_ws)
{
	if (!document.getElementsByTagName) return null;
	var divs = document.getElementsByTagName("div");
	for(var i=0; i < divs.length; i++)
	{
		var div = divs[i];
		var id = div.id;
		if ((id == "ma") || (id == "lss") || (id == "pa") || (id == "ec") || (id == "fua"))
		{
			var t2 = which_ws.concat(id);
			isvisible = getCookie(t2);
			if (isvisible == "yes")
 				{div.className = "";}
 			else
 			{
 				if (isvisible == "no")
 					{div.className = "hidden";}
				else 
  				{
					div.className = "hidden";
					setCookie(t2,"no",1800000);
				}
  			}
		}
	}
}

function getCookie(c_name)
{
	if (document.cookie.indexOf(c_name) != -1) // checks if a cookie is stored at all in the document.cookie object
 	{
 		c_start=document.cookie.indexOf(c_name + "=")
  		if (c_start!=-1) // check to see if our specific cookie is stored
    	{ 
    		c_start=c_start + c_name.length+1  
    		c_end=document.cookie.indexOf(";",c_start)
    		if (c_end==-1) 
    			c_end=document.cookie.length
    		return unescape(document.cookie.substring(c_start,c_end)) // return the value
    	} 
  	}
	return null
}

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setTime(exdate.getTime()+expiredays); // convert the number of days to a valid date, add the number of days until the cookie should expire
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate); // store the cookie name, cookie value and the expiration date in the document.cookie object
}

function checkCookie(which_ws,which_div) // which_ws makes this code more portable
{
	var t2 = which_ws.concat(which_div);
	isvisible = getCookie(t2);
	showWhat = document.getElementById(which_div);
	if (isvisible == "yes")
 	{
		showWhat.className = "hidden";
		setCookie(t2,"no",1800000)
	}
	else 
  	{
		showWhat.className = "";
		setCookie(t2,"yes",1800000)
    }
}
