﻿//Rollovers

if (document.images) {
     button1 = new Image
     button2 = new Image
     button3 = new Image
     button4 = new Image
     button5 = new Image
     button6 = new Image
     button7 = new Image
     button8 = new Image
     button9 = new Image
     button10 = new Image
     button11 = new Image
     button12 = new Image
     button13 = new Image
     button14 = new Image
     button15 = new Image
     button16 = new Image
     button17 = new Image
     button18 = new Image
     button19 = new Image
     button20 = new Image                    
     button21 = new Image
     button22 = new Image  
     
     button1.src = 'images/tab-home.jpg'
     button2.src = 'images/tab-home-over.jpg'
     button3.src = 'images/tab-gallery.jpg'
     button4.src = 'images/tab-gallery-over.jpg'
     button5.src = 'images/tab-ourstaff.jpg'
     button6.src = 'images/tab-ourstaff-over.jpg'
     button7.src = 'images/tab-directions.jpg'
     button8.src = 'images/tab-directions-over.jpg'
	 button9.src = 'images/tab-contact.jpg'
     button10.src = 'images/tab-contact-over.jpg'
     button11.src = 'images/cunningham.jpg'
     button12.src = 'images/cunningham2.jpg'
     button13.src = 'images/gall-nav-tl.jpg'
     button14.src = 'images/gall-nav-tl-over.jpg'
     button15.src = 'images/gall-nav-rs.jpg'
     button16.src = 'images/gall-nav-rs-over.jpg'
     button17.src = 'images/gall-nav-sfs.jpg'
     button18.src = 'images/gall-nav-sfs-over.jpg'
     button19.src = 'images/gall-nav-os.jpg'
     button20.src = 'images/gall-nav-os-over.jpg'
     button21.src = 'images/tab-affiliates.jpg'
     button22.src = 'images/tab-affiliates-over.jpg'     

 }
//--><script>
var arrButns = new Array(4);
for(var i=0; i<arrButns.length;i++){
	arrButns[i]=0;
}
function load(){
	menuNav(0,3,'gallery_tl.html')
}
function menuNav(inClick,inState,inLoc){
//0=no-status,1=over,2=out,3=click/active
	for(var i=0; i<arrButns.length;i++){
		oImg=document.getElementById("butt"+i)
		if(parseInt(inClick)!=parseInt(i)){
			//all other buttons
			if(parseInt(inState)==3){
				oImg.src=oImg.src.replace("-over","").replace("-active","");
				arrButns[i]=2;
			}
		}else{
			//this button
			if(oImg.src.indexOf("-active")==-1){
				if(parseInt(arrButns[i])!=3){
					switch(parseInt(inState)){
						case 1://over
							oImg.src=oImg.src.replace(".jpg","-over.jpg");
							break;
							
						case 2://out						
							oImg.src=oImg.src.replace("-over","");
							break;
							
						case 3://click
							if(oImg.src.indexOf("-active")==-1){
//								alert(oImg.src)
								oImg.src=oImg.src.replace("-over","").replace(".jpg","-active.jpg");
//								alert(oImg.src)
							}
							arrButns[i]=3;
							frames['gallery'].location.href=inLoc;
							break;
					}
				}
			}
		}
	}
}