function deleteItem(TYPE,DID) {
	if (TYPE == "category")
	  var delItem = confirm("POZOR!!!\n\nSi si istý, že chceš vymazať celú kategóriu?\n\nVymazaním sa stratia všetky údaje zaradené\ndo tejto kategórie.");
	if (TYPE == "link")
	  var delItem = confirm("POZOR!!!\n\nSi si istý, že chceš tento link?\n\nVymazaním sa tieto údaje stratia\nSi si istý?");
	if (delItem == true) {
	  if (TYPE == "category") document.location.href = "actions.php?cmd=dcategory&id=" + DID;
	  if (TYPE == "link") document.location.href = "actions.php?cmd=dlink&id=" + DID;
	}
}


function openURL(URL,w,h,menubar,statusbar,SCROLL) {
  var y = (screen.height-h)/2;
  var x = (screen.width-w)/2;
  if (y < 0) y = 0;
  if (x < 0) x = 0;
  options = 'menubar='+menubar+',toolbar=no,directories=no,location=no,status='+statusbar+',scrollbars='+SCROLL+',resizable=no,width='+w+',height='+h+',top='+y+',left='+x;
  window.open (URL, "openwin", options);
}


function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function Validate(theForm) {
  for(var i=0; i<theForm.length; i++ ) {
    with(theForm.elements[i]) { 
      if( type=="text" ) {
        if( value.length==0) {
          focus();
          return false; 
        }
      }
    }
  }
  return true;
}

function zkontroluj_email(adresa)
{
  re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;
  return adresa.search(re) == 0;
}

function skontroluj_formular(theForm)
{
  if (!Validate(theForm)) {
    alert('Vyplňte prosím potrebné údaje!');
    return false;
  }
  if (!zkontroluj_email(theForm.from.value))
  {
    alert("Vaša e-mail adresa nie je správna!");
    return false;
  }
  return true;  
}
