function newImage(arg) {
 if (document.images) {
  rslt = new Image();
  rslt.src = arg;
  return rslt;
 }
}

var preloadFlag = false;
function preloadImages() {
 if (document.images) {
  current_over = newImage("/i/nav/horiz/curent_over.png");
  future_over = newImage("/i/nav/horiz/future_over.png");
  past_over = newImage("/i/nav/horiz/past_over.png");  
  artists_over = newImage("/i/nav/artists_over.png");
  about_over = newImage("/i/nav/about_over.png");
  contact_over = newImage("/i/nav/contact_over.png");
  left_arrow_over = newImage("/i/img_viewer_ur/left_arrow_over.png");
  right_arrow_over = newImage("/i/img_viewer_ur/right_arrow_over.png");
   
  preloadFlag = true;
 }
}

function changeImages() {
 if (document.images && (preloadFlag == true)) {
  for (var i=0; i<changeImages.arguments.length; i+=2) {
   document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
  }
 }
}


// Fit Win to a minimum size
// From http://www.dotnethero.com/hero/javascript/ImageNewWindow.aspx?nmx=9_1
function fitToWin() {
	
	xtra_offest = 0;
	
	if ((screen.width >= 1200) && (screen.height >= 900))
	{
		xtra_offest = 100;
	}	
	
	if ((screen.width >= 1024) && (screen.height >= 768))
	{	
		if (window.innerWidth){
			iWidth = window.innerWidth;
			iHeight = window.innerHeight;
		}else{
			iWidth = document.body.clientWidth;
			iHeight =document.body.clientHeight;
		}
		
		if ((iWidth < 950) || (iHeight < 625 ))
		{
			iWidth = (950+xtra_offest) - iWidth;
			iHeight = (580+xtra_offest) - iHeight;
			
			window.resizeBy(iWidth, iHeight);
		}
	}
}