// JavaScript Document
var windowWidth = document.compatMode=='CSS1Compat' &&
  !window.opera?document.documentElement.clientWidth:
  document.body.clientWidth;

var windowHeight = document.compatMode=='CSS1Compat' &&
  !window.opera?document.documentElement.clientHeight:
  document.body.clientHeight;

var picArray = new Array(); 

function setPusher() {
	var pusherWidth = (windowWidth-980)/2;
	document.getElementById('pusher').width = pusherWidth;
}

function setHeightHome() {
		document.getElementById('home').height = windowHeight+1;
}

function setHeightIntro() {
		var introHeight = windowHeight-558;
		document.getElementById('introTable').height= introHeight;
}

function changeContent(picNr,newImage) { 
	newContent = document.getElementById('imageDIV').innerHTML;
	document.getElementById('picID').src = "image"; 
	document.getElementById('contentDIV').innerHTML = newContent.replace("image",newImage); 
	nextPic = Number(picNr) + 1;
	previousPic = picNr - 1;
	document.getElementById('next').value = nextPic; 
	document.getElementById('previous').value = previousPic; 
}

function setPicArray(picNr,picName) {
	picArray[picNr]=picName;
}

function nextImage() {
	picNr = Number(document.getElementById('next').value);
	if (picNr == picArray.length) {
		picNr = 0;
	}
	nImage = "../images/" + picArray[picNr];
	changeContent(picNr,nImage);
}
function previousImage() {
	picNr = Number(document.getElementById('previous').value);
	if (picNr < 0) {
		picNr = picArray.length + Number(picNr);
	}
	pImage = "../images/" + picArray[picNr];
	changeContent(picNr,pImage);
}

