var ajax_mode=0; 
var p1,p2,p3,p4;
function emoticon(text) {
   if (text=='[youtube]')
   {
     var yt;

     yt=document.getElementById("youtube").value;
    if (yt.length<11)
      return;
    text= ' [youtube]' + yt + '[/youtube] \n';
   }
   else if (text=='[HHhu]')
   {
     var yt;
     var hhses;
     yt=document.getElementById("HHhu").value;
     if (document.getElementById("HHsession").checked)
       text= ' [HHhu]' + yt + '/ses[/HHhu] \n';
     else
       text= ' [HHhu]' + yt + '[/HHhu] \n';

   }

   else if (text=='[href]')
   {
      var lu,lt;     
      lu=document.getElementById("linkurl").value;
      lt=document.getElementById("linktext").value;
      if (lu.indexOf(".")==-1)
            return;
      if (lu.indexOf("http://")==-1)
            lu='http://'+lu;
      if (lu.length<12 || lt.length<1)
           return;
      text='<a href=' + lu + '> ' + lt + ' </a>';
      document.getElementById("linkurl").value="http://";
      document.getElementById("linktext").value="Link szövege";
   }
   else if (text=='[img]')
   {
      var iu;     
      iu=document.getElementById("imgurl").value;
      if (iu.indexOf(".")==-1)
            return;
      if (iu.indexOf(".jpg")==-1 && iu.indexOf(".gif")==-1 && iu.indexOf(".png")==-1)
            return;
      if (iu.indexOf("http://")==-1)
            iu='http://'+iu;
      if (iu.length<12)
           return;
      text='<img src=' + iu + '> ';
      document.getElementById("imgurl").value="http://";
   }
   else
    text = ' ' + text + ' ';
   if (document.nw.hozzaszolas.createTextRange && document.nw.hozzaszolas.caretPos) {
     var caretPos = document.nw.hozzaszolas.caretPos;
	caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
	document.nw.hozzaszolas.focus();

    } else {
	document.nw.hozzaszolas.value  += text;
        document.nw.hozzaszolas.focus();
    }
}

function storeCaret(textEl) {
    if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
    }
    
function Cl(tx)
{
  return confirm(tx);
  }

function backgrd(link){
   document.getElementById("hatterprg").src=link+"&t="+Date();
   return false;
}

function modprg(link,oh){
 var c;
 c=document.getElementById("modsel"+oh).value;
 document.getElementById("hatterprg").src=link+"&modok="+c+"&t="+Date();
}

function errorprg(link){
 var c,d;
 c=document.getElementById("ecode").value;
 d=document.getElementById("ecom").value;
 document.getElementById("hatterprg").src=link+"&ecode="+c+"&ecom="+d+"&t="+Date();
}

var md1=0;
var md2=0;

function clsfld(mode){
 if (mode==1 && md1==0)  
 {
   lgn.neved.value='';
   md1=1;
 }
 if (mode==2 && md2==0)
 { 
   lgn.jelszo1.value='';
   md2=1;
  }
 if (mode==3)
 { 
   menusrch.srmit.value='';
   md2=1;
  }

}

function shwhidden(id,txt){
 document.getElementById("kat"+id).innerHTML=txt;
   return false;

}

function shwhidden_box(id,txt){
 document.getElementById("box"+id).innerHTML=txt;
   return false;

}


var outnr=0;

function textscroll() {

 if (maxout==0)
   return;
 if (outnr>maxout)
       outnr=0;
  
 document.getElementById("advtext").innerHTML='<li class=boldsticky><a href=poker-akciok> '+out[outnr]+' </a></li>';
 outnr++;
 setTimeout("textscroll()",1990);
}


function GaleriaChk()
{

 if (document.upl.keptipus.value==-1)
 {
   alert('Válassz kategóriát!');
   return false;
 } 
  return true;
}

function TopikChk()
{

 if (document.nw.kat.value==-1)
 {
   alert('Válassz kategóriát!');
   return false;
 } 
  return true;
}

function userfilter(id){
 document.getElementById("aa_"+id).style.display='none';
 document.getElementById("hsz_"+id).style.display='';
   return false;

}

function kibekapcs(ki,be){
 document.getElementById(ki).style.display='none';
 document.getElementById(be).style.display='';
   return false;
}

function kibekapcs2(ki1,ki2,ki3,be){
if (ki1!=0)
 document.getElementById(ki1).style.display='none';
if (ki2!=0)
 document.getElementById(ki2).style.display='none';
if (ki3!=0)
 document.getElementById(ki3).style.display='none';
 document.getElementById(be).style.display='';
   return false;
}


var mz='';
var stp=0;
var tmr;

function atkapcsolas(mezo){
 if (document.getElementById(mezo).style.display=='none')
   document.getElementById(mezo).style.display='';
 else
   document.getElementById(mezo).style.display='none';
 return false;
}


function bekapcsolas(mezo){
   document.getElementById(mezo).style.display='';
 return false;
}
function kikapcsolas(mezo){
   document.getElementById(mezo).style.display='none';
 return false;
}

function kikapcsolas2(mezo,ido){
if (stp==1){
 stp=0; return false;
}
mz=mezo;
tmr=setTimeout('kikapcsolas(mz)',ido);
}



function ajax(inp,pp) {
 var http_request=false;
 if (window.XMLHttpRequest) {
  http_request=new XMLHttpRequest();
  if (http_request.overrideMimeType) {
   http_request.overrideMimeType('text/html');
  }
 }
 else if (window.ActiveXObject) {
  try {
   http_request=new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch (e) {
   try {
    http_request=new ActiveXObject("Microsoft.XMLHTTP");
   }
   catch (e) {}
  }
 }

 if (!http_request) {
  alert("Feladtam :( Nem tudok XMLHTTP példányt létrehozni");
  return true;
 }
 http_request.onreadystatechange=function () { showContents(http_request,inp); };
 htp=pp+ '&' + Math.random();

 http_request.open("GET",htp,true);
 http_request.send(null);
 return false;
}

function showContents(http_request,inp) {
 if (http_request.readyState==4) {
  if (http_request.status==200) {
     if (http_request.responseText!='nope'){
          document.getElementById(inp).innerHTML=http_request.responseText;
          if (ajax_mode==1)
             fociliga();
          else if (ajax_mode==2)
          {
            document.body.style.cursor = "default"; 
            ajax_mode=0;
          } 
          else if (ajax_sort)
             ligasrt();  

     }
     else{
        document.body.style.cursor = "default"; 
        ajax_mode=0;
     }
  }
  else {
//   alert("Valami gond van a kéréssel. ("+http_request.status+")");
   return false;
  }
 }
}

function ajax_hivo(inp,pp,mode) {
 if (ajax_mode)
 {
   alert('Varj, mig vege az elozo muveletnek!')
   return false;
 }
 ajax_mode=mode; 
 document.body.style.cursor = "wait";
 ajax(inp,pp);
 return false;
}

function ajax_hivo2(inp,pp,id,max) {
 for(i=1;i<=max;i++) 
   document.getElementById('od'+i).style.backgroundColor='lightgrey';
 document.getElementById('od'+id).style.backgroundColor='white';
 ajax(inp,pp);
 document.getElementById('oddstable').scrollTop=0;
 return false;
}


ajax_sort=0;


function ajax_sr(inp,pp) {

 ajax_sort=1;
 document.body.style.cursor = "wait";
 if (document.getElementById('poz1').style.display=='none')
   p1='none';
 else
   p1='';
 if (document.getElementById('poz2').style.display=='none')
   p2='none';
 else
   p2='';
 if (document.getElementById('poz3').style.display=='none')
   p3='none';
 else
   p3='';
 if (document.getElementById('poz4').style.display=='none')
   p4='none';
 else
   p4='';
 ajax(inp,pp);
 return false;
}

function ligasrt(){
document.getElementById('poz1').style.display=p1;
document.getElementById('poz2').style.display=p2;
document.getElementById('poz3').style.display=p3;
document.getElementById('poz4').style.display=p4;
document.body.style.cursor = "default"; 
ajax_sort=0;

return false;
}


function fociliga() {

 a=document.getElementById('good_db').value;
 for(i=1;i<=a;i++)
 {
   jat=document.getElementById('good'+i).value;
   document.getElementById('a'+jat).style.display='';
   document.getElementById('b'+jat).style.display='none';
 }  
 a=document.getElementById('bad_db').value;
 for(i=1;i<=a;i++)
 {
   jat=document.getElementById('bad'+i).value;
   document.getElementById('a'+jat).style.display='none';
   document.getElementById('b'+jat).style.display='';
 }  
 ajax_mode=0;
 document.body.style.cursor = "default"; 
 return false;

 
}

var chat_start=0;

function chatscroll(qq)
{
   chat_start=chat_start+qq;

  if (chat_start<0)
    chat_start=0;
  if (chat_start>1000)
    chat_start=1000;

  ajax('chatbox','kulso/_chat.php?start='+chat_start+'&szoveg=');
//  chat_start=parseInt(document.getElementById("qw").value);
  return false;
}

function chatfunc()
{
  c=document.getElementById("szvg").value;
  chat_start=0;
  ajax('chatbox','kulso/_chat.php?start=0&szoveg='+c);
  document.getElementById("szvg").value="";
  return false;
}


function delchat(id)
{
  ajax('chatbox','kulso/_chat.php?start='+chat_start+'&del='+id+'&szoveg=');
  return false;
}

function showchatbox()
{
  ajax('chatbox','kulso/_chat.php?start='+chat_start+'&szoveg=');
  setTimeout("showchatbox()",10000);
  return false;

}




var schat_start=0;

function schatscroll(qq)
{
   schat_start=schat_start+qq;

  if (schat_start<0)
    schat_start=0;
  if (schat_start>1000)
    schat_start=1000;

  ajax('schatbox','kulso/_schat.php?start='+schat_start+'&szoveg=');
//  chat_start=parseInt(document.getElementById("qw").value);
  return false;
}

function schatfunc()
{
  c=document.getElementById("szvg").value;
  schat_start=0;
  ajax('schatbox','kulso/_schat.php?start=0&szoveg='+c);
  document.getElementById("szvg").value="";
  return false;
}



function showschatbox()
{
  ajax('schatbox','kulso/_schat.php?start='+schat_start+'&szoveg=');
  setTimeout("showschatbox()",6000);
  return false;

}

function supportbox()
{
  ajax('supportbox','kulso/_support.php?start='+schat_start+'&szoveg=');
  setTimeout("supportbox()",10000);
  return false;

}

var supportid=0;
function support(as)
{
  if (as)
    supportid=as;

  ajax('supportkliensbox','kulso/_supportkliens.php?id=' + supportid );
  setTimeout("support(0)",6000);
  return false;
}

function support1(as)
{
  if (as)
    supportid=as;

  ajax('supportkliensbox','kulso/_supportkliens.php?id=' + supportid );
  supporttime=900;
  return false;
}



function supportfunc()
{
  c=document.getElementById("szvg").value;
  ajax('supportkliensbox','kulso/_supportkliens.php?id='+supportid+'&start=0&szoveg='+c);
  ajax('supportbox','kulso/_support.php?start='+schat_start+'&szoveg=');
  document.getElementById("szvg").value="";
  supporttime=900;
  return false;
}


supporttime=900;

function supporttimefunc()
{
  document.getElementById("supporttime").value=supporttime;
  if (supporttime==0)
    location.href = "http://www.onlinepokerhu.com/poker/support-out";
  supporttime-=5;
  setTimeout("supporttimefunc()",5000);
  return false;
}








var scrolltimer = 0;
function scroll( p, o, dir )
 {

 document.getElementById( o ).style.top = Math.max( -document.getElementById( o ).scrollHeight + document.getElementById( p ).clientHeight, Math.min( ( parseInt( document.getElementById( o ).style.top ) + ( 2 * dir ) ), 0 ) ) + 'px';
 what = ( dir > 0 ? 'scrollUp( \'' + p + '\', \'' + o + '\' )' : 'scrollDown( \'' + p + '\', \'' + o + '\' )' );
 scrolltimer = setTimeout( what, 4 );
 return false;
 }

 function scrollUp( p, o ) { return scroll( p, o, 1 ); }
 function scrollDown( p, o ) { return scroll( p, o, -1 ); }

 function clearScroll() { window.clearTimeout( scrolltimer ); }

var Timer;
function ScrollUp_b()
{
  Timer = setInterval("document.getElementById('oddstable').scrollTop -= 2", 15);
}
function ScrollDown_b()
{
  Timer = setInterval("document.getElementById('oddstable').scrollTop += 2", 15);
}

function bgcol(cl,id) {
 for(i=1;i<=4;i++)
     document.getElementById(id+'_'+i).style.backgroundColor=cl;
}


function oddstable()
{
//  ajax('oddstable','sportodds/h.htm?');
  ajax('oddstable','kulso/__oddsload.php?');
  return false;
}


/***********************************************
* Pop-it menu- c Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/


////No need to edit beyond here

var ie5=document.all && !window.opera
var ns6=document.getElementById
var a="";
var b="";

function showmenu(tx,margin){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=document.getElementById("popitmenu")
menuobj.innerHTML=tx
menuobj.style.left=margin
menuobj.style.visibility="visible"
document.getElementById('hideunibet').style.visibility="hidden"
if (ie5){
document.getElementById('hideme').style.visibility="hidden"
document.getElementById('hideme2').style.visibility="hidden"
document.getElementById('hideme3').style.visibility="hidden"
document.getElementById('hideme4').style.visibility="hidden"
}
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
document.getElementById('hideunibet').style.visibility="visible"
if (ie5){
document.getElementById('hideme').style.visibility="visible"
document.getElementById('hideme2').style.visibility="visible"
document.getElementById('hideme3').style.visibility="visible"
document.getElementById('hideme4').style.visibility="visible"
}

}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu




