var sH = {
  // initialisation function, call with load
  init: function() {
    if (!document.getElementById || !document.getElementsByTagName)
      return;
      
      
    sH.ct = 0;
    //sH.doc = document.getElementsByTagName('body')[0];  
    sH.doc = document.getElementById('spectable');
      
      
		setTimeout("sH.checktimer()", 200);	
    
    
  },
  
	checktimer: function() {
		if (sH.ct != 7) {
			sH.ct = sH.ct + 1;	
			if (sH.ct == 1) {
				sH.doc.style.backgroundColor = "#A4DDEF";	
				setTimeout("sH.checktimer()", 200);	
			} else if (sH.ct == 2) {
				sH.doc.style.backgroundColor = "#B3E1EF";	
				setTimeout("sH.checktimer()", 70);	
			} else if (sH.ct == 3) {
				sH.doc.style.backgroundColor = "#C2E5EF";	
				setTimeout("sH.checktimer()", 60);	
			} else if (sH.ct == 4) {
				sH.doc.style.backgroundColor = "#D1E9EF";	
				setTimeout("sH.checktimer()", 50);	
			} else if (sH.ct == 5) {
				sH.doc.style.backgroundColor = "#E0ECEF";	
				setTimeout("sH.checktimer()", 40);	
			} else if (sH.ct == 6) {
				sH.doc.style.backgroundColor = "#EFEFEF";	
				setTimeout("sH.checktimer()", 30);		
			} else if (sH.ct == 7) {
				sH.doc.style.backgroundColor = "#FFFFFF";	
				setTimeout("sH.checktimer()", 20);	
			}	
		}
	},
  
	checktimer2: function() {
		if (sH.ct != 10) {
			sH.ct = sH.ct + 1;	
			if (sH.ct == 1) {
				sH.doc.style.backgroundColor = "#E7E7E7";	
			} else if (sH.ct == 2) {
				sH.doc.style.backgroundColor = "#E8E8E8";	
			} else if (sH.ct == 3) {
				sH.doc.style.backgroundColor = "#E9E9E9";	
			} else if (sH.ct == 4) {
				sH.doc.style.backgroundColor = "#EAEAEA";	
			} else if (sH.ct == 5) {
				sH.doc.style.backgroundColor = "#EBEBEB";	
			} else if (sH.ct == 6) {
				sH.doc.style.backgroundColor = "#ECECEC";	
			} else if (sH.ct == 7) {
				sH.doc.style.backgroundColor = "#EDEDED";	
			} else if (sH.ct == 8) {
				sH.doc.style.backgroundColor = "#EEEEEE";	
			} else if (sH.ct == 9) {
				sH.doc.style.backgroundColor = "#EFEFEF";	
			} else if (sH.ct == 10) {
				sH.doc.style.backgroundColor = "#FFFFFF";	
			}
			setTimeout("sH.checktimer()", 40);		
		}
	},

	// function to add event listener, also caches events so they can be removed when the
	// page unloads to avoid memory leaks in IE
  addEvent: function(elm, evType, fn, useCapture) {
		// for W3C DOM complience
    if (elm.addEventListener) {
      elm.addEventListener(evType, fn, useCapture);
      return true;
    }
		// for IE...
		else if (elm.attachEvent) {
      var r = elm.attachEvent('on' + evType, fn);
      //EventCache.add(elm, evType, fn);
      return r;
    } else {
			// for anyone else not IE or Moz... Safari etc
      elm['on' + evType] = fn;
    }
  },

	// function to add event listener, also caches events so they can be removed when the
	// page unloads to avoid memory leaks in IE
  removeEvent: function(elm, evType, fn, useCapture) {
		// for W3C DOM complience
    if (elm.removeEventListener) {
      elm.removeEventListener(evType, fn, useCapture);
      return true;
    }
		// for IE...
		else if (elm.detachEvent) {
      var r = elm.detachEvent('on' + evType, fn);
      //EventCache.add(elm, evType, fn);
      return r;
    }
  },
	
	// cross-browser get target
	find_target: function(e) 	{
		var target; 	
		// for IE, target is held in window.event array
		if (window.event && window.event.srcElement) 
			target = window.event.srcElement;
		else if (e && e.target)
			target = e.target;
		if (!target)
			return null;
			
		return target;
	}
	
	
	
}

sH.addEvent(window, 'load', sH.init, false);
// flush events on unload to avoid memory probs in IE
//sH.addEvent(window, 'unload', EventCache.flush, false);