var images = new Array();


for (i=0; i<40; i++){
	images[i] = document.images[i];
}


function setImageUrl(num)
{
 /*document['itemImage'].src = imageUrl;*/

 var image0 = document.getElementById("imgBox");
 //image0.src = imageUrl;
	image0.src = images[num];
}


function prevImageUrl()
{
 /*document['itemImage'].src = imageUrl;*/

 var image0 = document.getElementById("imgBox");
 image0.src = imageUrl;

}

function nextImageUrl()
{
 /*document['itemImage'].src = imageUrl;*/

 var image0 = document.getElementById("imgBox");
 image0.src = imageUrl;

}

/* opens a window of specified dimensions with the image inside (click image to close) */
function openNewWindow(bigurl, width, height)
{
 var newWindow = window.open("", "", "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, width=" + width + ", height=" + height + ", scrollbars=no");
 newWindow.document.writeln("<html>");
 newWindow.document.writeln("<body style='margin: 0 0 0 0; background-color: rgb(120, 120, 120);'>");
 newWindow.document.writeln("<a href='javascript:window.close();' style='text-decoration: none; color: rgb(120, 120, 120);'>");
 newWindow.document.writeln("<img src='" + bigurl + "' alt='Click to close' id='bigImage'/>");
 newWindow.document.writeln("</a>");
 newWindow.document.writeln("</body></html>");
 newWindow.document.close();
}



var revert = new Array();
var flipped = new Array();
var inames = new Array('ushmm', 'monticello', 'networkout', 'placetent', 'photography', 'video', 'thearb', 'drawing', 'container', 'venus', 'artiststudio', 'infiltration', 'bodyext', 'placemap', 'netmotion', 'gymbuff', 'gymmach1', 'gymmach2', 'avmono', 'process', 'recentdev', 'met', 'twitterate', 'goodbye', 'happiness', '1stfans', 'tools', 'script', 'table');

var revertsplash = new Array();
var flippedsplash = new Array();
var splashnames = new Array('montsplash', 'ushmmsplash', 'overheresplash', 'metsplash');

// Preload
if (document.images) {
  for(i=0; i< inames.length; i++) {
    flipped[i] = new Image();
	flipped[i].src = "./images/thumbnails/" + inames[i] + "T.jpg";
  }
  for(i=0; i< splashnames.length; i++){
	flippedsplash[i] = new Image();
	flippedsplash[i].src = "./images/splash/" + splashnames[i] + "T.jpg";	  
  }
  
}


function over(num) {
    revert[num] = document.images[inames[num]].src;
    document.images[inames[num]].src = flipped[num].src;
	
}

function out(num) {
 	document.images[inames[num]].src = revert[num];
}

function splashover(num) {
    revertsplash[num] = document.images[splashnames[num]].src;
    document.images[splashnames[num]].src = flippedsplash[num].src;
	
}

function splashout(num) {
 	document.images[splashnames[num]].src = revertsplash[num];
}
