//******************************************************************************************
// these scripts are for the image preloader functions 
/*document.write("<style type='text/css'>#carfade {visibility:hidden;}</style>");

function initImage() 
{
	imageId = 'carfade';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}

function fadeIn(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj = document.getElementById(objId);
		if (opacity <= 100) 
		{
			setOpacity(obj, opacity);
			opacity += 10;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		}
	}
}

function setOpacity(obj, opacity) 
{
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

window.onload = function() {
    initImage()
} */

var newLink, randImg, currOpac;

var imgs		= new Array();				
imgs[imgs.length]	= "images/cars/car1.jpg";
imgs[imgs.length]	= "images/cars/car2.jpg";
imgs[imgs.length]	= "images/cars/car3.jpg";
imgs[imgs.length]	= "images/cars/car4.jpg";
imgs[imgs.length]	= "images/cars/car5.jpg";
imgs[imgs.length]	= "images/cars/car6.jpg";
imgs[imgs.length]	= "images/cars/car7.jpg";
imgs[imgs.length]	= "images/cars/car8.jpg";
imgs[imgs.length]	= "images/cars/car9.jpg";
imgs[imgs.length]	= "images/cars/car10.jpg";
imgs[imgs.length]	= "images/cars/car11.jpg";
imgs[imgs.length]	= "images/cars/car12.jpg";
imgs[imgs.length]	= "images/cars/car13.jpg";
imgs[imgs.length]	= "images/cars/car14.jpg";
imgs[imgs.length]	= "images/cars/car15.jpg";
imgs[imgs.length]	= "images/cars/car16.jpg";
imgs[imgs.length]	= "images/cars/car17.jpg";



function alter(el_id){

  document.getElementById(el_id).src	= imgs[ Math.floor(Math.random() * imgs.length) ];
  document.getElementById(el_id).style.visibility	= "hidden";

  window.onload = function(){ 
    fadeIn(el_id, 0);
  }

}



function fadeIn(el, currOpac){

  el = document.getElementById(el);

  el.style.visibility	= "visible";				// Un-hides the image.

  currOpac		+= 3;
  currOpac		= (currOpac>100) ? 100 : currOpac ;

  el.style.filter	= "alpha(opacity:"+currOpac+")";
  el.style.KHTMLOpacity = currOpac / 100;
  el.style.MozOpacity	= (currOpac>=100) ? 0.9999 : currOpac/100;	// Prevent flicker in Moz.
  el.style.opacity	= (currOpac>=100) ? 0.9999 : currOpac/100;	// Prevent flicker in Moz.

  if(currOpac < 100){
    setTimeout("fadeIn('" + el.id + "', " + currOpac + ")", 40);
  }

}
