function fontResize() {
	  StyleActivate( CookieGet('sofia_betumeret') );
}

function CookieGet( name ) {
  var name = name + "=";
  var cs = document.cookie.split(';');
  for (var i=0; i<cs.length; i++) {
    var c = cs[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
  }
  return null;
}

function CookieSet(name,value) {
  document.cookie=name + "=" + escape(value) +
    ";expires=Thu Feb 10 2028 12:00:00 GMT+0100;path=/";
}

function StyleActivate( value ) {
  if (value == null) { value="normal"; }
  var i, lnk;
  for( i = 0; (lnk = document.getElementsByTagName("link")[i]); i++ ) {
    lnk.disabled = true;
    if ( lnk.getAttribute('rel').indexOf('style') != -1 && lnk.getAttribute('id') ) {
      if ( lnk.getAttribute('id') == value ) {
          lnk.disabled = false;
		  CookieSet( 'sofia_betumeret', StyleActual(lnk.getAttribute('id')) );
      }
    }
  }
}

function StyleActual( prefix ) {
  var i, lnk;
  for( i = 0; (lnk = document.getElementsByTagName("link")[i]); i++ ) {
    if ( lnk.getAttribute('rel').indexOf('style') != -1 &&
         lnk.getAttribute('id') && !lnk.disabled ) {
        return lnk.getAttribute('id');
    }
  }
  return null;
}

addEvent(window, 'load', fontResize);
