<!--


var text_sizes		= [11, 13, 15];
var line_heights	= [1.2, 1.4, 1.6];

var def_text_size = 0;
var def_line_height = 0;
var base_href = '';
var domain = '';

function change_line_height() {
	current_lh = getCookie('line_height');
	if (!current_lh) current_lh = 0;
	current_lh ++;
	if (current_lh == line_heights.length) current_lh = 0;
	if (current_lh != 0) {
		setCookie('line_height', current_lh,false,base_href,domain);
	} else {
		deleteCookie('line_height',base_href,domain);
		current_lh = def_line_height;
	}
	document.getElementById('content').style.lineHeight = line_heights[current_lh] + "em";
}

function change_text_size() {
	current_ts = getCookie('text_size');
	if (!current_ts) current_ts = 0;
	current_ts ++;
	if (current_ts == text_sizes.length) current_ts = 0;
	if (current_ts != 0) {
		setCookie('text_size', current_ts,false,base_href,domain);
	} else {
		deleteCookie('text_size',base_href,domain);
		current_ts = def_text_size;
	}
	document.getElementById('content').style.fontSize = text_sizes[current_ts] + 'px';
}

function init_text_properties() {
	current_text_size = getCookie('text_size');
	current_line_height = getCookie('line_height');
	
	if (current_text_size) {
		document.getElementById('content').style.fontSize = text_sizes[current_text_size] + "px";
	}	
	if (current_line_height) {
		document.getElementById('content').style.lineHeight = line_heights[current_line_height] + "em";
	}
	
}

/* set cookie */
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

/* get cookie */
function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) {
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}

/* delete cookie */
function deleteCookie( name, path, domain ) {
	if ( getCookie(name) ) 
		document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

/* returns the x,y coordinates of the current screen (for multi monitor setup) */

function get_top_left(width, height){
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
	  		winW = window.innerWidth;
	  		winH = window.innerHeight;
	 		winL = window.screenX;
	 		winT = window.screenY;
	 	} else {
	  		winW = document.body.offsetWidth;
	  		winH = document.body.offsetHeight;
	  		winL = window.screenLeft;
	  		winT = window.screenTop;
	 	}
	}
	
	var scroll = 0;
	var l = winL + winW/2 - width/2;
	var t = winT + winH/2 - height/2;
	
	
  	if(screen.width <= width){
  		width=screen.width;
  	}
  	if(screen.height <= height){
  		height=screen.height;
 	 	var t = 0;
  		var scroll = 1;
  	}
	return Array(t,l);
}

window.onload = function() {
	init_text_properties();

}


 -->
