
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();
}

function copyField(from, to) {
  document.getElementById(to).value = document.getElementById(from).value;
}

function set(input) {

  input.value = '';
}

function leave(input) {

  input.value = (input.value == '') ? input.defaultValue : input.value;
}
function changeImage(img, img_src) {

  img.src = img_src;
}

function calendar_show (id) {
	document.getElementById(id).style.display = 'block';
	document.getElementById('calendar_actual').style.display = 'none';
}

function calendar_hide (id) {
	document.getElementById(id).style.display = 'none';
	document.getElementById('calendar_actual').style.display = 'block';
}

function border_over(image) {
	image.style.border = '3px solid #FF9E0F';
	image.style.cursor = 'pointer';
}

function border_out(image) {
	image.style.border = '3px solid #E5ECF1';
	image.style.cursor = 'pointer';
}

function ConfirmDel(form)
{
  var c = 0;

  if (!document.forms[form].elements['todelete[]']) {
    alert('Nincs kijelölhető / törölhető tétel!');
    return false;
  }

  for ( i=0; i<document.forms[form].elements['todelete[]'].length; i++)
    if (document.forms[form].elements['todelete[]'][i].checked)
      c++

  if (document.forms[form].elements['todelete[]'].checked)
    c++;

  if (c<1) {
    alert('Nincs kijelölt tétel!');
    return false;
  }

  if(confirm('Figyelem: véglegesen akarja törölni a kijelölt tételeket.\nOK a folytatáshoz.'))
	  return true;
	else
	  return false;
}



var imageModify = new Array();

function openImageModify(method, image, width, height) {

  imageModify['method'] = method;
  imageModify['image'] = image;
  imageModify['width'] = width;
  imageModify['height'] = height;

  var wo = window.open('?base=imagemodify','','menubar=yes,left=100,top=100,width=750,height=480');
}

