var font = 11;
var line = 17;

var ajax = new sack();

function GetElement(){
	if(null !== document.getElementById('center1')){
		return document.getElementById('center1');
	} else if(null !== document.getElementById('center2')){
		return document.getElementById('center2');
	} else if(null !== document.getElementById('center3')){
		return document.getElementById('center3');
	}
}
function FontUp(){
	var el = GetElement();
	if(font  < 18){
		font = font + 2;
		line = line + 1;
		el.style.fontSize = font + 'px';
		el.style.lineHeight = line + 'px';
	}
}
function FontDown(){
	var el = GetElement();
	if(font > 10){
		font = font - 2;
		line = line - 1;
		el.style.fontSize = font + 'px';
		el.style.lineHeight = line + 'px';
	}
}

function Sortiraj(){
	sort = document.getElementById('polje');
	sort = sort.options[sort.selectedIndex].value;

	asc = document.getElementById('sort');
	asc = asc.options[asc.selectedIndex].value;

	num = document.getElementById('broj');
	num = num.options[num.selectedIndex].value;

	ajax.requestFile = '/ajax.php?f=Sort&s=' + sort + ' ' + asc + '&b=' + num;
	ajax.onCompletion = RefreshPage;
	ajax.runAJAX();
}

function SetSort(sort){
	ajax.requestFile = '/ajax.php?f=SetSort&s=' + sort;
	ajax.onCompletion = RefreshPage;
	ajax.runAJAX();
}
function SetNum(num){
	ajax.requestFile = '/ajax.php?f=SetNum&b=' + num;
	ajax.onCompletion = RefreshPage;
	ajax.runAJAX();
}
function RefreshPage(){
	location.reload(true);
}
function PrintIt(){
	var prozor = window.open("/print.php?u="+location.href, null, "height=600, width=742, scrollbars=yes, resizable=no, status=no,toolbar=no,menubar=no,location=no, status=no");
	prozor.focus();
}