var insideLayer = false;

function navOver(id, isSub, fc) {

	var pf = (isSub ? '' : '_root');

	document.getElementById('nav_item_'+id).className = 'navigation_item'+pf+'_over';
	document.getElementById('nav_label_'+id).className = 'navigation_label'+pf+'_over';

	if (fc) {
		var arrow = document.getElementById('nav_arrow_'+id);
		if (arrow) arrow.src = "/mod_bin/general/arrow.php?fc="+fc;
	}

}

function navOut(id, isSub, fc) {

	var pf = (isSub ? '' : '_root');

	document.getElementById('nav_item_'+id).className = 'navigation_item'+pf;
	document.getElementById('nav_label_'+id).className = 'navigation_label'+pf;

	if (fc) {
		var arrow = document.getElementById('nav_arrow_'+id);
		if (arrow) arrow.src = "/mod_bin/general/arrow.php?fc="+fc;
	}
	
}

function toggle_sub_menu(item_link) {
	menu_item = item_link.parentNode;
	menu_item.childNodes[1].style.display = menu_item.childNodes[1].style.display == 'none' ? 'block' : 'none';
}

function toggle_element(el) {
	
	if (el) {
		el.style.display = el.style.display == 'none' ? 'block' : 'none';
	}
}


function print_r(ar, ind) {
  if (typeof ind == 'undefined') ind = '';
  var s = 'Array\n' + ind + '(\n';
  for (var i in ar) s += ind + '    [' + i + '] => ' + (typeof ar[i] ==
'object' ? print_r(ar[i], ind+'    ') : ar[i]) + '\n';
  return s + ind + ')';
}

function alert_r(v) {
	alert(print_r(v));
}



function _totalElementOffset(obj) {

	var yOffset = (obj.offsetTop ? obj.offsetTop : 0);
	var xOffset = (obj.offsetLeft ? obj.offsetLeft : 0);
	var elParent = obj.offsetParent;

	while (elParent) {
		yOffset += (elParent.offsetTop ? elParent.offsetTop : 0);
		xOffset += (elParent.offsetLeft ? elParent.offsetLeft : 0);
		elParent = elParent.offsetParent;
	}

	this.y = yOffset;
	this.x = xOffset;

}

function tage_change_order(order) {
	
	document.forms['frm_event_select'].elements['agenda_order'].value = order;
	document.forms['frm_event_select'].submit();

}