/************************************************************************
 Scripts ©2004 marckroeks@houseofconcepts - Do not use without permission
 Design and Concepts jorn@houseofconcepts - www.houseofconcepts.nl
************************************************************************/
    
    function makearray(n){
      this.length = n;
      for(var i = 1; i <= n; i++)
      this[i] = 0;
      return this;
    }
    hexa = new makearray(16);
    for(var i = 0; i < 10; i++) hexa[i] = i;
    hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
    hexa[13]="d"; hexa[14]="e"; hexa[15]="f";
    function hex(i){
      if (i < 0) return "00";
      else if (i >255) return "ff";
      else return "" + hexa[Math.floor(i/16)] + hexa[i%16];
    }
    function setbgColor(r, g, b){
      var hr = hex(r); var hg = hex(g); var hb = hex(b);
      document.bgColor = "#"+hr+hg+hb;
    }
    
    function ShowColor() {
    
    var d = new Date();
    var r;
    var g;
    var b;
    
    var t= ( ( d.getHours() % 12  ) * 60 + d.getMinutes() ) / 720 *6;
  	 
    switch (Math.floor(t)) {
   	case 0:
   		r=1;
   		g=t;
   		b=0;
   		break;
   	case 1:
   		r=2-t;
   		g=1;
   		b=0;
   		break;
   	case 2:
   		r=0;
   		g=1;
   		b=t-2;
   		break;
   	case 3:
   		r=0;
   		g=4-t;
   		b=1;
   		break;
   	case 4:
   		r=t-4;
   		g=0;
   		b=1;
   		break;
   	case 5:
   		r=1;
   		g=0;
   		b=6-t;
   		break;
   	default :
   		document.write("Calculation error in switch!" +t);
     }  	
   
    r= Math.floor(r*256);
    g= Math.floor(g*256);
    b= Math.floor(b*256);
   
    setbgColor(r,g,b);
   }

	function StartClock() {
		ShowColor();
		setTimeout("StartClock()", 1000);
	}
