/* -------------------------------------------------------------------------- */
/* --- BROWSERCHECK                                                       --- */
/* --- A böngésző típusának meghatározásához kell.                        --- */
/* -------------------------------------------------------------------------- */
	NS4 = (document.layers) ? true : false;
	IE4 = (document.all && !document.getElementById) ? true : false;
	IE  = (window.showModalDialog && document.all && document.getElementById) ? true : false;
	O9  = (!window.showModalDialog && document.all && document.getElementById) ? true : false;
	NS6 = (!document.all && document.getElementById) ? true : false;
	FF1 = (!window.showModalDialog && document.getElementById) ? true : false;
/* -------------------------------------------------------------------------- */
/* --- BROWSERCHECK                                                       --- */
/* -------------------------------------------------------------------------- */




/* -------------------------------------------------------------------------- */
/* --- OBJECTPARAMETERS                                                   --- */
/* --- Html objektumok paramétereinek lekéréséhez, beállításához          --- */
/* --- vagy kiiratásához kellő függvények.                                --- */
/* -------------------------------------------------------------------------- */
/* Lekérés */
function getObjectTop(obj)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		return eval("document." + var_str + ".offsetTop");
	}
function getObjectLeft(obj)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		return eval("document." + var_str + ".offsetLeft");
	}
function getObjectWidth(obj)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		return eval("document." + var_str + ".offsetWidth");
	}
function getObjectHeight(obj)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		return eval("document." + var_str + ".offsetHeight");
	}


/* Beállítás */
function setObjectTop(obj,position)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		temp_obj = eval("document." + var_str);
		if (IE4||IE||O9) temp_obj.style.top = position;
		else position = temp_obj.style.top;
	}
function setObjectLeft(obj,position)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		temp_obj = eval("document." + var_str);
		if (IE4) temp_obj.style.left = position;
		else temp_obj.style.left = position+'px';
	}
function setObjectWidth(obj,value)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		temp_obj = eval("document." + var_str);
		if (IE4||IE||O9) temp_obj.style.width = value;
		else value = temp_obj.style.width;
	}
function setObjectHeight(obj,value)
	{
		if (IE4) var_str = "all." + obj;
		else var_str = "getElementById('" + obj + "')";
		temp_obj = eval("document." + var_str);
		if (IE4||IE||O9) temp_obj.style.height = value;
		else value = temp_obj.style.height;
	}


/* Kiiratás */
function printObjectTop(obj)
	{
		temp_obj = getObjectTop(obj);
		document.write(temp_obj);
	}

function printObjectLeft(obj)
	{
		temp_obj = getObjectLeft(obj);
		document.write(temp_obj);
	}

function printObjectWidth(obj)
	{
		temp_obj = getObjectWidth(obj);
		document.write(temp_obj);
	}

function printObjectHeight(obj)
	{
		temp_obj = getObjectHeight(obj);
		document.write(temp_obj);
	}
/* -------------------------------------------------------------------------- */
/* --- OBJECTPARAMETERS                                                   --- */
/* -------------------------------------------------------------------------- */




/* -------------------------------------------------------------------------- */
/* --- USEFUL 1                                                           --- */
/* --- Hasznos függvények 1: képcsere, színcsere, popuplink stb...        --- */
/* -------------------------------------------------------------------------- */
/* képcsere */
function changeSrc(obj,ujpic)
	{
		obj.src=ujpic;	
	}
function changeSrc_id(obj,ujpic)
	{
		document.getElementById(obj).src=ujpic;	
	}
function preLoad(imgObj,imgSrc) 
	{
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "../g/"+imgSrc')
	}
function preLoadWithActive(imgObj,imgSrc) 
	{
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "../g/"+imgSrc+".gif"')
		eval(imgObj+'_active = new Image()')
		eval(imgObj+'_active.src = "../g/"+imgSrc+"_active.gif"')
	}
function changeSrcPreLoad_id(imgName, imgObj) 
	{
		if (NS4)
			{
				eval('document.images["'+imgName+'"].src = '+imgObj+'.src');
			}
		else
			{
				document.images[imgName].src = eval(imgObj+".src");
			}
	}


/* háttérképcsere */
function changeBg(obj,ujpic)
	{
		obj.style.backgroundImage='url(' + ujpic + ')';
	}
function changeBg_id(obj,ujpic)
	{
		document.getElementById(obj).style.backgroundImage='url(' + ujpic + ')';
	}


/* háttérszíncsere */
function changeBgColor(obj,ujcolor)
	{
		obj.style.backgroundColor=ujcolor;
	}
function changeBgColor_id(obj,ujcolor)
	{
		document.getElementById(obj).style.backgroundColor=ujcolor;
	}


/* betűszínszíncsere */
function changeColor(obj,ujcolor)
	{
		obj.style.color=ujcolor;
	}
function changeColor_id(obj,ujcolor)
	{
		document.getElementById(obj).style.color=ujcolor;
	}


/* betű-dekoráció csere */
function changeDecoration(obj,ujdecoration)
	{
		obj.style.textDecoration=ujdecoration;
	}
function changeDecoration_id(obj,ujdecoration)
	{
		document.getElementById(obj).style.textDecoration=ujdecoration;
	}
/* -------------------------------------------------------------------------- */
/* --- USEFUL 1                                                           --- */
/* -------------------------------------------------------------------------- */




/* -------------------------------------------------------------------------- */
/* --- USEFUL 2                                                           --- */
/* --- Hasznos függvények 2: objektum eltűntetés-megjelenítés, kukaccsere --- */
/* --- popup-os link megnyitás, form+select link url átírás stb...        --- */
/* -------------------------------------------------------------------------- */
/* objektum eltűntetés és megjelenítés */
function show(obj)
	{
		obj.style.visibility='visible';
	}
function show_id(obj)
	{
		document.getElementById(obj).style.visibility='visible';
	}
function hide(obj)
	{
		obj.style.visibility='hidden';
	}
function hide_id(obj)
	{
		document.getElementById(obj).style.visibility='hidden';
	}

function show_display(obj)
	{
		obj.style.display='block';
	}
function show_display_id(obj)
	{
		document.getElementById(obj).style.display='block';
	}
function hide_display(obj)
	{
		obj.style.display='none';
	}
function hide_display_id(obj)
	{
		document.getElementById(obj).style.display='none';
	}

function show_all(obj)
	{
		obj.style.visibility='visible';
		obj.style.display='block';
	}
function show_all_id(obj)
	{
		document.getElementById(obj).style.visibility='visible';
		document.getElementById(obj).style.display='block';
	}
function hide_all(obj)
	{
		obj.style.visibility='hidden';
		obj.style.display='none';
	}
function hide_all_id(obj)
	{
		document.getElementById(obj).style.visibility='hidden';
		document.getElementById(obj).style.display='none';
	}


/* link popup megnyitás */
function popupWindow(linkUrl,linkTarget,winWidth,winHeight)
	{
		window.open(linkUrl,linkTarget,'width=' + winWidth + ',height=' + winHeight + ',left=' + (screen.width - winWidth) / 2 + ',top=' + (screen.height - winHeight) / 2 + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
	}

/* kukac string feloldás */
function eMailReplace()
	{
		var replaces = 0;
		var alltags = document.all ? document.all.tags("span") : document.getElementsByTagName("*");
		for (i=0; i < alltags.length; i++) {
			if (alltags[i].className == 'e-mail') {
				while (alltags[i].innerHTML.indexOf('#e-mail-kukac#') != -1 && replaces < 10000) {
					alltags[i].innerHTML = alltags[i].innerHTML.replace('#e-mail-kukac#', String.fromCharCode(64));
					replaces++;
				}
			}
		}
	}

/* szám string konvertálás (XSLT-vel való kapcsolathoz kell) */
function numberToString(n)
	{
		var res = n;
		if (n < 10)  res = '0' + n;
		return res;
	}

/* form és select link url beállítás */
function getElement(obj)
	{
		return document.getElementById(obj);
	}

function changeFormAction()
	{
		var form_id = 'header_form';
		var select_id = 'header_select';
		getElement(form_id).action = getElement(select_id).options[getElement(select_id).selectedIndex].value;
	}
/* -------------------------------------------------------------------------- */
/* --- USEFUL 2                                                           --- */
/* -------------------------------------------------------------------------- */




/* -------------------------------------------------------------------------- */
/* --- USEFUL 3                                                           --- */
/* --- Hasznos függvények 3: Középső hasáb méretének 100%-ra állítása     --- */
/* -------------------------------------------------------------------------- */
function setAreasHeight()
	{
		var body_height = document.body.clientHeight;
		var header_height = getObjectHeight("header");
		var footer_height = getObjectHeight("footer");
		var minus_sum = header_height + footer_height + 1
		var areas_height = body_height - minus_sum;

		getElement("areas_td").style.height = eval(areas_height) + "px";
		getElement("areas_table").style.height = eval(areas_height) + "px";
	}
function setLastModifyDateHeight()
	{
		var lastmodifydate_div_exist = document.getElementById("lastmodifydate_div") != null;
		if (lastmodifydate_div_exist == true)
			{
				var areas_height_new = getObjectHeight("areas_td");
				var lastmodifydate_top = getObjectTop("lastmodifydate_div");
				var lastmodifydate_height = 30;
				var lastmodifydate_height_calculated = areas_height_new - lastmodifydate_top -16;

				getElement("lastmodifydate_div").style.height = eval(lastmodifydate_height_calculated) + "px";
				getElement("lastmodifydate_td").style.height = eval(lastmodifydate_height_calculated) + "px";
			}
	}
/* -------------------------------------------------------------------------- */
/* --- USEFUL 3                                                           --- */
/* -------------------------------------------------------------------------- */




/* -------------------------------------------------------------------------- */
/* --- INITIALIZATION                                                     --- */
/* --- Onload, onresize autómatikus függvények                            --- */
/* -------------------------------------------------------------------------- */
var documentinit_onresize_set = false;
var documentinit_running = false;
var documentinit_last_run_time = 0;
function DocumentInit()
	{
		if (documentinit_running || documentinit_last_run_time + 5000 > new Date().getTime())
			{
				return;
			}
		documentinit_running = true;
			{
				setAreasHeight();
				setLastModifyDateHeight();
			}
			if (documentinit_onresize_set == false && window.attachEvent)
				{
					window.attachEvent("onresize",DocumentInit);
				}
			documentinit_onresize_set = true;
		documentinit_last_run_time = new Date().getTime();
		documentinit_running = false;
	}

/* MOZILLA, OPERA */
if (window.addEventListener)
	{
		window.addEventListener("load",DocumentInit,false);
		window.addEventListener("resize",DocumentInit,false);
	}
/* EXPLORER */
else if (window.attachEvent)
	{
		window.attachEvent("onload",DocumentInit);
	}
/* -------------------------------------------------------------------------- */
/* --- INITIALIZATION                                                     --- */
/* -------------------------------------------------------------------------- */
