﻿
var t;
var timer_is_on=0;

var ih, ip, ie;
var oldx1, oldx2, oldx3, oldy1, oldy2, oldy3;

var x1, y1;
var i;

function moveitBy(obj, x, y) {
    obj.offsetLeft += x;
    obj.offsetTop += y;
    
}

function moveitTo(obj, x, y) {
    obj.style.left = x + "px";
    obj.style.top = y + "px";
}



function timedCount() {

    /*var x;
    var y;

    x = Math.ceil(Math.random() * 2) - 1;
    y = Math.ceil(Math.random() * 2) - 1;
    moveitBy(document.getElementById("introheader"),x,y);
    */

/*
    x = Math.ceil(Math.random() * 2) - 1;
    oldx2 += x;

    x = Math.ceil(Math.random() * 2) - 1;
    oldx3 += x;

    var s1 = new String(oldx1.toString);
    ih.style.left = s1.concat("px");

    s1 = oldx2.toString;
    ip.style.left = s1.concat("px");

    s1 = oldx3.toString;
    ie.style.left = s1.concat("px");
  */


    ih.style.left = x1[i];
    ih.style.top = y1[i];

    var temp = Math.ceil(Math.random() * 30);
    var ss = new String(temp.toString);
    alert(ss);
    document.write(eval(ss));
    i++;
    if (i > 4) i = 0;
 
 
 
 t=setTimeout("timedCount()",500);
}

function doTimer()
{
if (!timer_is_on)
  {
      timer_is_on = 1;
      ih = window.document.getElementById("introheader");
      ip = window.document.getElementById("intropanel");
      ie = window.document.getElementById("introenq");

      if (!ih)
      //alert("ih does not exist");
          ;
      else {
          var s = ih.tagName + "\n";
          s += ih.offsetLeft + "\n";
          //alert(s)

      }

      //ih.setAttribute("style", "{left: 150px}");


      x1 = new Array("21px", "23px", "22px", "24px", "26px");
      y1 = new Array("60px", "61px", "63px", "65px", "68px");
      i = 0;
      //oldx1 = parseInt(ih.style.left);
      //oldx2 = parseInt(ip.style.left);
      //oldx3 = parseInt(ie.style.left);


      oldx1 = ih.offsetLeft;
      oldx2 = ip.offsetLeft;
      oldx3 = ie.offsetLeft;
      
      //timedCount();
      
      /*
      var s;
      s = new String;
          
      
      s.concat("oldx1 = ");
      //s.concat(oldx1.toString);



      alert(ih.style.left);

      ih.style.left = "200px";*/
  }
}

window.onload = doTimer;
