//**************
//Functions.js
//**************

var intButtonSelected=0


function Switch(layer){

	//	alert(layer)

	switch (layer) {

		//Switch is THE function to call.	
	
		//Case 0 assumes Small Icons are visble (keeps state)
		case 0:{
			document.all['LargeIcons'].style.visibility = 'hidden';
			break;
		}
	
		//case 1 assumes large icons as visible (keeps state)
		case 1:{
			document.all['LargeIcons'].style.visibility = 'visible';
			break;
		}
	
		//case 2 assumes small icons are visible and no button is selected
		case 2:{
			document.all['LargeIcons'].style.visibility = 'hidden';
			DeselectNerve() 
			break;
		}

		//case 3 assumes large icons are visible and no button is selected
		case 3:{
			document.all['LargeIcons'].style.visibility = 'visible';
			DeselectNerve() 
			break;
		}
	}
	
}


//Navigation: Mouse Roll Over
function NerveButtonOver(numb, channel) {
	if (intButtonSelected!=1) {
		var name;
		
		//SMALL FIRST
		name = ""+"Images/"+eval("small_rollon_"+numb);		
		var imgid = "SmallimgNerveButton" + numb;
		document.images[imgid].src= name;		
		
		//LARGE SECOND
		name = ""+"Images/"+eval("large_rollon_"+numb);		
		var imgid = "imgNerveButton" + numb;
		document.images[imgid].src= name;
		
		}
	}

//Navigation: Click (button down)
function NerveButtonDown(numb, channel) {
	var name;
		//SMALL FIRST
		name = ""+"Images/"+eval("small_rolloff_"+numb);
		var imgid = "SmallimgNerveButton" + numb;
		document.images[imgid].src= name;
			
		//LARGE SECOND
		name = ""+"Images/"+eval("large_rolloff_"+numb);		
		var imgid = "imgNerveButton" + numb;
		document.images[imgid].src= name;
	}

//Navigation: Mouse out
function NerveButtonOut(numb, channel) {
	if (intButtonSelected!=1) {
		var name;
		//SMALL FIRST
		name = ""+"Images/"+eval("small_normal_"+numb);
		var imgid = "SmallimgNerveButton" + numb;
		document.images[imgid].src= name;	

		//LARGE SECOND
		name = ""+"Images/"+eval("large_normal_"+numb);		
		var imgid = "imgNerveButton" + numb;
		document.images[imgid].src= name;
		}
	}

//Navigation: click (button up)
function NerveButtonUp(numb, channel) {
	intButtonSelected=1;
		var name;
		//SMALL FIRST
		name = ""+"Images/"+eval("small_selected_"+numb);
		var imgid = "SmallimgNerveButton" + numb;
		document.images[imgid].src= name;	
		//LARGE SECOND
		name = ""+"Images/"+eval("large_selected_"+numb);		
		var imgid = "imgNerveButton" + numb;
		document.images[imgid].src= name;
		
		top.CHANNELCONTENT.location = 'infChannelOnDemand0' + numb + '.htm';
		
		
	}

//Deselect all buttons
function DeselectNerve() {	
	
	//SMALL FIRST
	var name;
	for(i=1; i <= intChannelCount;){
		name = ""+"Images/"+eval("small_normal_"+i);
		var imgid = "SmallimgNerveButton" + i;
		document.images[imgid].src= name;
		i++;	
	}
	
	//LARGE SECOND
	for(i=1; i <= intChannelCount;){
		name = ""+"Images/"+eval("large_normal_"+i);
		var imgid = "imgNerveButton" + i;
		document.images[imgid].src= name;
		i++;	
	}	
}

//Scroll Functions
function ScrollUpDown() {	
	//document.images['imgChannelsScrollLayerScrollUp'].src='Images/BTN_CHANSCR1_D.gif'
}
function ScrollDownDown(){
	//document.images['imgChannelsScrollLayerScrollDown'].src='Images/BTN_CHANSCR2_D.gif'
}
function ScrollUpUp() {
	//document.images['imgChannelsScrollLayerScrollUp'].src = 'Images/BTN_CHANSCR1_U.gif';
}
function ScrollDownUp(){
	//document.images['imgChannelsScrollLayerScrollDown'].src = 'Images/BTN_CHANSCR2_U.gif';
}


