
var state = new Array;
state.graphiclandscapes = {"imgs":6,"pos":0};
state.buskelund = {"imgs":11,"pos":0};
state.dbb = {"imgs":9,"pos":0};
state.kfliser = {"imgs":5,"pos":0};
state.liv = {"imgs":15,"pos":0};
state.gg = {"imgs":2,"pos":0};
state.ocean = {"imgs":4,"pos":0};


function flipto(what, newpos) {
	document.getElementById("curpos_" + what).innerHTML = newpos;
	img   = document.getElementById(what + '_img');
	link = document.getElementById(what + '_a');
	
	img.setAttribute("src", "galleri/" + what + newpos + "_s.jpg");
	link.setAttribute("href", "galleri/" + what + newpos + ".jpg");
}

function flipback(what) {
	state[what].pos = (--state[what].pos % state[what].imgs);
	if(state[what].pos == -1)
	  state[what].pos = state[what].imgs-1;
	newpos = state[what].pos+1;
	flipto(what,newpos);
}
function flipforth(what) {
	newpos = ++state[what].pos % (state[what].imgs) + 1;
	flipto(what,newpos);
}


