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();
}

// show menu

function show(sid,mid) {
    var main = document.getElementById('main_'+mid);
    var sub = document.getElementById('sub_'+sid);
    var display = sub.style.display;
    var clss = main.className;

	if ( (mid != 1 &&  mid != 2) || (sub.style.display != 'block' && sub.style.display != '') ) {
		sub.style.display = (display == "block") ? "none" : "block";
		main.className = (clss == "current") ? "" : "current";

		if ( mid == 1 ) {
			main = document.getElementById('main_2');
			sub = document.getElementById('sub_2');
			sub.style.display = "none";
			main.className = "";
		}

		if ( mid == 2 ) {
			main = document.getElementById('main_1');
			sub = document.getElementById('sub_1');
			sub.style.display = "none";
			main.className = "";
		}

	}

}

var elOffer = null;

function stepOffers(type) {
	elOffer.oWindow.stepOffer(type);
}

function setStepOffer(num) {
	elOffer.oWindow.setStepOffer(num);
}

function isCount(id,form)
{
    if ( document.getElementById(id).value == '' || document.getElementById(id).value == 0 ) {
        alert('A kosárba helyezés előtt a darabszámot meg kell adni!');
    } else {
        submit();
    }
};
