function Point () {
	    this.x = 0; 
	    this.y = 0; 
	}


//*******************************************************************
//toolbar object
	function ToolBar(numTools) {
		this.item = new Array(numTools);
		for (i=1; i<=numTools; i++) {
			this.item[i] = new Tool();
		}
		this.count = numTools;
		this.elementID = '';
		this.active = 0;
	}
	function Tool() {
		this.upSRC = '';
		this.downSRC = '';
		this.cmd = '';
		this.type = 0;
		this.id = '';
	}

	//adds tool to toolbar
	function addtool(num,upSRC,downSRC,cmd,typenum,id) {
		this.item[num].upSRC = new Image();
		this.item[num].upSRC.src = upSRC;
		this.item[num].downSRC = new Image();
		this.item[num].downSRC.src = downSRC;
		this.item[num].cmd = cmd;
		this.item[num].type = typenum; //type 1 = tool; type 2 = button
		this.item[num].id = id;
	}

	//resets tools to up image
	//takes tool type and layer name if NS4
	function resettools(tooltype) {
		var theDOM = getDOM();
		if (theDOM=='LAYERS') {
			dom = document.layers[this.elementID].document;
		}
		else {
			dom = document;
		}
		if (tooltype==3) {
			for (i=1; i<=this.count; i++) {
				dom[this.item[i].id].src = this.item[i].upSRC.src;	
			}
		}
		if (tooltype==1||tooltype==2) {
			for (i=1; i<=this.count; i++) {
				if (tooltype==this.item[i].type) {
					dom[this.item[i].id].src = this.item[i].upSRC.src;
				}
			}
		}
	}

	//swaps tool image and returns command name
	//takes tool number and layer name if NS4
	function swaptool(num) {
		
		this.active = num
		var theDOM = getDOM();
		
		if (theDOM=='LAYERS') {
			dom = document.layers[this.elementID].document;
		}
		else {
			dom = document;
		}
		//if (this.item[num].type=1) {
			for (i=1; i<=this.count; i++) {
				dom[this.item[i].id].src = this.item[i].upSRC.src;	
				
			}
		//}
		dom[this.item[num].id].src = this.item[num].downSRC.src;	
		return this.item[num].cmd;
	}

	function activatetool(num) {
		this.active = num
		var theDOM = getDOM();
		if (theDOM=='LAYERS') {
			dom = document.layers[this.elementID].document;
		}
		else {
			dom = document;
		}
		dom[this.item[num].id].src = this.item[num].downSRC.src;	
		return this.item[num].cmd;
	}


	ToolBar.prototype.addTool = addtool;
	ToolBar.prototype.ResetTools = resettools;
	ToolBar.prototype.SwapTools = swaptool;
	ToolBar.prototype.ActivateTool = activatetool;
//*******************************************************************




//*******************************************************************
//dom
function getDOM() {
	var browser = navigator.appName;
	var version = parseInt(navigator.appVersion);
	var DOM = "";
	if (document.getElementById) {
		DOM = "GETID";
	}
	else {
		if (browser != "Microsoft Internet Explorer") {
			if (version<5 ){
				DOM = "LAYERS";			
			}
		}
		else {
			DOM = "ALL";
		}
	}
	return DOM;
}
//*******************************************************************