    images = new Array();
    descriptions = new Array();
    altTexts = new Array();
    
    imagesTemp = images;
    imageObj = new Image();
    var imageIndex = 0;
    var startValue=0;
    var reset = false;
    
    
 function preloader(theUrl,theDesc,theAlt){
     var i = 0;
  	 var urls = theUrl.split("*");
	 var descs = theDesc.split("*");
	 var alts = theAlt.split("*");
     
     // set image list
     for(var j = 0; j < urls.length; j++){
     images[j] = urls[j];
     descriptions[j] = descs[j];
     altTexts[j] = alts[j];
     }
     

     // start preloading
     for(i=0; i<=images.length-1; i++){
          imageObj.src=images[i];
          imageIndex++;
    }
    
     imageIndex--;
     startValue = imageIndex;
     if(images.length==1){
     document.write('<div id="innerWrapper"><div id="third" style="margin:40px 0px 0px 40px;"><img name="three" src="'+images[0]+'" border="0"></div></div>');
	 }
     else if(images.length==2){
     document.write('<div id="innerWrapper"><div id="second" style="margin:20px 0px 0px 20px;"><img name="two" src="'+images[0]+'"></div><div id="third" style="margin:40px 0px 0px 40px;"><a onclick="javascript:rotateStack();"><img name="three" src="'+images[1]+'" border="0"></a></div></div>');
	 }
     else if(images.length>=3){
     document.write('<div id="innerWrapper"><div id="first"><img name="one" src="'+images[images.length-3]+'"></div><div id="second" style="margin:20px 0px 0px 20px"><img name="two" src="'+images[images.length-2]+'"></div><div id="third" style="margin:40px 0px 0px 40px;"><a onclick="javascript:rotateStack();"><img name="three" src="'+images[images.length-1]+'" border="0"></a></div></div>');
	 }
	 var theText = document.getElementById('desc');
	 
	 if(images.length==1){
	 theText.innerHTML = '<p><h1>'+altTexts[images.length-1]+'</h1></p>'+'<p>'+descriptions[0]+'</p>';
	 }
	 else if(images.length==2){
	 theText.innerHTML = '<p><h1>'+altTexts[images.length-1]+'</h1></p>'+'<p>'+descriptions[0]+'</p>'+'<p id="navImages" color:#000;>'+'<div style="float:left;"><a onclick="javascript:rotateStack();">next</a></div>'+'</p>';
	 }
	 else if(images.length>2){
	 theText.innerHTML = '<p><h1>'+altTexts[images.length-1]+'</h1></p>'+'<p>'+descriptions[0]+'</p>'+'<p id="navImages" color:#000;>'+'<div style="float:left"><a onclick="javascript:rotateStack();">back</a></div><div style="float:left;margin-left:10px;"><a onclick="javascript:rotateStack();">next</a></div>'+'</p>';
	 }
	 
} 

function rotateStack(dir){
   if (dir==null){
   dir=1;
   }
   
   if(dir==1){
    imageIndex--;
    //alert(imageIndex);
    if(images.length>=3){
    	//rotate 3+ images
    	if(imageIndex >= 2){
        	firstImg=imageIndex-2;
        	secondImg=imageIndex-1;
        	thirdImg=imageIndex;
    	}
    
    	else {
    	if(imageIndex == 1){
        	firstImg=images.length-1;
        	secondImg=0;
        	thirdImg=1;
    	}
    
    	if(imageIndex == 0){
        	firstImg=images.length-2;
        	secondImg=images.length-1;
        	thirdImg=0;   
    	}
    
    	if(imageIndex < 0){
        	firstImg=images.length-3;
        	secondImg=images.length-2;
        	thirdImg=images.length-1;
        	imageIndex = startValue;
    	}
  }
  	document.one.src=imagesTemp[firstImg];
    document.two.src=imagesTemp[secondImg];
    document.three.src=imagesTemp[thirdImg];
    updateTheText(2);
  } 
  
  //rotate 2 images
  else if(images.length==2){
  if(imageIndex==0){
  secondImg=1;
  thirdImg=0;
  }
  else if(imageIndex==-1){
  secondImg=0;
  thirdImg=1;
  imageIndex=1;
  }
  document.two.src=imagesTemp[secondImg];
  document.three.src=imagesTemp[thirdImg];
  updateTheText(1);
  }
  }
  
  else if(dir==-1){
  if(imageIndex>=startValue){
    imageIndex=-1;
   }
    imageIndex++;
    
    if(imageIndex==0){
    firstImg=images.length-2;
    secondImg=images.length-1;
    thirdImg=imageIndex;
    }
    
    if(imageIndex==1){
    firstImg=images.length-1;
    secondImg=0;
    thirdImg=imageIndex;
    }
    
    if(imageIndex>=2){
    firstImg=imageIndex-2;
    secondImg=imageIndex-1;
    thirdImg=imageIndex;
    }
    
    
    //alert(imageIndex);
    
    document.one.src=imagesTemp[firstImg];
    document.two.src=imagesTemp[secondImg];
    document.three.src=imagesTemp[thirdImg];
    updateTheText(2);
  } 
  
  
  
  
  
}


function updateTheText(select){

     var theText = document.getElementById('desc');
     if(select==1){
	 theText.innerHTML = '<p><h1>'+altTexts[thirdImg]+'</h1></p>'+'<p>'+descriptions[thirdImg]+'</p>'+'<p id="navImages">'+'</div><div style="float:left;"><a onclick="javascript:rotateStack(1);">next</a></div>'+'</p>';
	 }
     else if(select==2){
	 theText.innerHTML = '<p><h1>'+altTexts[thirdImg]+'</h1></p>'+'<p>'+descriptions[thirdImg]+'</p>'+'<p id="navImages">'+'<div style="float:left"><a onclick="javascript:rotateStack(-1);">back</a></div><div style="float:left;margin-left:10px;"><a onclick="javascript:rotateStack(1);">next</a></div>'+'</p>';
	 }
	 
	 }


function swapMenu(show){

var ifn = document.getElementById('infoNav');
var nn = document.getElementById('normalNav');
var wn = document.getElementById('workNav');

if(show=='showWorkNav'){
ifn.style.display= "none";
nn.style.display= "none";
wn.style.display= "block";
}


if(show=='showInfoNav'){
wn.style.display= "none";
nn.style.display= "none";
ifn.style.display= "block";
}
}

