function $( name ) {
    return document.getElementById(name);
}

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 showConnects(div) {
	document.getElementById(div).style.display = document.getElementById(div).style.display == 'none' ? 'block' : 'none';
}

function submitForm(id,formid) {
    if ( document.getElementById(id).value == '' ) { 
        alert('Keresőszót meg kell adni!');
        document.getElementById(formid).submit.disabled = true; 
		return false;
    }; 
}

var products = 1;
function productsTree( num ) {

	if (document.getElementById('products') != null)
	{		
		$('products'+products).style.display = 'none';
		$('a'+products).style.fontWeight = 'normal';
	}
    
    $('products'+num).style.display = 'block';	
    $('a'+num).style.fontWeight = 'bold';

    products = num;
}

var tg = 1;
function toggle( num ) {

	/*if (document.getElementById('products') != null)
	{		
		$('products'+products).style.display = 'none';
		$('a'+products).style.fontWeight = 'normal';
	}*/
    
    $('b'+num).style.display = 'block';	
	$('b'+tg).style.display = 'none';	

    tg = num;
}
