// Function to set opacity to left-hand navigation items on mouseover.

function setOpacity(value, itemId) 
{
	var leftNavTopShadow = document.getElementById('leftNavTopShadow'+itemId);
	var leftNavBtmShadow = document.getElementById('leftNavBtmShadow'+itemId);
	var leftNavLeftShadow = document.getElementById('leftNavLeftShadow'+itemId);
	var leftNavRightShadow = document.getElementById('leftNavRightShadow'+itemId);	
	var leftNavLinkArea = document.getElementById('leftNavLinkArea'+itemId);	
	
	//if the top shadow row is present, change the opacity of the top curved line above the left nav
	if(leftNavTopShadow!=null){
	    leftNavTopShadow.style.opacity = value/10;
	    leftNavTopShadow.style.filter = 'alpha(opacity=' + value*10 + ')';
	} else {
	    //otherwise, if we're not on the topmost page, change the opacity of the top piece
	    //first get topmost page
	    
	    //otherwise, loop through left nav array, build new array of second levels, and in nav
        myCounter =0
        arrFileName = new Array
	    for(w=0;w<subNavFileName[thisCatIndex].length;w++){
	        //alert(subNavTitle[thisCatIndex][s] + "\n" + s);
	        if(subNavInNav[thisCatIndex][w]==1 && subNavParent[thisCatIndex][w]==""){
	            arrFileName[myCounter] = subNavFileName[thisCatIndex][w]
	            myCounter +=1
	        }
	    }
	    //filename of last second level item in left nav
        var firstFileName = (arrFileName[0]).toLowerCase();
	    
	    
	    if(thisFileName!=firstFileName){
	        document.getElementById("left_nav_crown").style.opacity = value/5;
	        document.getElementById("left_nav_crown").style.filter = 'alpha(opacity=' + value*17 + ')';
	    }
	}
	//if the row containing the shadow exists, go ahead an change transparency
	if(leftNavBtmShadow!=null){
	    leftNavBtmShadow.style.opacity = value/10;
	    leftNavBtmShadow.style.filter = 'alpha(opacity=' + value*10 + ')';
	} else {
	    //otherwise, loop through left nav array, build new array of second levels, and in nav
        myCounter =0
        arrFileName = new Array
	    for(s=0;s<subNavFileName[thisCatIndex].length;s++){
	        //alert(subNavTitle[thisCatIndex][s] + "\n" + s);
	        if(subNavInNav[thisCatIndex][s]==1 && subNavParent[thisCatIndex][s]==""){
	            arrFileName[myCounter] = subNavFileName[thisCatIndex][s]
	            myCounter +=1
	        }
	    }
	    //filename of last second level item in left nav
        var lastFileName = (arrFileName[arrFileName.length-1]).toLowerCase();
        
        if(lastFileName!=thisFileName){
            //current page is not the last item in left nav, go ahead and change the opacity
            document.getElementById("left_nav_end").style.opacity = value/5;
            document.getElementById("left_nav_end").style.filter = 'alpha(opacity=' + value*17 + ')';
            
        }
	}
	leftNavLeftShadow.style.opacity = value/10;
	leftNavLeftShadow.style.filter = 'alpha(opacity=' + value*10 + ')';
	
	leftNavRightShadow.style.opacity = value/10;
	leftNavRightShadow.style.filter = 'alpha(opacity=' + value*10 + ')';
}