var santadate = new Date("April 21, 2012 10:00:00");

//January February March April May June July August September October November December

function toSt(n) {
  s=""
  if(n<10) s+="0"
  return s+n;
}

function countdown() {
  ck=document.ckock;
  d=new Date();
  count=Math.floor((santadate.getTime()-d.getTime())/1000);
  if(count<=0)
    {ck.days.value ="----";
     ck.hours.value="--";
     ck.mins.value="--";
     ck.secs.value="--";
     return;
   }
  ck.secs.value=toSt(count%60);
  count=Math.floor(count/60);
  ck.mins.value=toSt(count%60);
  count=Math.floor(count/60);
  ck.hours.value=toSt(count%24);
  count=Math.floor(count/24);
  ck.days.value=count;

  setTimeout("countdown()",500);
}

function SC_timePlay(tmLnName, myID) { //v1.2
    //SC_initTimelines()

  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.SC_Time == null) SC_initTimelines(); //if *very* 1st time
  tmLn = document.SC_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('SC_timePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j];
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function SC_initTimelines() {
    //SC_initTimelines()
    var ns = navigator.appName == "Netscape";
    document.SC_Time = new Array(1);
    document.SC_Time[0] = new Array(0);
    document.SC_Time["Timeline1"] = document.SC_Time[0];
    document.SC_Time[0].MM_Name = "Timeline1";
    document.SC_Time[0].fps = 15;
    document.SC_Time[0].lastFrame = 0;
    for (i=0; i<document.SC_Time.length; i++) {
        document.SC_Time[i].ID = null;
        document.SC_Time[i].curFrame = 0;
        document.SC_Time[i].delay = 1000/document.SC_Time[i].fps;
    }
}

file://set message:
msg = "Dreiburgenland-Marathon - im suedlichen Bayerischen Wald";

timeID = 10;
stcnt = 16;
wmsg = new Array(33);
        wmsg[0]=msg;
        blnk = "                                                               ";
        for (i=1; i<32; i++)
        {
                b = blnk.substring(0,i);
                wmsg[i]="";
                for (j=0; j<msg.length; j++) wmsg[i]=wmsg[i]+msg.charAt(j)+b;
        }

function wiper()
{
        if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
        if (stcnt-- < -40) stcnt=31;
        status = str;
        clearTimeout(timeID);
        timeID = setTimeout("wiper()",100);
}

wiper()


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
