function getCookie(name) {
allCookies = document.cookie;
cookieArr  = allCookies.split(';');
for(var i=0;i<cookieArr.length;i++) {
	if(cookieArr[i].split('=')[0] == name) {
	  cookieValue=cookieArr[i].split('=');
		cookieValue=unescape(cookieValue[1]);
	 	return cookieValue;
	  }
	}
	return false;
}

function fontSize(size)
{
  document.getElementById('center').style.fontSize = size + 'em';
  document.cookie = "fontSize=" + size;
  document.getElementById(size.replace(".", "_"));
}

function initSize() {
  if (getCookie('fontSize')) {
    fontSize(getCookie('fontSize'));
  } else {
    fontSize('0.9');
  }
}

$(document).ready(function() {
  $('#center a').each(function() {
    var url = $(this).attr('href').match(/\b.pdf\b|\b.PDF\b/);
    if (url)
      $(this).addClass('pdf');
  });
});
