function init() {
	prva = true;
	selected = null;

	menu = document.getElementById('menu_left');
	items = menu.childNodes.length;
	for (i=0; i<items; i++) {
		if (menu.childNodes[i].className == "ml_no ml_act") {
			selected = menu.childNodes[i];
		}
	}
	param = 1;
	str = selected.onclick.toString();
	if (str.indexOf(', 0')>-1)
		param = 0;
	else if (str.indexOf(', 2')>-1)
		param = 2;

	lMenuOn(selected, param);
}

function menuOn(id) {
	tmpL = document.getElementById('mtl_'+id);
	tmpR = document.getElementById('mtr_'+id);
	tmpL.className = "mt_noL mt_actL";
	tmpR.className = "mt_noR mt_actR";
}

function menuOff(id) {
	tmpL = document.getElementById('mtl_'+id);
	tmpR = document.getElementById('mtr_'+id);
	tmpL.className = "mt_noL";
	tmpR.className = "mt_noR";
}

function lMenuOn(item, param) {
	item.childNodes[0].className='ml_no_link ml_act_link';
	item.className='ml_no ml_act';

	if (param == 0) {
		document.getElementById('lm_ltc').className = 'lm_ltc lm_ltcA';
		document.getElementById('lm_mtc').className = 'lm_mtc lm_mtcA';
		document.getElementById('lm_rtc').className = 'lm_rtc lm_rtcA';
	} else if (param == 2) {
		document.getElementById('lm_lbc').className = 'lm_lbc lm_lbcA';
		document.getElementById('lm_mbc').className = 'lm_mbc lm_mbcA';
		document.getElementById('lm_rbc').className = 'lm_rbc lm_rbcA';
	}
}

function lMenuOff(item, param) {
	item.childNodes[0].className='ml_no_link';
	item.className='ml_no';

	if (param == 0) {
		document.getElementById('lm_ltc').className = 'lm_ltc';
		document.getElementById('lm_mtc').className = 'lm_mtc';
		document.getElementById('lm_rtc').className = 'lm_rtc';
	} else if (param == 2) {
		document.getElementById('lm_lbc').className = 'lm_lbc';
		document.getElementById('lm_mbc').className = 'lm_mbc';
		document.getElementById('lm_rbc').className = 'lm_rbc';
	}
}

function openPageTM(item) {
	location.href = item.childNodes[0].href;
}

function openPageLM(item) {
	location.href = item.childNodes[0].href;
}

function iskalnikClear(str) {
	iskalnik = document.getElementById('iskalnik_field');
	if (iskalnik.value == str)
	iskalnik.value = '';
}

function iskalnikCSet(str) {
	iskalnik = document.getElementById('iskalnik_field');
	if (iskalnik.value == '')
		iskalnik.value = str;
}

