function popup(url,name,width,height,position,wplus,hplus,focus,left,top,menubar,status,toolbar,scrollbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

		var winleft = (screen.width - width) / 2;
		var wintop = (screen.height -  height) / 2;

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+winleft+',top='+wintop+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

function confirmMsg(msg) {
	var con = confirm(msg);
	if (con) return true;
	else return false;
}

function addEvent(obj, evType, fn, useCapture) {
	if (obj.addEventListener) {
		obj.addEventListener(evType,fn,useCapture);
		return true;
	} else if(obj.attachEvent){
		return obj.attachEvent("on"+evType,fn);
	} else {
		return false;
	}
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if (node == null) node = document;
	if (tag == null) tag = '*';
	var elems = node.getElementsByTagName(tag);
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	var i = 0;
	for (var j = 0; j < elems.length; j++) {
		if ( pattern.test(elems[j].className) ) {
			classElements[i++] = elems[j];
		}
	}
	return classElements;
}

function collapsible() {
	var collap = getElementsByClass("collapsible",null,"div");
	if (collap) {
		for(i in collap) {
			var dt = collap[i].getElementsByTagName("dt");
			for(j in dt) {
				dt[j].onclick = function() {
					this.parentNode.className = this.parentNode.className?'':'active';
					return false;
				}
			}
		}
	}
}

addEvent(window, 'load', collapsible);

function langalert(lang) {
	if ( lang == 'en') {
		alert('This website is under construction!\nPlease visit later!');
	}
	if ( lang == 'de') {
		alert('An dieser Website wird gerade gebaut.\nBitte schauen Sie später noch einmal vorbei.');
	}
}

function downloadConfirmMsg(FirmName) {
	var downloadConfirm = confirm('A letöltött anyagokért (fájlokért) vagy a megjelenített információkért a(z) '+ FirmName +' nem vállal felelőséget!\nAz Adatvédelem menüpontban leírtakat tudomásul veszem!\nA folytatáshoz kattintson az OK gombra, megszakításhoz a Mégse gombra!');
	if (downloadConfirm) return true;
	else return false;
}

function downloadConfirmMsgDe(FirmName) {
	var downloadConfirm = confirm('Für die runtergeladenen Files oder Informationen wird keine Haftung genommen. Ich nehme die Bedingungen in der Menüpunkt Datenschutz zur Kenntnis. Um weiterzumachen klicken Sie auf OK, um unterzubrechen auf die Taste Mégse.');
	if (downloadConfirm) return true;
	else return false;
}

function downloadConfirmMsgEn(FirmName) {
	var downloadConfirm = confirm(FirmName +' does not take the responsibility for downloaded materials (files) or represented information. I approve the issues in Data protection menu! Click on OK to continue and on Cancel to break off.');
	if (downloadConfirm) return true;
	else return false;
}

var old_div_02 = '';
var is_opened  = 'none';

function toggle( div ) {

    div_obj = document.getElementById(div);
    is_opened = div_obj.style.display;

	if (div != 'a01')
	{
		document.getElementById('a01').style.display = 'none';
	}

    if (old_div_02 != '' && is_opened == 'none') {
        old_div_obj = document.getElementById(old_div_02);
        old_div_obj.style.display = 'none';
    }

    if (old_div_02 != div || is_opened == 'none') {

        div_obj.style.display = 'block';
    }

    old_div_02 = div;
}

