function dw_setCookie(name,value,days,path,domain,secure) {
  var expires, date;
  if (typeof days == "number") {
    date = new Date();
    date.setTime( date.getTime() + (days*24*60*60*1000) );
		expires = date.toGMTString();
  }
  document.cookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function dw_getCookie(name) {
  var nameq = name + "=";
  var c_ar = document.cookie.split(';');
  for (var i=0; i<c_ar.length; i++) {
    var c = c_ar[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameq) == 0) return unescape( c.substring(nameq.length, c.length) );
  }
  return null;
}

function dw_deleteCookie(name,path,domain) {
  if ( dw_getCookie(name) ) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function change_fs(n) {
	$("#text_change").css("font-size", n + "em");
}

function resize_button($el) {

	if ($($el).attr("id") == "cfb1" ) {
		change_fs(1.2);
		dw_setCookie("fontsize", "cfb1");
		$("#cfb1 img").attr("src", "images/ico_font_1_a.gif");
		$("#cfb2 img").attr("src", "images/ico_font_2.gif");
		$("#cfb3 img").attr("src", "images/ico_font_3.gif");
	}
	if ($($el).attr("id") == "cfb2" ) {
		change_fs(1.4);
		dw_setCookie("fontsize", "cfb2");
		$("#cfb1 img").attr("src", "images/ico_font_1.gif");
		$("#cfb2 img").attr("src", "images/ico_font_2_a.gif");
		$("#cfb3 img").attr("src", "images/ico_font_3.gif");
	}
	if ($($el).attr("id") == "cfb3" ) {
		change_fs(1.5);
		dw_setCookie("fontsize", "cfb3");
		$("#cfb1 img").attr("src", "images/ico_font_1.gif");
		$("#cfb2 img").attr("src", "images/ico_font_2.gif");
		$("#cfb3 img").attr("src", "images/ico_font_3_a.gif");
	}
	ReinitScrollPane();
}

$(document).ready(
 function() {
	if (dw_getCookie("fontsize") == "cfb2") {
		change_fs(1.4);
		$("#cfb2 img").attr("src", "images/ico_font_2_a.gif");
	}
	else if (dw_getCookie("fontsize") == "cfb3") {
		change_fs(1.5);
		$("#cfb3 img").attr("src", "images/ico_font_3_a.gif");
	} else {
    change_fs(1.2);
		$("#cfb1 img").attr("src", "images/ico_font_1_a.gif");
	}
	ReinitScrollPane();
	});

