/* cookie option, can be : text / zoom / pdf (the default view type for the article) ****/
var selectedoption = 'default';
var expdate = new Date();

/* cookie initialization ****/
function initCookie()
{
	FixCookieDate (expdate);
	expdate.setTime (expdate.getTime() + (1000 * 24 * 60 * 60 * 1000));
	if ( GetCookie("selection") == null )
	{
		setViewType (selectedoption);
	}
	else
	{
		setViewType(GetCookie("selection"));
	}
}

function setViewType(selectedType)
{
  SetCookie("selection", selectedType, expdate, "/");
  initViewType(selectedType);
}

function selectViewType(selectObject)
{
  var index = selectObject.selectedIndex;
  if (index > 0)
  {
    var selectedOption = selectObject.options[index];
    setViewType(selectedOption.value);
  }
}