/*var req;

function Initialize()
{
    try
    {
        req=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
        try
        {
            req=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(oc)
        {
            req=null;
        }
    }


    if(!req&&typeof XMLHttpRequest!="undefined")
    {
        req = new XMLHttpRequest();
	}

}
function SendQuery(key)
{
    Initialize();
    
    var url="../show.php?s="+key;

    if(req!=null)
    {
        req.onreadystatechange = Process;
        req.open("GET", url, true);
        req.send(null);

    }
}

function Process()
{
    if (req.readyState == 4)
    {
        if (req.status == 200)
        {
            if(req.responseText=="")
                HideDiv("autocomplete");
            else
            {
                ShowDiv("autocomplete");
                document.getElementById("autocomplete").innerHTML =req.responseText;
            }
        }
        else
        {
            document.getElementById("autocomplete").innerHTML=
				"waiting ... <br>"+req.statusText;
        }
    }
}

function ShowDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="show";
   else document.getElementById(divid).style.display="inline";
}

function HideDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="hide";
   else document.getElementById(divid).style.display="block";
}

function BodyLoad()
{
    HideDiv("autocomplete");
    document.puzgi.q.focus();
}


function createPlayer(site, flvid) 
{
var vidplay="http://www.puzgi.com/images/"+site+"-"+flvid+".flv";
var s2 = new SWFObject("http://www.puzgi.com/images/player.swf","player","640","480","8");
	s2.addParam("allowfullscreen","true");
        s2.addParam("allowscriptaccess","always");
        s2.addParam("wmode","opaque");
        s2.addVariable("file", vidplay);
	s2.addVariable("displayheight","425");
        s2.addVariable("autostart","true");
	s2.addVariable("backcolor","000000");
	s2.addVariable("frontcolor","ffffff");
	s2.addVariable("lightcolor","ffffff");
	s2.addVariable("screencolor","000000");
	s2.addVariable("width","425");
	s2.addVariable("height","350");
s2.addVariable("enablejs", "true");
s2.addVariable("autostart", "true");
s2.write("container");
}
*/

function playvideo(adres,dividsi) { 
   var div = document.getElementById('dividsi'); 
   div.innerHTML = 'gg<img src=loading.gif><br><br>'; 

   var url="../show.php?id="+adres;
   var xmlhttp = new_xmlhttp();
   xmlhttp.open("POST", url ,true); 
   xmlhttp.send(null);
   xmlhttp.onreadystatechange = function() { 
      if (xmlhttp.readyState == 4)
    {
        if (xmlhttp.status == 200)
        {
     div.innerHTML = xmlhttp.responseText;
   } 
      else 
      { 
     div.innerHTML = 'sorry, i couldnt (TR-> hata olustu)'; 
      }}
}
}

// arama yapma
function sendPost(formId,spanId)//fonksiyonun xmlhttp kısımları user9 un kodlarından gelmedir.
{

var minutes = 1000*60;
var hours = minutes*60;
var days = hours*24;
var years = days*365;
var d = new Date();
var t = d.getTime();
var y = t/years;

        document.getElementById('videos').style.position = 'absolute'; 
        document.getElementById('loading').style.position = ''; 
        document.getElementById('videos').style.visibilty = 'hidden'; 
        document.getElementById('loading').style.visibility = 'visible'; 
        var form = document.getElementById(formId);
	var span = document.getElementById(spanId);
        var key = form.q.value;
	var url="../show.php?s="+key+"&time="+y;

	var xmlhttp = new_xmlhttp();/**alacaklı haciz koymuş bekire of offf*/
	xmlhttp.open("GET",url,true);
	//xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=iso-8859-9");
	xmlhttp.send("NULL");
	xmlhttp.onreadystatechange = function() {
 
if (xmlhttp.readyState == 4)
    {
document.getElementById('loading').style.visibility = 'visible'; 
document.getElementById('loading').style.position = 'absolute'; 
        if (xmlhttp.status == 200)
        {
                     document.getElementById('videos').style.position = ''; 
                     document.getElementById('loading').style.position = 'absolute'; 
                     document.getElementById('videos').style.visibility = 'visible'; 
                     document.getElementById('loading').style.visibility = 'hidden'; 
			span.innerHTML = xmlhttp.responseText;
		} else { span.innerHTML = '<h1>waiting</h1>'; } }
		

else if (xmlhttp.readyState == 3 || xmlhttp.readyState == 2 || xmlhttp.readyState == 1)
{
			span.innerHTML = '<h1><img src=loading.gif></h1>';
		}

	}
	return false;//formu yollama
}

// kayıt olma

function kayitPost(formId,spanId)//fonksiyonun xmlhttp kısımları user9 un kodlarından gelmedir.
{

var minutes = 1000*60;
var hours = minutes*60;
var days = hours*24;
var years = days*365;
var d = new Date();
var t = d.getTime();
var y = t/years;

        document.getElementById('videos').style.position = 'absolute'; 
        document.getElementById('loading').style.position = ''; 
        document.getElementById('videos').style.visibilty = 'hidden'; 
        document.getElementById('loading').style.visibility = 'visible'; 
        var form = document.getElementById(formId);
	var span = document.getElementById(spanId);
        var key = form.q.value;
	var url="../index.php?s="+key+"&time="+y;

	var xmlhttp = new_xmlhttp();/**alacaklı haciz koymuş bekire of offf*/
	xmlhttp.open("GET",url,true);
	//xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=iso-8859-9");
	xmlhttp.send("NULL");
	xmlhttp.onreadystatechange = function() {
 
if (xmlhttp.readyState == 4)
    {
document.getElementById('loading').style.visibility = 'visible'; 
document.getElementById('loading').style.position = 'absolute'; 
        if (xmlhttp.status == 200)
        {
                     document.getElementById('videos').style.position = ''; 
                     document.getElementById('loading').style.position = 'absolute'; 
                     document.getElementById('videos').style.visibility = 'visible'; 
                     document.getElementById('loading').style.visibility = 'hidden'; 
			span.innerHTML = xmlhttp.responseText;
		} else { span.innerHTML = '<h1>waiting</h1>'; } }
		

else if (xmlhttp.readyState == 3 || xmlhttp.readyState == 2 || xmlhttp.readyState == 1)
{
			span.innerHTML = '<h1><img src=loading.gif></h1>';
		}

	}
	return false;//formu yollama
}

// http://jibbering.com/2002/4/xmlhttp.js
function new_xmlhttp()
{
	var xmlhttp;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	  try {
	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp=false;
	  }
	 }
	@else
	 xmlhttp=false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	 try {
	  xmlhttp = new XMLHttpRequest();
	 } catch (e) {
	  xmlhttp=false;
	 }
	}
	return xmlhttp;
}