function popup(url,name,width,height,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 popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+left+',top='+top+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

var old_div = '';
var old_link = '';
var is_opened  = 'none';

function toggle( div ) {

    div_obj = document.getElementById('a'+div);
	link_obj = document.getElementById('l'+div);
    is_opened = div_obj.style.display;

	if (div == old_div)
	{
		return false;
	}

	if (div != 'a1')
	{
		document.getElementById('a1').style.display = 'none';
		document.getElementById('l1').className = '';
	}

    if (old_div != '' && is_opened == 'none') {
        old_div_obj = document.getElementById('a'+old_div);
		old_div_obj.style.display = 'none';
		old_link_obj = document.getElementById('l'+old_div);
		old_link_obj.className = '';
    }

    if (old_div != div || is_opened == 'none') {

        div_obj.style.display = 'block';
		link_obj.className = 'hover';
    }

    old_div = div;
}

function divHide(count) {
	for (i=2; i<=count; i++)
	{
		document.getElementById('a'+i).style.display = 'none';
	}
}

function checkCapsLock(e) {

	//Billentyű kód lekérése
	var KeyCode = e.which ? e.which : ( e.keyCode ? e.keyCode : ( e.charCode ? e.charCode : 0 ) );
	//Shift lenyomásának figyelése
	var ShiftKey = e.shiftKey || ( e.modifiers && ( e.modifiers & 4 ) ); //3. bit figyelése

	//Ha nagybetűt ír és nincs lenyomva a shift vagy pedig ha kisbetűt ír és le van nyomva a shift riaszt
	if ( ( ( KeyCode >= 65 && KeyCode <= 90 ) && !ShiftKey ) || ( ( KeyCode >= 97 && KeyCode <= 122 ) && ShiftKey ) ) {
		showMessages();
	}
}

function showMessages() {
    document.getElementById('CapsLockMsg').style.display = 'block';
	setTimeout(function() {document.getElementById('CapsLockMsg').style.display = 'none';} , 3000);
}
