// JavaScript Document
var instImg = ["images/inst_Manhattan3.jpg",
				"images/inst_Manhattan1.jpg",
				"images/inst_Wilkes1.jpg"];
var invisN = instImg.length;
var pics = new Array();
var picN;

// this function is for Main Installation page
function setInstall(N,M) {
 	if (document.images) {
	 document.getElementById("right-install").src = instImg[M];
	}
	invisAll(N);
	var instN = "install"+M;
	document.getElementById(instN).style.display = "block";
}

// this function will change the background color of Installations squares cube-instN
function setBgr(N,color) {
	var cubeID = "cube-inst"+N;
	document.getElementById(cubeID).style.backgroundColor = color;
}

// this function is for all Installation pages, it will make all "installX" div elements invisible
function invisAll (N) {
	for (var i=N; i<invisN; i++) {
        var di = 'install'+i;
		dd=document.getElementById(di).style.display="none";
    }
}
// this functions is used to show the same right-side image as was shown before top navigation rollover was initiated
function showPic(N) {
 if (document.images) {
  document.getElementById("right-install").src = pics[pic];
  invisAll('1');
  var instN = "install"+N;
  document.getElementById(instN).style.display = "block";
 }
}
// this function creates slide show
function chgPic(dir) {
 if (document.images) {
  pic = pic + dir;
  if ( pic > picN) { 
   pic = 0;
  }
  if ( pic < 0) { 
   pic = picN;
  }
  document.getElementById("right-install").src = pics[pic];
 }
}
//
function preLoadPics() {
 if (document.images) {
	for (var i=0; i<instImg.length; i++) {
		var  preImg = new Image;
		preImg.src = instImg[i];
	}
	if (pics.length > 0) {
	 for (var i=0; i<pics.length; i++) {
		var  preImg = new Image;
		preImg.src = pics[i];
	 }
	}
 }
}