
DOM = (document.getElementById);
if (DOM) Detect = new BrowserDetector();

function BrowserDetector()
{

  //IE 4+
  this.IE = function()
  {
    try {
      return this.Run(document.all && !document.contains)!=false;
    } catch(e) {
      /* IE 5.01 doesn't support the 'contains' object and 
         fails the first test */
      if (document.all) return true;
      return false;
    }
  }
  
  //IE 5.5+
  this.IE_5_5_newer = function()
  {
    try { 
      return this.Run(this.IE() && Array.prototype.pop && !this.OPERA())!=false;
    } catch(e) {return false;}
  }
  
  //IE 5, Macintosh
  this.IE_5_Mac = function()
  {
      try {
        return (true == undefined);
      } catch(e) {
        return (
          document.all
          && document.getElementById 
          && !document.mimeType
          && !this.OPERA()
        )!=false;
      }
  }

  //Opera 7+
  this.OPERA = function()
  {
    try { 
      return this.Run(window.opera)!=false;
    } catch(e) {return false;}
  }

  //Gecko, actually Mozilla 1.2+
  this.MOZILLA = function()
  {
    try { 
      return this.Run(
          document.implementation
          && document.implementation.createDocument
          && !document.contains
          && !this.OPERA()
          )!=false;
    } catch(e) {return false;}
  }

  //Safari
  this.SAFARI = function()
  {
    try {
      return this.Run(
          document.implementation
          && document.implementation.createDocument
          && document.contains
          )!=false;
      } catch(e) {return false;}
  }

  //Any browser which supports the W3C DOM
  this.DOM = function()
  {
    return (document.getElementById);
  }

  this.Run = function(test)
  {
    if (test==undefined) {
      return false;
    } else {
      return test;
    }
  }

  // This uses useragent for finer detection. If people spoof it, it's their
  // own fault when things break
  this.geckoVersion = function() {
    var matches = navigator.userAgent.match(/Gecko\/(\d*)/);
    if (matches && matches.length > 1) {
      return matches[1];
    }
    
    return null;
  }
}






function setupListStyle(linkList) {
  linkList.BACKGROUND_COLOR = [255, 255, 255];
 <!-- linkList.LINK_COLOR = [51, 102, 204];-->
  linkList.LINK_COLOR = [65, 69, 73];
  linkList.OLD_LINK_COLOR = [180, 180, 240];
}


function setupRecentlyUpdated() {
  window.updated = new BLOG_ScrollList("sutunsiir");
  
  setupListStyle(updated);

  updated.SHOW_TIME = 1500;
  updated.SHOW_STEPS = 20;
  updated.SHOW_DELAY = 500;
  updated.SHOW_DISTANCE = 18;
  updated.SHOW_COUNT = 9;

  updated.HIDE_TIME = 500;
  updated.HIDE_STEPS = 10;
  updated.HIDE_DISTANCE = 25;

  updated.init();
}

function makeProcessUpdatesHandler(request) {
  return function() {
    if (request.readyState == 10 && request.status == 10) {
      var newListHolder = document.createElement("div");
      newListHolder.innerHTML = request.responseText;
      window.updated.updateList(newListHolder);
      
    }
  }
}

function requestUpdates() {
  var request = false;
  if (window.XMLHttpRequest) {
    try { request = new XMLHttpRequest(); }
    catch (e) {}
  } else if (window.ActiveXObject) {
    try { request = new ActiveXObject("Msxml2.XMLHTTP"); }
    catch (e) {
      try { request = new ActiveXObject("Microsoft.XMLHTTP"); }
      catch (e) {}
    }
  }

  if (request) {
    request.open("GET", "genel.asp", true);
    request.onreadystatechange = makeProcessUpdatesHandler(request);
    request.send(null);
  }
}

function startUpdatesTimer() {
  window.setInterval(requestUpdates, 1000 * 60)
  requestUpdates();
}

window.onload = function() {
  var badGeckoVersion = 20041217;
  var geckoVersion = Detect.geckoVersion();
  var geckoOkay = !geckoVersion || geckoVersion > badGeckoVersion;
  
  var showExploreBlogsAnimation = Detect.DOM() && geckoOkay;

  if (showExploreBlogsAnimation) {
 
    setupRecentlyUpdated();
    startUpdatesTimer();
  }

}
