/************************************************************************************************************
resize text and store preference in cookie
************************************************************************************************************/	

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    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 null
}

function eraseCookie(name) {
  createCookie(name,"",-1);
}

function reloadPage()
{
    window.location.reload( false );
}

var min=14;
var max=30;

function increaseFontSize() {
	var s = getCookie('fsize');
	
	if (s == null) {
		s = 16;
	} else {
		s = parseInt(s) + 2;
	}

	if (s <= max) {
		eraseCookie('fsize');
		createCookie('fsize',s,0)
		parent.leftFrame.location = 'left.php';
		parent.mainFrame.location = getCookie('curPage');
	}
}

function decreaseFontSize() {
	var s = getCookie('fsize');
	
	if (s != null) {
		s = parseInt(s) - 2;
	}

	if (s >= min) {
		eraseCookie('fsize');
		createCookie('fsize',s,0)
		parent.leftFrame.location = 'left.php';
		parent.mainFrame.location = getCookie('curPage');
	}
}