var id=0,bid=0,lo=null,is="",bis="",se="",pr='<td onmousedown="md(this)" onmouseup="bn(this)" onmouseover="ov(this)" onmouseout="bn(this)" class="but" onclick=';

function ov(o)
{
  o.id="butOver";
}

function md(o)
{
  o.id="butDown";
}

function bn(o)
{
  o.id="";
}

function hr(o)
{
        if(o)o.click();
}

function b(t,u,c,tt)
{
  is="a"+(id++);
  document.write(pr+'"hr('+is+')"><a id='+is);
  if(tt)document.write(" title='"+tt+"'");
  document.write(' target='+t+' href="'+u+'">&nbsp;'+c+'&nbsp;</a></td>');
}

function bjs(t,js,c,tt)
{
  document.write(pr+'"'+js+'"><a href="#" onclick="'+js+'">&nbsp;'+c+'&nbsp;</a></td>');
}

function b2(t,u,c,s)
{
  is="a"+(id++);
  document.write(pr+'"hr('+is+')" colspan='+s+'><a id='+is+' target='+t+' href="'+u+'">&nbsp;'+c+'&nbsp;</a></td>');
}

function s(f,c)
{
  document.write(pr+'"document.getElementById(\''+f+'\').submit()" style="cursor:hand">&nbsp;&nbsp;'+c+'&nbsp;</td>');
}

function a(u,c,t)
{
  is="a"+(id++);
  document.write(pr+'"hr('+is+')" title="'+t+'"><a id='+is+' href="'+u+'" class=icon>&nbsp;'+c+'&nbsp;</a></td>');
}

function p(u,c,t,m)
{
  is="a"+(id++);
  document.write(pr+'"hr('+is+')" title="'+t+'"><a id='+is+' onclick="return confirm(\''+m+'\')" href="'+u+'" class=icon>&nbsp;'+c+'&nbsp;</a></td>');
}


function ct()
{
  tc=document.getElementById('ctf');
  if(tc)
  {
    var i=document.getElementsByTagName("input")
    var c=0;
    for(j=0;j<i.length;j++){if(i[j].type=="checkbox"){if(i[j].checked)c++;}}
    tc.style.display=c>0?'inline':'none';
  }
}

function ci(i)
{
  ic=document.getElementById('c'+i);
  with(ic)
  {
    style.display=style.display=='none'?'inline':'none';
    checked=checked?false:true;
    ct();
  }
}
function e(f,i,an)
{
        with(document)
        {
          write('<div align=right style="width:100%"><table id=m'+i+' style="visibility:hidden"><tr><td class=ei><a name="cid'+i+'"></a><a href="diyar.php?process=eid&eid='+i+'">( #'+i+' )</a></td>');
                  document.write('<td>&nbsp;</td>');
				  a("javascript:od('diyar.php?process=arti&id="+i+"')","+","+");
                  a("javascript:od('diyar.php?process=eksi&id="+i+"');","-","+");
                  document.write('<td>&nbsp;</td>');
                  a("javascript:od('diyar.php?process=popupmsg&islem=yenimsj.popup&gkime="+an+"&eid="+i+"','400','250');","msg","mesaj");
                  a("javascript:od('diyar.php?process=ben&kim="+an+"','350','400')","?","kim?");


		  document.write('<td>&nbsp;</td>');
          write('</tr></table></div>');
          var d=getElementById('d'+i);
          var m="document.getElementById('m"+i+"').style.visibility=";
          d.onmouseover=new Function(m+"'visible'");
          d.onmouseout=new Function(m+"'hidden'");
        }
}
function e_mod(f,i,an,sr)
{
        with(document)
        {
          write('<div align=right style="width:100%"><table id=m'+i+' style="visibility:hidden"><tr><td class=ei><a name="cid'+i+'"></a><a href="diyar.php?process=eid&eid='+i+'">( #'+i+' )</a></td>');
				  a("javascript:od('diyar.php?process=arti&id="+i+"')","+","+");
                  a("javascript:od('diyar.php?process=eksi&id="+i+"');","-","+");
                  document.write('<td>&nbsp;</td>');
                  a("javascript:od('diyar.php?process=popupmsg&islem=yenimsj.popup&gkime="+an+"&eid="+i+"','400','250');","msg","mesaj");
			a("javascript:location.href='diyar.php?process=eduzenle&id="+i+"&sr="+sr+"';","düzenle","düzenle");
            a("javascript:od('diyar.php?process=esil&id="+i+"&sr="+sr+"','350','150')","sil","sil!");
			a("javascript:od('diyar.php?process=ben&kim="+an+"','350','400')","?","kim?");

		  document.write('<td>&nbsp;</td>');

          write('</tr></table></div>');
          var d=getElementById('d'+i);
          var m="document.getElementById('m"+i+"').style.visibility=";
          d.onmouseover=new Function(m+"'visible'");
          d.onmouseout=new Function(m+"'hidden'");
        }
}
function e_ben(f,i,an,sr)
{
        with(document)
        {
          write('<div align=right style="width:100%"><table id=m'+i+' style="visibility:hidden"><tr><td class=ei><a name="cid'+i+'"></a><a href="diyar.php?process=eid&eid='+i+'">( #'+i+' )</a></td>');
                  document.write('<td>&nbsp;</td>');
			a("javascript:location.href='diyar.php?process=eduzenle&id="+i+"&sr="+sr+"';","düzenle","düzenle");
		  a("javascript:od('diyar.php?process=esil&id="+i+"&sr="+sr+"','250','150')","sil","sil!");
		  a("javascript:od('diyar.php?process=ben&kim="+an+"','400','400')","?","kim?");
          write('</tr></table></div>');
          var d=getElementById('d'+i);
          var m="document.getElementById('m"+i+"').style.visibility=";
          d.onmouseover=new Function(m+"'visible'");
          d.onmouseout=new Function(m+"'hidden'");
        }
}
function zyrt(f,i,an)
{
        with(document)
        {
          write('<div align=right style="width:100%"><table id=m'+i+' style="visibility:hidden"><tr><td class=ei><a name="cid'+i+'"></a><a href="diyar.php?process=eid&eid='+i+'">( #'+i+' )</a></td>');
                  document.write('<td>&nbsp;</td>');

          write('</tr></table></div>');
          var d=getElementById('d'+i);
          var m="document.getElementById('m"+i+"').style.visibility=";
          d.onmouseover=new Function(m+"'visible'");
          d.onmouseout=new Function(m+"'hidden'");
        }
}

function dd(i)
{
        od('diyar.php?process=privmsg&islem=yenimsj&gkime='+i);
        document.getElementById('d'+i).style.visibility='hidden';
}


function tr(i)
{
  document.write('<tr style="cursor:default" onmouseover="document.getElementById("m'+i+'").style.visibility=\'visible\'" onmouseout="style.borderWidth=\'0\';document.getElementById("m'+i+'").style.visibility=\'hidden\'">');
}

function od(u,w,h,x,y)
{
  if(!w)w=320;if(!h)h=200;if(!x)x=(screen.width-w)/2;if(!y)y=(screen.height-h)/2;
  var w=window.open(u,"_blank","resizable=yes,scrollbars=yes,top="+x.toString()+",left="+y.toString()+",width="+w.toString()+",height="+h.toString());
  w.focus();
}

function odf(u,w,h,x,y)
{
        od(u,w,h,x,y);return false;
}

function au(d)
{
  document.write('<tr><td nowrap align=right class=aul>(<a class=aul href="?t='+an+'">'+an+'</a>, '+d+')</td></tr>');
}

function sets(doc,fn)
{
  if(doc) {
    var len = doc.styleSheets.length;
    if(doc.createStyleSheet)
    {
            if (fn=="") {
              if(len>1) doc.styleSheets[1].href="";
            } else {
              if (len<2) doc.createStyleSheet(fn); else doc.styleSheets[1].href=fn;
            }
    }
    else
    {
      doc.location.reload();
    }
  }
}

function bp(o,m,c)
{
        var oo;
        for(var n=1;n<=m;n++) {
                oo = document.createElement("OPTION");
                o.options.add(oo);
                oo.innerText = n;
                oo.Value = n;
                oo.selected = n==c;
        }
}

var inpp=false,o=null,maxs=11,lx=20,w=213,bi=false,sint=new Array(20,23,30,43,61,82,107,135,166,197,213);

function os()
{
  if((o=document.getElementById('a'))!=null) with(o.style) with(document.body)
  {
          bi=n<=0;left=scrollLeft+sint[bi?0:(maxs-1)]+(clientWidth-233)+2;
          if(o.clientHeight+44<clientHeight) top=scrollTop+44;
  }
}

function ca()
{
        with(document.body) with(o.style) {
                left=(scrollLeft+sint[n]+(clientWidth-233))+"px";width=((w+lx)-sint[n])+"px";
                if(bi){if(++n<maxs)setTimeout("ca()",20); else {inpp=false;document.body.focus();document.getElementById('amain').disabled=true}}
                else{if(n-->0)setTimeout("ca()",20); else {inpp=false;document.getElementById('amain').disabled=false;}}
  }
}

function pp()
{
        if(!inpp) { inpp=true;o=document.getElementById('a');bi=n<=0;n=bi?0:(maxs-1);ca(); }
}

function tgb(i)
{
  t=document.getElementById('t'+i);
  m=document.getElementById('m'+i);
  b=document.getElementById('b'+i);
  if(t&&m&&b) {
    for(var j=0;j<bid;j++) {
      if(i==("b"+j))continue;
      document.getElementById('bb'+j).style.display='inline';
      document.getElementById('tb'+j).innerHTML='&rsaquo;&rsaquo;'+'&nbsp;';
      document.getElementById('mb'+j).style.display='none';
    }
    t.innerHTML=m.style.display=='none'?'&lsaquo;&lsaquo;':'&rsaquo;&rsaquo;'+'&nbsp;';
    m.style.display=m.style.display=='none'?'inline':'none';
    b.style.display=b.style.display=='none'?'inline':'none';
  }
}

function obba(n,t)
{
  bis="b"+(bid++);
  document.write('<a style="vertical-align:middle;" id=t'+bis+' href="#" onclick="tgb(\''+bis+'\');">&rsaquo;&rsaquo;&nbsp;</a>'+
    '<div id=m'+bis+' style="vertical-align:middle;width:90%;display:none;"><a href="msg.asp?to='+escape(n)+'" onclick="tgb(\''+bis+'\');od(\'msg.asp?to='+escape(n)+'\');return false">&nbsp;/msg</a>'+
    '&nbsp;&middot;<a href="info.asp?n='+escape(n)+'" onclick="tgb(\''+bis+'\');od(\'info.asp?n='+escape(n)+'\',350,420);return false">&nbsp;?</a>'+
    '&nbsp;&middot;<a href="index.asp?a=sr&so=y&f=y&au='+escape(n)+'" target="sozindex" onclick="tgb(\''+bis+'\');top.sozindex.location.href=\'index.asp?a=sr&so=y&f=y&au='+escape(n)+'\'">&nbsp;son</a>'+
    '</div><div id=b'+bis+' style="vertical-align:middle;width:90%;display:inline;"><a href="#" onclick="od(\'msg.asp?to='+escape(n)+'\');return false" id='+bis+'>'+n+'</a></div><br>');
}
function ob(n,t)
{
        t = (15-t)/15.0;
        document.write('<a href="diyar.php?process=privmsg&islem=yenimsj&kime='+escape(n)+'" onclick="od(\'diyar.php?process=privmsg&islem=yenimsj&kime='+escape(n)+'\');return false">'+n+'</a><br>');
}

function hen(d,a,b)
{
  var o=document.getElementById(d);
  if(document.selection && !window.opera)
  {
          var rg=document.selection.createRange();
          if(rg.parentElement()==o) {
                  rg.text = a+rg.text+b;
                  rg.select();
                } else alert("!");
  }
  else if(o.textLength||window.opera)
  {
          var s = o.value;
          o.value = s.substring(0,o.selectionStart)+a+s.substring(o.selectionStart,o.selectionEnd)+b+s.substring(o.selectionEnd,o.textLength);
  } else o.value += a+b;
  o.focus();
  return false;
}


function tac()
{
  var c = document.getElementsByTagName("input");
  for(var i=0;i<c.length;i++)if(c[i].type=="checkbox")c[i].checked=!c[i].checked;
}

function selcnt()
{
  var c = document.getElementsByTagName("input");
  var cnt = 0;
  for(var i=0;i<c.length;i++)if(c[i].type=="checkbox")cnt += c[i].checked?1:0;
  return cnt;
}
function ara()
{
  if(top.left)top.left.location.href='diyar.php?process=search&vampara_baslik='+escape(document.getElementById('q').value);
}
function idara()
{
  if(top.main)top.main.location.href='diyar.php?process=eid&eid='+escape(document.getElementById('q').value);
}
function dab()
{
  var c = document.getElementsByTagName("input");
  for(var i=0;i<c.length;i++)if(c[i].type=="submit"||c[i].type=="button")c[i].disabled=true;
}

