
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var clockID = 0;
var cTicks = 0;

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   document.theClock.theTime.value = Math.floor(this.cTicks/3600/10)+""+Math.floor(this.cTicks/3600%10)+":"+Math.floor(this.cTicks%3600/60/10)+""+Math.floor(this.cTicks%3600/60%10)+":"+Math.floor(this.cTicks%3600%60/10)+""+this.cTicks%3600%60%10;

   if(cTicks == secondtick) {
        document.banner.src = secondImageURL;
        var topp = document.getElementById("toppar");
        topp.innerHTML = secondTopText;
        var botp = document.getElementById("botpar");
        botp.innerHTML = secondBottomText;
        var ahref = document.getElementById("ahref");
        ahref.href = secondAhref;
}

   if(cTicks == thirdtick) {
        document.banner.src = thirdImageURL;
        var topp = document.getElementById("toppar");
        topp.innerHTML = thirdTopText;
        var botp = document.getElementById("botpar");
        botp.innerHTML = thirdBottomText;
        var ahref = document.getElementById("ahref");
        ahref.href = thirdAhref;
}

   cTicks--;

   if(cTicks >= 0)
        clockID = setTimeout("UpdateClock()", 1000);
   else {
        var dv2 = document.getElementById("counterdiv");
        dv2.style.visibility="hidden";
        }

}
function StartClock() {

   cTicks = firsttick;

   var dv = document.getElementById("counterdiv");
   dv.innerHTML = '<center><form name="theClock"><input type=text name="theTime" size=8 style="text-align: center;   background: '+ timerbackcolor+ ';   color: '+ timerforecolor + ';   font-size: 30pt;   font-family: Verdana; font-weight: bold;   border: 2px outset;   border-left: 2px outset darkgray;   border-top: 2px outset darkgray;"><br><div  name= "toppar" id="toppar">'+ firstTopText+ '</div><br><a id="ahref" href="'+firstAhref+'"><img src="'+firstImageURL+'" name="banner" id="banner"></a><br><div  name= "botpar" id="botpar">'+ firstBottomText +'</div></form></center>';

   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

window.onload = function() { StartClock(); };
window.onunload = function() { KillClock(); };
timerbackcolor = "#990000";
timerforecolor = "#FFFFFF";
firsttick = 90;
secondtick = 30;
thirdtick = 15;
firstAhref = "http://www.on2url.com/app/adtrack.asp?MerchantID=65140&AdID=336163";
secondAhref = "http://www.on2url.com/app/adtrack.asp?MerchantID=65140&AdID=336162";
thirdAhref = "http://www.on2url.com/app/adtrack.asp?MerchantID=65140&AdID=336161";
firstImageURL = "coupon/couponpix/$20off.gif";
secondImageURL = "coupon/couponpix/$15off.gif";
thirdImageURL = "coupon/couponpix/$10off.gif";
firstTopText = "<p align=\"center\"><font color=\"#CC0033\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">Hurry!<br>      When the counter reaches <U>30 seconds</U>, <br>  you won\'t be able to get the<br>      best price ever offered on <br>  Headline Creator Pro! <U>Just $9</U>! <strong><U><br><br>  Click on the<br>graphic below!!!</U></strong></font></p>";
secondTopText = "<p align=\"center\"><font color=\"#CC0033\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">Don\'t miss this chance...When the counter reaches <U>15 seconds</U>, the goes up again...it will still be <U>less than 50%</U> of the current $29 price! <strong><U><br>Click on the<br>graphic below!!!</U></strong></font></p>";
thirdTopText = "<p align=\"center\"><font color=\"#CC0033\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">Okay! Last chance to get a great discount...When the counter reaches <U>0 seconds</U>, the price on Headline Creator Pro jumps back to $29. Click before then you can still get it for <U>less than $20</U>. <strong><U><br>Click on the<br>graphic below!!!</U></strong></font><br></p>";
firstBottomText = "<p align=\"center\"><font color=\"#CC0033\" size=\"4\" face=\"Arial, Helvetica, sans-serif\"><strong><em>Don\'t hesitate...the clock is ticking!!!</em></strong></font></p>";
secondBottomText = "<p align=\"center\"><font color=\"#CC0033\" size=\"4\" face=\"Arial, Helvetica, sans-serif\"><strong><em>Don\'t hesitate...the clock is ticking!!!</em></strong></font></p>";
thirdBottomText = "<p align=\"center\"><font color=\"#CC0033\" size=\"4\" face=\"Arial, Helvetica, sans-serif\"><strong><em>Don\'t hesitate...the clock is ticking!!!</em></strong></font></p>";
