// JavaScript Document


function InitNav(){
	if (typeof(OnCellID) == 'undefined' || Sat_GetObj(OnCellID) == false){return}
	BgColor = '#7A7BAD';
	RightCell = getRightCell(OnCellID);
	
	Sat_GetObj(OnCellID).style.backgroundColor = BgColor;
	Sat_GetObj(OnCellID).style.backgroundImage = 'none'
	
	if(RightCell){ 
		RightCell.style.backgroundImage  = 'none';
	}
}


function getRightCell(CellID){
	rightCell = 'Nav' + (parseInt(CellID.substring(3)) + 1)
	return Sat_GetObj(rightCell)
}

function Sat_GetObj(ID) {
/*abstraction layer to deal with the IE vs NN object model */

	if (typeof(ID) != 'undefined' && ID.length != 0){
		if (document.all){	
			if (typeof(eval('document.all.' + ID)) != 'undefined' ){
				return eval('document.all.' + ID)
			}
		}
		else if (document.getElementById){
			if (typeof(document.getElementById(ID))!= 'undefined' && document.getElementById(ID) != null){
				return document.getElementById(ID)
			}
		}
	}
	return false
}


function ToggleNav(Cell, direction) {
	if (!window.OnCellID){OnCellID = ""}
	if (OnCellID == Cell.id) {return;} //don't touch the current on cell
	
	RightCell = getRightCell(Cell.id);
	
	//ColorOn = '#CF0000';
	ColorOn = '#7A7BAD';
	ColorOff = 'transparent';
	ImgOn = 'none';
	ImgOff = 'url(images/divider.gif)';
	
	BgImg = eval('Img' + direction);
	BgColor = eval('Color' + direction);

	if (document.all || document.getElementById){
		Cell.style.backgroundColor = BgColor;
		if (Cell.id != 'Nav1' && Cell != getRightCell(OnCellID)){Cell.style.backgroundImage = BgImg;}
		if(RightCell && RightCell.id != OnCellID) {
			RightCell.style.backgroundImage   = BgImg;
		}
	}
}
