// JavaScript Document
var defaultIndex = 0;
var procedureIndex = defaultIndex;

function changePicture( index, url )
{
	var myIndex = 0;
	var str;
	for( j = 0 ; j < this.document.images.length; j++ )
	{
		str = this.document.images[j].src;
		if( 
			( str.indexOf("light_off.gif") > 0 )
			||
			( str.indexOf("light_on.gif") > 0 )
		)
		{
			if( myIndex == index )
			{
				this.document.images[j].src = url;
				//return;
			}
			myIndex++;		
		}
	}
}


function setIndex( index)
{

	// set the new index
	procedureIndex = index;
	
	
	//if( this.Target.document.links != null )
	try
	{
		if(this.document.links.length > 5 )
		{
			// reset the link colors for the procedure list page
			for( i = 0; i < this.document.links.length; i++ )
			{
			  
			 //this.Target.document.links[i].style.color = 0x0066CC;
			  //this.document.links[i].style.fontSize = regular_font_size;
			  //this.document.links[i].style.fontWeight = "normal"; 
			  //this.Target.document.links[i].style.fontWeight = "normal";
			  if( this.document.images.length >  0)
			
			  {
				//this.Target.document.images[i].src = "../../../graphics/procedure-arrows/blank.gif";
				changePicture( i, "images/light_off.gif");
			
			  }
			}
			// set the highlight
			//this.Target.document.links[procedureIndex-defaultIndex].style.color = selColor;
			//this.document.links[procedureIndex-defaultIndex-1].style.fontSize = selected_font_size ;
			//this.document.links[procedureIndex-defaultIndex-1].style.fontWeight = "bold"; 
			//this.document.links[procedureIndex-defaultIndex-1].blur();
			
			if( this.document.images.length >  0)
			{
			  //this.Target.document.images[procedureIndex-defaultIndex].src = "../../../graphics/procedure-arrows/arrow.gif";
			  changePicture( [procedureIndex-defaultIndex-1], "images/light_on.gif");
			}
			
			// go to the anchor
	  		this.window.location = "#" + procedureIndex;
		}
	}
	catch(error)
	{
	}
}