<!--
function blick(eleId){
	if(document.getElementById(eleId).style.display == 'none'){
		document.getElementById(eleId).style.display = 'block';
	}else{
		document.getElementById(eleId).style.display = 'none';
	}
}

function check_flip(eleId){
	if(document.getElementById(eleId).checked != 1){
		document.getElementById(eleId).checked = 1;
	}else{
		document.getElementById(eleId).checked = 0;
	}
}

function check(eleId){
	document.getElementById(eleId).checked = 1;
}

function pic_window(picfile, picwidth, picheight){
	window.open('pic_window.php?pic='+picfile, 'picwindow', 'width='+picwidth+',height='+picheight+'');
}

function text_window(tid){
	window.open('text_window.php?tid='+tid, 'picwindow', 'width=300,height=300,scrollbars=yes,top=200,left=200');
}

function dtimer(){
	window.setTimeout(delay_submit, 500);
}

function delay_submit(){
	document.getElementById('kolik').form.submit();
}


function switchClass (id, class1, class2){
	obj = document.getElementById(id);

	if(obj.className == class1){
		obj.className = class2;
	}else{
		obj.className = class1;
	}
}

function enter_submit(){
	if(this.event.keyCode == 13){
		document.getElementById('loginform').submit();
	}
}

function galtab(idTab, idPosi, hCor, vCor){
	posByParent(idTab, idPosi, hCor, vCor);
	blick(idTab);
}

function showAllStates(eleId, lastIndex) {
	var el = document.getElementById(eleId);

	for (i = el.length - 1; i > -1; i--) {
		if (el.options[i].value != 'all') {
			el.options[i] = null;
		}
	}

	for (i = 0; i < states.length; i++) {
		el.options[i] = new Option(states[i]['text'], states[i]['id']);
	}
	el.selectedIndex = -1;
}

/* MENU */

var menu = new Array(
Array('root_1', '01_about_us.gif', '01_about_us_o.gif'),
Array('root_2', '02_membership.gif', '02_membership_o.gif'),
Array('root_3', '03_calendar.gif', '03_calendar_o.gif'),
Array('root_4', '04_news.gif', '04_news_o.gif'),
Array('root_5', '05_activities.gif', '05_activities_o.gif'),
Array('root_6', '06_workgroups.gif', '06_workgroups_o.gif'),
Array('root_7', '07_forum.gif', '07_forum_o.gif'),
Array('root_8', '08_media.gif', '08_media_o.gif'),
Array('root_9', '09_partners.gif', '09_partners_o.gif')
);

function m_pon(eleId){
	if(m_perm == false){
		for(x = 0; x < menu.length; ++x){
			if(menu[x][0] == eleId){
				document.getElementById(eleId).src = menu_path+menu[x][2];
			}
		}
	}
}

function m_poff(eleId){
	if(m_perm == false){
		for(x = 0; x < menu.length; ++x){
			if(menu[x][0] == eleId){
				document.getElementById(eleId).src = menu_path+menu[x][1];
			}
		}
	}
}

function posByParent(eleId, parId, hCor, vCor){
	ele = document.getElementById(parId);

	eleTop = ele.offsetHeight + hCor;
	eleLeft = ele.offsetWidth + vCor;
	while(ele){
		eleTop += ele.offsetTop
		eleLeft += ele.offsetLeft
		ele = ele.offsetParent;
	}

	document.getElementById(eleId).style.top = eleTop+'px';
	document.getElementById(eleId).style.left = eleLeft+'px';
}

function getHeight(eleId){
	ele = document.getElementById(eleId);
	return(ele.offsetHeight);
}

function getWidth(eleId){
	ele = document.getElementById(eleId);
	return(ele.offsetWidth);
}

var mouseOn = 0;
var prefix = 'menu_';
var lastOpen = '';
var timeout = '';

function arraySearch(Sarray, Sval){
	for(x = 0;x < Sarray.length;++x){
		if(Sarray[x] == Sval){
			return true;
			break;
		}
	}
	return false;
}

function show(eleId) {
	document.getElementById(eleId).style.visibility = 'visible';
}

function hide(eleId) {
	document.getElementById(eleId).style.visibility = 'hidden';
}

function hide_all(){
		for(x = 0;x < all_menus.length;++x){
				document.getElementById(all_menus[x]).style.visibility = 'hidden';
		}
}

function m_on(eleId) {
	mouseOn = 1;
}

function m_off(eleId) {
	mouseOn = 0;
	timeout = setTimeout('f_hide(\''+eleId+'\')', 1000);
}

function getTree(id){
	var res = Array(id);
	ch = 0;
	while(id){
		if(ch > 500){break;}
		cid = false;
		for(t = 0;t < menuParents.length;++t){
			if(menuParents[t][1] == id){
				res[res.length] = menuParents[t][0];
				id = menuParents[t][0];
				cid = id;
				break;
			}
		}
		if(cid == false){id = false;}
		++ch;
	}
	return res;
}

function hide_others(eleId){
	parts = eleId.split('_');
	parents = getTree(parts[1]);

	for(k = 0;k < all_menus.length ;++k){
		parts2 = all_menus[k].split('_');
		if(all_menus[k] != eleId && arraySearch(parents, parts2[1]) == false){
			hide(all_menus[k]);
		}
	}
}

function show_child(eleId){
	mouseOn = 1;
	timeout = '';
	if(document.getElementById(eleId).style.visibility == 'hidden' || document.getElementById(eleId).style.visibility == ''){
		show(eleId);
		lastOpen = eleId;
	}
	hide_others(eleId);
}

function f_hide(eleId){
	if(mouseOn == 0){
		hide_all();
	}
}

function line_on(eleId, lineNum){
	mouseOn = 1;
	timeout = '';
	lastOpen = '';
	hide_others(eleId);
}

function line_off(eleId, lineNum){
}
//-->
