function preloading(slideList){

	for (x=0; x<slideList.length; x++){

		myimages[x] = new Image();

		myimages[x].src = slideList[x];

	}

}


var myimages = new Array();
   
   
    
   
      var slideIndex = new Array(-1,-1,-1,-1,-1,-1,-1,-1); // which slide are we viewing?
	  var slideObj = new Array(new Array(),new Array(),new Array(),new Array(),new Array(),new Array(),new Array(),new Array());
	  var boxes = new Array('fadebox-0','fadebox-1','fadebox-2','fadebox-3','fadebox-4','fadebox-5','fadebox-6','fadebox-7');
   
      var fadeTimer = 500; // time, in seconds, it takes to swap images
   
      var swapTimer = 3; // time, in seconds, between image swaps
   
       
   
    
	  
	 
    
  function findUnused(){
  	var available = false;
	var startIndex;
	while(!available){
	    startIndex = Math.floor(Math.random()*slides.length);
		available = true;
		for(var k=0;k<slideIndex.length;k++){
			if(slideIndex[k] == startIndex)
				available = false;
		}
	}
	return startIndex;
  
  }
       
  
      function doSwap() {
	  	  var currentBox=Math.floor(Math.random()*8);
  
          var currentIndex = slideIndex[currentBox]; 
		  
		  var newIndex= findUnused();
		  
		 
  
         
  
          slideIndex[currentBox] = newIndex; // update slide index
  
          fade(currentIndex,currentBox,0); // fade the old slide out
  
          fade(newIndex,currentBox,1); // fade the new slide in!
  
          setTimeout("doSwap()",swapTimer*1000); // do it again in swapTimer seconds
  
      }
  
       
  
      function fade(index,box,dir) {
  		 var slide = document.getElementById('box-'+index); // get the slide element at index whoid
         
		 var fadebox = document.getElementById(boxes[box]);
		 fadebox.appendChild(slide); // put the image in the box
          var anim;
		 if(dir > 0)
		     anim = new YAHOO.util.ColorAnim(slide, {  opacity: {from:0, to: 1 } }, 2, YAHOO.util.Easing.easeOut);
		 else
		 	anim = new YAHOO.util.ColorAnim(slide, {  opacity: {from:1, to: 0 } }, 2, YAHOO.util.Easing.easeOut);		

		 anim.animate();
      }
	  
	
  
    function WindowOnload(oNewOnloadFunction) {
    var oPreviousOnloadFunction = window.onload;
    window.onload = function() { 
        if (oPreviousOnloadFunction) { oPreviousOnloadFunction(); }
        oNewOnloadFunction();
   	 }
	}

    function blankit(input)
    {
    	if(input.value == 'your email')
    		input.value = '';
    }
	

	

  
    
   
