// JavaScript Document
/**********
* Copyright 2007 Gregg B Larson
* All Rights reserved
***********/

function fret(){
	this.defaultbgcolor = "#996633";
	this.historycolor = "#0000FF"
	this.scalecolor = "#FF0000";
	this.scalehightlightcolor = "FFFF00";
	this.mousecolor = "#00FF00";
	
	this.sI = function(e){
		//swap image
	var newbg = "#00FF00";
	if(e.style.backgroundColor == "rgb(0, 0, 255)"){
		newbg = "#00FFFF";
	} else if(e.style.backgroundColor == "rgb(255, 0, 0)"){
		newbg = "#FFFF00";
	} else if(e.style.backgroundColor == "rgb(0, 255, 0)"){
		newbg = "#996633";
	}
	e.oldbg = e.style.backgroundColor;
	e.style.backgroundColor = newbg;
	var strElem = "note_" + e.id;
	e.oldnote = $(strElem).innerHTML;
	$(strElem).style.backgroundColor = newbg;
	if($(strElem).innerHTML == ""){
		$(strElem).innerHTML = e.title;
	}
	
	this.rI = function(e){
//replace image
var strElem = "note_" + e.id;

		if(e.style.backgroundColor ==  "rgb(0, 0, 255)"){
			e.style.backgroundColor = "#0000FF";
			$(strElem).style.backgroundColor = "";
		} else {
			e.style.backgroundColor = e.oldbg; 
			$(strElem).style.backgroundColor = "";
		}//"#996633";
			$(strElem).innerHTML = e.oldnote;
		}
	}
	
	this.ClrBrd = function (){
		for(i=5;i>=0;i--){
			for(j=0;j<=21;j++){
				var strID = (i+1) + "" + j;
				var strElem = "note_" + strID;
				//debug(strID);
				//$(strID).style.background = "#996633";
				$(strElem).innerHTML = "";
				$(strElem).style.backgroundImage = "";
			}
		}
	}
}
