ns4=(navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? 1 : 0;
ie4=(document.all && !document.getElementById)? 1 : 0;
ie5=(document.getElementById && document.all)? 1 : 0;
ns6=(document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? 1: 0;
w3c=(document.getElementById)? 1 : 0;

function getEl(id){
	if(w3c||ns6||ie5){
		return document.getElementById(id);
	}
	if(ie4){
		return document.all[id];
	}
	if(ns4){
		return document.layers[id];
	}
	return null;
}

function WindowOnload(f){
    var prev=window.onload;
    window.onload=function(){if(prev)prev(); f();}
}

/**
* Window popup
*/
function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}

	window.open(url.replace(/&amp;/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes, width=' + width);
	return false;
}

var tooltipon = false;
function searchTooltip(){
  if (tooltipon){
    $('searchbox').style.display = 'none';
    tooltipon = false;
  }
  else{
    $('searchbox').style.display = 'block';
    $('searchbox').style.position = 'absolute';
    var obj = $('searchlink');
    var pos = Position.cumulativeOffset(obj);
    $('searchbox').style.left = pos[0] + 'px'; 
    $('searchbox').style.top = pos[1]+20 + 'px'; 
    tooltipon = true;
  }
  return false;
}
function unveil_spoiler(id) {
	element = document.getElementById(id);
	if (element.style.display == 'none')
	{
		element.style.display = '';
	}
	else
	{
		element.style.display = 'none';
	}
}
function CheckConfirmation( msg_type ) {
	return confirm( "Oled kindel, et vajutasid "+msg_type+" nuppu?");
}

var clArr = [];
function registerHVR(cl) {
	clArr.push(cl);
	hideEl(cl);
}
var hideEl = function(x,idx) {
	$$(x).each(Effect.BlindUp);
}
var showEl = function(x,idx) {
	$$(x).each(Effect.BlindDown);
}
function hideAll() {
	var len = clArr.length;
	if( len > 0 ) {
		clArr.forEach(hideEl);
	}
}
