function gojump(a)
{
	var oldcont=document.getElementById("page"+parseInt(currp));
	//move to next picture - only from links inside con
	if ((this.id == "gopic") || ((oldcont.className=="goover") && !(this.id=="goback"))) {
		stor.appendChild(oldcont);
		currp++;
		var newcont = document.getElementById("page"+parseInt(currp));
		text.appendChild(newcont);
		newcont.style.display="inline";
	}
	//move to next/previous text (jumping over pictures)
	else {
		if (this.id == "goback") {
			inc=-1;
		}
		else {
			inc=1;
		}
		if (currp % 2 == 0) {
			currp=currp+inc;
			oldcont.style.display="none";
			document.getElementById("pictures").appendChild(oldcont);
		} 
		else {
			currp=currp+2*inc;
			stor.appendChild(oldcont);
		}
		var newcont = document.getElementById("page"+parseInt(currp));
		text.appendChild(newcont);
	}
		if (newcont.offsetHeight > 300) {
			spacer.style.height="15px";
		}
		else {
			spacer.style.height="120px";
		}
	if (window.innerHeight) {
		scrh=window.innerHeight;
	}
	else {
		scrh=document.body.clientHeight;
	}
	if (text.offsetHeight+100>scrh) {
		con.style.height="auto";
	}
	else {
		con.style.height="92%";
	}
	
	document.title=oldcont.id + "-->" + newcont.id;	
	//takes care about the border cases
	if (currp==1) {
		back.onclick=null;
		back.href="../designed/index.html";
		back.innerHTML="^";
	}
	else {
		back.href="#";
		back.onclick=gojump;
		back.innerHTML="<--";
	}
	if (currp>=nump-1) {
		forw.onclick=null;
		forw.href="../designed/index.html"
		forw.innerHTML="fin";
	}
	else {
		forw.href="#";
		forw.onclick=gojump;
		forw.innerHTML="-->";
	}	
	if (newcont.className=="goover") 
		gojump(1);
	return false; 
}

function resizeframe() {
	if (window.innerHeight) {
		scrh=window.innerHeight;
	}
	else {
		scrh=document.body.clientHeight;
	}
	if (con.offsetHeight+100>scrh) {
		con.style.height="auto";
	}
	else {
		con.style.height="92%";
	}

}

