function alertVacation(){
alert("**Please note that all orders will not be processed until after the 24th of July!** \n Thank you.");
}

function test(){
var x = document.getElementById('whatIfThis').value.length;
alert(x);
}

//SETTING MY RANDOM-IMAGE for the SILLYFACE icon//
        image_sources = new Array();

        //Here's where you set up your list of images:
        //When adding one, be sure to give it the next
        //number in square brackets []
        //The first image must be [0].

        image_sources[0] = "images/halfBigIcons/halfBigIcon-sillyFace";
        image_sources[1] = "images/halfBigIcons/halfBigIcon-sillyFace-2";
        image_sources[2] = "images/halfBigIcons/halfBigIcon-sillyFace-3";
        image_sources[3] = "images/halfBigIcons/halfBigIcon-sillyFace-4";
        image_sources[4] = "images/halfBigIcons/halfBigIcon-sillyFace-5";
               
       function random_image() {
            rindex = Math.floor(Math.random() * image_sources.length);
            document.rotating_image_g.src = image_sources[rindex]+"-g.jpg";
			document.rotating_image.src = image_sources[rindex]+".jpg";
        }
//END//

var slides = new Array;
slides[0] = new Array("homeImage-matchbox.jpg","view work samples","workSamplePages/samples-matchbox.html");
slides[1] = new Array("homeImage-engine.jpg","collaborate with us","javascript:showHide('yes','engineInfo')");
slides[2] = new Array("homeImage-clalona.jpg","view work samples","workSamplePages/samples-clalona.html");
slides[3] = new Array("homeImage-albums.jpg","view work samples","workSamplePages/samples-tripping.html");
slides[4] = new Array("homeImage-glider.jpg","view work samples","workSamplePages/samples-glider.html");
slides[5] = new Array("homeImage-ep.jpg","view work samples","workSamplePages/samples-ep.html");
slides[6] = new Array("homeImage-naples.jpg","view work samples","workSamplePages/samples-naples.html");
slides[7] = new Array("homeImage-elephantJournal.jpg","view work samples","workSamplePages/samples-elephantJournal.html");
var showLength = slides.length;


function startSlideShow(){
t=setTimeout("slideShow('down')",5000);
}

function setNavNugget(arg){
for(e=1;e<9;e++){
if(e==arg){
document.getElementById("nugget-"+e).className = "navNuggetPresent";
}else{
document.getElementById("nugget-"+e).className = "navNugget";
}
}
}

var i=0;
var eop=100;
function slideShow(dir){
if (dir == 'down'){
	if (eop>0){
	document.getElementById("homeImage").style.filter = "alpha(opacity="+eop+")";
	document.getElementById("homeImage").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+eop+")";
	document.getElementById("homeImage").style.MozOpacity = eop+"%";
	document.getElementById("homeImage").style.KhtmlOpacity = eop/100;
	document.getElementById("homeImage").style.opacity = eop/100;
	eop=eop-1;
	t=setTimeout("slideShow('down')",10);
    }else{
	  document.getElementById("homeImage").src = "images/homeImages/"+slides[i][0];
	  document.getElementById("linkIndicator").innerHTML = slides[i][1];
	  document.getElementById("homeImageLink").href = slides[i][2];
	  i++;
	  slideShow('up');
	  }
}else{
    if (eop<100){
	document.getElementById("homeImage").style.filter = "alpha(opacity="+eop+")";
	document.getElementById("homeImage").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+eop+")";
	document.getElementById("homeImage").style.MozOpacity = eop+"%";
	document.getElementById("homeImage").style.KhtmlOpacity = eop/100;
	document.getElementById("homeImage").style.opacity = eop/100;
	eop=eop+1;
	if(eop==50){setNavNugget(i);}
	t=setTimeout("slideShow('up')",10);
    }else{
       if(i<showLength){
       t=setTimeout("slideShow('down')",4000);
	   }else{
	   i=0;
	   t=setTimeout("slideShow('down')",4000);
	   }
  }
 }
}

var wmt=0;
function flyWhatIf(dir){
if(dir=='out'){
  if (wmt>-57){
  document.getElementById("whatIfScreenImg").style.marginTop = wmt+"px";
  wmt=wmt*1.04-1;
  t=setTimeout("flyWhatIf('out')",10);
  }
}else{
  if (wmt<0){
  document.getElementById("whatIfScreenImg").style.marginTop = wmt+"px";
  wmt=wmt*0.98+1;
  t=setTimeout("flyWhatIf()",10);
  }
}
}

var wddh=0;
function dropDownWhatIf(dir){
if (dir=='close'){
if (wddh>0){
  document.getElementById("whatIfDropDown").style.height = wddh+"px";
  wddh=wddh*0.98-1;
  t=setTimeout("dropDownWhatIf('close')",10);
  }
}else{
  if (wddh<148){
  document.getElementById("whatIfDropDown").style.height = wddh+"px";
  wddh=wddh*1.04+1;
  t=setTimeout("dropDownWhatIf()",10);
  }else{
  scrollMarker=0;
  pageScroll();
  }
}
}

var opac=100;
var doneArray = new Array;

/*NOTE to SELF: The following function was made a little more complex by the need to only fade the image out once.
'doneArray' is an array to which each id that gets sent to the fadeOut function gets added. At the 
start of the fadeout function, it checks to see if the array contains the id sent in as a parameter. 
If it does, it returns null. If it does not, it carries out the fade out effect and adds that id to the array.*/

function fadeOut(id){
var doneArrayLength = doneArray.length;
for (x=0;x<doneArrayLength;x++){
if (doneArray[x] == id){
	return null;
	}
}

if(opac>2){
	document.getElementById(id).style.filter = "alpha(opacity="+opac+")";
	document.getElementById(id).style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+opac+")";
	document.getElementById(id).style.MozOpacity = opac+"%";
	document.getElementById(id).style.KhtmlOpacity = opac/100;
	document.getElementById(id).style.opacity = opac/100;
	opac=opac-2;
	proxyID=id;//just passing in 'id' to the timeout below doesn't seem to work.
	t=setTimeout("fadeOut(proxyID)",10);
	}else{
	doneArray.unshift(id);
	opac=100;
	}
}


