var hintcontainer = null;   

function showhint(obj, txt) {
   if (hintcontainer==null) {   
      hintcontainer = document.createElement("div");   
      hintcontainer.className="hintstyle";   
      document.body.appendChild(hintcontainer);   
   }   
   obj.onmouseout = hidehint;   
   obj.onmousemove=movehint;   
   hintcontainer.innerHTML=txt;   
}   
function movehint(e) {   
    if (!e) e = event; //line for IE compatibility   
    hintcontainer.style.top =  (e.clientY+document.documentElement.scrollTop-24)+"px";   
    hintcontainer.style.left = (e.clientX+document.documentElement.scrollLeft-24)+"px";   
    hintcontainer.style.display="";   
}   
function hidehint() {   
   hintcontainer.style.display="none";   
}   

function postit_focus(id) {
  var savebtn=wg_getobj("savebtn_"+id);
  var doboz=wg_getobj("postit_"+id);
  savebtn.src='/images/icons/save_sel.gif';
  if (doboz.value=='Írj megjegyzést! Majd mentsd el!') {
     doboz.select();
	}
}

function setpostit(id,szoveg) {
  var doboz=wg_getobj("postit_"+id);
  doboz.value=szoveg;
}

function postit_save(id) {
  var doboz=wg_getobj("postit_"+id);
  wgo_ajax('/ajax/postit_save.php','&szoveg='+wgescape(doboz.value)+'&id='+wgescape(id),postit_save_success,postit_save_error,doboz);
}

function postit_save_success(html,obj) {
   var reszek=new Array();
   reszek=html.split('|',2);
   if (reszek[0]=='REGHIBA') {
      var wgcache=wg_getobj("wgcache_hirdetes_ids");
      wgshowdialog('regform','/ajax/loginform.php','wgcache_hirdetes_ids='+wgescape(wgcache.value)+'&id='+wgescape(reszek[1]),0,400,300,'center','center');
   } else {
	    alert('Kész');
	 }
}

function postit_save_error(http,obj) {
  alert("Valami hiba történt, próbáld újra pár perc múlva.");
}
