///////////////////////////////////////////////////////////////////////////////
// 							Colegrove
//
//	Dependencies:	apix.js		  				
//
//	Author:		Paul Coleman	  
//	Written:	8/16/1999 
//	Modified:	9/16/99 
// Copyright © 1999 by Computer Services Contracting. All rights reserved.
// permision for use granted freely for any non-commercial use as long as 
// credit is given to Computer Services Contracting. 
///////////////////////////////////////////////////////////////////////////////
if (!apix) {
	alert("Colegrove script (Colegrove.js) requires apix.js to be loaded.  Contact the WebMaster to report this problem.");
} else {
};
function ColegroveInit2() {
	if(is.DHTMLup) {
		xbInit();
		ImageInit();
		window.document.all.Wand.style.visibility = "visible";
		window.document.all.BubbleLarge.style.visibility = "visible";
		window.document.all.BubbleMedium.style.visibility = "visible";
		window.document.all.BubbleLittle.style.visibility = "visible";
//		with (window.document.all) {
//			Wand.style.visibility = "visible";
//			BubbleLarge.style.visibility = "visible";
//			BubbleMedium.style.visibility = "visible";
//			BubbleLittle.style.visibility = "visible";
//		};
		animate();
	} else {
		win2=window.open('','window2','scrollbars=yes height=100 width=400 dependent');
		win2.document.writeln('<P><B><H1>This Page uses advanced programming techniques to display a moving bubble wand and your browser does not support these features.</H1></B><BR>');
		win2.document.writeln('You will be able to view the rest of the pages normally without the moving bubble wand, simply close this window.<BR>');
		win2.document.writeln('To view these pages as designed, you will need to get either Netscape Navigator 4.06 or newer or Internet Explorer 4.0 or newer.</P>');
	};
};
function ImageInit() {
	LeftWand = new Image();
	LeftWand.src = "images/WandOnlyLeft.gif";
	LeftWand.width = 92;
	LeftWand.height = 57;
//width: 92; height: 57;	
	
	RightWand = new Image();
	RightWand.src = "images/WandOnlyRight.gif";
	RightWand.width = 92;
	RightWand.height = 57;
		
	iBubbleLarge = new Image();
	iBubbleLarge.src = "images/BubbleLarge.gif";
	iBubbleLarge.width = 31;
	iBubbleLarge.height = 30;
//width: 31 height: 30

	iBubbleMedium = new Image();
	iBubbleMedium.src = "images/BubbleMedium.gif";
	iBubbleMedium.width = 22;
	iBubbleMedium.height = 20;
//width="22" height="20"

	iBubbleLittle = new Image();
	iBubbleLittle.src = "images/BubbleLittle.gif";
	iBubbleLittle.width = 15;
	iBubbleLittle.height = 13;
//width="15" height="13";

	window.document.imgWandOnly.src = LeftWand.src;
	window.document.imgWandOnly.width = 92;
	window.document.imgWandOnly.height = 57;
	window.document.all.Bubbles.style.left = 20;

	window.document.imgBubbleLarge.src = iBubbleLarge.src;
	window.document.imgBubbleLarge.width = 31;
	window.document.imgBubbleLarge.height = 30;

	window.document.imgBubbleMedium.src = iBubbleMedium.src;
	window.document.imgBubbleMedium.width = 22;
	window.document.imgBubbleMedium.height = 20;

	window.document.imgBubbleLittle.src = iBubbleLittle.src;
	window.document.imgBubbleLittle.width = 15;
	window.document.imgBubbleLittle.height = 13;

//	with (window.document) {
//
//		imgWandOnly.src = LeftWand.src;
//		imgWandOnly.width = 92;
//		imgWandOnly.height = 57;
//		all.Bubbles.style.left = 20;
//
//		imgBubbleLarge.src = iBubbleLarge.src;
//		imgBubbleLarge.width = 31;
//		imgBubbleLarge.height = 30;
//
//		imgBubbleMedium.src = iBubbleMedium.src;
//		imgBubbleMedium.width = 22;
//		imgBubbleMedium.height = 20;
//
//		imgBubbleLittle.src = iBubbleLittle.src;
//		imgBubbleLittle.width = 15;
//		imgBubbleLittle.height = 13;
//	};

};

function FlipWand(sDirection) {
//	switch (sDirection) {
//	case "x":
	if (sDirection = "x") {
//		with (window.document) {
			if (window.document.all.Wand.Bounce.X_Delta < 0) {
				window.document.imgWandOnly.src = LeftWand.src;
				window.document.all.Bubbles.style.left = 20;
//				imgWandOnly.src = LeftWand.src;
//				all.Bubbles.style.left = 20;
			} else {
				window.document.imgWandOnly.src = RightWand.src;
				window.document.all.Bubbles.style.left = 0;
//				imgWandOnly.src = RightWand.src;
//				all.Bubbles.style.left = 0;
			};
//		};
	};
//		break;
//	case "y":
//		break;
//	default:
//	};
	
};

function animate() {
	document.all.Wand.Bounce = new axMoveInBounce(document.all.Wand,-1,1, FlipWand);
	document.all.Wand.Bounce.Start();

	document.all.BubbleLarge.Circle = new axMoveInCircle(document.all.BubbleLarge,270,1,15);
	document.all.BubbleLarge.Circle.Start();

	document.all.BubbleLittle.Oval = new axMoveInOval(document.all.BubbleLittle,270,-3,20,25);
	document.all.BubbleLittle.Oval.Start();

	document.all.BubbleMedium.Oval = new axMoveInOval(document.all.BubbleMedium,270,2,23,8);
	document.all.BubbleMedium.Oval.Start();
//	with (document.all) {
//
//		Wand.Bounce = new axMoveInBounce(document.all.Wand,-1,1, FlipWand);
//		Wand.Bounce.Start();
//
//		BubbleLarge.Circle = new axMoveInCircle(document.all.BubbleLarge,270,1,15);
//		BubbleLarge.Circle.Start();
//
//		BubbleLittle.Oval = new axMoveInOval(document.all.BubbleLittle,270,-3,20,25);
//		document.all.BubbleLittle.Oval.Start();
//
//		BubbleMedium.Oval = new axMoveInOval(document.all.BubbleMedium,270,2,23,8);
//		BubbleMedium.Oval.Start();
//	};
};

