//<![CDATA[

function changeFontSize(size) {
  //43200 minutes is 30 days
  var ckUtil = new CJL_CookieUtil("veno", 43200, '/');

  if (size == null) {
    // Get the size from the cookie if it exists.
    size = ckUtil.getSubValue("font-size");

    if (size == null) {
      size = "a1";
    }

  }

  // Remove the current font-size css.
  var tekstgrootte = $("tekstgrootte");
  if (tekstgrootte != null) {
    tekstgrootte.remove();
  }

  // Add the new font-size css.
  $$("head").first().insert(new Element("link", {id: "tekstgrootte", rel: "stylesheet", href: "/css/" + size + ".css", type: "text/css", media: "screen"}));

  // Save new font-size to a cookie.
  ckUtil.setSubValue("font-size", size);

  switch (size) {
  	case 'a3':
  		$("aaa").style.backgroundPosition = '0 -40px';
  		break;
  	case 'a2':
  		$("aaa").style.backgroundPosition = '0 -20px';
  		break;
  	case 'a1':
  	default:
  		$("aaa").style.backgroundPosition = '0 0';
  		break;
  }
}


Event.observe(window, 'load', function() {
  changeFontSize(null);
  
  for (i = 1; i <= 3; i++) {
	  $("a" + i).observe("click", function() {changeFontSize(this.id)} );
	}
});

//]]>
