
//Confirm delete
function confirmDelete(delUrl) {
  if (confirm("Biztos benne, hogy törli a kijelölt tartalmat?")) {
    document.location = delUrl;
  }
}

//TOOLTIP
function tooltip(d,E,b,i,a){
  d=document;E=d.documentElement;b=d.body;if(!E)return;
  for(i=0;a=b.getElementsByTagName("a")[i];i++){
    if(a.title){
      with(a.t=d.createElement("div")){
        id="tooltip"
        innerHTML=a.title.replace(/\|/g,"<br />")
      }
      a.onmouseover=function(e){
        with(this){title="";onmousemove(e)}
        b.appendChild(this.t)
      }
      a.onmouseout=function(x){
        with(this){title=t.innerHTML.replace(/<br \/>/g,"\|")}
        if(x=d.getElementById("tooltip"))b.removeChild(x)
      }
      a.onmousemove=function(e){
        e=e||event;with(this.t.style){
//         left=e.clientX+(E.scrollLeft||b.scrollLeft)+"px"
//         top=e.clientY+(E.scrollTop||b.scrollTop)+"px"
         left=e.clientX+(E.scrollLeft||b.scrollLeft) - Math.max(0, 0-((E.clientWidth||b.parentNode.clientWidth)-e.clientX-this.t.offsetWidth)) +"px"
         top=e.clientY+(E.scrollTop||b.scrollTop) - Math.max(0, 20-((E.clientHeight||b.parentNode.clientHeight)-e.clientY-this.t.offsetHeight)) +"px"
        }
      }
    }
  }
}
function addEvent(O,E,F,x){
  return(x=O.addEventListener)?x(E,F,1):(x=O.attachEvent)?x('on'+E,F):!1
}
addEvent(window,'load',tooltip);

// Betűméret növelés
/*
function zoomContent(inc)
{
  o = document.getElementById("realcontent");
  if (!o) return;
  
  if (inc == 0)
  {
    o.style.fontSize = "1em";
  }
  else
  {
    if (o.style && o.style.fontSize)
      var fs = parseFloat(o.style.fontSize);
    else
      var fs = 1.0;

    fs += inc*0.1;

    if (fs > 0.7 && fs < 1.4) o.style.fontSize = fs + "em";
  }
}
*/
var zoomState = 0;
function zoomContent(inc)
{
  if (((zoomState+inc) > 3 || (zoomState+inc) < -3) && inc != 0) { return; }

  if (inc == 0)
  {
    tmp = ((zoomState < 0)?(-1)*zoomState:zoomState);
    var x = (-1)*zoomState/tmp;
    for (i=0; i<tmp; i++)
    {
      zoomContent(x);
    }
    zoomState = 0;
  }
  else
  {
    zoomState += inc;
    o = document.getElementById("realcontent");
    zoomElement(o, inc);
  }
}

function zoomElement(o, inc)
{
  if (o.textContent != "")
  {
    if (o.style && o.style.fontSize)
    {
      o.style.fontSize = parseInt(o.style.fontSize) + inc + "px";
    }
    else
    {
      try
      {
        o.style.fontSize = (12+inc) + "px";
      }
      catch (e)
      {
        //alert(o.nodeName);
      }
    }
  }
  if (o.nodeType == 1 && o.hasChildNodes())
  {
    for (x in o.childNodes)
    {
      zoomElement(o.childNodes[x], inc);
    }
  }

}



function ujablak(ujablak)
{
	var width_popup=480;
	var H = (screen.height - width_popup) / 2;
	var height_popup=640;
	var L = (screen.width - height_popup) / 2;
	pop_up = window.open(ujablak,"Popup","status=no,scrollbars=no,resizable=yes,height="+width_popup+",width="+height_popup+",top="+H+",left="+L);
}
