

function hand() {
	var objImg = window.event.srcElement.id;
	document.all(objImg).className = "hand";

}

function hand2() {
	var objTable = window.event.srcElement.parentElement.parentElement.parentElement;
	var sId = objTable.id;
	if (window.event.srcElement.tagName == "TD") {
		document.all(sId).className = "hand2";
	}
}


function movingthing (xcoord, distance, lracc, rlacc, divstyle) {
	this.xcoord = xcoord;
	this.distance = distance;
	this.lracc = lracc;			
	this.rlacc = rlacc;			
	this.divstyle = divstyle;
	this.status = "closed";
	this.currentx = 0; 
	this.close = close;
	this.open = open;
	this.animate = animate;	
	this.draw = draw;	
	this.distancetomove = distancetomove;	
}
function close() {
	this.status = "closed";
}
function open() {
	this.status = "open";
}
function animate() {
	if (this.status == "closed") {
		if (this.currentx > 0) {
			this.currentx = this.currentx - this.distancetomove(this.rlacc);
			if (this.currentx < 0) {
				this.currentx = 0;
			}
			this.draw();
		}
	}
	else {
		if (this.currentx < this.distance) {
			this.currentx = this.currentx + this.distancetomove(this.lracc);
			if (this.currentx > this.distance) {
				this.currentx = this.distance;
			}
			this.draw();
		}
	}
}

function draw() {
	this.divstyle.left = (this.xcoord + this.currentx);
}

function distancetomove(a) {
	return (1 + this.currentx * a);
}

var numberofmovingthings = 6;	// a global variable
var themovingthings = new Array(numberofmovingthings);

function createmovingthings() {
	themovingthings[0] = new movingthing(0, 300, 0.06, 0.21, document.all["conTRola"].style);
	themovingthings[1] = new movingthing(60, 300, 0.09, 0.18, document.all["conTRolb"].style);
	themovingthings[2] = new movingthing(120, 300, 0.12, 0.15, document.all["conTRolc"].style);
	themovingthings[3] = new movingthing(180, 300, 0.15, 0.12, document.all["conTRold"].style);
	themovingthings[4] = new movingthing(240, 300, 0.18, 0.09, document.all["conTRole"].style);
	themovingthings[5] = new movingthing(300, 300, 0.21, 0.06, document.all["conTRolf"].style);

	themovingthings[0].draw();
	themovingthings[1].draw();
	themovingthings[2].draw();
	themovingthings[3].draw();
	themovingthings[4].draw();
	themovingthings[5].draw();
}

function select(n) {
	var counter = 0;

	do {
		themovingthings[counter].close();
		counter++;
	} while (counter <= n)

	while (counter < numberofmovingthings) {
		themovingthings[counter].open();
		counter++;
	}
}

function doframe() {
	for (var c=0; c < numberofmovingthings; c++) {
		themovingthings[c].animate();
	}
}

function showStatus(bFlag) {
	var sImgId = window.event.srcElement.id;
	if (bFlag){
		switch (sImgId){
			case "img1":
				window.status = "words";
				break;
			case "img2":
				window.status = "about";
				break;
			case "img3":
				window.status = "music";
				break;
			case "img4":
				window.status = "cam";
				break;
			case "img5":
				window.status = "contact";
				break;
			case "img6":
				window.status = "links";
				break;
			case "imgGbook":
				window.status = "gbook";
				break;
			case "imgPortal":
				window.status = "cam portal";
				break;
			case "imgSong":
				window.status = "mp3";
				break;
		}
		return false;
	}
	else {
		window.status = '';
	}
}	

var objDataRow;
function selectCell(){
	var objTarget = window.event.srcElement;
	var objTable = document.getElementById('tblMusicBands');
	var sId = objTarget.id;
	if (objTarget.tagName == "TD") {
		if (objTarget.className == "dataRowOn") {
				objDataRow.className = "dataRowOff";
				objDataRow = null;
				for (i=0; i < objTable.rows.length; i++){
					objTable.rows[i].className = "trHid";
				}
		}
		else {
			if (objDataRow != null) {
				objDataRow.className = "dataRowOff";
				for (i=0; i < objTable.rows.length; i++){
					objTable.rows[i].className = "trHid";
				}
			}
			objDataRow = objTarget;
			objDataRow.className = "dataRowOn";
			objTable.all(sId).className = "tdUnHid";
			
		}
	}
	else { return false; } 
}


