var faded = 0;
function fadeInOut(id) {
	if( faded == 1 ) {
		faded = 0;
		opacity(id, 0, 100, 3000);
	}
	else {
		faded = 1;
		opacity(id, 100, 0, 3000);
	}
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

var myimages=new Array()
function preloadmenuimages(){
 for (i=0;i<preloadmenuimages.arguments.length;i++){
  myimages[i]=new Image()
  myimages[i].src=preloadmenuimages.arguments[i]
 }
}

function filter(imagename,objectsrc){
 if (document.images)
  document.images[imagename].src=eval(objectsrc+".src")
}

preloadmenuimages(
"images/TVback.jpg",
"images/buttons/ViArt.jpg",
"images/buttons/ViArt-.jpg",
"images/buttons/DaveWeb.jpg",
"images/buttons/DaveWeb-.jpg",
"images/buttons/abode.jpg",
"images/buttons/abode-.jpg",
"images/buttons/RoadTrips.jpg",
"images/buttons/RoadTrips-.jpg",
"images/buttons/OtherTrips.jpg",
"images/buttons/OtherTrips-.jpg",
"images/buttons/cars.jpg",
"images/buttons/cars-.jpg",
"images/buttons/family.jpg",
"images/buttons/family-.jpg",
"images/buttons/odds.jpg",
"images/buttons/odds-.jpg",
"images/buttons/new.jpg",
"images/buttons/new-.jpg",
"images/buttons/contact.jpg",
"images/buttons/contact-.jpg",
"images/buttons/home.jpg",
"images/buttons/home-.jpg"
)

cViArt7=new Image(90,22)
cViArt7.src="images/buttons/ViArt.jpg"
cViArt2=new Image(90,22)
cViArt2.src="images/buttons/ViArt-.jpg"

cDaveWeb7=new Image(90,22)
cDaveWeb7.src="images/buttons/DaveWeb.jpg"
cDaveWeb2=new Image(90,22)
cDaveWeb2.src="images/buttons/DaveWeb-.jpg"

cabode7=new Image(90,22)
cabode7.src="images/buttons/abode.jpg"
cabode2=new Image(90,22)
cabode2.src="images/buttons/abode-.jpg"

cRoadTrips7=new Image(90,22)
cRoadTrips7.src="images/buttons/RoadTrips.jpg"
cRoadTrips2=new Image(90,22)
cRoadTrips2.src="images/buttons/RoadTrips-.jpg"

cOtherTrips7=new Image(90,22)
cOtherTrips7.src="images/buttons/OtherTrips.jpg"
cOtherTrips2=new Image(90,22)
cOtherTrips2.src="images/buttons/OtherTrips-.jpg"

ccars7=new Image(90,22)
ccars7.src="images/buttons/cars.jpg"
ccars2=new Image(90,22)
ccars2.src="images/buttons/cars-.jpg"

cfamily7=new Image(90,22)
cfamily7.src="images/buttons/family.jpg"
cfamily2=new Image(90,22)
cfamily2.src="images/buttons/family-.jpg"

codds7=new Image(90,22)
codds7.src="images/buttons/odds.jpg"
codds2=new Image(90,22)
codds2.src="images/buttons/odds-.jpg"

cnew7=new Image(90,22)
cnew7.src="images/buttons/new.jpg"
cnew2=new Image(90,22)
cnew2.src="images/buttons/new-.jpg"

ccontact7=new Image(90,22)
ccontact7.src="images/buttons/contact.jpg"
ccontact2=new Image(90,22)
ccontact2.src="images/buttons/contact-.jpg"

chome7=new Image(90,22)
chome7.src="images/buttons/home.jpg"
chome2=new Image(90,22)
chome2.src="images/buttons/home-.jpg"

