
/************************/
/* Layout funktioner	*/
/************************/

function mouseon1(sObj) 
{
var st;
	st = sObj.style;
	st.backgroundImage='url(http://mekatronisk-selskab.dk/Pictures/menu2.jpg)';
  st.color='white';
}

function mouseoff1(sObj) 
{
	var st;
	st = sObj.style;
	st.backgroundImage='url(http://mekatronisk-selskab.dk/Pictures/menu3.jpg)';
  st.color='black';
}
if (parent.frames[0]) 
{
	parent.location.href = self.location.href;
}

function mouseon(sObj) {
	var st;
	st = sObj.style;
	st.backgroundColor= 'rgb(30,80,140)';
 
  }

  function mouseoff(sObj) {
    var st;
	st = sObj.style;
	st.backgroundColor= 'rgb(20,60,100)';
  }


/************************/
/* Billede fremvisning	*/
/************************/


var currentId = 1;
var curObj = null;
var folder = "http://mekatronisk-selskab.dk/Pictures/";
var fileExtension = ".jpg";
//var fileName = "pic";
var pictures; 
var numberOfPictures = 0;

function initNumOfPics(length)
{
	//alert("init" + length);
	numberOfPictures = length;
/*	pictures = new makeArray(numberOfPictures);
	for (var count = 0; count < numberOfPictres; count++)
	{
		pictures[count] = count;
	}
*/
}

function setFolder(strFolder)
{
	//alert("setFoler=" + strFolder);
	folder = folder + strFolder + "/";
}


function picView(sObj, id)
{
	if(curObj != null)
	{
		curObj.border= '2px solid black';
	}
	curObj = sObj.style;
	curObj.border= '2px solid rgb(30,80,140)';
	currentId = id;
	//alert(id);
	var pictureNext = folder+ currentId + fileExtension;
	document.mainPic.src = pictureNext;
	//alert(pictureNext);
}

function pictureDisplayNext()
{
	currentId = (currentId +1)% numberOfPictures;
	var temp = currentId;
	var tempObj = document.getElementById(temp);
	picView(tempObj, currentId);
//	alert(currentId);	
}

function pictureDisplayPrev()
{
//alert(folder);
//alert(numberOfPictures);
	if(currentId == 0)
	{
		currentId = numberOfPictures;
	}
	currentId = (currentId -1)% numberOfPictures;
	var temp = currentId;
	var tempObj = document.getElementById(temp);
	picView(tempObj, currentId);
//	alert(currentId);	
}

/* help function for creating arrays crossbrowser*/
/*
function makeArray(n)
{
	this.length = n;
	for (var i=1; i <= n; i++)
	{
		this[i] = null;
	}
	return this;
}*/