//
// this site design and all code Copyright © 2001 to M.Keating VOS Ltd
//


function clockit() {

setClock()
clock.show()
clock.slideBy(0,-500,20,20,"setTimeout('clock.slideBy(0,500,20,20)',3000)")
}

function homer() {

hint0=window.open("", "tw2", "toolbar=no,location=no,directories=0,status=no,menubar=no,width=400,height=500" );
var result = '<body bgcolor="0000ff"><center><form>';
result += '<blink><h1>';
result +='the time of reckoning is upon you</h1></blink><br>(Hidden link, again well done on finding it)<br>';
result += '<image src="gifs/homer2.GIF"></form></center></body>';
hint0.document.write(result);
window.location="gifs/COMET1.WAV";
//retF()
hint0.onblur = hint0.focus
setTimeout('hint0.close()', 20000);}


function retF() {hint0.focus
hint0.onblur = hint0.focus ; setTimeout('retF()',50)}


function DynMouseMove(x,y) {

if ( x > 450 & x <550 & y > 030 & y < 80) window.status='no, its not that easy to find the hidden links'

}
function DynMouseUp(x,y) {return true}

// include drag.js and/or scroll2.js after this file to overwrite these variables
Scroll = null


function Drag() {
	this.obj = null
	this.array = new Array()
	this.dropTargets = new Array()
	this.active = false
	this.offsetX = 0
	this.offsetY = 0
	this.zIndex = 0
	this.resort = true
	this.add = DragAdd
	this.addTargets = DragAddTargets
	this.checkTargets = DragCheckTargets
	this.targetHit == null
	this.remove = DragRemove
	this.setGrab = DragSetGrab
	this.mouseDown = DragMouseDown
	this.mouseMove = DragMouseMove
	this.mouseUp = DragMouseUp
	this.onDragStart = new Function()
	this.onDragMove = new Function()
	this.onDragEnd = new Function()
	this.onDragDrop = new Function()
}
function DragAdd() {
	for (var i=0; i<arguments.length; i++) {
		var l = this.array.length
		this.array[l] = arguments[i]
		this.array[l].dragGrab = new Array(0,this.array[l].w,this.array[l].h,0)
		this.zIndex += 1
	}
}
function DragAddTargets() {
	for (var i=0; i<arguments.length; i++) {
		var l = this.dropTargets.length
		this.dropTargets[l] = arguments[i]
		this.dropTargets[l].dragGrab = new Array(0,this.dropTargets[l].w,this.dropTargets[l].h,0)
	}
}
function DragSetGrab(dynlayer,top,right,bottom,left) { 
	dynlayer.dragGrab = new Array(top,right,bottom,left)
}
function DragRemove() {
	for (var i=0; i<arguments.length; i++) {
		for (var j=0; j<this.array.length; j++) {
			if (this.array[j]==arguments[i]) {
				for (var k=j;k<=this.array.length-2;k++) this.array[k] = this.array[k+1]
				this.array[this.array.length-1] = null
				this.array.length -= 1
				break
			}
		}
	}
}
function DragMouseDown(x,y) {
	for (var i=this.array.length-1;i>=0;i--) {
		var lyr = this.array[i]
		if (checkWithinLayer(x,y,lyr)) {
			this.obj = this.array[i]
			this.offsetX = x-this.obj.x
			this.offsetY = y-this.obj.y
			this.active = true
			break
		}
	}
	if (!this.active) return false
	else {
		if (this.resort) {
			this.obj.css.zIndex = this.zIndex++
			for (var j=i;j<=this.array.length-2;j++) this.array[j] = this.array[j+1]
			this.array[this.array.length-1] = this.obj
		}
		this.onDragStart(x,y)
		return true
	}
}
function DragMouseMove(x,y) {
	if (!this.active) return false
	else {
		this.obj.moveTo(x-this.offsetX,y-this.offsetY)
		this.onDragMove(x,y)
		return true
	}
}
function DragMouseUp(x,y) {
	if (!this.active) return false
	else {
		this.active = false
		if (this.checkTargets()) this.onDragDrop()
		this.onDragEnd(x,y)
		return true
	}
}
function DragCheckTargets() {
	for (i in this.dropTargets) {
		var lyr = this.dropTargets[i]
		if (checkWithinLayer(lyr.x,lyr.y,this.obj) ||
		checkWithinLayer(lyr.x+lyr.w,lyr.y,this.obj) ||
		checkWithinLayer(lyr.x,lyr.y+lyr.h,this.obj) ||
		checkWithinLayer(lyr.x+lyr.w,lyr.y+lyr.h,this.obj) ||
		checkWithinLayer(this.obj.x,this.obj.y,lyr) ||
		checkWithinLayer(this.obj.x+this.obj.w,this.obj.y,lyr) ||
		checkWithinLayer(this.obj.x,this.obj.y+this.obj.h,lyr) ||
		checkWithinLayer(this.obj.x+this.obj.w,this.obj.y+this.obj.h,lyr)) {
			this.targetHit = lyr
			return true
		}
	}
	return false
}

function checkWithin(x,y,left,right,top,bottom) {
	if (x>=left && x<right && y>=top && y<bottom) return true
	else return false
}
function checkWithinLayer(x,y,lyr) {
	if (checkWithin(x,y,lyr.x+lyr.dragGrab[3],lyr.x+lyr.dragGrab[1],lyr.y+lyr.dragGrab[0],lyr.y+lyr.dragGrab[2])) return true
	else return false
}

// automatically define the default "drag" Drag Object
drag = new Drag()

// Mouse Event Functions

function initMouseEvents() {
	document.onmousedown = mouseDown
	document.onmousemove = mouseMove
	document.onmouseup = mouseUp
	if (is.ns) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
}
function mouseDown(e) {
	if ((is.ns && e.which!=1) || (is.ie && event.button!=1)) return true
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
	if (is.ns && e.target!=document) routeEvent(e)
	if (Scroll && ScrollTestActive()) return false
	else if (Drag && drag.mouseDown(x,y)) return false
	else return DynMouseDown(x,y)
}
function mouseMove(e) {
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
	if (is.ns && e.target!=document) routeEvent(e)
	if (Scroll && ScrollTestActive()) return false
	else if (Drag && drag.mouseMove(x,y)) return false
	else return DynMouseMove(x,y)
}
function mouseUp(e) {
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
	if (is.ns && e.target!=document) routeEvent(e)
	if (Drag && drag.mouseUp(x,y)) return false
	else return DynMouseUp(x,y)
}

// overwrite these functions in your html source to do other mouse handling

var showlocV = false 

function DynMouseDown(x,y) {
var elap = new Date();
var secs = elap.getSeconds(); 

if (secs > 40 & secs < 59 &  x >606 & x <616 & y >43 &  y<59) {chL(709)} 
if (secs > 20 & secs < 40 &  x >230 & x <255 & y >105 &  y<125) {homer()} 
if ( x >000 & x <50 & y >50 &  y<100) {clockit()} 
//if ( x >000 & x <120 & y >120 &  y<550) {butN3()} 
if ( x >000 & x <50 & y >00 &  y<50) {butN2()} 
if(showlocV) window.status='current x= '+x+', current y= '+y+', current seconds= '+secs

}

var fireW=0

function butN1(jj,rector) {

//alert('hi')
for (i=0;i,i<jj;i++){
top.window.moveBy(0,rector)
top.window.moveBy(rector,0)
top.window.moveBy(0,-rector)
top.window.moveBy(-rector,0)
}
//alert('hi2')
}

function butN4 (){

FWS(6)

B1.slideBy(1100,0,200,200,'B1.moveTo(00,-100)')
B2.slideBy(1100,0,190,200,'B2.moveTo(00,-100)')
B3.slideBy(1100,0,180,200,'B3.moveTo(00,-100)')
B4.slideBy(1100,0,170,200,'B4.moveTo(00,-100)')
B5.slideBy(1100,0,160,200,'B5.moveTo(00,-100)')
B6.slideBy(1100,0,150,200,'B6.moveTo(00,-100)')

setTimeout('B1.slideBy(0,560,99,70)',1800)
setTimeout('B2.slideBy(0,490,77,70)',1800)
setTimeout('B3.slideBy(0,420,66,70)',1800)
setTimeout('B4.slideBy(0,350,55,70)',1800)
setTimeout('B5.slideBy(0,280,44,70)',1800)
setTimeout('B6.slideBy(0,210,41,70)',1800)

}


function butN3() {

fireW=1;
Fireworks();
setTimeout('fireW=0',2000)

B1.slideBy(-200,0,88,70,'B1.moveBy(200,-800)')
B2.slideBy(-200,0,78,70,'B2.moveBy(200,-800)')
B3.slideBy(-200,0,68,70,'B3.moveBy(200,-800)')
B4.slideBy(-200,0,58,70,'B4.moveBy(200,-800)')
B5.slideBy(-200,0,48,70,'B5.moveBy(200,-800)')
B6.slideBy(-200,0,38,70,'B6.moveBy(200,-800)')

setTimeout('B1.slideBy(00,800,99,70)',1000)
setTimeout('B2.slideBy(00,800,77,70)',1000)
setTimeout('B3.slideBy(00,800,66,70)',1000)
setTimeout('B4.slideBy(00,800,55,70)',1000)
setTimeout('B5.slideBy(00,800,44,70)',1000)
setTimeout('B6.slideBy(00,800,41,70)',1000)
}

//a2247


function butN2() {

var i = 7

for (j=0; j<7; j++) {

i--
setTimeout('DFFD('+i+')',800*j)

}
}

function DFFD(i) {

var s1 = "B"
var s2 = "setTimeout('B"
var s3 = "setTimeout('B"
var s12 = ".slideBy(150,0,28,70 )"
var s22 = ".slideBy(0,350,55,70)', 500)"
var s32 = ".slideBy(-150,0,28,70)', 1000)"
var mu1 = "setTimeout('B"
var mu2 = ".slideBy(0,-70,28,70)',100)"

for (jj=1; jj<7; jj++) {
if ( jj != i ) eval(mu1+jj+mu2)
}
//alert(i)

if ( i != 0) {
eval(s1+i+s12)
eval(s2+i+s22)
eval(s3+i+s32)}

}

function FWS(i){

fireW=1;
Fireworks();
setTimeout('fireW=0',i*1000)

}


/*
Document firework script (By Kurt Gregg, kurt.grigg@virgin.net)
Modified/ perm. granted to Dynamic Drive to feature script in archive
For full source and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var ns=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0

amount=14;
if (ns){
for (i=0; i < amount; i++)
document.write("<LAYER NAME='nsstars"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>");
}
else if (ie4||ns6){
document.write("<div id='ieCov' style='position:absolute;top:0px;left:0px'>");
document.write("<div style='position:relative'>");
for (i=0; i < amount; i++)
document.write("<div id='iestars"+i+"' style='position:absolute;top:0px;left:0px;width:1;height:1;background:#ffffff;font-size:1;z-index:10'></div>");
document.write("</div></div>");
}
Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff')
sClrs=new Array('ffa500','00ff00','FFAAFF','fff000','fffffF')
Xpos=300;
Ypos=150;
initialStarColor='00ff00';
step=5;
currStep=0;
explosionSize=120;
function Fireworks(){
var stopF = 0
var WinHeight=(ns||ns6)?window.innerHeight-100:window.document.body.clientHeight-100;
var WinWidth=(ns||ns6)?window.innerWidth-100:window.document.body.clientWidth-100;
var Yscroll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
for (i=0; i < amount; i++){
if (ie4||ns6)
var layer=ns6?document.getElementById("iestars"+i).style : eval("iestars"+i).style;
else if (ns)
var layer=document.layers["nsstars"+i]
var randCol=Math.round(Math.random()*8);
var randSz=Math.round(Math.random()*6);
layer.top = Ypos + explosionSize*Math.sin((currStep+i*5)/3)*Math.sin(currStep/100)
layer.left= Xpos + explosionSize*Math.cos((currStep+i*5)/3)*Math.sin(currStep/100)
if (currStep < 110){
 if (ns){layer.bgColor=initialStarColor;layer.clip.width=1;layer.clip.height=1}
 else{layer.background=initialStarColor;layer.width=1;layer.height=1;layer.fontSize=1}
 }
else{
 if (ns){layer.bgColor=Clrs[randCol];layer.clip.width=randSz;layer.clip.height=randSz}
 else{layer.background=Clrs[randCol];layer.width=randSz;layer.height=randSz;layer.fontSize=randSz}
 }
}
if (currStep > 220 & fireW==0 ) {
stopF = 1
for (i=0; i < amount; i++){
var layer=ns6?document.getElementById("iestars"+i).style : eval("iestars"+i).style;
layer.top = -300 
}
} else if (currStep > 220 ) {
 currStep=0;
 Ypos = 50+Math.round(Math.random()*WinHeight)+Yscroll;
 Xpos = 50+Math.round(Math.random()*WinWidth);
 for (i=0; i < sClrs.length; i++)
  {
  var newIcol=Math.round(Math.random()*i);
  }
initialStarColor=sClrs[newIcol];
explosionSize=Math.round(80*Math.random()+100);

} 
currStep+=step;
if (stopF == 0) setTimeout("Fireworks()",20);

}

function bats () {

batD1.moveTo(50,-100)
batD2.moveTo(450,-100)
batD3.moveTo(950,-100)
batD4.moveTo(450,900)
batD5.moveTo(1150,900)

batD1.slideTo(650,380,40,100)
batD2.slideTo(650,380,40,100)
batD3.slideTo(650,380,40,100)
batD4.slideTo(650,380,40,100,'bats2(0)')
batD5.slideTo(650,380,40,100)
window.status = "bats"
}

var BatcurrStep = 0;
var BatXpos = 650;
var BatYpos = 380;

function bats2(BatcurrStep) {
//alert(BatcurrStep)
var yBase = 200
var xBase = 300
var step = .2;
var ystep = .5;
var obj = "batD"
var j = 0;
for (j = 1; j<6 ; j++) {
yy = BatYpos + Math.cos((30 * Math.sin(BatcurrStep/(20 + j))) + j * 70) * yBase * (Math.sin(10 + BatcurrStep/10) + 0.2) *  Math.cos((BatcurrStep + j * 25)/10);
xx = BatXpos + Math.sin((30 * Math.sin(BatcurrStep/20)) + j * 70) * xBase * (Math.sin(10 + BatcurrStep/(10 + j))+ 0.2) *  Math.cos((BatcurrStep + j * 25)/10);
str1 = obj + j + '.slideTo(xx,yy)'
eval (str1)
}
window.status="step: "+BatcurrStep
BatcurrStep += step
if (BatcurrStep <= 25) {setTimeout('bats2('+BatcurrStep+')', 30)} else {window.status="no bats";bats3()} 

}
function bats3() {

setTimeout('batD1.slideTo(-90,180,40,100)',800)
setTimeout('batD2.slideTo(-90,380,40,100)',800)
setTimeout('batD3.slideTo(1150,-80,40,100)',800)
setTimeout('batD4.slideTo(650,1080,40,100)',800)
setTimeout('batD5.slideTo(50,1080,40,100)',800)

}

function circle() {

theta = new Array()
theta[0] = 0
theta[1] = 60
theta[2] = 120
theta[3] = 180
theta[4] = 240
theta[5] = 300

var radius=200
var RCX =300
var RCY =280
var Thet = 0
var piv = 6.28/360

B1.slideTo(RCX+radius*Math.sin(piv*theta[0]),RCY+radius*Math.cos(piv*theta[0]))
B2.slideTo(RCX+radius*Math.sin(piv*theta[1]),RCY+radius*Math.cos(piv*theta[1]))
B3.slideTo(RCX+radius*Math.sin(piv*theta[2]),RCY+radius*Math.cos(piv*theta[2]))
B4.slideTo(RCX+radius*Math.sin(piv*theta[3]),RCY+radius*Math.cos(piv*theta[3]))
B5.slideTo(RCX+radius*Math.sin(piv*theta[4]),RCY+radius*Math.cos(piv*theta[4]))
B6.slideTo(RCX+radius*Math.sin(piv*theta[5]),RCY+radius*Math.cos(piv*theta[5]))
setTimeout('circ2(theta, 0)',1000)

}

function circ2(theta, icw){
icw++

var d1x=1
var d1y=1

if (icw > 50 && icw < 125 ) {d1x =-1;d1y=-1}

for (j = 1 ; j< 7 ; j++) {
theta[j-1] += (3.6+(icw/15))*d1x  

sx = 300+d1x*200*Math.sin(0.0174*theta[j-1])
sy = 280+d1y*200*Math.cos(0.0174*theta[j-1])
var s3 = "B"+j+".moveTo("+sx+","+sy+")"
eval(s3)
window.status = "HYPNOTISING ISNT IT ???   " + (200-icw) 
}
if(icw <= 200) setTimeout('circ2(theta,'+icw+')', 5); else {circ3()}

}

function circ3() {

setTimeout('B1.slideTo(0,460,99,70)',1)
setTimeout('B2.slideTo(0,390,77,70)',1)
setTimeout('B3.slideTo(0,320,66,70)',1)
setTimeout('B4.slideTo(0,250,55,70)',1)
setTimeout('B5.slideTo(0,180,44,70)',1)
setTimeout('B6.slideTo(0,110,41,70)',1)
window.status = "thank god thats over"

}

// -->

