function showTip(obj,text) {
  var width=window.innerWidth;
  if(document.body.clientWidth) {
    width=document.body.clientWidth;
  }
  document.getElementById('tip').innerHTML=text;
  document.getElementById('tip').style.display="block";
  var offset = getRealOffset(obj);
  if(offset[0]>width-document.getElementById('tip').offsetWidth) {
    document.getElementById('tip').style.left=((offset[0]+offset[2])-document.getElementById('tip').offsetWidth)+"px";
  } else {
    document.getElementById('tip').style.left=offset[0]+"px";
  }
  document.getElementById('tip').style.top=(offset[1]+offset[3]+20)+"px";
}


function hideTip(text) {
document.getElementById('tip').style.display="none";
}


function getRealOffset(object) {
var offset = new Array(0,0,0,0);
   offset[2] = object.offsetWidth;
   offset[3] = object.offsetHeight;
while(object) {
offset[0]+= object.offsetLeft;
offset[1]+= object.offsetTop;
offset[1]-= object.scrollTop;
object = object.offsetParent;
}
return offset;
}

function confirm_del() {
  if (document.getElementById('del').checked==true) {
    var del=confirm('Wirklich löschen?\nDie Aktion kann nicht rückgängig gemacht werden!');
    if (del) {
      return true;
    } else {
      document.getElementById('del').checked=false;
      return false;
    }
  } else {
    return true;
  }
}

function confirm_del_link() {
  return confirm('Wirklich löschen?\nDie Aktion kann nicht rückgängig gemacht werden!');
}

function popup_info (url) {
  window.open('index.php?p=help&nr='+url,"Hilfe zur GHC Homepage","width=500,height=375,left=400,top=400");
}
