// Duration.js - Copyright 2007, Spectrum Research, Inc. - All Rights Reserved.

  function ClickThrough(url)
  { if(document.images)
    { var e = window.encodeURIComponent ? encodeURIComponent : escape;
      var u="";
      if(url) u="/ClickThrough?url="+e(url.replace(/#.*/,"")).replace(/\+/g,"%2B");
      new Image().src = u;
    }
    return true;
  };

  function PopupCenteredNoFrills(file, iWidth, iHeight)
  { iUserRan = 1;
    iX = Math.floor((screen.width  - iWidth)  / 2);
    iY = Math.floor((screen.height - iHeight) / 2);
    iX -= 5; iY -= 14;
    if(iX < 0) { iX = 0; };
    if(iY < 0) { iY = 0; };
    style="left=" +iX+ ",top=" +iY+ ",width=" +iWidth+ ",height=" +iHeight+ ",toolbar=0,scrollbars=1,status=0,location=0,resizable=1,menubar=0,alwaysRaised=1";
    NewWindow = window.open(file,'_blank',style);
  };

  function GetSeconds()
  { objEnd  = new Date();                                   // Get the ending time.
    objDiff = objEnd - objStart;                            // Calculate the difference.
    return(objDiff / 1000);
  };

  function SetDuration(strUrl)
  { obj = document.getElementById("DURATION");
    obj.src = strUrl;
  };

  function D1()     { strUrl = "duration1.bmp?URL="   + location.pathname; SetDuration(strUrl); };
  function D15()    { strUrl = "duration15.bmp?URL="  + location.pathname; SetDuration(strUrl); };
  function D30()    { strUrl = "duration30.bmp?URL="  + location.pathname; SetDuration(strUrl); };
  function D45()    { strUrl = "duration45.bmp?URL="  + location.pathname; SetDuration(strUrl); };
  function D60()    { strUrl = "duration60.bmp?URL="  + location.pathname; SetDuration(strUrl); };
  function D90()    { strUrl = "duration90.bmp?URL="  + location.pathname; SetDuration(strUrl); };
  function D120()   { strUrl = "duration120.bmp?URL=" + location.pathname; SetDuration(strUrl); };

  // No frame viewing.
  if(top != self) { top.location.href = self.location.href; };

  objStart = new Date();
  strScreen = "Scr=" + screen.width + "x" + screen.height + "x" + screen.colorDepth;
  strDate   = "TZ=" + (objStart.getTimezoneOffset() / 60);
  document.cookie = strScreen;
  document.cookie = strDate;

  // Load images.
  window.setTimeout("D1();", 1000);
  window.setTimeout("D15();",  15000);  
  window.setTimeout("D30();",  30000);  
  window.setTimeout("D45();",  45000);  
  window.setTimeout("D60();",  60000);  
  window.setTimeout("D90();",  90000);  
  window.setTimeout("D120();", 120000);
